index int64 | statement_id int64 | statement string | lineno int64 | end_lineno int64 | comprehension_types list | metadata dict |
|---|---|---|---|---|---|---|
146 | 1 | test_items = [
self.algorithm.predict(new_user_id, full_dataset.to_raw_iid(i))
for i in range(0, full_dataset.n_items)
if i not in watched
] | 38 | 42 | [
"ListComp"
] | {
"hexsha": "f7006506115787b6ab648322e288f899a2ea56b5",
"max_stars_repo_name": "mateuszrusin/filmweb-rekomendacje",
"max_stars_repo_path": "movies_recommender/RecommenderSVD.py",
"lang": "Python"
} |
146 | 2 | topn_items = [i[0] for i in get_top_n(test_items, n=k, minimum_rating=1.0)[new_user_id]] | 44 | 44 | [
"ListComp"
] | {
"hexsha": "f7006506115787b6ab648322e288f899a2ea56b5",
"max_stars_repo_name": "mateuszrusin/filmweb-rekomendacje",
"max_stars_repo_path": "movies_recommender/RecommenderSVD.py",
"lang": "Python"
} |
148 | 0 | key = tuple(
get_lookup_value(obj, field) for field in order_with_respect_to
) | 175 | 177 | [
"GeneratorExp"
] | {
"hexsha": "f700666f3ddc127976f134add98c0159870b03e1",
"max_stars_repo_name": "MarcelForArt/django-safedelete",
"max_stars_repo_path": "safedelete/queryset.py",
"lang": "Python"
} |
148 | 1 | return {field: _get_lookup_value(field) for field in order_with_respect_to} | 193 | 193 | [
"DictComp"
] | {
"hexsha": "f700666f3ddc127976f134add98c0159870b03e1",
"max_stars_repo_name": "MarcelForArt/django-safedelete",
"max_stars_repo_path": "safedelete/queryset.py",
"lang": "Python"
} |
149 | 0 | detProbs = [np.array([1 if j == i else 0 for j in range(numActions)]) for i in range(numActions)] | 7 | 7 | [
"ListComp"
] | {
"hexsha": "f70067377c11a437d33b5c947e65a2cb6d20e8e6",
"max_stars_repo_name": "rohit-konda/markovGames",
"max_stars_repo_path": "markovGames/learning/bruteSearch.py",
"lang": "Python"
} |
149 | 1 | return [Policy(states, pol, acSet) for pol in detPol] | 16 | 16 | [
"ListComp"
] | {
"hexsha": "f70067377c11a437d33b5c947e65a2cb6d20e8e6",
"max_stars_repo_name": "rohit-konda/markovGames",
"max_stars_repo_path": "markovGames/learning/bruteSearch.py",
"lang": "Python"
} |
149 | 2 | polList = [getPolList(states, ac) for ac in listActions] | 21 | 21 | [
"ListComp"
] | {
"hexsha": "f70067377c11a437d33b5c947e65a2cb6d20e8e6",
"max_stars_repo_name": "rohit-konda/markovGames",
"max_stars_repo_path": "markovGames/learning/bruteSearch.py",
"lang": "Python"
} |
149 | 3 | jointAc = [listAcSet[j][ind] for j, ind in enumerate(index)] | 29 | 29 | [
"ListComp"
] | {
"hexsha": "f70067377c11a437d33b5c947e65a2cb6d20e8e6",
"max_stars_repo_name": "rohit-konda/markovGames",
"max_stars_repo_path": "markovGames/learning/bruteSearch.py",
"lang": "Python"
} |
149 | 4 | numPL = [len(pL) for pL in listAcSet] | 33 | 33 | [
"ListComp"
] | {
"hexsha": "f70067377c11a437d33b5c947e65a2cb6d20e8e6",
"max_stars_repo_name": "rohit-konda/markovGames",
"max_stars_repo_path": "markovGames/learning/bruteSearch.py",
"lang": "Python"
} |
149 | 5 | for ind in product(*[range(nI) for nI in numPL]):
payoff[ind] = utilInd(ind) | 35 | 36 | [
"ListComp"
] | {
"hexsha": "f70067377c11a437d33b5c947e65a2cb6d20e8e6",
"max_stars_repo_name": "rohit-konda/markovGames",
"max_stars_repo_path": "markovGames/learning/bruteSearch.py",
"lang": "Python"
} |
149 | 6 | cpnes = [tuple(cpne) for cpne in cpnes] | 47 | 47 | [
"ListComp"
] | {
"hexsha": "f70067377c11a437d33b5c947e65a2cb6d20e8e6",
"max_stars_repo_name": "rohit-konda/markovGames",
"max_stars_repo_path": "markovGames/learning/bruteSearch.py",
"lang": "Python"
} |
149 | 7 | pneWelf = [welfareMat[cpne] for cpne in cpnes] | 61 | 61 | [
"ListComp"
] | {
"hexsha": "f70067377c11a437d33b5c947e65a2cb6d20e8e6",
"max_stars_repo_name": "rohit-konda/markovGames",
"max_stars_repo_path": "markovGames/learning/bruteSearch.py",
"lang": "Python"
} |
149 | 8 | priceRatios = [float(pne) / opt for pne in pneWelf] | 63 | 63 | [
"ListComp"
] | {
"hexsha": "f70067377c11a437d33b5c947e65a2cb6d20e8e6",
"max_stars_repo_name": "rohit-konda/markovGames",
"max_stars_repo_path": "markovGames/learning/bruteSearch.py",
"lang": "Python"
} |
152 | 0 | params = {target: {'results': {}} for target in targets} | 123 | 123 | [
"DictComp"
] | {
"hexsha": "f7006be989e72bdce78c68bad744121539b63e0a",
"max_stars_repo_name": "FlanFlanagan/raven",
"max_stars_repo_path": "framework/TSA/Wavelet.py",
"lang": "Python"
} |
152 | 1 | base.append(xmlUtils.newNode(name, text=','.join([str(v) for v in value]))) | 194 | 194 | [
"ListComp"
] | {
"hexsha": "f7006be989e72bdce78c68bad744121539b63e0a",
"max_stars_repo_name": "FlanFlanagan/raven",
"max_stars_repo_path": "framework/TSA/Wavelet.py",
"lang": "Python"
} |
158 | 0 | t.lexer.lineno += len([a for a in t.value if a=="\n"]) | 132 | 132 | [
"ListComp"
] | {
"hexsha": "f700708d0b9048b76b77d12bc9318376b5a488e6",
"max_stars_repo_name": "lamondlab/sipify",
"max_stars_repo_path": "CppHeaderParser-2.7/CppHeaderParser/CppHeaderParser.py",
"lang": "Python"
} |
158 | 1 | t.lexer.lineno += len([a for a in t.value if a=="\n"]) | 154 | 154 | [
"ListComp"
] | {
"hexsha": "f700708d0b9048b76b77d12bc9318376b5a488e6",
"max_stars_repo_name": "lamondlab/sipify",
"max_stars_repo_path": "CppHeaderParser-2.7/CppHeaderParser/CppHeaderParser.py",
"lang": "Python"
} |
158 | 2 | return [ meth['name'] for meth in self['methods'][ type ] ] | 405 | 405 | [
"ListComp"
] | {
"hexsha": "f700708d0b9048b76b77d12bc9318376b5a488e6",
"max_stars_repo_name": "lamondlab/sipify",
"max_stars_repo_path": "CppHeaderParser-2.7/CppHeaderParser/CppHeaderParser.py",
"lang": "Python"
} |
158 | 3 | cpy = dict((k,v) for (k,v) in list(self.items()) if k not in filter_keys) | 900 | 900 | [
"GeneratorExp"
] | {
"hexsha": "f700708d0b9048b76b77d12bc9318376b5a488e6",
"max_stars_repo_name": "lamondlab/sipify",
"max_stars_repo_path": "CppHeaderParser-2.7/CppHeaderParser/CppHeaderParser.py",
"lang": "Python"
} |
158 | 4 | cpy = dict((k,v) for (k,v) in list(self.items()) if k in keys_white_list) | 1,024 | 1,024 | [
"GeneratorExp"
] | {
"hexsha": "f700708d0b9048b76b77d12bc9318376b5a488e6",
"max_stars_repo_name": "lamondlab/sipify",
"max_stars_repo_path": "CppHeaderParser-2.7/CppHeaderParser/CppHeaderParser.py",
"lang": "Python"
} |
158 | 5 | names = [ v['name'] for v in values ] | 1,042 | 1,042 | [
"ListComp"
] | {
"hexsha": "f700708d0b9048b76b77d12bc9318376b5a488e6",
"max_stars_repo_name": "lamondlab/sipify",
"max_stars_repo_path": "CppHeaderParser-2.7/CppHeaderParser/CppHeaderParser.py",
"lang": "Python"
} |
158 | 6 | filteredParseHistory = [h for h in parseHistory if h["braceDepth"] == self.braceDepth] | 1,916 | 1,916 | [
"ListComp"
] | {
"hexsha": "f700708d0b9048b76b77d12bc9318376b5a488e6",
"max_stars_repo_name": "lamondlab/sipify",
"max_stars_repo_path": "CppHeaderParser-2.7/CppHeaderParser/CppHeaderParser.py",
"lang": "Python"
} |
158 | 7 | num_newlines = len([a for a in m if a=="\n"]) | 2,153 | 2,153 | [
"ListComp"
] | {
"hexsha": "f700708d0b9048b76b77d12bc9318376b5a488e6",
"max_stars_repo_name": "lamondlab/sipify",
"max_stars_repo_path": "CppHeaderParser-2.7/CppHeaderParser/CppHeaderParser.py",
"lang": "Python"
} |
158 | 8 | num_newlines = len([a for a in m if a=="\n"]) | 2,167 | 2,167 | [
"ListComp"
] | {
"hexsha": "f700708d0b9048b76b77d12bc9318376b5a488e6",
"max_stars_repo_name": "lamondlab/sipify",
"max_stars_repo_path": "CppHeaderParser-2.7/CppHeaderParser/CppHeaderParser.py",
"lang": "Python"
} |
158 | 9 | num_newlines = len([a for a in match_str if a=="\n"]) | 2,202 | 2,202 | [
"ListComp"
] | {
"hexsha": "f700708d0b9048b76b77d12bc9318376b5a488e6",
"max_stars_repo_name": "lamondlab/sipify",
"max_stars_repo_path": "CppHeaderParser-2.7/CppHeaderParser/CppHeaderParser.py",
"lang": "Python"
} |
163 | 0 | X = np.array([x**i for i in range(5)]).T | 53 | 53 | [
"ListComp"
] | {
"hexsha": "f7007426c0895ef71449b89c57011d35fd1a9bea",
"max_stars_repo_name": "DEVESHTARASIA/big-data-tutorial",
"max_stars_repo_path": "tutorial/helpers.py",
"lang": "Python"
} |
163 | 1 | X_test = np.array([x_test**i for i in range(5)]).T | 54 | 54 | [
"ListComp"
] | {
"hexsha": "f7007426c0895ef71449b89c57011d35fd1a9bea",
"max_stars_repo_name": "DEVESHTARASIA/big-data-tutorial",
"max_stars_repo_path": "tutorial/helpers.py",
"lang": "Python"
} |
163 | 2 | X = np.array([x**i for i in range(10)]).T | 59 | 59 | [
"ListComp"
] | {
"hexsha": "f7007426c0895ef71449b89c57011d35fd1a9bea",
"max_stars_repo_name": "DEVESHTARASIA/big-data-tutorial",
"max_stars_repo_path": "tutorial/helpers.py",
"lang": "Python"
} |
163 | 3 | X_test = np.array([x_test**i for i in range(10)]).T | 60 | 60 | [
"ListComp"
] | {
"hexsha": "f7007426c0895ef71449b89c57011d35fd1a9bea",
"max_stars_repo_name": "DEVESHTARASIA/big-data-tutorial",
"max_stars_repo_path": "tutorial/helpers.py",
"lang": "Python"
} |
166 | 0 | optional_kwargs = dict(
(param, self.module.params[param])
for param in optional_get_method_params
if self.module.params.get(param) is not None
) | 255 | 259 | [
"GeneratorExp"
] | {
"hexsha": "f7007599d5407174b0644c00cd4a735463bb5b0e",
"max_stars_repo_name": "LaudateCorpus1/oci-ansible-collection",
"max_stars_repo_path": "plugins/modules/oci_data_catalog_namespace_facts.py",
"lang": "Python"
} |
166 | 1 | optional_kwargs = dict(
(param, self.module.params[param])
for param in optional_list_method_params
if self.module.params.get(param) is not None
) | 280 | 284 | [
"GeneratorExp"
] | {
"hexsha": "f7007599d5407174b0644c00cd4a735463bb5b0e",
"max_stars_repo_name": "LaudateCorpus1/oci-ansible-collection",
"max_stars_repo_path": "plugins/modules/oci_data_catalog_namespace_facts.py",
"lang": "Python"
} |
171 | 0 | return [int(x) for x in option_feeds.strip().split(',')] | 38 | 38 | [
"ListComp"
] | {
"hexsha": "f70079cc4279ef48d761d342b154ee50b32ac6d2",
"max_stars_repo_name": "dumpmemory/rssant",
"max_stars_repo_path": "rssant_cli/rss.py",
"lang": "Python"
} |
171 | 1 | return [unionid.decode(x)[1] for x in option_feeds.strip().split(',')] | 46 | 46 | [
"ListComp"
] | {
"hexsha": "f70079cc4279ef48d761d342b154ee50b32ac6d2",
"max_stars_repo_name": "dumpmemory/rssant",
"max_stars_repo_path": "rssant_cli/rss.py",
"lang": "Python"
} |
171 | 2 | feed_ids = [feed.id for feed in Feed.objects.only('id').all()] | 50 | 50 | [
"ListComp"
] | {
"hexsha": "f70079cc4279ef48d761d342b154ee50b32ac6d2",
"max_stars_repo_name": "dumpmemory/rssant",
"max_stars_repo_path": "rssant_cli/rss.py",
"lang": "Python"
} |
171 | 3 | story_ids = [story.id for story in Story.objects.only('id').all()] | 66 | 66 | [
"ListComp"
] | {
"hexsha": "f70079cc4279ef48d761d342b154ee50b32ac6d2",
"max_stars_repo_name": "dumpmemory/rssant",
"max_stars_repo_path": "rssant_cli/rss.py",
"lang": "Python"
} |
171 | 4 | feed_ids.extend(x.id for x in feed_objs) | 385 | 385 | [
"GeneratorExp"
] | {
"hexsha": "f70079cc4279ef48d761d342b154ee50b32ac6d2",
"max_stars_repo_name": "dumpmemory/rssant",
"max_stars_repo_path": "rssant_cli/rss.py",
"lang": "Python"
} |
181 | 0 | diff = [lfc_p.m - el_p.m for lfc_p, el_p in zip(lfc_p_list, el_p_list)] | 511 | 511 | [
"ListComp"
] | {
"hexsha": "f7007ee1209e9e3b464ffcab4ffdfa1412233c4b",
"max_stars_repo_name": "aschueth/MetPy",
"max_stars_repo_path": "src/metpy/calc/thermo.py",
"lang": "Python"
} |
181 | 1 | others = interpolate_1d(isentlevels, pres_theta.m, *(arr[sorter] for arr in args),
axis=axis, return_list_always=True) | 1,782 | 1,783 | [
"GeneratorExp"
] | {
"hexsha": "f7007ee1209e9e3b464ffcab4ffdfa1412233c4b",
"max_stars_repo_name": "aschueth/MetPy",
"max_stars_repo_path": "src/metpy/calc/thermo.py",
"lang": "Python"
} |
186 | 0 | data = {year: stats.get(year, 0) for year in xrange(min_year, max_year + 1)} | 118 | 118 | [
"DictComp"
] | {
"hexsha": "f700828dd6b4498dce5f1f79ff761916bbd8bed5",
"max_stars_repo_name": "bnavigator/indico",
"max_stars_repo_path": "indico/modules/categories/controllers/display.py",
"lang": "Python"
} |
186 | 1 | ids = ({c.id for c in cat.children} | {c.id for c in cat.parent_chain_query}) - excluded_ids | 171 | 171 | [
"SetComp"
] | {
"hexsha": "f700828dd6b4498dce5f1f79ff761916bbd8bed5",
"max_stars_repo_name": "bnavigator/indico",
"max_stars_repo_path": "indico/modules/categories/controllers/display.py",
"lang": "Python"
} |
186 | 2 | return jsonify_data(categories=[serialize_category_chain(c, include_children=True) for c in categories],
flash=False) | 182 | 183 | [
"ListComp"
] | {
"hexsha": "f700828dd6b4498dce5f1f79ff761916bbd8bed5",
"max_stars_repo_name": "bnavigator/indico",
"max_stars_repo_path": "indico/modules/categories/controllers/display.py",
"lang": "Python"
} |
186 | 3 | return jsonify_data(categories=[serialize_category(c, with_favorite=True, with_path=True) for c in query],
total_count=total_count, flash=False) | 206 | 207 | [
"ListComp"
] | {
"hexsha": "f700828dd6b4498dce5f1f79ff761916bbd8bed5",
"max_stars_repo_name": "bnavigator/indico",
"max_stars_repo_path": "indico/modules/categories/controllers/display.py",
"lang": "Python"
} |
186 | 4 | event_counts = {c.id: {'value': c.deep_events_count, 'pretty': format_number(c.deep_events_count)}
for c in self.category.children} | 227 | 228 | [
"DictComp"
] | {
"hexsha": "f700828dd6b4498dce5f1f79ff761916bbd8bed5",
"max_stars_repo_name": "bnavigator/indico",
"max_stars_repo_path": "indico/modules/categories/controllers/display.py",
"lang": "Python"
} |
186 | 5 | subcategory_ids = {event.category.effective_icon_data['source_id']
for event in events if event.category.has_effective_icon} | 484 | 485 | [
"SetComp"
] | {
"hexsha": "f700828dd6b4498dce5f1f79ff761916bbd8bed5",
"max_stars_repo_name": "bnavigator/indico",
"max_stars_repo_path": "indico/modules/categories/controllers/display.py",
"lang": "Python"
} |
186 | 6 | params['accessible_categories'] = {cat_id
for cat_id, prot_parent_id in db.session.query(cte)
if prot_parent_id == self.category.id} | 515 | 517 | [
"SetComp"
] | {
"hexsha": "f700828dd6b4498dce5f1f79ff761916bbd8bed5",
"max_stars_repo_name": "bnavigator/indico",
"max_stars_repo_path": "indico/modules/categories/controllers/display.py",
"lang": "Python"
} |
186 | 7 | events_by_day = [x for x in events_by_day if x[0].weekday() not in (5, 6)] | 538 | 538 | [
"ListComp"
] | {
"hexsha": "f700828dd6b4498dce5f1f79ff761916bbd8bed5",
"max_stars_repo_name": "bnavigator/indico",
"max_stars_repo_path": "indico/modules/categories/controllers/display.py",
"lang": "Python"
} |
186 | 8 | timetable_objects_by_date = {x[0]: list(x[1]) for x
in groupby(timetable_objects, key=lambda x: x.start_dt.astimezone(tzinfo).date())} | 585 | 586 | [
"DictComp"
] | {
"hexsha": "f700828dd6b4498dce5f1f79ff761916bbd8bed5",
"max_stars_repo_name": "bnavigator/indico",
"max_stars_repo_path": "indico/modules/categories/controllers/display.py",
"lang": "Python"
} |
186 | 9 | return [_EventProxy(event, day, tzinfo, timetable_objects_by_date.get(day.date(), [])) for day in event_days] | 593 | 593 | [
"ListComp"
] | {
"hexsha": "f700828dd6b4498dce5f1f79ff761916bbd8bed5",
"max_stars_repo_name": "bnavigator/indico",
"max_stars_repo_path": "indico/modules/categories/controllers/display.py",
"lang": "Python"
} |
188 | 0 | return [(y, x) for (x, y) in xy_list] | 32 | 32 | [
"ListComp"
] | {
"hexsha": "f700831c65772de4a694995aa5bd1a37f57f8a1c",
"max_stars_repo_name": "mrcagney/googlemaps_helpers",
"max_stars_repo_path": "googlemaps_helpers/main.py",
"lang": "Python"
} |
188 | 1 | return [prefix + '{num:0{pad}d}'.format(num=i, pad=k) for i in range(n)] | 40 | 40 | [
"ListComp"
] | {
"hexsha": "f700831c65772de4a694995aa5bd1a37f57f8a1c",
"max_stars_repo_name": "mrcagney/googlemaps_helpers",
"max_stars_repo_path": "googlemaps_helpers/main.py",
"lang": "Python"
} |
188 | 2 | o_locs = [geo.coords[0] for geo in o_gdf['geometry']] | 189 | 189 | [
"ListComp"
] | {
"hexsha": "f700831c65772de4a694995aa5bd1a37f57f8a1c",
"max_stars_repo_name": "mrcagney/googlemaps_helpers",
"max_stars_repo_path": "googlemaps_helpers/main.py",
"lang": "Python"
} |
188 | 3 | d_locs = [geo.coords[0] for geo in d_gdf['geometry']] | 199 | 199 | [
"ListComp"
] | {
"hexsha": "f700831c65772de4a694995aa5bd1a37f57f8a1c",
"max_stars_repo_name": "mrcagney/googlemaps_helpers",
"max_stars_repo_path": "googlemaps_helpers/main.py",
"lang": "Python"
} |
189 | 0 | self._slave_report_event_handlers = [h for h in events.slave_report._handlers] | 44 | 44 | [
"ListComp"
] | {
"hexsha": "f700833e6a88443d785e41ccd0504c32a9ae21bb",
"max_stars_repo_name": "wenlongyan/locust",
"max_stars_repo_path": "locust/test/test_runners.py",
"lang": "Python"
} |
201 | 0 | indices = [tuple([n for n in flag_range(o)]) for o in iter] | 16 | 16 | [
"ListComp"
] | {
"hexsha": "f70088778ecb6371359f0e87efb64d34322d52f5",
"max_stars_repo_name": "vishalbelsare/pyaugmecon",
"max_stars_repo_path": "pyaugmecon/flag.py",
"lang": "Python"
} |
206 | 0 | self.tags = list(set([
x.strip() for x in config.device.tags.split(',') if x.strip()
])) if config.device.tags else [] | 31 | 33 | [
"ListComp"
] | {
"hexsha": "f7008bf87b5a1c0780d7272b314fa3142ffb3ef3",
"max_stars_repo_name": "freberkivra/netbox-agent",
"max_stars_repo_path": "netbox_agent/server.py",
"lang": "Python"
} |
206 | 1 | config_cf = set([
f.strip() for f in config.device.custom_fields.split(",")
if f.strip()
]) | 35 | 38 | [
"ListComp"
] | {
"hexsha": "f7008bf87b5a1c0780d7272b314fa3142ffb3ef3",
"max_stars_repo_name": "freberkivra/netbox-agent",
"max_stars_repo_path": "netbox_agent/server.py",
"lang": "Python"
} |
206 | 2 | self.custom_fields.update(dict([
(k.strip(), v.strip()) for k, v in
[f.split("=", 1) for f in config_cf]
])) | 40 | 43 | [
"ListComp"
] | {
"hexsha": "f7008bf87b5a1c0780d7272b314fa3142ffb3ef3",
"max_stars_repo_name": "freberkivra/netbox-agent",
"max_stars_repo_path": "netbox_agent/server.py",
"lang": "Python"
} |
206 | 3 | new_chassis = nb.dcim.devices.create(
name=self.get_chassis_name(),
device_type=device_type.id,
serial=serial,
device_role=device_role.id,
site=datacenter.id if datacenter else None,
tenant=tenant.id if tenant else None,
rack=rack.id if... | 198 | 208 | [
"ListComp"
] | {
"hexsha": "f7008bf87b5a1c0780d7272b314fa3142ffb3ef3",
"max_stars_repo_name": "freberkivra/netbox-agent",
"max_stars_repo_path": "netbox_agent/server.py",
"lang": "Python"
} |
206 | 4 | new_blade = nb.dcim.devices.create(
name=hostname,
serial=serial,
device_role=device_role.id,
device_type=device_type.id,
parent_device=chassis.id,
site=datacenter.id if datacenter else None,
tenant=tenant.id if tenant else None,
... | 220 | 231 | [
"ListComp"
] | {
"hexsha": "f7008bf87b5a1c0780d7272b314fa3142ffb3ef3",
"max_stars_repo_name": "freberkivra/netbox-agent",
"max_stars_repo_path": "netbox_agent/server.py",
"lang": "Python"
} |
206 | 5 | new_blade = nb.dcim.devices.create(
name=hostname,
serial=serial,
device_role=device_role.id,
device_type=device_type.id,
parent_device=chassis.id,
site=datacenter.id if datacenter else None,
tenant=tenant.id if tenant else None,
... | 243 | 253 | [
"ListComp"
] | {
"hexsha": "f7008bf87b5a1c0780d7272b314fa3142ffb3ef3",
"max_stars_repo_name": "freberkivra/netbox-agent",
"max_stars_repo_path": "netbox_agent/server.py",
"lang": "Python"
} |
206 | 6 | new_server = nb.dcim.devices.create(
name=hostname,
serial=serial,
device_role=device_role.id,
device_type=device_type.id,
platform=self.device_platform,
site=datacenter.id if datacenter else None,
tenant=tenant.id if tenant else None,
... | 272 | 282 | [
"ListComp"
] | {
"hexsha": "f7008bf87b5a1c0780d7272b314fa3142ffb3ef3",
"max_stars_repo_name": "freberkivra/netbox-agent",
"max_stars_repo_path": "netbox_agent/server.py",
"lang": "Python"
} |
206 | 7 | server_tags = sorted(set([x.name for x in server.tags])) | 449 | 449 | [
"ListComp"
] | {
"hexsha": "f7008bf87b5a1c0780d7272b314fa3142ffb3ef3",
"max_stars_repo_name": "freberkivra/netbox-agent",
"max_stars_repo_path": "netbox_agent/server.py",
"lang": "Python"
} |
206 | 8 | new_tags_ids = [x.id for x in self.nb_tags] | 452 | 452 | [
"ListComp"
] | {
"hexsha": "f7008bf87b5a1c0780d7272b314fa3142ffb3ef3",
"max_stars_repo_name": "freberkivra/netbox-agent",
"max_stars_repo_path": "netbox_agent/server.py",
"lang": "Python"
} |
206 | 9 | server_tags_ids = [x.id for x in server.tags] | 456 | 456 | [
"ListComp"
] | {
"hexsha": "f7008bf87b5a1c0780d7272b314fa3142ffb3ef3",
"max_stars_repo_name": "freberkivra/netbox-agent",
"max_stars_repo_path": "netbox_agent/server.py",
"lang": "Python"
} |
222 | 0 | classes_dict = {c: np.identity(len(classes))[i, :] for i, c in
enumerate(classes)} | 8 | 9 | [
"DictComp"
] | {
"hexsha": "f700969b9239575a2ccde759ad10177179f6a30d",
"max_stars_repo_name": "Pengchengpcx/Neighbor-Sampling-GCN",
"max_stars_repo_path": "build/lib/pygcn/utils.py",
"lang": "Python"
} |
222 | 1 | idx_map = {j: i for i, j in enumerate(idx)} | 26 | 26 | [
"DictComp"
] | {
"hexsha": "f700969b9239575a2ccde759ad10177179f6a30d",
"max_stars_repo_name": "Pengchengpcx/Neighbor-Sampling-GCN",
"max_stars_repo_path": "build/lib/pygcn/utils.py",
"lang": "Python"
} |
227 | 0 | self.fetch_ratings([player.steam_id for player in self.players()]) | 186 | 186 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 1 | return [int(_steam_id) for _steam_id in used_steam_ids] | 329 | 329 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 2 | result = requests_retry_session().get(
url_template.format("+".join([str(steam_id) for steam_id in steam_ids])), timeout=A_ELO.timeout) | 335 | 336 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 3 | primary_filtered = [player for player in team if player.steam_id in primary_rating_provider.rated_steam_ids()] | 520 | 520 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 4 | primary_filtered = [player for player in primary_filtered
if gametype in primary_rating_provider.rated_gametypes_for(player.steam_id)] | 521 | 522 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 5 | primary_filtered = [player for player in primary_filtered
if primary_rating_provider.games_for(player.steam_id, gametype) > 0] | 523 | 524 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 6 | primary_unranked = [player for player in team if player not in primary_filtered] | 549 | 549 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 7 | secondary_filtered = [player for player in primary_unranked
if player.steam_id in secondary_rating_provider.rated_steam_ids()] | 552 | 553 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 8 | secondary_filtered = [player for player in secondary_filtered
if gametype in secondary_rating_provider.rated_gametypes_for(player.steam_id)] | 554 | 555 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 9 | secondary_filtered = [player for player in secondary_filtered
if secondary_rating_provider.games_for(player.steam_id, gametype) > 0] | 556 | 557 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 10 | secondary_unranked = [player for player in primary_unranked if player not in secondary_filtered] | 572 | 572 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 11 | players = dict([(p.steam_id, gt) for p in teams["red"] + teams["blue"]]) | 612 | 612 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 12 | return min([player for player in players], key=lambda _player: self.find_games_here(_player)) | 659 | 659 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 13 | steam_ids = [player.steam_id for player in teams["red"] + teams["blue"]] | 688 | 688 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 14 | blue_steam_ids = [steam_id for steam_id in steam_ids if steam_id not in red_steam_ids] | 696 | 696 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 15 | blue_steam_ids = [steam_id for steam_id in steam_ids if steam_id not in red_steam_ids] | 718 | 718 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 16 | steam_ids = [player.steam_id for player in teams["red"] + teams["blue"]] | 734 | 734 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 17 | blue_steam_ids = [steam_id for steam_id in steam_ids if steam_id not in red_steam_ids] | 746 | 746 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 18 | filtered_combinations = [(red_steam_ids, blue_steam_ids, diff) for (red_steam_ids, blue_steam_ids, diff) in
team_combinations if diff < self.minimum_suggestion_diff] | 764 | 765 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 19 | red_team = [player.steam_id for player in teams["red"]] | 775 | 775 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 20 | blue_team = [player.steam_id for player in teams["blue"]] | 776 | 776 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 21 | steam_ids = [player.steam_id for player in teams["red"] + teams["blue"]] | 785 | 785 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 22 | rated_steam_ids = [steam_id for steam_id in steam_ids
if steam_id in configured_rating_provider.rated_steam_ids()] | 793 | 794 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 23 | rated_steam_ids = [steam_id for steam_id in rated_steam_ids if
gametype in configured_rating_provider.rated_gametypes_for(steam_id)] | 795 | 796 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 24 | rated_steam_ids = [steam_id for steam_id in rated_steam_ids if
configured_rating_provider[steam_id][gametype]["games"] > 0] | 797 | 798 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 25 | return sum([configured_rating_provider[steam_id][gametype]["elo"] for steam_id in steam_ids]) / len(
steam_ids) | 912 | 913 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 26 | team_elos = [pow(configured_rating_provider[steam_id][gametype]["elo"] - mu, 2) for steam_id in steam_ids] | 931 | 931 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 27 | self.report_teams([player.steam_id for player in teams["red"]],
[player.steam_id for player in teams["blue"]],
channel) | 945 | 947 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 28 | player_steam_ids = [player.steam_id for player in teams["red"] + teams["blue"]] | 976 | 976 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 29 | avg_red = self.team_average([player.steam_id for player in teams["red"]], gametype,
rating_provider=configured_rating_provider) | 984 | 985 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 30 | avg_blue = self.team_average([player.steam_id for player in teams["blue"]], gametype,
rating_provider=configured_rating_provider) | 986 | 987 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 31 | stddev_red = self.team_stddev([player.steam_id for player in teams["red"]], gametype, mu=avg_red,
rating_provider=configured_rating_provider) | 993 | 994 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 32 | stddev_blue = self.team_stddev([player.steam_id for player in teams["blue"]], gametype, mu=avg_blue,
rating_provider=configured_rating_provider) | 995 | 996 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
227 | 33 | player_steam_ids = [player.steam_id for player in teams["red"] + teams["blue"]] | 1,013 | 1,013 | [
"ListComp"
] | {
"hexsha": "f70099ac7223f1be8c17620e702c90a2d07be3fd",
"max_stars_repo_name": "mgaertne/minqlx-plugin-tests",
"max_stars_repo_path": "experimental/python/balancetwo.py",
"lang": "Python"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.