@contextlib.contextmanager
def get_xml_iterator(source, _debug_python_based_parser=False):
 with _convert_to_fd_or_read_function(source) as fd:
  if _debug_python_based_parser:
   context = _slow_iterparse(fd)
  else:
   context = _fast_iterparse(fd)
  (yield iter(context))

@ contextlib . contextmanager def get_xml_iterator ( source , _debug_python_based_parser = False ) : with _convert_to_fd_or_read_function ( source ) as fd : if _debug_python_based_parser : context = _slow_iterparse ( fd ) else : context = _fast_iterparse ( fd ) ( yield iter ( context ) )
returns an iterator over the elements of an xml file .