code: def register_compressor(compressor_name, compressor, force=False):
      """Register a new compressor.
  
      Parameters
      ----------
      compressor_name: str.
          The name of the compressor.
      compressor: CompressorWrapper
          An instance of a 'CompressorWrapper'.
      """
      global _COMPRESSORS
      if not isinstance(compressor_name, str):
          raise ValueError(
              "Compressor name should be a string, "
              "'{}' given.".format(compressor_name)
          )
  
      if not isinstance(compressor, CompressorWrapper):
          raise ValueError(
              "Compressor should implement the CompressorWrapper "
              "interface, '{}' given.".format(compressor)
          )
  
      if compressor.fileobj_factory is not None and (
          not hasattr(compressor.fileobj_factory, "read")
          or not hasattr(compressor.fileobj_factory, "write")
          or not hasattr(compressor.fileobj_factory, "seek")
          or not hasattr(compressor.fileobj_factory, "tell")
      ):
          raise ValueError(
              "Compressor 'fileobj_factory' attribute should "
              "implement the file object interface, '{}' given.".format(
                  compressor.fileobj_factory
              )
          )
  
      if compressor_name in _COMPRESSORS and not force:
          raise ValueError(
              "Compressor '{}' already registered.".format(
                  compressor_name
              )
          )
  
      _COMPRESSORS[compressor_name] = compressor
  
imports: import io
  import zlib
  from joblib.backports import LooseVersion
label_desc: Use image node_id 1 for calling a global function with example usage: register_compressor(compressor_name, compressor, force) without return types