Module Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias Assign NameStore Num Assign NameStore Str Assign NameStore Call NameLoad Call AttributeLoad Str attr Str ClassDef bases body FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body Assign NameStore Dict Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr If CompareNotEq NameLoad Str body Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body If CompareNotEq NameLoad Str body Assign SubscriptStore NameLoad Index BinOpMod Str SubscriptLoad NameLoad Index NameLoad Call NameLoad NameLoad If BoolOpAnd CompareEq NameLoad AttributeLoad NameLoad attr BoolOpOr CompareEq NameLoad Str CompareEq NameLoad Str body Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index NameLoad Assert CompareIn AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults Num body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore BinOpMod BinOpAdd Str Str TupleLoad NameLoad BinOpAdd NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad ListLoad NameLoad For TupleStore NameStore NameLoad body If BoolOpAnd CompareLt Call NameLoad NameLoad NameLoad UnaryOpNot CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr Num keyword NameLoad body If BoolOpAnd CompareLt Call NameLoad NameLoad NameLoad UnaryOpNot CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad For TupleStore NameStore NameLoad body Return Call NameLoad NameLoad decorator_list If CompareEq NameLoad Str body Import alias Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore Str Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword BinOpAdd NameLoad Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Num keyword Str Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Str Assign NameStore Call AttributeLoad NameLoad attr Print BinOpMod Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Str AugAssignAdd NameStore Call AttributeLoad Str attr GeneratorExp BinOpMod Str NameLoad comprehension NameStore NameLoad AugAssignAdd NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Print NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad For TupleStore NameStore NameLoad body AugAssignAdd SubscriptStore NameLoad Index NameLoad Num Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Print Call NameLoad GeneratorExp NameLoad comprehension NameStore NameLoad CompareGtE SubscriptLoad NameLoad Index NameLoad NameLoad Print Call NameLoad Call NameLoad GeneratorExp NameLoad comprehension NameStore NameLoad CompareGtE SubscriptLoad NameLoad Index NameLoad NameLoad Assign NameStore Call NameLoad Str Call NameLoad AttributeLoad NameLoad attr Assign NameStore Dict Assign NameStore Num For TupleStore NameStore NameStore NameStore NameStore NameLoad body If BoolOpOr CompareGtE NameLoad Num CompareLt SubscriptLoad NameLoad Index NameLoad NameLoad body Continue AugAssignAdd NameStore Num Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad If CompareEq BinOpMod NameLoad Num Num body Print TupleLoad NameLoad NameLoad NameLoad Print NameLoad Assign NameStore ListComp BinOpMod Str SubscriptLoad NameLoad Index NameLoad comprehension NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call NameLoad AttributeLoad NameLoad attr Str BinOpAdd ListLoad Str Str Str NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call NameLoad AttributeLoad NameLoad attr Str BinOpAdd ListLoad Str Str NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call NameLoad AttributeLoad NameLoad attr Str ListLoad Str Str Expr Call AttributeLoad NameLoad attr For NameStore Call AttributeLoad NameLoad attr body Print AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str
N/A N/A sqlite3 N/A operator N/A random csv DictWriter collections defaultdict extract_features instantiate_feature guesses_for_question util.qdb QuestionDatabase unidecode unidecode N/A kCOUNT_CUTOFF 2 N/A kCHOICEIDS ABCDEFGHIJKLMNOP N/A kCATEGORIES N/A set N/A N/A Science
Science:Astronomy
Science:Biology
Science:Chemistry
Science:Computer_Science
Science:Earth_Science
Science:Math
Science:Mathematics
Science:Other
Mathematics
Physics
Biology
Chemistry
Earth Science
Science:Physics split McScience N/A N/A __init__ N/A N/A self page question fold N/A N/A N/A N/A self page page N/A N/A self question question N/A N/A self choices N/A N/A N/A self fold fold N/A add_text N/A N/A self text N/A N/A N/A N/A self text text N/A add_choices N/A N/A self choices N/A N/A N/A N/A self choices N/A list choices N/A N/A N/A random shuffle N/A self choices N/A csv_line N/A N/A self choice_strings destination N/A train N/A N/A d N/A N/A N/A d N/A id N/A self question N/A N/A destination key N/A N/A N/A d N/A question N/A self text N/A N/A ii cc N/A enumerate N/A self choices N/A N/A N/A destination key N/A N/A N/A d N/A N/A answer%s N/A choice_strings N/A ii N/A unidecode cc N/A N/A N/A cc N/A self page N/A N/A destination train N/A destination key N/A N/A N/A d N/A correctAnswer N/A choice_strings N/A ii N/A N/A N/A self page N/A self choices N/A Correct answer %s not in the set %s N/A N/A self page N/A str N/A self choices N/A d N/A N/A question_top_guesses N/A N/A text deep guess_connection id page num_guesses N/A 4 N/A N/A 
    Return the top guesses for this page
     N/A c N/A N/A guess_connection cursor N/A command N/A N/A select page from guesses where sentence = 2 and token = 0 and question = %i  order by score desc limit %i N/A id N/A num_guesses 1 N/A N/A N/A c execute command N/A choices N/A set N/A page N/A N/A ii c N/A N/A N/A N/A N/A len choices num_guesses N/A N/A ii choices N/A N/A N/A N/A choices add ii N/A new_guesses N/A N/A deep text_guess text N/A N/A guess score N/A sorted N/A N/A new_guesses items key N/A N/A operator itemgetter 1 reverse True N/A N/A N/A N/A N/A len choices num_guesses N/A N/A guess choices N/A N/A N/A N/A choices add guess N/A choices N/A question_first_sentence N/A N/A database_connection question N/A N/A N/A 
    return the id, answer, and first sentence of questions in a set of categories
     N/A c N/A N/A database_connection cursor N/A command N/A select raw from text where question=%i question N/A N/A N/A c execute command N/A N/A ii c N/A N/A N/A unidecode ii N/A N/A N/A __name__ __main__ N/A N/A argparse N/A parser N/A N/A argparse ArgumentParser description N/A default_path data/ N/A N/A N/A parser add_argument --question_db type str default N/A default_path questions.db N/A N/A N/A parser add_argument --guess_db type str default N/A default_path guesses.db help Guess database N/A N/A N/A parser add_argument --num_choices type int default 4 help How many choices do we write N/A N/A N/A parser add_argument --train_out type str default sci_train.csv N/A N/A N/A parser add_argument --test_out type str default sci_test.csv N/A N/A N/A parser add_argument --key_out type str default sci_key.csv N/A flags N/A N/A parser parse_args N/A N/A Opening %s N/A flags question_db N/A question_database N/A N/A sqlite3 connect N/A flags question_db N/A guess_database N/A N/A sqlite3 connect N/A flags guess_db N/A query select page from questions where page != "" and ( N/A query N/A N/A  or  join N/A N/A category='%s' x N/A x kCATEGORIES N/A query ) N/A c N/A N/A question_database cursor N/A query N/A N/A N/A c execute query N/A answer_count N/A defaultdict int N/A N/A pp c N/A N/A N/A answer_count N/A pp 1 N/A query select page, id, naqt, fold from questions where page != "" N/A c N/A N/A question_database cursor N/A N/A N/A c execute query N/A N/A list N/A x N/A x answer_count N/A N/A answer_count N/A x kCOUNT_CUTOFF N/A N/A len N/A list N/A x N/A x answer_count N/A N/A answer_count N/A x kCOUNT_CUTOFF N/A deep N/A instantiate_feature deep N/A QuestionDatabase N/A flags question_db N/A questions N/A N/A question_num 0 N/A N/A pp ii nn ff c N/A N/A N/A N/A nn 0 N/A N/A answer_count N/A pp kCOUNT_CUTOFF N/A N/A N/A question_num 1 N/A question N/A McScience pp ii ff N/A N/A N/A question add_text N/A question_first_sentence question_database ii N/A choices N/A question_top_guesses N/A question text deep guess_database ii pp N/A flags num_choices N/A N/A N/A question add_choices choices N/A N/A questions N/A ii question N/A N/A N/A question_num 100 0 N/A N/A N/A pp ii question_num N/A choices N/A answer_choices N/A N/A answer%s N/A kCHOICEIDS N/A x N/A x N/A xrange N/A flags num_choices N/A train_out N/A DictWriter N/A open N/A flags train_out w N/A N/A id question correctAnswer answer_choices N/A N/A N/A train_out writeheader N/A test_out N/A DictWriter N/A open N/A flags test_out w N/A N/A id question answer_choices N/A N/A N/A test_out writeheader N/A key_out N/A DictWriter N/A open N/A flags key_out w N/A id correctAnswer N/A N/A N/A key_out writeheader N/A qq N/A N/A questions values N/A N/A N/A qq fold N/A N/A N/A qq fold devtest N/A N/A N/A N/A test_out writerow N/A N/A qq csv_line kCHOICEIDS test N/A N/A N/A key_out writerow N/A N/A qq csv_line kCHOICEIDS key N/A N/A N/A N/A train_out writerow N/A N/A qq csv_line kCHOICEIDS train