index
int64
statement_id
int64
statement
string
lineno
int64
end_lineno
int64
comprehension_types
list
metadata
dict
227
34
r = [player.steam_id for player in teams["red"] if player.steam_id != red_p.steam_id] + [blue_p.steam_id]
1,024
1,025
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
35
b = [player.steam_id for player in teams["blue"] if player.steam_id != blue_p.steam_id] + [red_p.steam_id]
1,026
1,027
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
36
_names = [p.name for p in _scheduled_players]
1,173
1,173
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
37
matched_players = [_player for _player in _scheduled_players if msg[1] in _player.name]
1,179
1,179
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
38
_matched_names = [_player.name for _player in matched_players]
1,186
1,186
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
39
steam_ids = [player.steam_id for player in self.players()]
1,195
1,195
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
40
alternative_team_a = [player for player in teams[last_new_player.team] if player != last_new_player] + \ [player]
1,379
1,380
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
41
team1_steam_ids = [player.steam_id for player in team1]
1,413
1,413
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
42
team2_steam_ids = [player.steam_id for player in team2]
1,414
1,414
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
43
self.previous_teams = [player.steam_id for player in teams["red"]], \ [player.steam_id for player in teams["blue"]]
1,662
1,663
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
44
steam_ids = [player.steam_id for player in teams["red"] + teams["blue"]]
1,670
1,670
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
45
other_twovstwo = sorted([steam_id for steam_id in steam_ids if steam_id not in next_twovstwo])
1,678
1,678
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
46
red_steam_ids = sorted([player.steam_id for player in teams["red"]])
1,679
1,679
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
47
blue_steam_ids = sorted([player.steam_id for player in teams["blue"]])
1,680
1,680
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
48
other_twovstwo = sorted([steam_id for steam_id in steam_ids if steam_id not in next_twovstwo])
1,686
1,686
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
49
request_url = self.url_base + "{}/{}".format(self.balance_api, "+".join([str(steam_id) for steam_id in steam_ids]))
1,738
1,739
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
50
returned[steam_id] = {gametype: self.gametype_data_for(steam_id, gametype) for gametype in self.rated_gametypes_for(steam_id)}
1,813
1,814
[ "DictComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
51
return [gametype for gametype in player_data if gametype not in FILTERED_OUT_GAMETYPE_RESPONSES]
1,871
1,871
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
52
returned = returned + [int(steam_id) for steam_id in json_rating["playerinfo"]]
1,890
1,890
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
53
return [steam_id for steam_id in set(returned)]
1,892
1,892
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
227
54
return "[{}]".format(", ".join([str(suggestion) for suggestion in self.suggestions]))
1,969
1,969
[ "ListComp" ]
{ "hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd", "max_stars_repo_name": "mgaertne/minqlx-plugin-tests", "max_stars_repo_path": "experimental/python/balancetwo.py", "lang": "Python" }
233
0
Info = namedtuple('PluginInfo', [camel_to_snake(name) for name in _info_sequence])
20
20
[ "ListComp" ]
{ "hexsha": "f7009dcf50aae16de77397752b83afd09472de19", "max_stars_repo_name": "nicehuster/mmdetection-supervisely-person-datasets", "max_stars_repo_path": "superviselySDK/supervisely_lib/api/plugin_api.py", "lang": "Python" }
237
0
return [name for name in self._ssql_ctx.tableNames()]
408
408
[ "ListComp" ]
{ "hexsha": "f7009fe5893e095621033c84f03e04542a553ee8", "max_stars_repo_name": "levyx/spark", "max_stars_repo_path": "python/pyspark/sql/context.py", "lang": "Python" }
237
1
return [name for name in self._ssql_ctx.tableNames(dbName)]
410
410
[ "ListComp" ]
{ "hexsha": "f7009fe5893e095621033c84f03e04542a553ee8", "max_stars_repo_name": "levyx/spark", "max_stars_repo_path": "python/pyspark/sql/context.py", "lang": "Python" }
240
0
input_layer = [Input(shape=(d, )) for d in in_dims]
14
14
[ "ListComp" ]
{ "hexsha": "f700a0f85c56c6c32dc9556cd94098aa1d2efe6b", "max_stars_repo_name": "nguyen-binh-minh/logographic", "max_stars_repo_path": "experiment/exp1x.py", "lang": "Python" }
245
0
return [a for a in glob.glob(path) if os.path.isdir(a)]
183
183
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
1
return [GuestAgent(path=path) for path in self.agent_dirs()]
224
224
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
2
v = [FlexibleVersion(AGENT_DIR_PATTERN.match(a).group(1)) for a in self.agent_dirs()]
244
244
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
3
self.update_handler._set_agents([GuestAgent(path=path) for path in self.agent_dirs()])
982
982
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
4
self.assertEqual( [agent.version for agent in kept_agents], [agent.version for agent in self.update_handler.agents])
1,154
1,156
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
5
agent_calls = [args[0] for (args, _) in mock_popen.call_args_list if "run-exthandlers" in ''.join(args[0])]
1,180
1,181
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
6
self.assertEqual(calls, len([c for c in [call[0] for call in mock_handler.return_value.method_calls] if c == 'run']))
1,377
1,377
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
7
self.update_handler._set_agents([GuestAgent(path=path) for path in self.agent_dirs()])
1,417
1,417
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
8
self.update_handler._set_agents([GuestAgent(path=path) for path in self.agent_dirs()])
1,424
1,424
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
9
self.assertTrue(any(call_args[0] == "[HEARTBEAT] Agent {0} is running as the goal state agent {1}" for call_args in patch_info.call_args), "The heartbeat was not written to the agent's log")
1,585
1,586
[ "GeneratorExp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
10
self.assertTrue(any( "Not setting up persistent firewall rules as OS.EnableFirewall=False" == args[0] for (args, _) in patch_info.call_args_list), "Info not logged properly, got: {0}".format(patch_info.call_args_list))
1,643
1,645
[ "GeneratorExp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
11
self.assertTrue([FirewallCmdDirectCommands.QueryPassThrough in cmd for cmd in executed_commands], "The remaining commands should only be for querying the firewall commands")
1,669
1,670
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
12
upgrade_event_msgs = [kwarg['message'] for _, kwarg in mock_telemetry.call_args_list if '{0} Agent upgrade discovered, updating to WALinuxAgent-99999.0.0.0 -- exiting'.format( upgrade_type) in kwarg['message'] and kwarg[ '...
1,766
1,769
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
13
self.assertEqual(0, len([kwarg['message'] for _, kwarg in mock_telemetry.call_args_list if "Agent upgrade discovered, updating to" in kwarg['message'] and kwarg[ 'op'] == WALAEventOperation.AgentUpgrade]), "Unwanted upgrade")
1,777
1,779
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
14
upgrade_event_msgs = [kwarg['message'] for _, kwarg in mock_telemetry.call_args_list if kwarg['op'] == WALAEventOperation.AgentUpgrade]
1,885
1,886
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
15
self.assertGreater(len([msg for msg in upgrade_event_msgs if 'Discovered new {0} upgrade WALinuxAgent-99999.0.0.0; Will upgrade on or after'.format( AgentUpgradeType.Normal) in msg]), 0, "Error message not propagated properly")
1,887
1,889
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
16
calls_to_strings = lambda calls: (str(c) for c in calls)
2,155
2,155
[ "GeneratorExp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
17
filter_calls = lambda calls, regex=None: (c for c in calls_to_strings(calls) if regex is None or re.match(regex, c))
2,156
2,156
[ "GeneratorExp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
18
logger_calls = lambda regex=None: [m for m in filter_calls(logger.method_calls, regex)]
2,157
2,157
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
19
telemetry_calls = lambda regex=None: [m for m in filter_calls(add_event.mock_calls, regex)]
2,161
2,161
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
245
20
exthandlers_handler.report_ext_handlers_status = Mock(side_effect=[create_vm_status(s) for s in extension_statuses])
2,257
2,257
[ "ListComp" ]
{ "hexsha": "f700a2d53401ad7f036b114a974636da78dec066", "max_stars_repo_name": "dhivyaganesan/WALinuxAgent", "max_stars_repo_path": "tests/ga/test_update.py", "lang": "Python" }
247
0
load_consts = [instr for instr in dis.get_instructions(code) if instr.opname == 'LOAD_CONST']
97
98
[ "ListComp" ]
{ "hexsha": "f700a3646ef373f0c80bd2f7108ae24442bd12c3", "max_stars_repo_name": "hausen/pypy3.6-7.3.0-osx", "max_stars_repo_path": "lib-python/3/test/test_peepholer.py", "lang": "Python" }
247
1
returns = [instr for instr in dis.get_instructions(f) if instr.opname == 'RETURN_VALUE']
253
254
[ "ListComp" ]
{ "hexsha": "f700a3646ef373f0c80bd2f7108ae24442bd12c3", "max_stars_repo_name": "hausen/pypy3.6-7.3.0-osx", "max_stars_repo_path": "lib-python/3/test/test_peepholer.py", "lang": "Python" }
247
2
returns = [instr for instr in dis.get_instructions(f) if instr.opname == 'RETURN_VALUE']
263
264
[ "ListComp" ]
{ "hexsha": "f700a3646ef373f0c80bd2f7108ae24442bd12c3", "max_stars_repo_name": "hausen/pypy3.6-7.3.0-osx", "max_stars_repo_path": "lib-python/3/test/test_peepholer.py", "lang": "Python" }
247
3
returns = [instr for instr in dis.get_instructions(f) if instr.opname == 'RETURN_VALUE']
280
281
[ "ListComp" ]
{ "hexsha": "f700a3646ef373f0c80bd2f7108ae24442bd12c3", "max_stars_repo_name": "hausen/pypy3.6-7.3.0-osx", "max_stars_repo_path": "lib-python/3/test/test_peepholer.py", "lang": "Python" }
247
4
returns = [instr for instr in dis.get_instructions(f) if instr.opname == 'JUMP_ABSOLUTE']
291
292
[ "ListComp" ]
{ "hexsha": "f700a3646ef373f0c80bd2f7108ae24442bd12c3", "max_stars_repo_name": "hausen/pypy3.6-7.3.0-osx", "max_stars_repo_path": "lib-python/3/test/test_peepholer.py", "lang": "Python" }
247
5
returns = [instr for instr in dis.get_instructions(f) if instr.opname == 'RETURN_VALUE']
294
295
[ "ListComp" ]
{ "hexsha": "f700a3646ef373f0c80bd2f7108ae24442bd12c3", "max_stars_repo_name": "hausen/pypy3.6-7.3.0-osx", "max_stars_repo_path": "lib-python/3/test/test_peepholer.py", "lang": "Python" }
253
0
return [1 for x in self.get_sensitive_attributes()]
66
66
[ "ListComp" ]
{ "hexsha": "f700a5efbabcafda7e171a38a5f9eb3d47ebaada", "max_stars_repo_name": "JSGoedhart/fairness-comparison", "max_stars_repo_path": "fairness/data/objects/Data.py", "lang": "Python" }
253
1
return priv_class_names + ['-'.join(str(v) for v in priv_class_names)]
77
77
[ "GeneratorExp" ]
{ "hexsha": "f700a5efbabcafda7e171a38a5f9eb3d47ebaada", "max_stars_repo_name": "JSGoedhart/fairness-comparison", "max_stars_repo_path": "fairness/data/objects/Data.py", "lang": "Python" }
253
2
return [data_frame.groupby(a).size() for a in self.get_sensitive_attributes()]
147
148
[ "ListComp" ]
{ "hexsha": "f700a5efbabcafda7e171a38a5f9eb3d47ebaada", "max_stars_repo_name": "JSGoedhart/fairness-comparison", "max_stars_repo_path": "fairness/data/objects/Data.py", "lang": "Python" }
255
0
files1 = [f for f in os.listdir(directory) if f[-4:].lower() in (".jpg",".JPG",".png",".PNG",".jpeg",".JPEG",".bmp",".gif")]
44
44
[ "ListComp" ]
{ "hexsha": "f700a70644d82c316ab0fc24f1e3f5646c62c338", "max_stars_repo_name": "QuentiumYT/ImageRenaming", "max_stars_repo_path": "ImageRenaming.pyw", "lang": "Python" }
255
1
files2 = [f for f in os.listdir(directory) if f[-4:].lower() in (".jpg",".JPG",".png",".PNG",".jpeg",".JPEG",".bmp",".gif")]
57
57
[ "ListComp" ]
{ "hexsha": "f700a70644d82c316ab0fc24f1e3f5646c62c338", "max_stars_repo_name": "QuentiumYT/ImageRenaming", "max_stars_repo_path": "ImageRenaming.pyw", "lang": "Python" }
257
0
source_files.extend([os.path.join(root, f) for f in filenames if f.endswith('.py')])
113
113
[ "ListComp" ]
{ "hexsha": "f700a89c0b32d02df5957e1b626dcb3be33f0f5e", "max_stars_repo_name": "shiaky/jsonrpc-websocket", "max_stars_repo_path": "tests.py", "lang": "Python" }
258
0
self._blocks = sorted(M.nonzero_positions_in_column(i) for i in range(M.ncols()))
201
201
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
1
if self._points == list(range(len(points))) and all(isinstance(x,(int,Integer)) for x in self._points): self._point_to_index = None else: self._point_to_index = {e:i for i,e in enumerate(self._points)}
209
212
[ "DictComp", "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
2
self._point_to_index = {e:i for i,e in enumerate(self._points)}
212
212
[ "DictComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
3
if any(x not in self._points for x in block): raise ValueError("Block {} is not contained in the point set".format(block))
216
217
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
4
blocks = [sorted(self._point_to_index[e] for e in block) for block in blocks]
223
223
[ "GeneratorExp", "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
5
blocks = [sorted(block) for block in blocks]
226
226
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
6
yield [self._points[i] for i in b]
262
262
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
7
if any(p not in p_to_i for p in other.ground_set()): return False
318
319
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
8
other_blocks = sorted(sorted(p_to_i[p] for p in b) for b in other.blocks())
321
321
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
9
block = [self._point_to_index[x] for x in block]
382
382
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
10
g.add_edges((i+n,x) for i,b in enumerate(self._blocks) for x in b)
411
411
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
11
canonical_label = [canonical_label[x] for x in range(n)]
413
413
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
12
B_canon_rev = {y:x for x,y in six.iteritems(B_canon)}
485
485
[ "DictComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
13
return {x:B_canon_rev[xint] for x,xint in six.iteritems(A_canon)}
486
486
[ "DictComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
14
int_points = [self._point_to_index[x] for x in points]
638
638
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
15
return IncidenceStructure(points, [[self._points[x] for x in S] for S in self._blocks if int_points.issuperset(S)])
643
646
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
16
int_points = frozenset(int(x) for x in points)
704
704
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
17
int_points = frozenset(self._point_to_index[x] for x in points)
710
710
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
18
blocks = [int_points.intersection(S) for S in self._blocks]
714
714
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
19
blocks = [S for S in blocks if len(S)>=min_size]
716
716
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
20
IS.relabel({i:self._points[i] for i in int_points})
720
720
[ "DictComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
21
return [b[:] for b in self._blocks]
774
774
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
22
return [[self._points[i] for i in b] for b in self._blocks]
776
776
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
23
return [len(_) for _ in self._blocks]
791
791
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
24
return sum((p in b) for b in self._blocks) if p != -1 else 0
838
838
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
25
p = set(self._point_to_index.get(x,-1) for x in p)
843
843
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
26
p = set(p) if all(x>=0 and x<len(self._points) for x in p) else set([-1])
845
845
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
27
return sum(p.issubset(b) for b in self._blocks) if -1 not in p else 0
847
847
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
28
return {p: d[i] for i, p in enumerate(self._points)}
892
892
[ "DictComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
29
d = {t:0 for t in combinations(range(self.num_points()),size)}
895
895
[ "DictComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
30
return {tuple([self._points[x] for x in s]):v for s,v in six.iteritems(d)}
900
900
[ "DictComp", "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
31
return max(len(b) for b in self._blocks)
914
914
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
32
return all(B[i] != B[i+1] for i in range(len(B)-1))
1,056
1,056
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
33
gB = [[x+1 for x in b] for b in self._blocks]
1,070
1,070
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
34
V = [Set(v) for v in self]
1,106
1,106
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
35
G.add_edges((b,x) for x in b)
1,192
1,192
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
36
I = IncidenceStructure([X.difference(B) for B in self._blocks])
1,271
1,271
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
37
I.relabel({i:self._points[i] for i in range(self.num_points())})
1,273
1,273
[ "DictComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
38
self._points = [perm[x] for x in self._points]
1,352
1,352
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
39
self._point_to_index = {v:i for i,v in enumerate(self._points)}
1,356
1,356
[ "DictComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
40
d = [[] for x in self._points]
1,413
1,413
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
41
p.add_constraint(p.sum([b[i] for i in L]) <= 1)
1,421
1,421
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }