index
int64
statement_id
int64
statement
string
lineno
int64
end_lineno
int64
comprehension_types
list
metadata
dict
258
42
p.set_objective(p.sum([b[i] for i in range(self.num_blocks())]))
1,424
1,424
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
43
return [[self._points[x] for x in self._blocks[i]] for i, v in six.iteritems(p.get_values(b)) if v]
1,428
1,429
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
44
if (any(len(block) != k for block in self._blocks) or # non k-uniform v != self.num_points()): return (False, (0,0,0,0)) if return_parameters else False
1,568
1,570
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
45
gB.append([x-1 for x in b])
1,776
1,776
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
46
g.add_edges((i+n,x) for i,b in enumerate(self._blocks) for x in b)
1,821
1,821
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
47
gens = [[tuple([self._points[i] for i in cycle if (not cycle or cycle[0]<n)]) for cycle in g.cycle_tuples()] for g in ag.gens()]
1,826
1,828
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
48
gens = [[tuple(cycle) for cycle in g.cycle_tuples() if (not cycle or cycle[0]<n)] for g in ag.gens()]
1,830
1,831
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
49
dual = [[] for i in domain]
1,930
1,930
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
50
p.add_constraint(p.sum(b[t,i] for i in dual[x]) == 1)
1,938
1,938
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
51
p.add_constraint(p.sum(b[t,i] for t in range(n_classes)) == 1)
1,942
1,942
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
52
self._classes = [[] for _ in range(n_classes)]
1,950
1,950
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
53
assert sorted(id(c) for cls in self._classes for c in cls) == sorted(id(b) for b in self._blocks), "some set does not appear exactly once"
1,956
1,956
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
54
classes = [[block[:] for block in classs] for classs in self._classes]
1,966
1,966
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
55
classes = [[[self._points[i] for i in block] for block in classs] for classs in self._classes]
1,968
1,968
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
56
elif any(len(x) == 1 for x in self._blocks): raise RuntimeError("No coloring can be defined " "when there is a set of size 1") elif k == 1: if any(x for x in self._blocks): raise ValueError("This hypergraph contains a set. " ...
2,036
2,043
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
57
if any(x for x in self._blocks): raise ValueError("This hypergraph contains a set. " "It is not 1-chromatic")
2,040
2,042
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
58
p.add_constraint(p.sum(b[x,i] for i in range(k)) == 1)
2,050
2,050
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
59
p.add_constraint(p.sum(b[x,i] for x in s) <= len(s)-1)
2,054
2,054
[ "GeneratorExp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
60
col = [[] for i in range(k)]
2,061
2,061
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
61
blocks_sets = [frozenset(_) for _ in blocks]
2,094
2,094
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
62
return [[blocks[i] for i in C] for C in g.coloring(algorithm="MILP")]
2,096
2,096
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
63
return {k[1]: (round(x, 3), round(y, 3)) for k, (x, y) in g.get_pos().items()}
2,144
2,145
[ "DictComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
64
colored_sets = [(s,i) for i,S in enumerate(self.edge_coloring()) for s in S]
2,187
2,187
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
258
65
s = [pos[_] for _ in s]
2,209
2,209
[ "ListComp" ]
{ "hexsha": "f700a8f4cec9fde4e8d43839bae356ee49f0283c", "max_stars_repo_name": "bopopescu/sagemath", "max_stars_repo_path": "src/sage/combinat/designs/incidence_structures.py", "lang": "Python" }
260
0
return {key: _apply(value) for key, value in x.items()}
60
60
[ "DictComp" ]
{ "hexsha": "f700a9a5b731462eee5cc0aaf1dfbb70ffdaf312", "max_stars_repo_name": "xiaodashuaiya/fairseq", "max_stars_repo_path": "fairseq/utils.py", "lang": "Python" }
260
1
return [_apply(x) for x in x]
62
62
[ "ListComp" ]
{ "hexsha": "f700a9a5b731462eee5cc0aaf1dfbb70ffdaf312", "max_stars_repo_name": "xiaodashuaiya/fairseq", "max_stars_repo_path": "fairseq/utils.py", "lang": "Python" }
260
2
return tuple(_apply(x) for x in x)
64
64
[ "GeneratorExp" ]
{ "hexsha": "f700a9a5b731462eee5cc0aaf1dfbb70ffdaf312", "max_stars_repo_name": "xiaodashuaiya/fairseq", "max_stars_repo_path": "fairseq/utils.py", "lang": "Python" }
260
3
return {_apply(x) for x in x}
66
66
[ "SetComp" ]
{ "hexsha": "f700a9a5b731462eee5cc0aaf1dfbb70ffdaf312", "max_stars_repo_name": "xiaodashuaiya/fairseq", "max_stars_repo_path": "fairseq/utils.py", "lang": "Python" }
260
4
embed_dict[pieces[0]] = torch.Tensor( [float(weight) for weight in pieces[1:]] )
154
156
[ "ListComp" ]
{ "hexsha": "f700a9a5b731462eee5cc0aaf1dfbb70ffdaf312", "max_stars_repo_name": "xiaodashuaiya/fairseq", "max_stars_repo_path": "fairseq/utils.py", "lang": "Python" }
260
5
norms += [torch.norm(g, p=2, dtype=torch.float32) for g in cur_device_grads]
278
278
[ "ListComp" ]
{ "hexsha": "f700a9a5b731462eee5cc0aaf1dfbb70ffdaf312", "max_stars_repo_name": "xiaodashuaiya/fairseq", "max_stars_repo_path": "fairseq/utils.py", "lang": "Python" }
260
6
grads = [p.grad.detach() for p in filter(lambda p: p.grad is not None, params)]
287
287
[ "ListComp" ]
{ "hexsha": "f700a9a5b731462eee5cc0aaf1dfbb70ffdaf312", "max_stars_repo_name": "xiaodashuaiya/fairseq", "max_stars_repo_path": "fairseq/utils.py", "lang": "Python" }
260
7
total_norm = torch.norm( torch.stack([torch.norm(g, p=2, dtype=torch.float32) for g in grads]) )
304
306
[ "ListComp" ]
{ "hexsha": "f700a9a5b731462eee5cc0aaf1dfbb70ffdaf312", "max_stars_repo_name": "xiaodashuaiya/fairseq", "max_stars_repo_path": "fairseq/utils.py", "lang": "Python" }
260
8
word_start = [int(token not in exclude_list) for token in tokens]
524
524
[ "ListComp" ]
{ "hexsha": "f700a9a5b731462eee5cc0aaf1dfbb70ffdaf312", "max_stars_repo_name": "xiaodashuaiya/fairseq", "max_stars_repo_path": "fairseq/utils.py", "lang": "Python" }
260
9
token_to_word = {i: word_idx[i] for i in range(n)}
526
526
[ "DictComp" ]
{ "hexsha": "f700a9a5b731462eee5cc0aaf1dfbb70ffdaf312", "max_stars_repo_name": "xiaodashuaiya/fairseq", "max_stars_repo_path": "fairseq/utils.py", "lang": "Python" }
261
0
hubs_dict = {h:[] for h in hubs}
66
66
[ "DictComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
1
attended_train = [train[idx] for idx in highest_attn]
70
70
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
2
idx2loc = {idx:loc for loc, idx in loc2idx.items()}
99
99
[ "DictComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
3
idxs = [idx for idx in range(n_states)]
100
100
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
4
hiddens = [[] for i in range(2)]
113
113
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
5
hiddens_cong = [[] for i in range(2)]
114
114
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
6
hiddens_incong = [[] for i in range(2)]
115
115
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
7
hiddens_ctxs = [[[] for j in range(args.N_contexts)] for i in range(2)]
116
116
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
8
hiddens_ctxs = [[] for i in range(args.N_contexts)]
121
121
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
9
idxs1_ctxs = [[] for i in range(args.N_contexts)]
125
125
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
10
idxs2_ctxs = [[] for i in range(args.N_contexts)]
126
126
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
11
samples_ctxs = [[] for i in range(args.N_contexts)]
128
128
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
12
temp1 = [np.expand_dims(hiddens[i,f1_ind,:], axis=0) for i, idx1 in enumerate(idxs1) if idx1==f]
254
255
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
13
temp2 = [np.expand_dims(hiddens[i,f2_ind,:], axis=0) for i, idx2 in enumerate(idxs2) if idx2==f]
256
257
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
14
temp1_ctxs = [hiddens_ctxs[ctx,i,f1_ind,:] for i, idx1 in enumerate(idxs1_ctxs[ctx]) if idx1==f]
261
262
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
15
temp2_ctxs = [hiddens_ctxs[ctx,i,f2_ind,:] for i, idx2 in enumerate(idxs2_ctxs[ctx]) if idx2==f]
263
264
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
16
temp = [hiddens[i,:] for i, (idx1, idx2) in enumerate(zip(idxs1, idxs2)) if ((idx1==f) | (idx2==f))]
275
277
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
17
temp_ctxs = [hiddens_ctxs[ctx][i] for i, (idx1, idx2) in enumerate(zip(idxs1_ctxs[ctx], idxs2_ctxs[ctx])) if ((idx1==f) | (idx2==f))]
281
283
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
18
temp1 = [hiddens[0,i,:] for i, idx1 in enumerate(idxs1) if idx1==f]
293
294
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
19
temp2 = [hiddens[1,i,:] for i, idx2 in enumerate(idxs2) if idx2==f]
295
296
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
20
temp1_ctxs = [hiddens_ctxs[0,ctx,i,:] for i, idx1 in enumerate(idxs1_ctxs[ctx]) if idx1==f]
303
304
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
21
temp2_ctxs = [hiddens_ctxs[1,ctx,i,:] for i, idx2 in enumerate(idxs2_ctxs[ctx]) if idx2==f]
305
306
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
22
hiddens_ctxs = [np.concatenate(h, axis=0) for h in hiddens_ctxs]
356
356
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
23
idx2loc = {idx:loc for loc, idx in loc2idx.items()}
390
390
[ "DictComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
24
idxs = [idx for idx in range(n_states)]
391
391
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
25
hidd_dists_ctxs = [[] for i in range(N_contexts)]
397
397
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
26
grid_1ds_ctxs = [[] for i in range(N_contexts)]
398
398
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
27
idx2loc = {idx:loc for loc, idx in loc2idx.items()}
455
455
[ "DictComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
28
idxs = [idx for idx in range(n_states)]
456
456
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
29
idx2loc = {idx:loc for loc, idx in loc2idx.items()}
561
561
[ "DictComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
30
idxs = [idx for idx in range(n_states)]
562
562
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
31
locs = [idx2loc[idx] for idx in idxs]
563
563
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
32
p_val, t_val, param, bse = ([[] for i in range(2)] for i in range(4))
751
751
[ "GeneratorExp", "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
33
p_val, t_val, param, bse = ([[] for i in range(2)] for i in range(4))
770
770
[ "GeneratorExp", "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
34
p_val, t_val, param, y_hat_E, y, bse = ([[] for i in range(2)] for i in range(6))
824
824
[ "GeneratorExp", "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
35
p_val, t_val, param, bse = ([[] for i in range(2)] for i in range(4))
842
842
[ "GeneratorExp", "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
36
p_vals, t_vals, params, bses = ([[] for i in range(2)] for i in range(4))
871
871
[ "GeneratorExp", "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
37
p_vals, t_vals, params, bses = ([] for i in range(4))
873
873
[ "GeneratorExp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
38
s_idxs = [i for i, sample in enumerate(samples) if state not in sample]
876
876
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
39
s_idxs = [i for i, sample in enumerate(samples) if ((0 not in sample) & (15 not in sample))]
899
899
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
40
s_idxs = [i for i, sample in enumerate(samples) if ((0 not in sample) & (15 not in sample) & (3 not in sample) & (12 not in sample))]
920
921
[ "ListComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
261
41
idx2loc = {idx:loc for loc, idx in test_data.loc2idx.items()}
966
966
[ "DictComp" ]
{ "hexsha": "f700a9eaeb9d656f880043ec173164ac3cfad160", "max_stars_repo_name": "MaryZolfaghar/WCSLS", "max_stars_repo_path": "utils/analyze.py", "lang": "Python" }
274
0
rects = [x for x in ax.get_children() if isinstance(x, Rectangle)]
239
239
[ "ListComp" ]
{ "hexsha": "f700b2934cd8c92e5e974a0aa261366b0abef8fe", "max_stars_repo_name": "EkremBayar/bayar", "max_stars_repo_path": "venv/Lib/site-packages/pandas/tests/plotting/test_hist_method.py", "lang": "Python" }
274
1
result = [axes[0, i].get_title() for i in range(3)]
379
379
[ "ListComp" ]
{ "hexsha": "f700b2934cd8c92e5e974a0aa261366b0abef8fe", "max_stars_repo_name": "EkremBayar/bayar", "max_stars_repo_path": "venv/Lib/site-packages/pandas/tests/plotting/test_hist_method.py", "lang": "Python" }
274
2
rects = [x for x in ax.get_children() if isinstance(x, Rectangle)]
486
486
[ "ListComp" ]
{ "hexsha": "f700b2934cd8c92e5e974a0aa261366b0abef8fe", "max_stars_repo_name": "EkremBayar/bayar", "max_stars_repo_path": "venv/Lib/site-packages/pandas/tests/plotting/test_hist_method.py", "lang": "Python" }
277
0
_LOG.info("run%s: %s", cwd_str, " ".join(shlex.quote(a) for a in cmd_args))
75
75
[ "GeneratorExp" ]
{ "hexsha": "f700b5774c7202e1709ce0393be8b037314148e8", "max_stars_repo_name": "BaldLee/tvm", "max_stars_repo_path": "apps/microtvm/zephyr/template_project/microtvm_api_server.py", "lang": "Python" }
277
1
CMAKE_BOOL_MAP = dict( [(k, True) for k in ("1", "ON", "YES", "TRUE", "Y")] + [(k, False) for k in ("0", "OFF", "NO", "FALSE", "N", "IGNORE", "NOTFOUND", "")] )
82
85
[ "ListComp" ]
{ "hexsha": "f700b5774c7202e1709ce0393be8b037314148e8", "max_stars_repo_name": "BaldLee/tvm", "max_stars_repo_path": "apps/microtvm/zephyr/template_project/microtvm_api_server.py", "lang": "Python" }
277
2
fpu_boards = [name for name, board in BOARD_PROPERTIES.items() if board["fpu"]]
446
446
[ "ListComp" ]
{ "hexsha": "f700b5774c7202e1709ce0393be8b037314148e8", "max_stars_repo_name": "BaldLee/tvm", "max_stars_repo_path": "apps/microtvm/zephyr/template_project/microtvm_api_server.py", "lang": "Python" }
277
3
ports = [p for p in serial.tools.list_ports.grep(serial_number)]
540
540
[ "ListComp" ]
{ "hexsha": "f700b5774c7202e1709ce0393be8b037314148e8", "max_stars_repo_name": "BaldLee/tvm", "max_stars_repo_path": "apps/microtvm/zephyr/template_project/microtvm_api_server.py", "lang": "Python" }
279
0
xs = tuple([ext.new_tensor_like("%s x" % p.name, p) for p in params])
28
28
[ "ListComp" ]
{ "hexsha": "f700b5ea0958a3f503dbde8209de66f43cecf0b2", "max_stars_repo_name": "RussellM2020/maml_gps", "max_stars_repo_path": "rllab/optimizers/conjugate_gradient_optimizer.py", "lang": "Python" }
279
1
Hx_plain_splits = TT.grad( TT.sum([TT.sum(g * x) for g, x in zip(constraint_grads, xs)]), wrt=params, disconnected_inputs='warn' )
31
36
[ "ListComp" ]
{ "hexsha": "f700b5ea0958a3f503dbde8209de66f43cecf0b2", "max_stars_repo_name": "RussellM2020/maml_gps", "max_stars_repo_path": "rllab/optimizers/conjugate_gradient_optimizer.py", "lang": "Python" }
279
2
return TT.concatenate([TT.flatten(s) for s in Hx_plain_splits])
37
37
[ "ListComp" ]
{ "hexsha": "f700b5ea0958a3f503dbde8209de66f43cecf0b2", "max_stars_repo_name": "RussellM2020/maml_gps", "max_stars_repo_path": "rllab/optimizers/conjugate_gradient_optimizer.py", "lang": "Python" }
279
3
flat_xs = np.concatenate([np.reshape(x, (-1,)) for x in xs])
79
79
[ "ListComp" ]
{ "hexsha": "f700b5ea0958a3f503dbde8209de66f43cecf0b2", "max_stars_repo_name": "RussellM2020/maml_gps", "max_stars_repo_path": "rllab/optimizers/conjugate_gradient_optimizer.py", "lang": "Python" }
279
4
subsample_inputs += tuple([x[inds] for x in inputs_grouped])
242
242
[ "ListComp" ]
{ "hexsha": "f700b5ea0958a3f503dbde8209de66f43cecf0b2", "max_stars_repo_name": "RussellM2020/maml_gps", "max_stars_repo_path": "rllab/optimizers/conjugate_gradient_optimizer.py", "lang": "Python" }
281
0
ax.plot(date_list, [float(g) for g in date_expense_list], label="Expenses")
118
118
[ "ListComp" ]
{ "hexsha": "f700b617b69a760f427812c69e5b061c7327a011", "max_stars_repo_name": "ngwenbin/ExpenseTracker", "max_stars_repo_path": "app.py", "lang": "Python" }
281
1
axs.bar(cat_list, [float(g) for g in sum_list])
224
224
[ "ListComp" ]
{ "hexsha": "f700b617b69a760f427812c69e5b061c7327a011", "max_stars_repo_name": "ngwenbin/ExpenseTracker", "max_stars_repo_path": "app.py", "lang": "Python" }
287
0
flags = {k: v for k, v in data.items() if k in flag_keys}
111
111
[ "DictComp" ]
{ "hexsha": "f700bc34071ef6d48c20c00c6d54dbc8afe7de28", "max_stars_repo_name": "sthapa/froide", "max_stars_repo_path": "froide/foirequest/services.py", "lang": "Python" }
287
1
publicbody_ids = [pb.pk for pb in data["publicbodies"]]
152
152
[ "ListComp" ]
{ "hexsha": "f700bc34071ef6d48c20c00c6d54dbc8afe7de28", "max_stars_repo_name": "sthapa/froide", "max_stars_repo_path": "froide/foirequest/services.py", "lang": "Python" }
289
0
files_list = [file.filename for file in get_files(git_object)]
95
95
[ "ListComp" ]
{ "hexsha": "f700bd3e668d5f4fe3f075fecf18bb44137fc1c9", "max_stars_repo_name": "vincenttran-msft/azure-sdk-for-python", "max_stars_repo_path": "tools/azure-sdk-tools/packaging_tools/swaggertosdk/SwaggerToSdkCore.py", "lang": "Python" }
289
1
filenames = [file.filename.lower() for file in get_files(git_object)]
134
134
[ "ListComp" ]
{ "hexsha": "f700bd3e668d5f4fe3f075fecf18bb44137fc1c9", "max_stars_repo_name": "vincenttran-msft/azure-sdk-for-python", "max_stars_repo_path": "tools/azure-sdk-tools/packaging_tools/swaggertosdk/SwaggerToSdkCore.py", "lang": "Python" }
289
2
readme_lang = [name for name in filenames if re.match(r"(.*)readme.\w+.md", name)]
135
135
[ "ListComp" ]
{ "hexsha": "f700bd3e668d5f4fe3f075fecf18bb44137fc1c9", "max_stars_repo_name": "vincenttran-msft/azure-sdk-for-python", "max_stars_repo_path": "tools/azure-sdk-tools/packaging_tools/swaggertosdk/SwaggerToSdkCore.py", "lang": "Python" }
289
3
return bool([name for name in readme_lang if name.endswith("readme.{}.md".format(lang))])
140
140
[ "ListComp" ]
{ "hexsha": "f700bd3e668d5f4fe3f075fecf18bb44137fc1c9", "max_stars_repo_name": "vincenttran-msft/azure-sdk-for-python", "max_stars_repo_path": "tools/azure-sdk-tools/packaging_tools/swaggertosdk/SwaggerToSdkCore.py", "lang": "Python" }
289
4
files_list = [file.filename for file in get_files(git_object)]
144
144
[ "ListComp" ]
{ "hexsha": "f700bd3e668d5f4fe3f075fecf18bb44137fc1c9", "max_stars_repo_name": "vincenttran-msft/azure-sdk-for-python", "max_stars_repo_path": "tools/azure-sdk-tools/packaging_tools/swaggertosdk/SwaggerToSdkCore.py", "lang": "Python" }
289
5
for expected_readme in [l for l in expected_folder.iterdir() if l.is_file()]: # Need to do a case-insensitive test. match = re.match(r"readme.\w*.?md", expected_readme.name, re.I) if match: readme_files.add(expected_readme.relative_to(Path(base_dir)))
159
163
[ "ListComp" ]
{ "hexsha": "f700bd3e668d5f4fe3f075fecf18bb44137fc1c9", "max_stars_repo_name": "vincenttran-msft/azure-sdk-for-python", "max_stars_repo_path": "tools/azure-sdk-tools/packaging_tools/swaggertosdk/SwaggerToSdkCore.py", "lang": "Python" }
289
6
readme_files_in_pr = { readme for readme in swagger_files_in_pr if getattr(readme, "name", readme).lower().endswith("readme.md") }
190
192
[ "SetComp" ]
{ "hexsha": "f700bd3e668d5f4fe3f075fecf18bb44137fc1c9", "max_stars_repo_name": "vincenttran-msft/azure-sdk-for-python", "max_stars_repo_path": "tools/azure-sdk-tools/packaging_tools/swaggertosdk/SwaggerToSdkCore.py", "lang": "Python" }
289
7
input_files = [Path(input_file) for input_file in input_files]
274
274
[ "ListComp" ]
{ "hexsha": "f700bd3e668d5f4fe3f075fecf18bb44137fc1c9", "max_stars_repo_name": "vincenttran-msft/azure-sdk-for-python", "max_stars_repo_path": "tools/azure-sdk-tools/packaging_tools/swaggertosdk/SwaggerToSdkCore.py", "lang": "Python" }