class_docstr: SAX driver for the pyexpat C module.
class_docstr_tok: ["SAX","driver","for","the","pyexpat","C","module","."]
docstr: Parse an XML document from a URL or an InputSource.
docstr_tok: ["Parse","an","XML","document","from","a","URL","or","an","InputSource","."]
code: def parse(self, source):
      "Parse an XML document from a URL or an InputSource."
      source = saxutils.prepare_input_source(source)
  
      self._source = source
      try:
          self.reset()
          self._cont_handler.setDocumentLocator(ExpatLocator(self))
          xmlreader.IncrementalParser.parse(self, source)
      except:
          # bpo-30264: Close the source on error to not leak resources:
          # xml.sax.parse() doesn't give access to the underlying parser
          # to the caller
          self._close_source()
          raise
  
imports: from xml.sax._exceptions import *
  from xml.sax.handler import feature_validation, feature_namespaces
  from xml.sax.handler import feature_namespace_prefixes
  from xml.sax.handler import feature_external_ges, feature_external_pes
  from xml.sax.handler import feature_string_interning
  from xml.sax.handler import property_xml_string, property_interning_dict
  from xml.sax import xmlreader, saxutils, handler
label_desc: Use image node_id 2 for calling the ExpatParser obj's underlying member method code with example usage: obj.parse(source) without return types