Module ImportFrom alias ImportFrom alias identifier Import alias ImportFrom alias alias ImportFrom alias alias ImportFrom alias alias alias alias ImportFrom alias FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Yield NameLoad decorator_list NameLoad ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad ListLoad Str Str Assign NameStore Call NameLoad Num keyword ListLoad Str Str Expr Call AttributeLoad NameLoad attr NameLoad ListLoad Str Str Str Str decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults vararg kwarg body Assign NameStore GeneratorExp Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore DictComp NameLoad Call NameLoad NameLoad comprehension TupleStore NameStore NameStore NameLoad Return Call AttributeLoad Call NameLoad attr NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Assign NameStore GeneratorExp ListLoad NameLoad comprehension NameStore NameLoad Return Call NameLoad Str keyword NameLoad keyword NameLoad decorator_list decorator_list ClassDef bases NameLoad NameLoad body FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad Str keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad TupleLoad Num Num Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad ListLoad Num Num Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad TupleLoad Num Num Num keyword Num keyword Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad ListLoad Num Num Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad TupleLoad Num Num Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad TupleLoad Num Num Num keyword Num With Call AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListLoad With Call AttributeLoad NameLoad attr Num body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr CompareGt Call NameLoad NameLoad Num With Call AttributeLoad NameLoad attr Num body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr CompareGt Call NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad TupleLoad Num Num Num keyword Num With Call AttributeLoad NameLoad attr Num body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr CompareGt Call NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad TupleLoad Num Num Num keyword Num With Call AttributeLoad NameLoad attr TupleLoad Num Num NameLoad NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListLoad Num Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign NameStore ListLoad TupleLoad Set Num Num Num Num TupleLoad Set Num Num Num NameLoad Num TupleLoad Set Num Num Num NameLoad Num For TupleStore NameStore TupleStore NameStore NameStore Call NameLoad Call NameLoad AttributeLoad NameLoad attr NameLoad body With Call AttributeLoad NameLoad attr keyword NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad TupleLoad Num Num Num keyword Num With Call NameLoad NameStore body Expr Call AttributeLoad NameLoad attr NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num decorator_list decorator_list ClassDef bases NameLoad NameLoad body FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad TupleLoad Num Num Num keyword Num With Call AttributeLoad NameLoad attr TupleLoad Num Num NameLoad NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListLoad Num Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign NameStore ListLoad TupleLoad Set Num Num Num Num TupleLoad Set Num Num NameLoad Num TupleLoad Set Num NameLoad Num For TupleStore NameStore TupleStore NameStore NameStore Call NameLoad Call NameLoad AttributeLoad NameLoad attr NameLoad body With Call AttributeLoad NameLoad attr keyword NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num NameLoad decorator_list decorator_list
N/A contextlib contextmanager copy copy copy_ N/A unittest unittest.mock patch MagicMock openrcv models streams openrcv.contestgen make_standard_candidate_names BallotGenerator UniqueBallotGenerator STOP_CHOICE openrcv.utiltest.helpers UnitCase _temp_ballots_resource N/A N/A N/A N/A N/A resource N/A N/A streams ListResource N/A ballots_resource N/A N/A models BallotsResource resource N/A N/A ballots_resource N/A contextmanager ModuleTest N/A UnitCase N/A test_make_standard_candidate_names N/A N/A self N/A N/A N/A names N/A make_standard_candidate_names 2 N/A N/A N/A self assertEqual names N/A Ann Bob N/A names N/A make_standard_candidate_names 4 names N/A A B N/A N/A N/A self assertEqual names N/A A B Person 3 Person 4 N/A N/A CopyingMock N/A MagicMock N/A __call__ N/A N/A self N/A args kwargs N/A N/A args N/A N/A copy_ arg N/A arg args N/A kwargs N/A k N/A copy_ v N/A N/A k v kwargs N/A N/A N/A N/A super __call__ args kwargs N/A N/A BallotGeneratorMixin N/A object N/A patch_sample_one N/A N/A self values N/A N/A N/A values N/A N/A v N/A v values N/A N/A patch openrcv.contestgen.sample new_callable CopyingMock side_effect values N/A N/A BallotGeneratorTest N/A UnitCase BallotGeneratorMixin N/A patch_random N/A N/A self return_value N/A N/A N/A N/A patch openrcv.contestgen.random return_value return_value N/A test_init__defaults N/A N/A self N/A N/A N/A chooser N/A BallotGenerator N/A 1 2 3 N/A N/A N/A self assertEqual N/A chooser choices N/A set N/A 1 2 3 N/A N/A N/A self assertEqual N/A chooser max_length 3 N/A N/A N/A self assertEqual N/A chooser undervote 0.1 N/A test_init__defaults N/A N/A self N/A N/A N/A chooser N/A BallotGenerator N/A 1 2 3 max_length 4 undervote 0.5 N/A N/A N/A self assertEqual N/A chooser choices N/A set N/A 1 2 3 N/A N/A N/A self assertEqual N/A chooser max_length 4 N/A N/A N/A self assertEqual N/A chooser undervote 0.5 N/A test_choose N/A N/A self N/A N/A N/A chooser N/A BallotGenerator N/A 1 2 3 N/A N/A N/A self assertEqual N/A N/A chooser choose N/A 1 1 N/A test_make_choices__undervote N/A N/A self N/A N/A N/A chooser N/A BallotGenerator N/A 1 2 3 undervote 0.5 N/A N/A N/A self patch_random 0.49 N/A N/A N/A N/A self assertEqual N/A N/A chooser make_choices N/A N/A N/A N/A self patch_random 0.5 N/A N/A ballot N/A N/A chooser make_choices N/A N/A N/A self assertTrue N/A N/A len ballot 0 N/A N/A N/A self patch_random 0.51 N/A N/A ballot N/A N/A chooser make_choices N/A N/A N/A self assertTrue N/A N/A len ballot 0 N/A test_make_choices__undervote__zero N/A N/A self N/A N/A N/A Check the zero edge case. N/A chooser N/A BallotGenerator N/A 1 2 3 undervote 0 N/A N/A N/A self patch_random 0 N/A N/A ballot N/A N/A chooser make_choices N/A N/A N/A self assertTrue N/A N/A len ballot 0 N/A test_make_choices N/A N/A self N/A N/A N/A chooser N/A BallotGenerator N/A 1 2 3 undervote 0 N/A N/A N/A self patch_sample_one N/A 1 1 STOP_CHOICE mock_sample N/A N/A N/A N/A self assertEqual N/A N/A chooser make_choices N/A 1 1 N/A N/A N/A self assertEqual N/A mock_sample call_count 3 N/A expecteds N/A N/A N/A 1 2 3 1 N/A N/A 1 2 3 STOP_CHOICE 1 N/A N/A 1 2 3 STOP_CHOICE 1 N/A N/A i N/A actual expected N/A enumerate N/A zip N/A mock_sample call_args_list expecteds N/A N/A N/A N/A self subTest index i N/A N/A N/A N/A self assertEqual N/A actual N/A 0 expected N/A test_add_random_ballots N/A N/A self N/A N/A N/A chooser N/A BallotGenerator N/A 1 2 3 undervote 0 N/A N/A _temp_ballots_resource ballots_resource N/A N/A N/A N/A chooser add_random_ballots ballots_resource count 12 N/A N/A N/A self assertEqual N/A N/A ballots_resource count 12 N/A N/A UniqueBallotGeneratorTest N/A UnitCase BallotGeneratorMixin N/A test_make_choices N/A N/A self N/A N/A N/A chooser N/A UniqueBallotGenerator N/A 1 2 3 undervote 0 N/A N/A N/A self patch_sample_one N/A 1 2 STOP_CHOICE mock_sample N/A N/A N/A N/A self assertEqual N/A N/A chooser make_choices N/A 1 2 N/A N/A N/A self assertEqual N/A mock_sample call_count 3 N/A expecteds N/A N/A N/A 1 2 3 1 N/A N/A 2 3 STOP_CHOICE 1 N/A N/A 3 STOP_CHOICE 1 N/A N/A i N/A actual expected N/A enumerate N/A zip N/A mock_sample call_args_list expecteds N/A N/A N/A N/A self subTest index i N/A N/A N/A N/A self assertEqual N/A actual N/A 0 expected N/A N/A