Module Expr Str Import alias Import alias Import alias identifier Import alias ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body AugAssignAdd AttributeStore NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot AttributeLoad NameLoad attr body Print Str orelse Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body For NameStore NameLoad body If CompareEq SubscriptLoad NameLoad Index Num NameLoad body Return SubscriptLoad NameLoad Index Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareNotIn NameLoad ListLoad Str Str Str Str Str body If AttributeLoad NameLoad attr body Print BinOpAdd BinOpAdd AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr orelse If AttributeLoad NameLoad attr body Print BinOpAdd AttributeLoad NameLoad attr NameLoad If BoolOpAnd CompareEq AttributeLoad NameLoad attr Str CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str If CompareEq NameLoad Str body Assign AttributeStore NameLoad attr Str orelse If CompareEq AttributeLoad NameLoad attr Str body If CompareEq NameLoad Str body Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str orelse If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str If BoolOpAnd NameLoad Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num Assign AttributeStore NameLoad attr NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str If BoolOpAnd NameLoad Call AttributeLoad NameLoad attr Str body Assign AttributeStore NameLoad attr NameLoad orelse If CompareEq NameLoad Str body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body While AttributeLoad NameLoad attr body Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr If CompareNotEq NameLoad NameLoad body If AttributeLoad NameLoad attr body Print BinOpMod Str TupleLoad NameLoad NameLoad orelse Break If AttributeLoad NameLoad attr body Print BinOpAdd AttributeLoad NameLoad attr Str If CompareEq AttributeLoad NameLoad attr Str body If CompareEq NameLoad Str body Assign AttributeStore NameLoad attr Str orelse If CompareEq NameLoad Str body If AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr Str Str AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr Str Str AttributeLoad NameLoad attr attr If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body If AttributeLoad NameLoad attr body AugAssignAdd AttributeStore NameLoad attr NameLoad orelse If AttributeLoad NameLoad attr body AugAssignAdd AttributeStore NameLoad attr NameLoad Pass decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareIn NameLoad ListLoad Str Str Str Str Str Str body Return Str If BoolOpOr CompareNotEq Call AttributeLoad NameLoad attr Str Num CompareNotEq Call AttributeLoad NameLoad attr Str Num body Return Str Return Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad With Call NameLoad NameLoad NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore ListLoad For TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr ListLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore BinOpAdd Call AttributeLoad Str attr NameLoad Str Print BinOpMod Str NameLoad If BoolOpOr UnaryOpNot NameLoad CompareEq NameLoad Str body Print NameLoad orelse With Call NameLoad NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str keyword BinOpMod Str NameLoad keyword NameLoad keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword BinOpMod Str NameLoad keyword NameLoad keyword Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call NameLoad NameLoad NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A Extract attribution data from the ohchr UDHR site. N/A argparse N/A codecs N/A HTMLParser html N/A re nototools tool_utils ParseOhchr N/A N/A html HTMLParser N/A __init__ N/A N/A self trace N/A False N/A N/A N/A N/A N/A html HTMLParser __init__ self N/A N/A self trace trace N/A N/A self result_list N/A N/A N/A N/A self restart N/A restart N/A N/A self N/A N/A N/A N/A self margin N/A N/A self state before_table N/A N/A self tag_stack N/A N/A N/A self collect_lang False N/A N/A self collect_source False N/A N/A self ohchr_code N/A N/A self lang_name N/A N/A self source_name N/A results N/A N/A self N/A N/A N/A N/A self result_list N/A indent N/A N/A self N/A N/A N/A N/A self margin N/A outdent N/A N/A self N/A N/A N/A N/A N/A self margin N/A N/A *** cannot outdent *** N/A N/A N/A self margin N/A N/A self margin N/A -2 N/A get_attr N/A N/A self attr_list attr_id N/A N/A N/A t attr_list N/A N/A N/A N/A t N/A 0 attr_id N/A N/A N/A t N/A 1 N/A None N/A handle_starttag N/A N/A self tag attrs N/A N/A N/A N/A tag N/A link meta area img br N/A N/A N/A self trace N/A N/A N/A N/A N/A self margin tag > N/A N/A N/A N/A self tag_stack append N/A tag N/A N/A self getpos N/A N/A N/A self indent N/A N/A N/A self trace N/A N/A N/A N/A self margin tag N/A N/A N/A N/A self state before_table N/A tag table N/A N/A table_id N/A N/A self get_attr attrs id N/A N/A table_id ohchr_alldata N/A N/A N/A self state in_table N/A N/A N/A N/A self state in_table N/A N/A N/A tag tr N/A N/A N/A self ohchr_code N/A N/A self lang_name N/A N/A self source_name N/A N/A N/A tag a N/A N/A a_id N/A N/A self get_attr attrs id N/A N/A a_id N/A N/A a_id endswith _hpLangTitleID N/A N/A ohchr_code N/A N/A self get_attr attrs href N/A ix N/A N/A ohchr_code rfind = N/A N/A self ohchr_code N/A ohchr_code N/A N/A ix 1 N/A N/A self collect_lang True N/A N/A N/A tag span N/A N/A span_id N/A N/A self get_attr attrs id N/A N/A span_id N/A N/A span_id endswith _lblSourceID N/A N/A N/A self collect_source True N/A N/A N/A tag td N/A N/A N/A self collect_lang False N/A N/A self collect_source False N/A handle_endtag N/A N/A self tag N/A N/A N/A N/A self tag_stack N/A N/A N/A prev_tag prev_pos N/A N/A N/A self tag_stack pop N/A N/A N/A self outdent N/A N/A tag prev_tag N/A N/A N/A self trace N/A N/A N/A no close tag for %s at %s N/A prev_tag prev_pos N/A N/A N/A N/A self trace N/A N/A N/A N/A self margin < N/A N/A N/A self state in_table N/A N/A N/A tag table N/A N/A N/A self state after_table N/A N/A N/A tag tr N/A N/A N/A self ohchr_code N/A N/A N/A self lang_name N/A N/A N/A N/A re sub \s+ N/A self lang_name strip N/A N/A self source_name N/A N/A N/A N/A re sub \s+ N/A self source_name strip N/A N/A N/A self source_name N/A N/A N/A self source_name (no attribution) N/A N/A N/A N/A self result_list append N/A N/A self ohchr_code N/A self lang_name N/A self source_name N/A N/A self ohchr_code N/A N/A self lang_name N/A N/A self source_name N/A handle_data N/A N/A self data N/A N/A N/A N/A self collect_lang N/A N/A N/A self lang_name data N/A N/A N/A self collect_source N/A N/A N/A self source_name data N/A N/A N/A get_ohchr_status N/A N/A ohchr_code lang attrib N/A N/A N/A Decide the status based on the attribution text.

  'original' are in the public domain and need no attribution.
  'UN' are official UN translations and should be attributed as such.
  'other' are not official UN translations and should be attributed as such. N/A N/A ohchr_code N/A eng frn spn rus chn arz N/A N/A original N/A N/A N/A N/A N/A attrib find United Nations -1 N/A N/A N/A attrib find High Commissioner for Human Rights -1 N/A N/A UN N/A other N/A parse_ohchr_html_file N/A N/A htmlfile outfile N/A N/A N/A parser N/A ParseOhchr False N/A N/A open htmlfile f N/A N/A N/A N/A parser feed N/A N/A f read N/A lines N/A N/A N/A ohchr_code lang attrib N/A N/A parser results N/A N/A s N/A get_ohchr_status ohchr_code lang attrib N/A N/A N/A lines append N/A N/A join N/A ohchr_code s lang attrib N/A data N/A N/A N/A join lines N/A N/A outfile: "%s" outfile N/A N/A N/A outfile N/A outfile - N/A N/A data N/A N/A N/A open outfile w f N/A N/A N/A N/A f write data N/A main N/A N/A N/A N/A N/A default_input [tools]/third_party/ohchr/ohchr_all.html N/A default_output [tools]/third_party/ohchr/attributions.tsv N/A parser N/A N/A argparse ArgumentParser N/A N/A N/A parser add_argument --src help N/A input ohchr html file (default %s) default_input default default_input metavar file dest htmlfile N/A N/A N/A parser add_argument --dst help N/A output tsv file (default %s) default_output default default_output metavar file dest outfile N/A args N/A N/A parser parse_args N/A htmlfile N/A N/A tool_utils resolve_path N/A args htmlfile N/A outfile N/A N/A tool_utils resolve_path N/A args outfile N/A N/A parse_ohchr_html_file htmlfile outfile N/A N/A N/A __name__ __main__ N/A N/A N/A main