code: def _detect_compressor(fileobj):
      """Return the compressor matching fileobj.
  
      Parameters
      ----------
      fileobj: file object
  
      Returns
      -------
      str in {'zlib', 'gzip', 'bz2', 'lzma', 'xz', 'compat', 'not-compressed'}
      """
      # Ensure we read the first bytes.
      fileobj.seek(0)
      first_bytes = fileobj.read(_MAX_PREFIX_LEN)
      fileobj.seek(0)
  
      if first_bytes.startswith(_ZLIB_PREFIX):
          return "zlib"
      elif first_bytes.startswith(_GZIP_PREFIX):
          return "gzip"
      elif first_bytes.startswith(_BZ2_PREFIX):
          return "bz2"
      elif first_bytes.startswith(_LZMA_PREFIX):
          return "lzma"
      elif first_bytes.startswith(_XZ_PREFIX):
          return "xz"
      elif first_bytes.startswith(_ZFILE_PREFIX):
          return "compat"
  
      return "not-compressed"
  
imports: import pickle
  import sys
  import io
  import zlib
  import gzip
  import bz2
  import warnings
  import contextlib
  from contextlib import closing
  from ._compat import PY3_OR_LATER, PY26, PY27, _basestring
label_desc: Use image node_id 1 for calling a global function with example usage: _detect_compressor(fileobj) and returns: str, str, str, str, str, str, str