Registers a decompressor for a specific compression method.

    Args:
      decompressor (type): decompressor class.

    Raises:
      KeyError: if the corresponding decompressor is already set.
556283
def RegisterDecompressor(cls, decompressor):
    
    compression_method = decompressor.COMPRESSION_METHOD.lower()
    if compression_method in cls._decompressors:
      raise KeyError(
          'Decompressor for compression method: {0:s} already set.'.format(
              decompressor.COMPRESSION_METHOD))

    cls._decompressors[compression_method] = decompressor
562792
@Override
  public Decompressor createDecompressor() {
    if (!isNativeCodeLoaded()) {
      throw new RuntimeException("native lz4 library not available");
    }
    int bufferSize = conf.getInt(
        IO_COMPRESSION_CODEC_LZ4_BUFFERSIZE_KEY,
        IO_COMPRESSION_CODEC_LZ4_BUFFERSIZE_DEFAULT);
    return new Lz4Decompressor(bufferSize);
  }
628616
def register_converter(self, converter: Converter[S, T]):
        
        check_var(converter, var_types=Converter, var_name='converter')

        # (0) sanity check : check that parser handles jokers properly
        res = converter.is_able_to_convert_detailed(from_type=JOKER, to_type=JOKER, strict=True)
        if not (res[0] is True and res[1] is None and res[2] is None):
            raise ValueError('Converter ' + str(converter) + ' can not be registered since it does not handle the JOKER'
                             ' cases correctly')

        # compute all possible chains and save them
        generic_chains, generic_nonstrict_chains, specific_chains, specific_nonstrict_chains \
            = self._create_all_new_chains(converter)
        self._generic_nonstrict_conversion_chains += generic_nonstrict_chains
        self._generic_conversion_chains += generic_chains
        self._specific_non_strict_conversion_chains += specific_nonstrict_chains
        self._specific_conversion_chains += specific_chains

        # sort all lists by length
        self._generic_nonstrict_conversion_chains = sorted(self._generic_nonstrict_conversion_chains, key=len,
                                                           reverse=True)
        self._generic_conversion_chains = sorted(self._generic_conversion_chains, key=len, reverse=True)
        self._specific_non_strict_conversion_chains = sorted(self._specific_non_strict_conversion_chains, key=len,
                                                             reverse=True)
        self._specific_conversion_chains = sorted(self._specific_conversion_chains, key=len, reverse=True)
1169040
function registerCompression(encodingName, fileExtension) {
        if (!findCompressionByName(encodingName))
            compressions.push(new Compression(encodingName, fileExtension));
    }
189809
def GetDecoder(cls, encoding_method):
    
    encoding_method = encoding_method.lower()
    decoder = cls._decoders.get(encoding_method, None)
    if not decoder:
      return None

    return decoder()
419048
def register_meta(self, type, **meta):
        
        try:
            self.registered_formats[type]['meta'] = meta
        except KeyError:
            self.registered_formats[type] = {'meta': meta}
1265938
def register(cls, encryptor: Encryptor):
        
        # save the current encryptor statically
        cls.__encryptor__ = encryptor

        # NB: we cannot use the before_insert listener in conjunction with a foreign key relationship
        # for encrypted data; SQLAlchemy will warn about using 'related attribute set' operation so
        # late in its insert/flush process.
        listeners = dict(
            init=on_init,
            load=on_load,
        )

        for name, func in listeners.items():
            # If we initialize the graph multiple times (as in many unit testing scenarios),
            # we will accumulate listener functions -- with unpredictable results. As protection,
            # we need to remove existing listeners before adding new ones; this solution only
            # works if the id (e.g. memory address) of the listener does not change, which means
            # they cannot be closures around the `encryptor` reference.
            #
            # Hence the `__encryptor__` hack above...
            if contains(cls, name, func):
                remove(cls, name, func)
            listen(cls, name, func)
973519
def register(cls):
        
        if not cls.IS_LOADED:
            cls.IS_LOADED = True

            yaml.add_constructor('!param', Parameter.parameter_constructor, Loader=yaml.SafeLoader)
            yaml.add_constructor('!env', EnvironmentVariable.parameter_constructor, Loader=yaml.SafeLoader)
52804
public void registerReceiver (InvocationDecoder decoder)
    {
        // add the receiver to the list
        _reclist.add(decoder);

        // if we're already online, assign a receiver id to this decoder
        if (_clobj != null) {
            assignReceiverId(decoder);
        }
    }
121473
def _register(self, cls):
        
        if not inspect.isclass(cls):
            raise ValueError('Only classes may be registered.')
        elif not issubclass(cls, self._registerable_class):
            raise ValueError('Only %s classes or subclasses may be registered.'
                             % self._registerable_class.__name__)

        if cls not in self._registry:
            cls._registered_with = self
            self._registry[cls] = cls()

        return self._registry[cls]
701367
def register(filetypes):
    
    def decorator(clazz):
        for ext in filetypes:
            checkers.setdefault(ext, []).append(clazz)
        return clazz
    return decorator
1374516
public static void 
  setOutputCompressorClass(JobConf conf, 
                           Class<? extends CompressionCodec> codecClass) {
    setCompressOutput(conf, true);
    conf.setClass("mapred.output.compression.codec", codecClass, 
                  CompressionCodec.class);
  }
799183
private function registerCompressorProvider() {
        $this->app->bind(\BackupManager\Compressors\CompressorProvider::class, function () {
            $provider = new Compressors\CompressorProvider;
            $provider->add(new Compressors\GzipCompressor);
            $provider->add(new Compressors\NullCompressor);
            return $provider;
        });
    }
900307
def _registerHandler(self, handler):
        
        self._logger.addHandler(handler)
        self._handlers.append(handler)
459957
public static void register(Charset charset, Class<? extends Decoder> decoder) {
		decoders.put(charset.name(), decoder);
	}
567905
def register_writer(klass):
    
    if not callable(klass):
        raise ValueError("Can only register callables as engines")
    engine_name = klass.engine
    _writers[engine_name] = klass
1251888
def setDecoder(self, decoder):
        
        if not decoder:
            self._decoder = json.JSONDecoder()
        else:
            self._decoder = decoder
        self._decode = self._decoder.decode