Module Expr Str ImportFrom alias Import alias Import alias Import alias ImportFrom alias alias Assign NameStore Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Num keyword Str keyword Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword NameLoad keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword NameLoad keyword Str keyword Str If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad ImportFrom alias ImportFrom alias Assign NameStore NameLoad For NameStore AttributeLoad NameLoad attr body If BoolOpAnd UnaryOpNot NameLoad CompareGt AttributeLoad NameLoad attr Num body Print Call AttributeLoad Str attr AttributeLoad NameLoad attr For NameStore Call NameLoad AttributeLoad NameLoad attr body Print Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Num Print Print orelse Assign NameStore NameLoad Assign NameStore NameLoad With Call NameLoad NameLoad NameStore body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad Assign NameStore Num Assign NameStore Num Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str For NameStore NameLoad body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str Assign NameStore Call AttributeLoad Str attr SubscriptLoad AttributeLoad NameLoad attr Index Str SubscriptLoad AttributeLoad NameLoad attr Index Str Assign NameStore Dict Str Str Str Str Str Str For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad TryExcept body Assign NameStore BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad Call NameLoad NameLoad keyword Str attr Str If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr orelse Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Print NameLoad Assign NameStore BinOpAdd NameLoad Num Print Print Call AttributeLoad Str attr NameLoad Print Call AttributeLoad Str attr NameLoad NameLoad Print
N/A N/A 
Project: Appraise evaluation system
 Author: Christian Federmann <cfedermann@gmail.com>

usage: python import_wmt15_xml.py
               [-h] [--wait SLEEP_SECONDS] [--dry-run] [--mturk-only]
               hits-file [hits-file ...]

Imports HITs from a given XML file into the Django database. Uses
appraise.wmt15.validators.validate_hits_xml_file() for validation.

positional arguments:
  hits-file             XML file(s) containing HITs. Can be multiple files
                        using patterns such as '*.xml' or similar.

optional arguments:
  -h, --help            Show this help message and exit.
  --wait SLEEP_SECONDS  Amount of seconds to wait between individual files.
  --dry-run             Enable dry run to simulate import.
  --mturk-only          Enable MTurk-only flag for all HITs.

 time sleep N/A argparse N/A os N/A sys xml.etree.ElementTree fromstring tostring N/A PARSER N/A N/A argparse ArgumentParser description Imports HITs from a given XML file into the Django database.
Uses appraise.wmt15.validators.validate_hits_xml_file() for validation. N/A N/A N/A PARSER add_argument hits_file metavar hits-file help XML file(s) containing HITs.  Can be multiple files using patterns such as '*.xml' or similar. nargs + N/A N/A N/A PARSER add_argument --wait action store default 5 dest sleep_seconds help Amount of seconds to wait between individual files. type int N/A N/A N/A PARSER add_argument --dry-run action store_true default False dest dry_run_enabled help Enable dry run to simulate import. N/A N/A N/A PARSER add_argument --mturk-only action store_true default False dest mturk_only help Enable MTurk-only flag for all HITs. N/A N/A __name__ __main__ N/A N/A args N/A N/A PARSER parse_args N/A N/A N/A os environ N/A DJANGO_SETTINGS_MODULE settings N/A PROJECT_HOME N/A N/A N/A os path normpath N/A N/A N/A os getcwd /.. N/A N/A N/A N/A sys path append PROJECT_HOME appraise.wmt15.models HIT appraise.wmt15.validators validate_hits_xml_file N/A first_run True N/A _hits_file N/A args hits_file N/A N/A N/A N/A first_run N/A N/A args sleep_seconds 0 N/A N/A N/A N/A Waiting {0} second(s) format N/A args sleep_seconds N/A i N/A range N/A args sleep_seconds N/A N/A  . N/A N/A N/A N/A sys stdout flush N/A N/A sleep 1 N/A N/A N/A N/A first_run False N/A hits_xml_string None N/A N/A open _hits_file infile N/A N/A hits_xml_string N/A unicode N/A N/A infile read utf-8 N/A N/A validate_hits_xml_file hits_xml_string N/A _errors 0 N/A _total 0 N/A _tree N/A fromstring N/A N/A hits_xml_string encode utf-8 N/A _child _tree N/A N/A block_id N/A N/A _child attrib N/A block-id N/A language_pair N/A N/A {0}2{1} format N/A N/A _child attrib N/A source-language N/A N/A _child attrib N/A target-language N/A iso_639_2_to_3_mapping N/A cze fre ger ces fra deu N/A N/A part2_code part3_code N/A N/A iso_639_2_to_3_mapping items N/A N/A language_pair N/A N/A language_pair replace part2_code part3_code N/A N/A N/A _total N/A _total 1 N/A _hit_xml N/A N/A N/A tostring _child encoding utf-8 decode utf-8 N/A N/A args dry_run_enabled N/A N/A _ N/A HIT block_id block_id hit_xml _hit_xml language_pair language_pair mturk_only N/A args mturk_only N/A N/A h N/A HIT block_id block_id hit_xml _hit_xml language_pair language_pair mturk_only N/A args mturk_only N/A N/A N/A h save N/A N/A N/A Exception N/A msg N/A N/A msg N/A _errors N/A _errors 1 N/A N/A N/A N/A [{0}] format _hits_file N/A N/A N/A Successfully imported {0} HITs, encountered errors for {1} HITs. format _total _errors N/A