code: def _get_file_magic_name(self, buffer):
          
          default = "Unknown"
  
          # Faster way, test once, return default.
          if self.__no_magic:
              return default
  
          try:
              # Magic is optional
              import magic
          except ImportError:
              self.__no_magic = True
              log.warning("No Magic library was found on your system.")
              return default
          except TypeError as e:
              self.__no_magic = True
              log.warning("It looks like you have the magic python package installed but not the magic library itself!")
              log.warning("Error from magic library: %s", e)
              log.warning("Please follow the installation instructions at https://github.com/ahupp/python-magic/#installation")
              return default
  
          try:
              # There are several implementations of magic,
              # unfortunately all called magic
              # We use this one: https://github.com/ahupp/python-magic/
              getattr(magic, "MagicException")
          except AttributeError:
              self.__no_magic = True
              log.warning("Not the correct Magic library was found on your system. Please install python-magic!")
              return default
  
          try:
              ftype = magic.from_buffer(buffer[:1024])
          except magic.MagicError as e:
              log.exception("Error getting the magic type: %s", e)
              return default
  
          if not ftype:
              return default
          else:
              return self._patch_magic(buffer, ftype)
docs: Return the filetype guessed for a buffer
          :param buffer: bytes
          :returns: str of filetype