code: def is_xml(origin, filepath, fileobj, *args, **kwargs):
      
      # pylint: disable=unused-argument
      if fileobj is not None:
          loc = fileobj.tell()
          fileobj.seek(0)
          try:
              sig = fileobj.read(5).lower()
              return sig == XML_SIGNATURE
          finally:
              fileobj.seek(loc)
      elif filepath is not None:
          return filepath.endswith(('.xml', '.xml.gz'))
docs: Identify a file object as XML (any format)