<s> import codecs <EOL> import poioapi . annotationgraph <EOL> ag = poioapi . annotationgraph . AnnotationGraph ( ) <EOL> ag . from_elan ( "<STR_LIT>" ) <EOL> tier_hierarchy = None <EOL> for t in ag . tier_hierarchies : <EOL> if t [ <NUM_LIT:0> ] == "<STR_LIT>" : <EOL> tier_hierarchy = t <EOL> ag . structure_type_handler = poioapi . data . DataStructureType ( <EOL> tier_hierarchy ) <EOL> af = poioapi . annotationgraph . AnnotationGraphFilter ( ag ) <EOL> af . set_filter_for_tier ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> af . set_filter_for_tier ( "<STR_LIT>" , r"<STR_LIT>" ) <EOL> ag . append_filter ( af ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( ag . filtered_node_ids ) <EOL> ag . pop_filter ( ) <EOL> search_terms = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : r"<STR_LIT>" <EOL> } <EOL> af = ag . create_filter_for_dict ( search_terms ) <EOL> ag . append_filter ( af ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( ag . filtered_node_ids ) <EOL> html = ag . as_html_table ( True ) <EOL> f = codecs . open ( "<STR_LIT>" , "<STR_LIT:w>" , "<STR_LIT:utf-8>" ) <EOL> f . write ( html ) <EOL> f . close ( ) </s>
