<s> from . import xml <EOL> NS_OPENIOC = "<STR_LIT>" <EOL> NAMESPACES = { "<STR_LIT>" : NS_OPENIOC } <EOL> def get_top_indicators ( root ) : <EOL> xpath = "<STR_LIT>" <EOL> return list ( root . xpath ( xpath , namespaces = NAMESPACES ) ) <EOL> def get_indicators ( root ) : <EOL> xpath = "<STR_LIT>" <EOL> return list ( root . xpath ( xpath , namespaces = NAMESPACES ) ) <EOL> def get_items ( indicator ) : <EOL> xpath = "<STR_LIT>" <EOL> return list ( indicator . xpath ( xpath , namespaces = NAMESPACES ) ) <EOL> def get_search ( item ) : <EOL> tag = xml . tag ( NS_OPENIOC , "<STR_LIT>" ) <EOL> ctx = item . find ( tag ) <EOL> if ctx is None : <EOL> return None <EOL> return ctx . attrib . get ( "<STR_LIT>" ) <EOL> def get_content ( item ) : <EOL> tag = xml . tag ( NS_OPENIOC , "<STR_LIT>" ) <EOL> return item . findtext ( tag ) <EOL> def get_condition ( item ) : <EOL> return item . attrib . get ( "<STR_LIT>" ) </s>
