<s> import doctest , sys <EOL> from test import test_support <EOL> SAMPLE_XML = """<STR_LIT>""" <EOL> SAMPLE_XML_NS = """<STR_LIT>""" <EOL> def sanity ( ) : <EOL> """<STR_LIT>""" <EOL> def check_method ( method ) : <EOL> if not callable ( method ) : <EOL> print method , "<STR_LIT>" <EOL> def serialize ( ET , elem , encoding = None ) : <EOL> import StringIO <EOL> file = StringIO . StringIO ( ) <EOL> tree = ET . ElementTree ( elem ) <EOL> if encoding : <EOL> tree . write ( file , encoding ) <EOL> else : <EOL> tree . write ( file ) <EOL> return file . getvalue ( ) <EOL> def summarize ( elem ) : <EOL> return elem . tag <EOL> def summarize_list ( seq ) : <EOL> return map ( summarize , seq ) <EOL> def interface ( ) : <EOL> """<STR_LIT>""" <EOL> def find ( ) : <EOL> """<STR_LIT>""" <EOL> def parseliteral ( ) : <EOL> r"""<STR_LIT>""" <EOL> def check_encoding ( ET , encoding ) : <EOL> """<STR_LIT>""" <EOL> ET . XML ( "<STR_LIT>" % encoding ) <EOL> XINCLUDE = { } <EOL> XINCLUDE [ "<STR_LIT>" ] = """<STR_LIT>""" <EOL> XINCLUDE [ "<STR_LIT>" ] = """<STR_LIT>""" <EOL> XINCLUDE [ "<STR_LIT>" ] = """<STR_LIT>""" <EOL> XINCLUDE [ "<STR_LIT>" ] = "<STR_LIT>" <EOL> XINCLUDE [ "<STR_LIT>" ] = """<STR_LIT>""" <EOL> XINCLUDE [ "<STR_LIT>" ] = """<STR_LIT>""" <EOL> XINCLUDE [ "<STR_LIT>" ] = """<STR_LIT>""" <EOL> XINCLUDE [ "<STR_LIT>" ] = """<STR_LIT>""" <EOL> def xinclude_loader ( href , parse = "<STR_LIT>" , encoding = None ) : <EOL> try : <EOL> data = XINCLUDE [ href ] <EOL> except KeyError : <EOL> raise IOError ( "<STR_LIT>" ) <EOL> if parse == "<STR_LIT>" : <EOL> from xml . etree . ElementTree import XML <EOL> return XML ( data ) <EOL> return data <EOL> def xinclude ( ) : <EOL> r"""<STR_LIT>""" <EOL> def test_main ( ) : <EOL> from test import test_xml_etree <EOL> test_support . run_doctest ( test_xml_etree , verbosity = True ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> test_main ( ) </s>
