docs: def backend_from_fobj(f):
      """Determine backend module object from a file object."""
      if magic is None:
          warn("magic lib is not installed; assuming mime type %r" % (
              DEFAULT_MIME))
          return backend_from_mime(DEFAULT_MIME)
      else:
          offset = f.tell()
          try:
              f.seek(0)
              chunk = f.read(MAGIC_BUFFER_SIZE)
              mime = magic.from_buffer(chunk, mime=True)
              return backend_from_mime(mime)
          finally:
              f.seek(offset)