rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
outputdir = arg | rpmdir = arg | def usage(output=sys.stdout): output.write("Usage: %s [-g <groupname>] [-u <uri>] [-d <dir>] [-p <priority>] [-o <output>]\n" % sys.argv[0]) | b2b8dad96133a5c91d4df368807bac54595abc68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/b2b8dad96133a5c91d4df368807bac54595abc68/rpmlisting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
12,
2844,
33,
9499,
18,
10283,
4672,
876,
18,
2626,
2932,
5357,
30,
738,
87,
23059,
75,
411,
1655,
529,
34,
65,
23059,
89,
411,
1650,
34,
65,
23059,
72,
411,
1214,
34,
65,
2305... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
12,
2844,
33,
9499,
18,
10283,
4672,
876,
18,
2626,
2932,
5357,
30,
738,
87,
23059,
75,
411,
1655,
529,
34,
65,
23059,
89,
411,
1650,
34,
65,
23059,
72,
411,
1214,
34,
65,
2305... |
message = _("The case '%s' has been closed.") % name | message = _("The case '%s' has been closed.") % case.name | def case_close(self, cr, uid, ids, *args): """Overrides close for crm_case for setting close date @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of case Ids @param *args: Tuple Value for additional Params """ res = super(crm_lead, self).case_close(cr, uid, ids, args) self.write(cr, uid, ids, {'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')}) for case in self.browse(cr, uid, ids): if case.type == 'lead': message = _("The lead '%s' has been closed.") % name elif case.type == 'opportunity': message = _("The opportunity '%s' has been closed.") % name else: message = _("The case '%s' has been closed.") % name self.log(cr, uid, case.id, message) return res | f1c40bd6d4da75880cef38afa893300e02349f98 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f1c40bd6d4da75880cef38afa893300e02349f98/crm_lead.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
648,
67,
4412,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
380,
1968,
4672,
3536,
13084,
1746,
364,
4422,
81,
67,
3593,
364,
3637,
1746,
1509,
632,
891,
365,
30,
1021,
733,
4407,
632,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
648,
67,
4412,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
380,
1968,
4672,
3536,
13084,
1746,
364,
4422,
81,
67,
3593,
364,
3637,
1746,
1509,
632,
891,
365,
30,
1021,
733,
4407,
632,
... |
if event.GetId() == dsgn.GetId() and dsgn.selection: dsgn.selection.selectCtrl(dsgn, dsgn.companion) | if event.GetId() == dsgn.GetId(): if dsgn.selection: dsgn.selection.selectCtrl(dsgn, dsgn.companion) elif dsgn.multiSelection: dsgn.clearMultiSelection() dsgn.assureSingleSelection() dsgn.selection.selectCtrl(dsgn, dsgn.companion) return | def OnControlResize(self, event): """ Control is resized, emulate native wxWindows layout behaviour """ dsgn = self.designer try: if event.GetId() == dsgn.GetId() and dsgn.selection: dsgn.selection.selectCtrl(dsgn, dsgn.companion) | 102ae9e4df0cfddbfdb2acfb7df920a5d291af8c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/102ae9e4df0cfddbfdb2acfb7df920a5d291af8c/Designer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
3367,
12182,
12,
2890,
16,
871,
4672,
3536,
8888,
353,
21615,
16,
801,
6243,
6448,
7075,
10399,
3511,
14273,
3536,
302,
1055,
82,
273,
365,
18,
16934,
264,
775,
30,
309,
871,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
3367,
12182,
12,
2890,
16,
871,
4672,
3536,
8888,
353,
21615,
16,
801,
6243,
6448,
7075,
10399,
3511,
14273,
3536,
302,
1055,
82,
273,
365,
18,
16934,
264,
775,
30,
309,
871,
18,
... |
if not current_file: current_file = getpatchfile(afile, bfile, current_hunk) if not current_file: current_file, current_hunk = None, None rejects += 1 continue | if emitfile: emitfile = False yield 'file', (afile, bfile, current_hunk) | def getpatchfile(afile, bfile, hunk): try: if sourcefile: targetfile = patchfile(ui, sourcefile) else: targetfile = selectfile(afile, bfile, hunk, strip, reverse) targetfile = patchfile(ui, targetfile) return targetfile except PatchError, err: ui.warn(str(err) + '\n') return None | 8baabe46f7b47d71dbfe145c06affa37eb3f3039 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/8baabe46f7b47d71dbfe145c06affa37eb3f3039/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
2272,
768,
12,
69,
768,
16,
324,
768,
16,
366,
1683,
4672,
775,
30,
309,
1084,
768,
30,
1018,
768,
273,
4729,
768,
12,
4881,
16,
1084,
768,
13,
469,
30,
1018,
768,
273,
2027,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
2272,
768,
12,
69,
768,
16,
324,
768,
16,
366,
1683,
4672,
775,
30,
309,
1084,
768,
30,
1018,
768,
273,
4729,
768,
12,
4881,
16,
1084,
768,
13,
469,
30,
1018,
768,
273,
2027,
... |
'utf8extra': '\\DeclareUnicodeCharacter{00A0}{\nobreakspace}', | 'utf8extra': '\\DeclareUnicodeCharacter{00A0}{\\nobreakspace}', | def __init__(self, node): self.env = LaTeXTranslator.desc_map.get(node['desctype'], 'describe') self.type = self.cls = self.name = self.params = \ self.annotation = self.returns = '' self.count = 0 | 33823020b2605da3866ad841719e782027d97925 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7032/33823020b2605da3866ad841719e782027d97925/latex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
756,
4672,
365,
18,
3074,
273,
21072,
21575,
60,
12233,
18,
5569,
67,
1458,
18,
588,
12,
2159,
3292,
5489,
12387,
17337,
296,
22748,
6134,
365,
18,
723,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
756,
4672,
365,
18,
3074,
273,
21072,
21575,
60,
12233,
18,
5569,
67,
1458,
18,
588,
12,
2159,
3292,
5489,
12387,
17337,
296,
22748,
6134,
365,
18,
723,
... |
_params_allgood_header() | if verbose>0: _params_allgood_header() | def exec_conv(version, shapes, verbose, random, mode, print_=None, rtol=1e-5, ones=False): _params_allgood_header() nb_failed = 0 nb_tests = 0 failed_version=set() failed_id=[] for ver in version:# I put -1 in case we forget to add version in the test to. for id,(ishape, kshape, subshape, istride, kstride) in enumerate(shapes): ret=False try: ret = _params_allgood(ishape, kshape, mode, subsample=subshape, img_stride=istride, kern_stride=kstride, version=ver, verbose=verbose, random=random, id=id,print_=print_,rtol=rtol,ones=ones) except: pass if not ret: failed_version.add(ver) failed_id.append(id) nb_failed+=1 nb_tests+=1 if nb_failed>0: print "nb_failed",nb_failed,"on",nb_tests, "failed_version",failed_version, "failed_id",failed_id assert nb_failed==0 else: print 'Executed',nb_tests,'different shapes' | 8e72e6c0088cff9c3bbff49f2ccdf3be8c6238a1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/8e72e6c0088cff9c3bbff49f2ccdf3be8c6238a1/test_conv_cuda_ndarray.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1196,
67,
4896,
12,
1589,
16,
14736,
16,
3988,
16,
2744,
16,
1965,
16,
1172,
67,
33,
7036,
16,
436,
3490,
33,
21,
73,
17,
25,
16,
5945,
33,
8381,
4672,
309,
3988,
34,
20,
30,
389,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1196,
67,
4896,
12,
1589,
16,
14736,
16,
3988,
16,
2744,
16,
1965,
16,
1172,
67,
33,
7036,
16,
436,
3490,
33,
21,
73,
17,
25,
16,
5945,
33,
8381,
4672,
309,
3988,
34,
20,
30,
389,
... |
if isnan(x): return self.special_fmt % (_nan_str,) elif isinf(x): if x > 0: return self.special_fmt % (_inf_str,) else: return self.special_fmt % ('-' + _inf_str,) | import numeric as _nc err = _nc.seterr(invalid='ignore') try: if isnan(x): return self.special_fmt % (_nan_str,) elif isinf(x): if x > 0: return self.special_fmt % (_inf_str,) else: return self.special_fmt % ('-' + _inf_str,) finally: _nc.seterr(**err) | def __call__(self, x, strip_zeros=True): if isnan(x): return self.special_fmt % (_nan_str,) elif isinf(x): if x > 0: return self.special_fmt % (_inf_str,) else: return self.special_fmt % ('-' + _inf_str,) s = self.format % x if self.large_exponent: # 3-digit exponent expsign = s[-3] if expsign == '+' or expsign == '-': s = s[1:-2] + '0' + s[-2:] elif self.exp_format: # 2-digit exponent if s[-3] == '0': s = ' ' + s[:-3] + s[-2:] elif strip_zeros: z = s.rstrip('0') s = z + ' '*(len(s)-len(z)) return s | 52c43da079009c4b18ec5a7ac6bf31ef6cad69ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14925/52c43da079009c4b18ec5a7ac6bf31ef6cad69ed/arrayprint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
619,
16,
2569,
67,
22008,
33,
5510,
4672,
1930,
6389,
487,
389,
14202,
393,
273,
389,
14202,
18,
542,
370,
12,
5387,
2218,
6185,
6134,
775,
30,
309,
1679... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
619,
16,
2569,
67,
22008,
33,
5510,
4672,
1930,
6389,
487,
389,
14202,
393,
273,
389,
14202,
18,
542,
370,
12,
5387,
2218,
6185,
6134,
775,
30,
309,
1679... |
if self.connection is not None: self.connection = None | if self.downloader is not None: self.downloader.stop() | def abort(self): if self.connection is not None: #TODO disconnect somehow #self.connection.disconnect() self.connection = None self.close() | bffe23505fbaa126f88204309cabaf324dbafe0f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10199/bffe23505fbaa126f88204309cabaf324dbafe0f/ppanel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6263,
12,
2890,
4672,
309,
365,
18,
4071,
353,
486,
599,
30,
468,
6241,
9479,
28578,
468,
2890,
18,
4071,
18,
20177,
1435,
365,
18,
4071,
273,
599,
365,
18,
4412,
1435,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6263,
12,
2890,
4672,
309,
365,
18,
4071,
353,
486,
599,
30,
468,
6241,
9479,
28578,
468,
2890,
18,
4071,
18,
20177,
1435,
365,
18,
4071,
273,
599,
365,
18,
4412,
1435,
2,
-100,
-100,
... |
return [node] | return set([node]) | def make_burca_tailor_fragment(dag, input_cache, seg, tag): input_cache = list(input_cache) input_cache.sort(reverse = True) nodes = [] while input_cache: node = BurcaTailorNode(burcatailorjob) node.add_input_cache(input_cache[-5:]) del input_cache[-5:] node.set_name("ligolw_burca_tailor_%s_%d_%d_%d" % (tag, int(seg[0]), int(abs(seg)), len(nodes))) node.set_output(tag) dag.add_node(node) nodes.append(node) node = BurcaTailorNode(burcatailorjob) node.set_name("ligolw_burca_tailor_%s_%d_%d" % (tag, int(seg[0]), int(abs(seg)))) for parent in nodes: node.add_parent(parent) node.add_input_cache(parent.get_output_cache()) del node.get_args()[:] node.add_var_arg("--add-from-cache %s" % node.cache_name) node.set_output(tag) #node.set_post_script("/bin/rm -f %s" % " ".join([c.path() for c in node.get_input_cache()])) dag.add_node(node) return [node] | 40a9937130115c4762623af8bdfa60662e979e5f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/40a9937130115c4762623af8bdfa60662e979e5f/power.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
70,
295,
5353,
67,
13101,
280,
67,
11956,
12,
30204,
16,
810,
67,
2493,
16,
2291,
16,
1047,
4672,
810,
67,
2493,
273,
666,
12,
2630,
67,
2493,
13,
810,
67,
2493,
18,
3804,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
70,
295,
5353,
67,
13101,
280,
67,
11956,
12,
30204,
16,
810,
67,
2493,
16,
2291,
16,
1047,
4672,
810,
67,
2493,
273,
666,
12,
2630,
67,
2493,
13,
810,
67,
2493,
18,
3804,
... |
user_groups = set(self.pool.get('res.users').read(cr, uid, uid)['groups_id']) | user_groups = set(self.pool.get('res.users').browse(cr, uid, uid)['groups_id'] or []) | def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {} ids = osv.orm.orm.search(self, cr, uid, args, offset, limit, order, context=context) if uid==1: return ids user_groups = set(self.pool.get('res.users').read(cr, uid, uid)['groups_id']) result = [] for menu in self.browse(cr, uid, ids): restrict_to_groups = menu.groups_id if not restrict_to_groups: if menu.action: # if the menu itself has no restrictions, we get the groups of # the action of the menu try: m, oid = menu.action.split(',', 1) data = self.pool.get(m).read(cr, uid, int(oid), context=context) if data and 'groups_id' in data: restrict_to_groups = data['groups_id'] except: pass | f456e3a052034c58292d003b63d37caaf9a1b3dc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/f456e3a052034c58292d003b63d37caaf9a1b3dc/ir_ui_menu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
4422,
16,
4555,
16,
833,
16,
1384,
33,
20,
16,
1800,
33,
17172,
16,
1353,
33,
7036,
16,
819,
33,
7036,
16,
1056,
33,
8381,
4672,
309,
819,
353,
599,
30,
819,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
4422,
16,
4555,
16,
833,
16,
1384,
33,
20,
16,
1800,
33,
17172,
16,
1353,
33,
7036,
16,
819,
33,
7036,
16,
1056,
33,
8381,
4672,
309,
819,
353,
599,
30,
819,
27... |
proc += ["-logdir", (os.getcwd() + "\\" + self.temp_dir)] | proc += ["-logdir", self.temp_dir] | def ToolCommand(self): """Get the valgrind command to run.""" tool_name = self.ToolName() | fc6b9756a51541f7c45e8edfa1ba23a3fd9d4af6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/fc6b9756a51541f7c45e8edfa1ba23a3fd9d4af6/valgrind_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13288,
2189,
12,
2890,
4672,
3536,
967,
326,
1244,
3197,
728,
1296,
358,
1086,
12123,
5226,
67,
529,
273,
365,
18,
6364,
461,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13288,
2189,
12,
2890,
4672,
3536,
967,
326,
1244,
3197,
728,
1296,
358,
1086,
12123,
5226,
67,
529,
273,
365,
18,
6364,
461,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
log.msg(fmt % (origin, map(str, [u for (u, f) in recipients] or user_recipients))) | log.msg(fmt % (origin, [str(u) for (u, f) in recipients])) | def do_DATA(self, rest): if self._from is None or (not self._to and not self._user_to): self.sendCode(503, 'Must have valid receiver and originator') return assert self.delivery self.mode = DATA helo, origin, user_recipients = self._helo, self._from, self._user_to recipients = self._to self._from = None self._to = [] self._user_to = [] self.datafailed = None if user_recipients: try: self.__messages = self.startMessage(user_recipients) except SMTPServerError, e: self.sendCode(e.code, e.resp) self.mode = COMMAND return rcvdhdr = self.delivery.receivedHeader( helo, origin, map(str, user_recipients)) else: try: self.__messages = [f() for (u, f) in recipients] except SMTPServerError, e: self.sendCode(e.code, e.resp) self.mode = COMMAND return except: log.err() self.sendCode(550, "Internal server error") self.mode = COMMAND return | 1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
4883,
12,
2890,
16,
3127,
4672,
309,
365,
6315,
2080,
353,
599,
578,
261,
902,
365,
6315,
869,
471,
486,
365,
6315,
1355,
67,
869,
4672,
365,
18,
4661,
1085,
12,
3361,
23,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
4883,
12,
2890,
16,
3127,
4672,
309,
365,
6315,
2080,
353,
599,
578,
261,
902,
365,
6315,
869,
471,
486,
365,
6315,
1355,
67,
869,
4672,
365,
18,
4661,
1085,
12,
3361,
23,
1... |
return self.SimpleTest("chrome", "remoting_unittests") | return self.SimpleTest("chrome", "remoting_unittests", cmd_args=[ "--ui-test-timeout=240000", "--ui-test-action-timeout=120000", "--ui-test-action-max-timeout=280000"]) | def TestRemoting(self): return self.SimpleTest("chrome", "remoting_unittests") | f4a13ccc511e224e125d0cdfb0198b6075fee681 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/f4a13ccc511e224e125d0cdfb0198b6075fee681/chrome_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7766,
1933,
17128,
12,
2890,
4672,
327,
365,
18,
5784,
4709,
2932,
343,
10896,
3113,
315,
2764,
17128,
67,
4873,
16341,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7766,
1933,
17128,
12,
2890,
4672,
327,
365,
18,
5784,
4709,
2932,
343,
10896,
3113,
315,
2764,
17128,
67,
4873,
16341,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if (div == 1 and level == 1): print'</div>' | if (div == 1 and level == 1): print'</ol></div>' | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle, div if (lstrip(linein) == ""): return linein = beautifyLine(linein) lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (lineLevel > level): # increasing depth while (lineLevel > level): if (formatMode == "indent"): if (inBodyText == 1): print"</p>" inBodyText = 0 print "<ol>" else: sys.exit("Error! Unknown formatMode type") level = level + 1 elif (lineLevel < level): # decreasing depth while (lineLevel < level): if (inBodyText == 1): print"</p>" inBodyText = 0 elif (inBodyText == 2): print"</pre>" inBodyText = 0 elif (inBodyText == 3): print"</table>" inBodyText = 0 print "</ol>" level = level - 1 if (div == 1 and level == 1): print'</div>' else: print # same depth if (slides == 0): if (lineLevel == find(linein," ") +1 ) or \ (lineLevel == find(linein,":") +1 ): if (inBodyText == 0): handleBodyText(linein,lineLevel) elif (colonStrip(rstrip(lstrip(linein))) == ""): print "</p>" handleBodyText(linein,lineLevel) else: print colonStrip(rstrip(lstrip(linein))), elif (lineLevel == find(linein,";") +1 ): if (inBodyText == 0): handlePreformattedText(linein,lineLevel) elif (semicolonStrip(rstrip(lstrip(linein))) == ""): print "</pre>" handlePreformattedText(linein,lineLevel) else: print semicolonStrip(rstrip(lstrip(linein))), elif (lineLevel == find(linein,"|") +1 ): if (inBodyText == 0): handleTable(linein,lineLevel) elif (pipeStrip(rstrip(lstrip(linein))) == ""): print "</table>" handleTtable(linein,lineLevel) else: print handleTableRow(linein,lineLevel), else: if (inBodyText == 1): print"</p>" inBodyText = 0 elif (inBodyText == 2): print"</pre>" inBodyText = 0 elif (inBodyText == 3): print"</table>" inBodyText = 0 if (div == 1 and lineLevel == 1): print divName(linein) print "<li", if (styleSheet != ""): if (lineLevel == find(linein,"- ") +1 ): print " class=\"LB" + str(lineLevel) + "\"", print ">" + lstrip(rstrip(dashStrip(lstrip(linein)))), elif (lineLevel == find(linein,"+ ") +1 ): print " class=\"LN" + str(lineLevel) + "\"", print ">" + lstrip(rstrip(plusStrip(lstrip(linein)))), else: print " class=\"L" + str(lineLevel) + "\"", print ">" + rstrip(lstrip(linein)), else: if (lineLevel == 1): if (linein[0] == " "): if (inBodyText == 0): handleBodyText(linein,lineLevel) else: print rstrip(lstrip(linein)), else: print "<address>" print rstrip(lstrip(linein)), print "</address>\n" else: if (lineLevel == find(linein," ") +1 ) or \ (lineLevel == find(linein,":") +1 ): if (inBodyText == 0): handleBodyText(linein,lineLevel) else: print rstrip(lstrip(linein)), else: if (inBodyText == 1): print"</p>" inBodyText = 0 print "<li", if (styleSheet != ""): print " class=\"LI.L" + str(lineLevel) + "\"", print ">" + rstrip(lstrip(linein)), | fc16136abe0e486a37c93cf3944efd4ef14901d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6154/fc16136abe0e486a37c93cf3944efd4ef14901d9/otl2html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
1670,
12,
1369,
267,
4672,
2552,
1801,
16,
740,
2309,
16,
30119,
16,
6853,
9051,
16,
316,
2250,
1528,
16,
2154,
8229,
16,
6370,
2885,
16,
3739,
309,
261,
80,
6406,
12,
1369,
267,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
1670,
12,
1369,
267,
4672,
2552,
1801,
16,
740,
2309,
16,
30119,
16,
6853,
9051,
16,
316,
2250,
1528,
16,
2154,
8229,
16,
6370,
2885,
16,
3739,
309,
261,
80,
6406,
12,
1369,
267,... |
ret | return [None, None] | def _synthesize(browser): """Attempt to synthesize a controller base on existing controllers. This is useful to create a controller when a user specifies a path to an entry in the BROWSER environment variable -- we can copy a general controller to operate using a specific installation of the desired browser in this way. If we can't create a controller in this way, or if there is no executable for the requested browser, return [None, None]. """ if not os.path.exists(browser): return [None, None] name = os.path.basename(browser) try: command = _browsers[name.lower()] except KeyError: return [None, None] # now attempt to clone to fit the new name: controller = command[1] if controller and name.lower() == controller.basename: import copy controller = copy.copy(controller) controller.name = browser controller.basename = os.path.basename(browser) register(browser, None, controller) return [None, controller] ret | a68f3ddcc75b81ffdd2ee7fcf8cca8006d12c6a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a68f3ddcc75b81ffdd2ee7fcf8cca8006d12c6a0/webbrowser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11982,
7915,
554,
12,
11213,
4672,
3536,
7744,
358,
6194,
7915,
554,
279,
2596,
1026,
603,
2062,
12403,
18,
225,
1220,
353,
5301,
358,
752,
279,
2596,
1347,
279,
729,
11470,
279,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11982,
7915,
554,
12,
11213,
4672,
3536,
7744,
358,
6194,
7915,
554,
279,
2596,
1026,
603,
2062,
12403,
18,
225,
1220,
353,
5301,
358,
752,
279,
2596,
1347,
279,
729,
11470,
279,
58... |
__version_info__ = (1, 1, 0) | __version_info__ = (1, 1, 1) | def do_status(self, subcmd, opts, *paths): print "handle 'svn status' command" | 3ca6d973f3c9c7662505ff939ca58a53c8a89219 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10333/3ca6d973f3c9c7662505ff939ca58a53c8a89219/cmdln.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2327,
12,
2890,
16,
720,
4172,
16,
1500,
16,
380,
4481,
4672,
1172,
315,
4110,
296,
31505,
1267,
11,
1296,
6,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2327,
12,
2890,
16,
720,
4172,
16,
1500,
16,
380,
4481,
4672,
1172,
315,
4110,
296,
31505,
1267,
11,
1296,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
(r"\\([()/'\".'_!§$%& ?=+-]{1}|[a-zA-Z0-9]+)", String.Char), | (r"\\([()/'\".'_!§$%& ?;=+-]{1}|[a-zA-Z0-9]+)", String.Char), | def analyse_text(text): return shebang_matches(text, r'(tcl)') | fb89dd22cf72291368cf0541f3fc5c4903e24be1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2885/fb89dd22cf72291368cf0541f3fc5c4903e24be1/agile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31087,
67,
955,
12,
955,
4672,
327,
23901,
70,
539,
67,
8436,
12,
955,
16,
436,
11,
12,
88,
830,
2506,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31087,
67,
955,
12,
955,
4672,
327,
23901,
70,
539,
67,
8436,
12,
955,
16,
436,
11,
12,
88,
830,
2506,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
wanted = " Blaahblah " | wanted = " Blaahblah " | def _options_off(self): self.send(":set ts=8\n") self.send(":set noexpandtab\n") | fdb662207345be6b6cdf6a50f5c349319fb1d95f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11767/fdb662207345be6b6cdf6a50f5c349319fb1d95f/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2116,
67,
3674,
12,
2890,
4672,
365,
18,
4661,
2932,
30,
542,
3742,
33,
28,
64,
82,
7923,
365,
18,
4661,
2932,
30,
542,
1158,
12320,
7032,
64,
82,
7923,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2116,
67,
3674,
12,
2890,
4672,
365,
18,
4661,
2932,
30,
542,
3742,
33,
28,
64,
82,
7923,
365,
18,
4661,
2932,
30,
542,
1158,
12320,
7032,
64,
82,
7923,
2,
-100,
-100,
-100,
-10... |
_verify('LOG4', 1.38629436111989) | _verify('LOG4', LOG4, 1.38629436111989) | def _verify(name, expected): computed = eval(name) if abs(computed - expected) > 1e-7: raise ValueError( "computed value for %s deviates too much " "(computed %g, expected %g)" % (name, computed, expected)) | ff6ef3dceba19fe693692a09e6b981488eeca3c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/ff6ef3dceba19fe693692a09e6b981488eeca3c0/random.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8705,
12,
529,
16,
2665,
4672,
8470,
273,
5302,
12,
529,
13,
309,
2417,
12,
20307,
300,
2665,
13,
405,
404,
73,
17,
27,
30,
1002,
2068,
12,
315,
20307,
460,
364,
738,
87,
27492,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8705,
12,
529,
16,
2665,
4672,
8470,
273,
5302,
12,
529,
13,
309,
2417,
12,
20307,
300,
2665,
13,
405,
404,
73,
17,
27,
30,
1002,
2068,
12,
315,
20307,
460,
364,
738,
87,
27492,... |
open( 'dirac-pilot', "w" ).write(bz2.decompress( base64.decodestring( "%(compressedAndEncodedPilot)s" ) ) ) | open( '%(pilotScript)s', "w" ).write(bz2.decompress( base64.decodestring( "%(compressedAndEncodedPilot)s" ) ) ) | def _writePilotScript( self, workingDirectory, pilotOptions, proxy, httpProxy ): """ Prepare the script to execute the pilot For the moment it will do like Grid Pilots, a full DIRAC installation | 850c97bb2d28cc3e13cd7d670c5f6a6ab32cd0e7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/850c97bb2d28cc3e13cd7d670c5f6a6ab32cd0e7/DIRACPilotDirector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
52,
22797,
3651,
12,
365,
16,
5960,
2853,
16,
293,
22797,
1320,
16,
2889,
16,
1062,
3886,
262,
30,
3536,
7730,
326,
2728,
358,
1836,
326,
293,
22797,
2457,
326,
10382,
518,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
52,
22797,
3651,
12,
365,
16,
5960,
2853,
16,
293,
22797,
1320,
16,
2889,
16,
1062,
3886,
262,
30,
3536,
7730,
326,
2728,
358,
1836,
326,
293,
22797,
2457,
326,
10382,
518,
... |
fobj.seek(-len(buf) - size, 1) | fobj.seek(offset) | def delete_bytes(fobj, size, offset): """Delete size bytes of empty space starting at offset. fobj must be an open file object, open rb+ or equivalent. Mutagen tries to use mmap to resize the file, but falls back to a significantly slower method if mmap fails. """ assert 0 < size assert 0 <= offset fobj.seek(0, 2) filesize = fobj.tell() movesize = filesize - offset - size assert 0 <= movesize if movesize > 0: fobj.flush() map = mmap.mmap(fobj.fileno(), filesize) try: map.move(offset, offset + size, movesize) map.close() except ValueError: # handle broken python on 64bit map.close() fobj.seek(offset + size) buf = fobj.read(size) while len(buf): fobj.seek(-len(buf) - size, 1) fobj.write(buf) fobj.seek(size, 1) buf = fobj.read(size) fobj.truncate(filesize - size) fobj.flush() | d320e1f661ea50e33b17d44fe426c3f8ede2458b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1845/d320e1f661ea50e33b17d44fe426c3f8ede2458b/_util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
3890,
12,
27936,
16,
963,
16,
1384,
4672,
3536,
2613,
963,
1731,
434,
1008,
3476,
5023,
622,
1384,
18,
225,
24705,
1297,
506,
392,
1696,
585,
733,
16,
1696,
7138,
15,
578,
76... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
3890,
12,
27936,
16,
963,
16,
1384,
4672,
3536,
2613,
963,
1731,
434,
1008,
3476,
5023,
622,
1384,
18,
225,
24705,
1297,
506,
392,
1696,
585,
733,
16,
1696,
7138,
15,
578,
76... |
try: | try: | def killTask(self, taskSpecId): """ | 9752b3a2cecf57e39b299943a948ab05eeba09ce /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/9752b3a2cecf57e39b299943a948ab05eeba09ce/BossLiteKiller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
2174,
12,
2890,
16,
1562,
1990,
548,
4672,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
2174,
12,
2890,
16,
1562,
1990,
548,
4672,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.NotifyPresenceChanged(jabberID) | self.NotifyPresenceChanged(who) | def ConfirmSubscription(self, subscriptionType, who): # if we're already doing this, ignore the request if self.confirmDialog != None: return displayName = self.GetNameFromID(who) message = '%s wishes to %s to your presence information. Do you approve?' % (displayName, subscriptionType) self.confirmDialog = wxMessageDialog(self.application.wxMainFrame, message, _("Confirm Subscription"), wxYES_NO | wxICON_QUESTION) result = self.confirmDialog.ShowModal() if result == wxID_YES: if subscriptionType == 'subscribe': self.connection.send(Presence(to=who, type='subscribed')) self.connection.send(Presence(to=who, type='subscribe')) elif subscriptionType == 'unsubscribe': self.connection.send(Presence(to=who, type='unsubscribed')) self.connection.send(Presence(to=who, type='unsubscribe')) self.NotifyPresenceChanged(jabberID) self.confirmDialog = None | c22df98b269cd8c000ba8c4f5915cfa0daa00b02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/c22df98b269cd8c000ba8c4f5915cfa0daa00b02/ChandlerJabber.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17580,
6663,
12,
2890,
16,
4915,
559,
16,
10354,
4672,
468,
309,
732,
4565,
1818,
9957,
333,
16,
2305,
326,
590,
309,
365,
18,
10927,
6353,
480,
599,
30,
327,
225,
16218,
273,
365,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17580,
6663,
12,
2890,
16,
4915,
559,
16,
10354,
4672,
468,
309,
732,
4565,
1818,
9957,
333,
16,
2305,
326,
590,
309,
365,
18,
10927,
6353,
480,
599,
30,
327,
225,
16218,
273,
365,
18,... |
results_tmp = search_pattern(req, p3, f3, m3, of=of, dbg=dbg) | results_tmp = search_pattern(req, p3, f3, m3, ap=ap, of=of, dbg=dbg) | def perform_request_search(req=None, cc=cdsname, c=None, p="", f="", rg="10", sf="", so="d", sp="", of="hb", ot="", as="0", p1="", f1="", m1="", op1="", p2="", f2="", m2="", op2="", p3="", f3="", m3="", sc="0", jrec="0", recid="-1", recidb="-1", sysno="", id="-1", idb="-1", sysnb="", action="SEARCH", d1y="", d1m="", d1d="", d2y="", d2m="", d2d="", dbg="0"): """Perform search, without checking for authentication. Return list of recIDs found, if of=id. Otherwise create web page.""" # wash all passed arguments: cc = wash_url_argument(cc, 'str') sc = wash_url_argument(sc, 'int') (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) # which colls to search and to display? p = wash_pattern(wash_url_argument(p, 'str')) f = wash_field(wash_url_argument(f, 'str')) rg = wash_url_argument(rg, 'int') sf = wash_url_argument(sf, 'str') so = wash_url_argument(so, 'str') sp = wash_url_argument(sp, 'string') of = wash_url_argument(of, 'str') if type(ot) is list: ot = string.join(ot,",") ot = wash_url_argument(ot, 'str') as = wash_url_argument(as, 'int') p1 = wash_pattern(wash_url_argument(p1, 'str')) f1 = wash_field(wash_url_argument(f1, 'str')) m1 = wash_url_argument(m1, 'str') op1 = wash_url_argument(op1, 'str') p2 = wash_pattern(wash_url_argument(p2, 'str')) f2 = wash_field(wash_url_argument(f2, 'str')) m2 = wash_url_argument(m2, 'str') op2 = wash_url_argument(op2, 'str') p3 = wash_pattern(wash_url_argument(p3, 'str')) f3 = wash_field(wash_url_argument(f3, 'str')) m3 = wash_url_argument(m3, 'str') jrec = wash_url_argument(jrec, 'int') recid = wash_url_argument(recid, 'int') recidb = wash_url_argument(recidb, 'int') sysno = wash_url_argument(sysno, 'str') id = wash_url_argument(id, 'int') idb = wash_url_argument(idb, 'int') sysnb = wash_url_argument(sysnb, 'str') action = wash_url_argument(action, 'str') d1y = wash_url_argument(d1y, 'str') d1m = wash_url_argument(d1m, 'str') d1d = wash_url_argument(d1d, 'str') d2y = wash_url_argument(d2y, 'str') d2m = wash_url_argument(d2m, 'str') d2d = wash_url_argument(d2d, 'str') day1, day2 = wash_dates(d1y, d1m, d1d, d2y, d2m, d2d) dbg = wash_url_argument(dbg, 'int') # backwards compatibility: id, idb, sysnb -> recid, recidb, sysno (if applicable) if sysnb != "" and sysno == "": sysno = sysnb if id > 0 and recid == -1: recid = id if idb > 0 and recidb == -1: recidb = idb # TODO deduce passed search limiting criterias (if applicable) pl = "" # no limits by default if action != "Browse": # we do not want to add options while browsing fieldargs = cgi.parse_qs(req.args) for fieldcode in get_fieldcodes(): if fieldargs.has_key(fieldcode): for val in fieldargs[fieldcode]: pl += "+%s:\"%s\" " % (fieldcode, val) # deduce recid from sysno argument (if applicable): if sysno: # ALEPH SYS number was passed, so deduce MySQL recID for the record: recid = get_mysql_recid_from_aleph_sysno(sysno) # deduce collection we are in (if applicable): if recid>0: cc = guess_primary_collection_of_a_record(recid) # deduce user id (if applicable): try: uid = getUid(req) except: uid = 0 ## 0 - start output page_start(req, of, cc, as, uid) if recid>0: ## 1 - detailed record display if of == "hb": of = "hd" if record_exists(recid): if recidb<=recid: # sanity check recidb=recid+1 print_records(req, range(recid,recidb), -1, -9999, of, ot) else: # record does not exist if of.startswith("h"): print_warning(req, "Requested record does not seem to exist.") elif action == "Browse": ## 2 - browse needed if of.startswith("h"): req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, pl, d1y, d1m, d1d, d2y, d2m, d2d, action)) if as==1 or (p1 or p2 or p3): browse_pattern(req, colls_to_search, p1, f1, rg) browse_pattern(req, colls_to_search, p2, f2, rg) browse_pattern(req, colls_to_search, p3, f3, rg) else: browse_pattern(req, colls_to_search, p, f, rg) else: ## 3 - search needed if of.startswith("h"): req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, pl, d1y, d1m, d1d, d2y, d2m, d2d, action)) t1 = os.times()[4] results_in_any_collection = HitList() if as == 1 or (p1 or p2 or p3): ## 3A - advanced search results_in_any_collection = search_pattern(req, p1, f1, m1, of=of, dbg=dbg) if results_in_any_collection._nbhits == 0: return page_end(req, of) if p2: results_tmp = search_pattern(req, p2, f2, m2, of=of, dbg=dbg) if op1 == "a": # add results_in_any_collection.intersect(results_tmp) elif op1 == "o": # or results_in_any_collection.union(results_tmp) elif op1 == "n": # not results_in_any_collection.difference(results_tmp) else: if of.startswith("h"): print_warning(req, "Invalid set operation %s." % op1, "Error") results_in_any_collection.calculate_nbhits() if results_in_any_collection._nbhits == 0: return page_end(req, of) if p3: results_tmp = search_pattern(req, p3, f3, m3, of=of, dbg=dbg) if op2 == "a": # add results_in_any_collection.intersect(results_tmp) elif op2 == "o": # or results_in_any_collection.union(results_tmp) elif op2 == "n": # not results_in_any_collection.difference(results_tmp) else: if of.startswith("h"): print_warning(req, "Invalid set operation %s." % op2, "Error") results_in_any_collection.calculate_nbhits() else: ## 3B - simple search results_in_any_collection = search_pattern(req, p, f, of=of, dbg=dbg) if results_in_any_collection._nbhits == 0: return page_end(req, of) | ecbca079c2ffbb7166e391821982c873c23535a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/ecbca079c2ffbb7166e391821982c873c23535a2/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
3072,
12,
3658,
33,
7036,
16,
4946,
33,
71,
2377,
529,
16,
276,
33,
7036,
16,
293,
1546,
3113,
284,
1546,
3113,
14524,
1546,
2163,
3113,
9033,
1546,
3113,
1427,
154... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
3072,
12,
3658,
33,
7036,
16,
4946,
33,
71,
2377,
529,
16,
276,
33,
7036,
16,
293,
1546,
3113,
284,
1546,
3113,
14524,
1546,
2163,
3113,
9033,
1546,
3113,
1427,
154... |
id = self.unlink_mark[(model, res_id)] | def _process_end(self, cr, uid, modules): if not modules: return True modules = list(modules) module_in = ",".join(["%s"] * len(modules)) cr.execute('select id,name,model,res_id,module from ir_model_data where module in (' + module_in + ') and noupdate=%s', modules + [False]) wkf_todo = [] for (id, name, model, res_id,module) in cr.fetchall(): if (module,name) not in self.loads: self.unlink_mark[(model,res_id)] = id if model=='workflow.activity': cr.execute('select res_type,res_id from wkf_instance where id in (select inst_id from wkf_workitem where act_id=%s)', (res_id,)) wkf_todo.extend(cr.fetchall()) cr.execute("update wkf_transition set condition='True', role_id=NULL, signal=NULL,act_to=act_from,act_from=%s where act_to=%s", (res_id,res_id)) cr.execute("delete from wkf_transition where act_to=%s", (res_id,)) | ca39947d11c1a94ded13d4bd9b683cec4c6eaab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ca39947d11c1a94ded13d4bd9b683cec4c6eaab0/ir_model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
67,
409,
12,
2890,
16,
4422,
16,
4555,
16,
4381,
4672,
309,
486,
4381,
30,
327,
1053,
4381,
273,
666,
12,
6400,
13,
1605,
67,
267,
273,
5753,
18,
5701,
3816,
28385,
87,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
67,
409,
12,
2890,
16,
4422,
16,
4555,
16,
4381,
4672,
309,
486,
4381,
30,
327,
1053,
4381,
273,
666,
12,
6400,
13,
1605,
67,
267,
273,
5753,
18,
5701,
3816,
28385,
87,
11... | |
self.updating_art = False | def update_album_art2(self): self.stop_art_update = False if not self.show_covers: self.updating_art = False return self.updating_art = True if self.conn and self.status and self.status.state in ['play', 'pause']: artist = getattr(self.songinfo, 'artist', None) if not artist: artist = "" album = getattr(self.songinfo, 'album', None) if not album: album = "" try: filename = os.path.expanduser("~/.covers/" + artist + "-" + album + ".jpg") if filename == self.lastalbumart: # No need to update.. self.stop_art_update = False self.updating_art = False return if os.path.exists(filename): self.set_image_for_cover(filename) else: #Check for some local images: songdir = os.path.dirname(self.songinfo.file) if os.path.exists(self.musicdir + songdir + "/cover.jpg"): self.set_image_for_cover(self.musicdir + songdir + "/cover.jpg") elif os.path.exists(self.musicdir + songdir + "/folder.jpg"): self.set_image_for_cover(self.musicdir + songdir + "/folder.jpg") else: gtk.gdk.threads_enter() self.albumimage.set_from_file(self.sonatacd) self.set_tooltip_art(gtk.gdk.pixbuf_new_from_file(self.sonatacd)) self.lastalbumart = None gtk.gdk.threads_leave() self.download_image_to_filename(artist, album, filename) if os.path.exists(filename): self.set_image_for_cover(filename) except: gtk.gdk.threads_enter() self.albumimage.set_from_file(self.sonatacd) self.set_tooltip_art(gtk.gdk.pixbuf_new_from_file(self.sonatacd)) self.lastalbumart = None gtk.gdk.threads_leave() else: gtk.gdk.threads_enter() self.albumimage.set_from_file(self.sonatacd) self.set_tooltip_art(gtk.gdk.pixbuf_new_from_file(self.sonatacd)) self.lastalbumart = None gtk.gdk.threads_leave() gc.collect() self.updating_art = False self.stop_art_update = False | 7887607cb534b053442ac9710ec7241659a64004 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2312/7887607cb534b053442ac9710ec7241659a64004/sonata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
25090,
67,
485,
22,
12,
2890,
4672,
365,
18,
5681,
67,
485,
67,
2725,
273,
1083,
309,
486,
365,
18,
4500,
67,
14014,
414,
30,
327,
365,
18,
5533,
1776,
67,
485,
273,
1053,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
25090,
67,
485,
22,
12,
2890,
4672,
365,
18,
5681,
67,
485,
67,
2725,
273,
1083,
309,
486,
365,
18,
4500,
67,
14014,
414,
30,
327,
365,
18,
5533,
1776,
67,
485,
273,
1053,
... | |
"HZ1": atom_info("H", 0, "H'"), "O": atom_info("O", 0, "O"), "HZ3": atom_info("H", 0, "H'"), "HZ2": atom_info("H", 0, "H'"), | "HZ1": atom_info("H", 0, "H"), "O": atom_info("O", 0, "O"), "HZ3": atom_info("H", 0, "H"), "HZ2": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") | 46b20303e8ed53745807da84c39cb29f25aa3911 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/46b20303e8ed53745807da84c39cb29f25aa3911/residue_info.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1311,
12,
2890,
4672,
327,
7566,
2956,
67,
7175,
3113,
315,
285,
335,
67,
2019,
3113,
315,
31320,
310,
67,
1925,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1311,
12,
2890,
4672,
327,
7566,
2956,
67,
7175,
3113,
315,
285,
335,
67,
2019,
3113,
315,
31320,
310,
67,
1925,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
startup_pipe.write("READY") | startup_pipe.write(struct.pack('@H', listen_port)) | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | 5b712c834b0f706d7c68e57ffa10c929ee7c5a7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5b712c834b0f706d7c68e57ffa10c929ee7c5a7b/testserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2116,
16,
833,
4672,
15204,
273,
1696,
2668,
3813,
3567,
18,
1330,
2187,
296,
91,
6134,
2589,
18,
10283,
273,
1387,
8438,
92,
264,
12,
9499,
18,
10283,
16,
15204,
13,
2589,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2116,
16,
833,
4672,
15204,
273,
1696,
2668,
3813,
3567,
18,
1330,
2187,
296,
91,
6134,
2589,
18,
10283,
273,
1387,
8438,
92,
264,
12,
9499,
18,
10283,
16,
15204,
13,
2589,
1... |
belongs. The test is, for each bin, to iterate through the time slide dictionaries applying the offsets to both the bin and the CacheEntry, and checking if the (time shifted) CacheEntry's segment(s) intersects the (time shifted) segments already in the bin, comparing only those that are involved in the time slide. | belongs, merge them, and add this cache entry to the result. Create a new bin for this cache entry if it does not belong in any of the existing bins. The cache entry "belongs" in a bin if after each of the preset offset vectors (see the .set_offset_vectors() method) is applied to both the contents of a bin and the cache entry, any of the segment lists of the bin and cache entry are found to intersect. When checking for intersection, only the segment lists whose instrument names are listed in the offset vector are compared. | def pack(self, cache_entry): """ Find all bins in which this glue.lal.CacheEntry instance belongs. The test is, for each bin, to iterate through the time slide dictionaries applying the offsets to both the bin and the CacheEntry, and checking if the (time shifted) CacheEntry's segment(s) intersects the (time shifted) segments already in the bin, comparing only those that are involved in the time slide. """ new = LALCacheBin() new.add(cache_entry, cache_entry.to_segmentlistdict()) matching_bins = [] for n in xrange(bisect.bisect_left([bin.extent[1] for bin in self.bins], new.extent[0] - self.max_gap), len(self.bins)): bin = self.bins[n] for offsetdict in self.timeslides: new.size.offsets.update(offsetdict) bin.size.offsets.update(offsetdict) if bin.size.is_coincident(new.size, keys = offsetdict.keys()): matching_bins.append(n) break bin.size.offsets.clear() new.size.offsets.clear() | 626a80ee3e03d7a3edce4a5fa7cb1998f6a34c6c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/626a80ee3e03d7a3edce4a5fa7cb1998f6a34c6c/ligolw_cafe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2298,
12,
2890,
16,
1247,
67,
4099,
4672,
3536,
4163,
777,
8963,
316,
1492,
333,
17960,
18,
80,
287,
18,
27630,
791,
11081,
16,
2691,
2182,
16,
471,
527,
333,
1247,
1241,
358,
326,
563... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2298,
12,
2890,
16,
1247,
67,
4099,
4672,
3536,
4163,
777,
8963,
316,
1492,
333,
17960,
18,
80,
287,
18,
27630,
791,
11081,
16,
2691,
2182,
16,
471,
527,
333,
1247,
1241,
358,
326,
563... |
except AssertionError, msg2: raise ValueError(msg + msg2) | except AssertionError: raise ValueError(msg) | def __init__(self, data=None, pos=None, loops=None, format=None, boundary=[], weighted=None, implementation='networkx', sparse=True, vertex_labels=True, **kwds): """ TESTS:: sage: D = DiGraph() sage: loads(dumps(D)) == D True | db76baf167127ccb52ad91ec34a42f359828d3a4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/db76baf167127ccb52ad91ec34a42f359828d3a4/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
33,
7036,
16,
949,
33,
7036,
16,
14075,
33,
7036,
16,
740,
33,
7036,
16,
7679,
22850,
6487,
13747,
33,
7036,
16,
4471,
2218,
5185,
92,
2187,
9387,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
33,
7036,
16,
949,
33,
7036,
16,
14075,
33,
7036,
16,
740,
33,
7036,
16,
7679,
22850,
6487,
13747,
33,
7036,
16,
4471,
2218,
5185,
92,
2187,
9387,
... |
keys = ['language', 'translate_out', 'translate_in', 'upgrade', 'debug_mode', | keys = ['language', 'translate_out', 'translate_in', 'debug_mode', | def __init__(self, fname=None): self.options = { 'email_from':False, 'interface': '', # this will bind the server to all interfaces 'port': '8069', 'netinterface': '', 'netport': '8070', 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'soap': False, 'translate_in': None, 'translate_out': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'price_accuracy': 2, 'secure' : False, 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.WARNING, # level above which a failed assert will be raise } | edcd7bb1b2897b54625fffa94e2abea0e642665b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12853/edcd7bb1b2897b54625fffa94e2abea0e642665b/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5299,
33,
7036,
4672,
365,
18,
2116,
273,
288,
296,
3652,
67,
2080,
4278,
8381,
16,
296,
5831,
4278,
10226,
565,
468,
333,
903,
1993,
326,
1438,
358,
777... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5299,
33,
7036,
4672,
365,
18,
2116,
273,
288,
296,
3652,
67,
2080,
4278,
8381,
16,
296,
5831,
4278,
10226,
565,
468,
333,
903,
1993,
326,
1438,
358,
777... |
patterns = self._gather_selected_patterns() self.remove_from_files(patterns) | def on_remove_patterns(self, button): """Remove the currently selected patterns from their respective files.""" image = gtk.Image() image.set_from_stock(gtk.STOCK_DIALOG_WARNING, gtk.ICON_SIZE_DIALOG) dialog = gtk.Dialog(u"Remove patterns" , self , gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_MODAL , (gtk.STOCK_NO, gtk.RESPONSE_NO , gtk.STOCK_YES, gtk.RESPONSE_YES)) dialog.set_default_response(gtk.RESPONSE_CLOSE) dialog.set_title(u"Remove patterns") | 8be9d0da1ac9fc4fcbc698deb6d4979b64bf27e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6427/8be9d0da1ac9fc4fcbc698deb6d4979b64bf27e0/pattern.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
4479,
67,
13317,
12,
2890,
16,
3568,
4672,
3536,
3288,
326,
4551,
3170,
6884,
628,
3675,
17613,
1390,
12123,
1316,
273,
22718,
18,
2040,
1435,
1316,
18,
542,
67,
2080,
67,
15381... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
4479,
67,
13317,
12,
2890,
16,
3568,
4672,
3536,
3288,
326,
4551,
3170,
6884,
628,
3675,
17613,
1390,
12123,
1316,
273,
22718,
18,
2040,
1435,
1316,
18,
542,
67,
2080,
67,
15381... | |
print "Could not open serial port %s: %s" % (ser.portstr, e) | sys.stderr.write("Could not open serial port %s: %s\n" % (ser.portstr, e)) | def stop(self): """Stop copying""" if self.alive: self.alive = False self.thread_read.join() | 8c80bbcfa2dee7de96e5435fdcc0741993aac1ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10955/8c80bbcfa2dee7de96e5435fdcc0741993aac1ac/tcp_serial_redirect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2132,
12,
2890,
4672,
3536,
4947,
8933,
8395,
309,
365,
18,
11462,
30,
365,
18,
11462,
273,
1083,
365,
18,
5930,
67,
896,
18,
5701,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2132,
12,
2890,
4672,
3536,
4947,
8933,
8395,
309,
365,
18,
11462,
30,
365,
18,
11462,
273,
1083,
365,
18,
5930,
67,
896,
18,
5701,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
keys = Set(values.keys()) | keys = set(values.keys()) | def ParseEDSFile(filepath): eds_dict = {} # Read file text eds_file = open(filepath,'r').read() sections = ExtractSections(eds_file) # Parse assignments for each section for section_name, assignments in sections: # Reset values of entry values = {} # Search if the section name match an index or subindex expression index_result = index_model.match(section_name.upper()) subindex_result = subindex_model.match(section_name.upper()) index_objectlinks_result = index_objectlinks_model.match(section_name.upper()) # Compilation of the EDS information dictionary is_entry = False # First case, section name is in SECTION_KEYNAMES if section_name.upper() in SECTION_KEYNAMES: # Verify that entry is not already defined if section_name.upper() not in eds_dict: eds_dict[section_name.upper()] = values else: raise SyntaxError, "\"[%s]\" section is defined two times"%section_name # Second case, section name is an index name elif index_result: # Extract index number index = int(index_result.groups()[0], 16) # If index hasn't been referenced before, we add an entry into the dictionary if index not in eds_dict: eds_dict[index] = values eds_dict[index]["subindexes"] = {} elif eds_dict[index].keys() == ["subindexes"]: values["subindexes"] = eds_dict[index]["subindexes"] eds_dict[index] = values else: raise SyntaxError, "\"[%s]\" section is defined two times"%section_name is_entry = True # Third case, section name is a subindex name elif subindex_result: # Extract index and subindex number index, subindex = [int(value, 16) for value in subindex_result.groups()] # If index hasn't been referenced before, we add an entry into the dictionary # that will be updated later if index not in eds_dict: eds_dict[index] = {"subindexes" : {}} if subindex not in eds_dict[index]["subindexes"]: eds_dict[index]["subindexes"][subindex] = values else: raise SyntaxError, "\"[%s]\" section is defined two times"%section_name is_entry = True # Third case, section name is a subindex name elif index_objectlinks_result: pass # In any other case, there is a syntax problem into EDS file else: raise SyntaxError, "Section \"[%s]\" is unrecognized"%section_name for assignment in assignments: # Escape any comment if assignment.startswith(";"): pass # Verify that line is a valid assignment elif assignment.find('=') > 0: # Split assignment into the two values keyname and value keyname, value = assignment.split("=", 1) # keyname must be immediately followed by the "=" sign, so we # verify that there is no whitespace into keyname if keyname.isalnum(): # value can be preceded and followed by whitespaces, so we escape them value = value.strip() # First case, value starts with "$NODEID", then it's a formula if value.upper().startswith("$NODEID"): try: test = int(value.upper().replace("$NODEID+", ""), 16) computed_value = "\"%s\""%value except: raise SyntaxError, "\"%s\" is not a valid formula for attribute \"%s\" of section \"[%s]\""%(value, keyname, section_name) # Second case, value starts with "0x", then it's an hexadecimal value elif value.startswith("0x") or value.startswith("-0x"): try: computed_value = int(value, 16) except: raise SyntaxError, "\"%s\" is not a valid value for attribute \"%s\" of section \"[%s]\""%(value, keyname, section_name) elif value.isdigit() or value.startswith("-") and value[1:].isdigit(): # Third case, value is a number and starts with "0", then it's an octal value if value.startswith("0") or value.startswith("-0"): computed_value = int(value, 8) # Forth case, value is a number and don't start with "0", then it's a decimal value else: computed_value = int(value) # In any other case, we keep string value else: computed_value = value # Add value to values dictionary if computed_value != "": # If entry is an index or a subindex if is_entry: # Verify that keyname is a possible attribute if keyname.upper() not in ENTRY_ATTRIBUTES: raise SyntaxError, "Keyname \"%s\" not recognised for section \"[%s]\""%(keyname, section_name) # Verify that value is valid elif not ENTRY_ATTRIBUTES[keyname.upper()](computed_value): raise SyntaxError, "Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\""%(value, keyname, section_name) else: values[keyname.upper()] = computed_value else: values[keyname.upper()] = computed_value # All lines that are not empty and are neither a comment neither not a valid assignment elif assignment.strip() != "": raise SyntaxError, "\"%s\" is not a valid EDS line"%assignment.strip() # If entry is an index or a subindex if is_entry: # Verify that entry has an ObjectType values["OBJECTTYPE"] = values.get("OBJECTTYPE", 7) # Extract parameters defined keys = Set(values.keys()) keys.discard("subindexes") # Extract possible parameters and parameters required possible = Set(ENTRY_TYPES[values["OBJECTTYPE"]]["require"] + ENTRY_TYPES[values["OBJECTTYPE"]]["optional"]) required = Set(ENTRY_TYPES[values["OBJECTTYPE"]]["require"]) # Verify that parameters defined contains all the parameters required if not keys.issuperset(required): missing = required.difference(keys)._data.keys() if len(missing) > 1: attributes = "Attributes %s are"%", ".join(["\"%s\""%attribute for attribute in missing]) else: attributes = "Attribute \"%s\" is"%missing[0] raise SyntaxError, "Error on section \"[%s]\":\n%s required for a%s entry"%(section_name, attributes, ENTRY_TYPES[values["OBJECTTYPE"]]["name"]) # Verify that parameters defined are all in the possible parameters if not keys.issubset(possible): unsupported = keys.difference(possible)._data.keys() if len(unsupported) > 1: attributes = "Attributes %s are"%", ".join(["\"%s\""%attribute for attribute in unsupported]) else: attributes = "Attribute \"%s\" is"%unsupported[0] raise SyntaxError, "Error on section \"[%s]\":\n%s unsupported for a%s entry"%(section_name, attributes, ENTRY_TYPES[values["OBJECTTYPE"]]["name"]) VerifyValue(values, section_name, "ParameterValue") VerifyValue(values, section_name, "DefaultValue") return eds_dict | 466d7309b8c9187d6431dfde546a4b58f0a839ba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/116/466d7309b8c9187d6431dfde546a4b58f0a839ba/eds_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
2056,
55,
812,
12,
10561,
4672,
1675,
87,
67,
1576,
273,
2618,
468,
2720,
585,
977,
1675,
87,
67,
768,
273,
1696,
12,
10561,
11189,
86,
16063,
896,
1435,
7178,
273,
8152,
15965,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
2056,
55,
812,
12,
10561,
4672,
1675,
87,
67,
1576,
273,
2618,
468,
2720,
585,
977,
1675,
87,
67,
768,
273,
1696,
12,
10561,
11189,
86,
16063,
896,
1435,
7178,
273,
8152,
15965,
... |
self.query = obj_move._query_get(cr, uid, obj='l', context=data['form'].get('used_context',{})) self.init_query = obj_move._query_get(cr, uid, obj='l', context=data['form'].get('used_context_initial_bal', {})) | self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context',{})) self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context_initial_bal', {})) | def set_context(self, objects, data, ids, report_type=None): new_ids = ids obj_move = self.pool.get('account.move.line') self.sortby = data['form'].get('sortby', 'sort_date') self.query = obj_move._query_get(cr, uid, obj='l', context=data['form'].get('used_context',{})) self.init_query = obj_move._query_get(cr, uid, obj='l', context=data['form'].get('used_context_initial_bal', {})) self.init_balance = data['form']['initial_balance'] self.display_account = data['form']['display_account'] self.target_move = data['form'].get('target_move', 'all') ctx = self.context.copy() ctx['fiscalyear'] = data['form']['fiscalyear_id'] if data['form']['filter'] == 'filter_period': ctx['periods'] = data['form']['periods'] elif data['form']['filter'] == 'filter_date': ctx['date_from'] = data['form']['date_from'] ctx['date_to'] = data['form']['date_to'] ctx['state'] = data['form']['target_move'] self.context.update(ctx) if (data['model'] == 'ir.ui.menu'): new_ids = [data['form']['chart_account_id']] objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids) return super(general_ledger, self).set_context(objects, data, new_ids, report_type=report_type) | 5c4592ba23d4057ad0143ee7a84d0acb93ba88ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5c4592ba23d4057ad0143ee7a84d0acb93ba88ad/account_general_ledger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2472,
12,
2890,
16,
2184,
16,
501,
16,
3258,
16,
2605,
67,
723,
33,
7036,
4672,
394,
67,
2232,
273,
3258,
1081,
67,
8501,
273,
365,
18,
6011,
18,
588,
2668,
4631,
18,
8501,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2472,
12,
2890,
16,
2184,
16,
501,
16,
3258,
16,
2605,
67,
723,
33,
7036,
4672,
394,
67,
2232,
273,
3258,
1081,
67,
8501,
273,
365,
18,
6011,
18,
588,
2668,
4631,
18,
8501,
... |
os.chmod(os.path.join(root, d), 0755) | if 'contrib' in root: continue if 'contrib' in d: os.chmod(os.path.join(root, d), 2775) else: os.chmod(os.path.join(root, d), 0755) | def ReleaseToCandidatesDir(options, upload_dir, files): candidatesDir = CANDIDATES_DIR % {'version': options.version, 'buildnumber': options.build_number} candidatesPath = os.path.join(NIGHTLY_PATH, candidatesDir) candidatesUrl = CANDIDATES_URL_PATH % { 'nightly_dir': options.nightly_dir, 'version': options.version, 'buildnumber': options.build_number, 'product': options.product, } for f in files: realCandidatesPath = candidatesPath if 'win32' in f: realCandidatesPath = os.path.join(realCandidatesPath, 'unsigned') url = os.path.join(candidatesUrl, 'unsigned') else: url = candidatesUrl if options.builddir: realCandidatesPath = os.path.join(realCandidatesPath, options.builddir) url = os.path.join(url, options.builddir) CopyFileToDir(f, upload_dir, realCandidatesPath, preserve_dirs=True) # Output the URL to the candidate build if f.startswith(upload_dir): relpath = f[len(upload_dir):].lstrip("/") else: relpath = f.lstrip("/") sys.stderr.write("%s\n" % os.path.join(url, relpath)) # We always want release files chmod'ed this way so other users in # the group cannot overwrite them. os.chmod(f, 0644) # Same thing for directories, but 0755 for root,dirs,files in os.walk(candidatesPath): for d in dirs: os.chmod(os.path.join(root, d), 0755) | aecbb29a397ac80ad36c864946907db4b6d6bd41 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6206/aecbb29a397ac80ad36c864946907db4b6d6bd41/post_upload.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10819,
774,
18455,
1621,
12,
2116,
16,
3617,
67,
1214,
16,
1390,
4672,
7965,
1621,
273,
385,
4307,
734,
1777,
55,
67,
4537,
738,
13666,
1589,
4278,
702,
18,
1589,
16,
296,
3510,
2696,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10819,
774,
18455,
1621,
12,
2116,
16,
3617,
67,
1214,
16,
1390,
4672,
7965,
1621,
273,
385,
4307,
734,
1777,
55,
67,
4537,
738,
13666,
1589,
4278,
702,
18,
1589,
16,
296,
3510,
2696,
... |
"WHERE PAP.HOMOLOGENE.HGE_GENEID = PAP.MRNA_COORDINATES.MRC_GENEID") | "WHERE PAP.HOMOLOGENE.HGE_GENEID = PAP.MRNA_COORDINATES.MRC_GENEID " "AND HGE_TAXID IN (" + species_limit + ")") | def _get_homologene_to_mrna(dbase): """ Returns: homologene_to_mrna (dict) """ # homologene_to_mrna: (Dict) # key: hge_homologeneid # TODO: Double-check that not all HGE_GENEIDs map to MRC_GENEIDs # # Homologene has 244,950 rows, while the select has only 67,520 # val: set((mrc_geneid, mrc_transcript_no), (mrc_geneid, mrc_transcript_no), ...) homologene_to_mrna = {} print "Populating: homologene_to_mrna" mrna_dbase = dbase.cursor() mrna_dbase.execute("SELECT DISTINCT HGE_HOMOLOGENEID, MRC_GENEID, MRC_TRANSCRIPT_NO " "FROM PAP.HOMOLOGENE, PAP.MRNA_COORDINATES " "WHERE PAP.HOMOLOGENE.HGE_GENEID = PAP.MRNA_COORDINATES.MRC_GENEID") for row in SQLGenerator(mrna_dbase): homologene_to_mrna.setdefault(row[0], set()).add((row[1], row[2])) mrna_dbase.close() print "Populated.\n" return homologene_to_mrna | b850fb892724b1943780db181408ec0a356cd4f5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12607/b850fb892724b1943780db181408ec0a356cd4f5/scan.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
17125,
3966,
4009,
67,
869,
67,
21387,
6582,
12,
1966,
448,
4672,
3536,
2860,
30,
13995,
3966,
4009,
67,
869,
67,
21387,
6582,
261,
1576,
13,
3536,
468,
13995,
3966,
4009,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
17125,
3966,
4009,
67,
869,
67,
21387,
6582,
12,
1966,
448,
4672,
3536,
2860,
30,
13995,
3966,
4009,
67,
869,
67,
21387,
6582,
261,
1576,
13,
3536,
468,
13995,
3966,
4009,
... |
for att in soup({'tbody':True})[1].findAll({'tr':True}): attach = Bug.Attachment() aux = att.findAll({'td':True}) attach.IdBug = self.get_Id(soup) attach.Name = str(aux[0].contents[2]) attach.Description = str(aux[1].contents[2]) attach.Url = str(SourceForgeFrontend.domain+aux[2].a['href']) dataBugs["Attachments:"].append(attach) | if tg.has_key('id') and tg['id'] == 'filebar': for att in soup({'tbody':True})[1].findAll({'tr':True}): attach = Bug.Attachment() aux = att.findAll({'td':True}) attach.IdBug = self.get_Id(dataBugs,soup) attach.Name = str(aux[0].contents[1]) attach.Description = str(aux[1].contents[1]) attach.Url = str(SourceForgeFrontend.domain+aux[2].a['href']) dataBugs["Attachments:"].append(attach) | def get_Attachments(self,dataBugs, soup): attachs = [] try : if self.getNumChAttComm('Attached File',soup): debug("Viendo attachments") for tg in soup('h4'): for att in soup({'tbody':True})[1].findAll({'tr':True}): attach = Bug.Attachment() aux = att.findAll({'td':True}) attach.IdBug = self.get_Id(soup) attach.Name = str(aux[0].contents[2]) attach.Description = str(aux[1].contents[2]) attach.Url = str(SourceForgeFrontend.domain+aux[2].a['href']) dataBugs["Attachments:"].append(attach) #debug("Attach : %s" % attachs) #return attachs else : try: #attach = Bug.Attachment() #attach.IdBug = None #attach.Name = None #attach.Description = None #attach.Url = None #attachs.append(attach) #return attachs pass except: debug("Error Attachs None") except : debug("Errors getting Attachments") #return attachs | f8cdd044a6dff2b1c2d5aa6bee01a8dfe0255bb7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10888/f8cdd044a6dff2b1c2d5aa6bee01a8dfe0255bb7/sf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
12961,
12,
2890,
16,
892,
31559,
16,
15418,
4672,
3306,
87,
273,
5378,
775,
294,
309,
365,
18,
588,
2578,
782,
3075,
12136,
2668,
14890,
1387,
2187,
2048,
416,
4672,
1198,
2932,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
12961,
12,
2890,
16,
892,
31559,
16,
15418,
4672,
3306,
87,
273,
5378,
775,
294,
309,
365,
18,
588,
2578,
782,
3075,
12136,
2668,
14890,
1387,
2187,
2048,
416,
4672,
1198,
2932,... |
return self._retcode | return self.retcode() | def kill(self): """Kill our running process if needed. Wait for kill to complete. | edabcd69156d56093d5c167ac95d15713a2ad345 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/edabcd69156d56093d5c167ac95d15713a2ad345/coverage_posix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
12,
2890,
4672,
3536,
19045,
3134,
3549,
1207,
309,
3577,
18,
225,
5838,
364,
8673,
358,
3912,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
12,
2890,
4672,
3536,
19045,
3134,
3549,
1207,
309,
3577,
18,
225,
5838,
364,
8673,
358,
3912,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
class SimpleDemo(object): | glColor4f(1.0, 1.0, 0.0, 0.8) for x in [4, 3.5, 3, 2.5, 2, 1.5, 1, 0.5, 0, -0.5, -1, -1.5, -2, -2.5, -3, -3.5, -4]: draw_line(float(x), -4.0, float(x), 4.0) draw_line(-4.0, float(x), 4.0, float(x)) class SimpleApp(object): | def draw(self): # DRAW STUFF HERE glColor4f(1.0, 0.8, 0.2, 1.0) draw_square() | 3b67b85e99556271865210ae7472d5929c2a3297 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/579/3b67b85e99556271865210ae7472d5929c2a3297/gl-hello.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
468,
463,
10821,
2347,
57,
2246,
670,
29340,
5118,
2957,
24,
74,
12,
21,
18,
20,
16,
374,
18,
28,
16,
374,
18,
22,
16,
404,
18,
20,
13,
3724,
67,
19719,
1435,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
468,
463,
10821,
2347,
57,
2246,
670,
29340,
5118,
2957,
24,
74,
12,
21,
18,
20,
16,
374,
18,
28,
16,
374,
18,
22,
16,
404,
18,
20,
13,
3724,
67,
19719,
1435,... |
tempDict = dict tempDict["include files"] = match.group(1).strip() makeSubstitutions(tempDict) for file in tempDict["include files"].split(): | files = evaluate(match.group(1),dict).split() for file in files: | def parseMakefile(filename): """Open filename, read in the text and return a dictionary of make variable names and values. If an include statement is found, this routine will be called recursively.""" lines = open(filename,"r").readlines() # Read in the lines of the Makefile lines = [s.split("#")[0] for s in lines] # Remove all comments removeContinuationLines(lines) # Remove continuation lines lines = filter(isNotBlankLine, lines) # Remove all blank lines dict = { } for line in lines: # Process include statements match = includeRE.match(line) if match: tempDict = dict tempDict["include files"] = match.group(1).strip() makeSubstitutions(tempDict) for file in tempDict["include files"].split(): try: dict.update(parseMakefile(file)) except IOError: pass continue # Process assignment statements match = assignRE.match(line) if match: dict[match.group(1).strip()] = match.group(2).strip() return dict | e4c75bc4569aae4974c57b527eedcb6fafc7a154 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1130/e4c75bc4569aae4974c57b527eedcb6fafc7a154/MakefileVariables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
6464,
768,
12,
3459,
4672,
3536,
3678,
1544,
16,
855,
316,
326,
977,
471,
327,
279,
3880,
434,
1221,
2190,
1257,
471,
924,
18,
225,
971,
392,
2341,
3021,
353,
1392,
16,
333,
1224... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
6464,
768,
12,
3459,
4672,
3536,
3678,
1544,
16,
855,
316,
326,
977,
471,
327,
279,
3880,
434,
1221,
2190,
1257,
471,
924,
18,
225,
971,
392,
2341,
3021,
353,
1392,
16,
333,
1224... |
elif len(trackerSizeList[listIndex]) > 0: | elif len(trackerSizeList[listIndex]) > 0 and len(trackerSizeList[listIndex][0]) > 0: | def calculateSwarmSize(self, torrentList, content, toBC=True): """ This method gets a list of torrent_ids and then calculat the size of the swarm for those torrents. @author: Rahim @param torrentList: A list of torrent_id. @param content: If it be 'infohash' , the content of the torrentList is infohsh of torrents. If it be 'torrentIds', the content is a list of torrent_id. @param toBc: This flag determines that whether the returned result will be used to create a new BC message or not. The difference is that nodes just send first hand information to each other. The prevent speard of contamination if one of the nodes receive incorrent value from sender. The main difference in the flow of the process is that, if toBC be set to False, this fucntion will look for the most recenct report inside both Popularity and Torrent table, otherwise it will just use torrent table. @return: returns a list with the same size az input and each items is composed of below items: (torrent_id, num_seeders, num_leechers, num_of_sources) """ if content=='Infohash': torrentList = [self.torrent_db.getTorrentID(infohash) for infohash in torrentList ] elif content=='TorrentIds': pass else: return [] trackerSizeList =[] popularityList=[] for torrentId in torrentList: trackerSizeList.append(self.torrent_db.getSwarmInfo(torrentId)) if not toBC: popularityList.append(self.getPopularityList(torrent_id=torrentId)) result =[] timeNow=int(time()) averagePeerUpTime = 2 * 60 * 60 # we suppose that the average uptime is roughly two hours. listIndex = 0 for id in torrentList: result.append([id, -1, -1, -1, -1]) # (torrent_id, calc_age, num_seeders, num_leechers, num_sources_seen) if not toBC and len(popularityList[listIndex]) > 0 : #if popularityList[listIndex][0] is not None: latest = self.getLatestPopularityReport(popularityList[listIndex], timeNow) result[listIndex][1] = latest[4] # num_seeders result[listIndex][2] = latest[5] # num_leechers result[listIndex][3] = timeNow - latest[2]+latest[3] # age of the report result[listIndex][4] = latest[6] # num_sources # print latest if len(trackerSizeList[listIndex]) > 0: #if trackerSizeList[listIndex][0] is not None: temp=trackerSizeList[listIndex][0] tempAge = timeNow - temp[3] if tempAge < result[listIndex][3]: result[listIndex][1] = temp[1] #num_seeders result[listIndex][2] = temp[2] #num_leechers result[listIndex][3] = tempAge # Age of the tracker asking othersSeenSources = self.torrent_db.getLargestSourcesSeen(id, timeNow, averagePeerUpTime) result[listIndex][4] = max(temp[4], othersSeenSources) # num_sources | fc74242fd2fbecb2942865be0abbe196487b2cde /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9686/fc74242fd2fbecb2942865be0abbe196487b2cde/SqliteCacheDBHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4604,
55,
13113,
1225,
12,
2890,
16,
17351,
682,
16,
913,
16,
358,
16283,
33,
5510,
4672,
3536,
1220,
707,
5571,
279,
666,
434,
17351,
67,
2232,
471,
1508,
3026,
270,
326,
963,
434,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4604,
55,
13113,
1225,
12,
2890,
16,
17351,
682,
16,
913,
16,
358,
16283,
33,
5510,
4672,
3536,
1220,
707,
5571,
279,
666,
434,
17351,
67,
2232,
471,
1508,
3026,
270,
326,
963,
434,
32... |
Assigned To.*?<br>\s+(?P<assignee>\S+) | assigned.*?<br>\s+(?P<assignee>\S+) | def strip_tags(s): while '<' in s and '>' in s: s = str(s[:s.find('<')]) + str(s[s.find('>')+1:]) return s | e8fe9b90fe8c3b2a631e37b6e97e0ae67ab54887 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3104/e8fe9b90fe8c3b2a631e37b6e97e0ae67ab54887/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2569,
67,
4156,
12,
87,
4672,
1323,
9138,
316,
272,
471,
7481,
316,
272,
30,
272,
273,
609,
12,
87,
10531,
87,
18,
4720,
2668,
32,
6134,
5717,
397,
609,
12,
87,
63,
87,
18,
4720,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2569,
67,
4156,
12,
87,
4672,
1323,
9138,
316,
272,
471,
7481,
316,
272,
30,
272,
273,
609,
12,
87,
10531,
87,
18,
4720,
2668,
32,
6134,
5717,
397,
609,
12,
87,
63,
87,
18,
4720,
2... |
width = nCols*deltax | width = maxWidth+(nCols-1)*deltax | def draw(self): colorNamePairs = self.colorNamePairs autoCP = isAuto(colorNamePairs) if autoCP: chart = getattr(colorNamePairs,'chart',getattr(colorNamePairs,'obj',None)) swatchMarker = None autoCP = Auto(obj=chart) n = chart._seriesCount chartTexts = self._getTexts(colorNamePairs) else: swatchMarker = getattr(self,'swatchMarker',None) if isAuto(swatchMarker): chart = getattr(swatchMarker,'chart',getattr(swatchMarker,'obj',None)) swatchMarker = Auto(obj=chart) n = len(colorNamePairs) dx = self.dx dy = self.dy alignment = self.alignment columnMaximum = self.columnMaximum deltax = self.deltax deltay = self.deltay dxTextSpace = self.dxTextSpace fontName = self.fontName fontSize = self.fontSize fillColor = self.fillColor strokeWidth = self.strokeWidth strokeColor = self.strokeColor leading = fontSize*1.2 yGap = self.yGap if not deltay: deltay = max(dy,leading)+self.autoYPadding ba = self.boxAnchor baw = ba not in ('nw','w','sw','autox') maxWidth = self._calculateMaxWidth(colorNamePairs) nCols = int((n+columnMaximum-1)/columnMaximum) xW = dx+dxTextSpace+self.autoXPadding variColumn = self.variColumn if variColumn: width = reduce(operator.add,maxWidth,0)+xW*nCols else: deltax = max(maxWidth+xW,deltax) width = nCols*deltax maxWidth = nCols*[maxWidth] | 3a4ff3393aecd009765ecab0c857910a70a941b7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3878/3a4ff3393aecd009765ecab0c857910a70a941b7/legends.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
2036,
461,
10409,
273,
365,
18,
3266,
461,
10409,
3656,
4258,
273,
27079,
12,
3266,
461,
10409,
13,
309,
3656,
4258,
30,
4980,
273,
3869,
12,
3266,
461,
10409,
1118... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
2036,
461,
10409,
273,
365,
18,
3266,
461,
10409,
3656,
4258,
273,
27079,
12,
3266,
461,
10409,
13,
309,
3656,
4258,
30,
4980,
273,
3869,
12,
3266,
461,
10409,
1118... |
(result,res_descr)=hlr_utils.empty_result(obj) (o_descr,d_descr)=hlr_utils.get_descr(obj) | (result, res_descr) = hlr_utils.empty_result(obj) o_descr = hlr_utils.get_descr(obj) | def tof_to_initial_wavelength_igs(obj,**kwargs): """ This function converts a primary axis of a SOM or SO from time-of-flight to initial_wavelength_igs. The time-of-flight axis for a SOM must be in units of microseconds. The primary axis of a SO is assumed to be in units of microseconds. A tuple of [tof, tof_err2] (assumed to be in units of microseconds) can be converted to [initial_wavelength_igs, initial_wavelength_igs_err2]. Parameters: ---------- -> obj is the SOM, SO or tuple to be converted -> kwargs is a list of key word arguments that the function accepts: lambda_f= a tuple containing the final wavelength and its associated error^2 time_zero= a tuple containing the time zero offset and its associated error^2 dist_source_sample= a tuple or list of tuples containing the source to sample distance information and its associated error^2 dist_sample_detector= a tuple or list of tuples containing the sample to detector distance information and its associated error^2 run_filter=<True or False> This determines if the filter on the negative wavelengths is run units= a string containing the expected units for this function. The default for this function is microseconds Return: ------ <- A SOM or SO with a primary axis in time-of-flight or a tuple converted to initial_wavelength_igs Exceptions: ---------- <- TypeError is raised if the incoming object is not a type the function recognizes <- RuntimeError is raised if the SOM x-axis units are not microseconds """ # import the helper functions import hlr_utils # set up for working through data (result,res_descr)=hlr_utils.empty_result(obj) (o_descr,d_descr)=hlr_utils.get_descr(obj) # Setup keyword arguments try: lambda_f = kwargs["lambda_f"] except KeyError: lambda_f = None try: time_zero = kwargs["time_zero"] except KeyError: time_zero = None try: dist_source_sample = kwargs["dist_source_sample"] except KeyError: dist_source_sample = None try: dist_sample_detector = kwargs["dist_sample_detector"] except KeyError: dist_sample_detector = None try: units = kwargs["units"] except KeyError: units = "microseconds" try: run_filter = kwargs["run_filter"] except KeyError: run_filter = True # Primary axis for transformation. If a SO is passed, the function, will # assume the axis for transformation is at the 0 position if o_descr == "SOM": axis = hlr_utils.hlr_1D_units(obj, units) else: axis = 0 result=hlr_utils.copy_som_attr(result,res_descr,obj,o_descr) if res_descr == "SOM": result = hlr_utils.hlr_force_units(result, "Angstroms", axis) result.setAxisLabel(axis, "wavelength") result.setYUnits("Counts/A") result.setYLabel("Intensity") else: pass # Where to get instrument information if dist_source_sample == None or dist_sample_detector == None: if o_descr == "SOM": try: obj.attr_list.instrument.get_primary() inst = obj.attr_list.instrument except RuntimeError: raise RuntimeError, "A detector was not provided!" else: if dist_source_sample == None and dist_sample_detector == None: raise RuntimeError, "If a SOM is not passed, the "\ +"source-sample and sample-detector distances must be "\ +"provided." elif dist_source_sample == None: raise RuntimeError, "If a SOM is not passed, the "\ +"source-sample distance must be provided." elif dist_sample_detector == None: raise RuntimeError, "If a SOM is not passed, the "\ +"sample-detector distance must be provided." else: raise RuntimeError, "If you get here, see Steve Miller for "\ +"your mug." else: pass if lambda_f != None: (l_descr,e_descr) = hlr_utils.get_descr(lambda_f) else: if o_descr == "SOM": try: som_l_f = obj.attr_list["Wavelength_final"] except KeyError: raise RuntimeError, "Please provide a final wavelength "\ +"parameter either via the function call or the SOM" else: raise RuntimeError, "You need to provide a final wavelength" if time_zero != None: (t_descr,e_descr) = hlr_utils.get_descr(time_zero) else: if o_descr == "SOM": try: obj.attr_list["Time_zero"] t_0 = obj.attr_list["Time_zero"][0] t_0_err2 = obj.attr_list["Time_zero"][1] except KeyError: raise RuntimeError, "Please provide a time-zero "\ +"parameter either via the function call or the SOM" else: t_0 = 0.0 t_0_err2 = 0.0 if dist_source_sample != None: (ls_descr,e_descr) = hlr_utils.get_descr(dist_source_sample) # Do nothing, go on else: pass if dist_sample_detector != None: (ld_descr,e_descr) = hlr_utils.get_descr(dist_sample_detector) # Do nothing, go on else: pass if o_descr == "SOM" and run_filter: length = len(obj[0]) filter = True elif o_descr == "SO" and run_filter: length = len(obj) filter = True else: filter = False # iterate through the values import axis_manip for i in range(hlr_utils.get_length(obj)): val = hlr_utils.get_value(obj,i,o_descr,"x",axis) err2 = hlr_utils.get_err2(obj,i,o_descr,"x",axis) map_so = hlr_utils.get_map_so(obj,None,i) if dist_source_sample == None: (L_s,L_s_err2) = hlr_utils.get_parameter("primary",map_so,inst) else: L_s = hlr_utils.get_value(dist_source_sample,i,ls_descr) L_s_err2 = hlr_utils.get_err2(dist_source_sample,i,ls_descr) if dist_sample_detector == None: (L_d,L_d_err2) = hlr_utils.get_parameter("secondary",map_so,inst) else: L_d = hlr_utils.get_value(dist_sample_detector,i,ld_descr) L_d_err2 = hlr_utils.get_err2(dist_sample_detector,i,ld_descr) if lambda_f != None: l_f = hlr_utils.get_value(lambda_f,i,t_descr) l_f_err2 = hlr_utils.get_err2(lambda_f,i,t_descr) else: l_f_tuple = hlr_utils.get_special(som_l_f, map_so) l_f = l_f_tuple[0] l_f_err2 = l_f_tuple[1] if time_zero != None: t_0 = hlr_utils.get_value(time_zero,i,t_descr) t_0_err2 = hlr_utils.get_err2(time_zero,i,t_descr) else: pass value=axis_manip.tof_to_initial_wavelength_igs(val, err2, l_f, l_f_err2, t_0, t_0_err2, L_s, L_s_err2, L_d, L_d_err2) # Remove all wavelengths < 0 if filter: index = 0 for val in value[0]: if val > 0: break index += 1 value[0].__delslice__(0,index) value[1].__delslice__(0,index) map_so.y.__delslice__(0,index) map_so.var_y.__delslice__(0,index) hlr_utils.result_insert(result,res_descr,value,map_so,"x",axis) return result | f2732e272bffc96d577287672dd8a0fe10605815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/f2732e272bffc96d577287672dd8a0fe10605815/hlr_tof_to_initial_wavelength_igs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
74,
67,
869,
67,
6769,
67,
91,
16775,
67,
360,
87,
12,
2603,
16,
636,
4333,
4672,
3536,
1220,
445,
7759,
279,
3354,
2654,
434,
279,
348,
1872,
578,
7460,
628,
813,
17,
792,
17,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
74,
67,
869,
67,
6769,
67,
91,
16775,
67,
360,
87,
12,
2603,
16,
636,
4333,
4672,
3536,
1220,
445,
7759,
279,
3354,
2654,
434,
279,
348,
1872,
578,
7460,
628,
813,
17,
792,
17,
... |
fn['upper-case']: 'UPPER' | fn['upper-case']: 'UPPER', fn.substring: 'SUBSTR', | def Literal(self, expr): if expr.literal.typeUri in self._noStringTypes: return "%s" % unicode(expr.literal) else: return "'%s'" % unicode(expr.literal) | ddd2842306c57d5b14c394931ef43cbb91123514 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5223/ddd2842306c57d5b14c394931ef43cbb91123514/emit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14392,
12,
2890,
16,
3065,
4672,
309,
3065,
18,
13107,
18,
723,
3006,
316,
365,
6315,
2135,
780,
2016,
30,
327,
2213,
87,
6,
225,
738,
5252,
12,
8638,
18,
13107,
13,
469,
30,
327,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14392,
12,
2890,
16,
3065,
4672,
309,
3065,
18,
13107,
18,
723,
3006,
316,
365,
6315,
2135,
780,
2016,
30,
327,
2213,
87,
6,
225,
738,
5252,
12,
8638,
18,
13107,
13,
469,
30,
327,
22... |
@staticmethod def _name_and_arguments(command): return command['object'].name_with_arguments(command["name"]) | def _usage_line(): return "Usage: %prog [options] command [command-options] [command-arguments]" | 521a0052c5c62f674706d7f453852d96e0b4e764 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/521a0052c5c62f674706d7f453852d96e0b4e764/multicommandtool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9167,
67,
1369,
13332,
327,
315,
5357,
30,
738,
14654,
306,
2116,
65,
1296,
306,
3076,
17,
2116,
65,
306,
3076,
17,
7099,
4279,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9167,
67,
1369,
13332,
327,
315,
5357,
30,
738,
14654,
306,
2116,
65,
1296,
306,
3076,
17,
2116,
65,
306,
3076,
17,
7099,
4279,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
binaries[arch][0][binary] = self.binaries[suite][arch][0][binary] | binaries[parch][0][binary] = self.binaries[suite][parch][0][binary] | def doop_source(self, pkg): """Apply a change to the testing distribution as requested by `pkg` | b8d4deefd1e15dc48987f2d10c01b6f060204f30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2784/b8d4deefd1e15dc48987f2d10c01b6f060204f30/britney.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
556,
67,
3168,
12,
2890,
16,
3475,
4672,
3536,
7001,
279,
2549,
358,
326,
7769,
7006,
487,
3764,
635,
1375,
10657,
68,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
556,
67,
3168,
12,
2890,
16,
3475,
4672,
3536,
7001,
279,
2549,
358,
326,
7769,
7006,
487,
3764,
635,
1375,
10657,
68,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self.ProfileComboBox.connect("changed", self.ProfileChanged) | self.ProfileHandler = self.ProfileComboBox.connect("changed", self.ProfileChangedAddTimeout) | def __init__(self, main, context): self.Context = context self.Main = main rightChild = gtk.VBox() rightChild.set_border_width(10) | 3ac61daed7b38b15dd56283f1f62118233306460 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7183/3ac61daed7b38b15dd56283f1f62118233306460/Pages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2774,
16,
819,
4672,
365,
18,
1042,
273,
819,
365,
18,
6376,
273,
2774,
2145,
1763,
273,
22718,
18,
58,
3514,
1435,
2145,
1763,
18,
542,
67,
8815,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2774,
16,
819,
4672,
365,
18,
1042,
273,
819,
365,
18,
6376,
273,
2774,
2145,
1763,
273,
22718,
18,
58,
3514,
1435,
2145,
1763,
18,
542,
67,
8815,
67,
... |
for i in xrange(1000): | for unused_i in xrange(1000): | def runtest(self): # may take about a minute or so for i in xrange(1000): self.runcmd(self.distcc() + _gcc + " -o testtmp.o -c testtmp.c") | c113ba17e90da226b1e0b4c65576f800ab939f6a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4521/c113ba17e90da226b1e0b4c65576f800ab939f6a/testdistcc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
3813,
12,
2890,
4672,
468,
2026,
4862,
2973,
279,
8044,
578,
1427,
364,
10197,
67,
77,
316,
12314,
12,
18088,
4672,
365,
18,
86,
551,
1264,
12,
2890,
18,
4413,
952,
1435,
397,
38... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
3813,
12,
2890,
4672,
468,
2026,
4862,
2973,
279,
8044,
578,
1427,
364,
10197,
67,
77,
316,
12314,
12,
18088,
4672,
365,
18,
86,
551,
1264,
12,
2890,
18,
4413,
952,
1435,
397,
38... |
currentindet = indent | currentindent = indent | def StructuredText(paragraphs, delimiter=re.compile(para_delim)): """ StructuredText accepts paragraphs, which is a list of lines to be parsed. StructuredText creates a structure which mimics the structure of the paragraphs. Structure => [paragraph,[sub-paragraphs]] """ currentlevel = 0 currentindent = 0 levels = {0:0} level = 0 # which header are we under struct = [] # the structure to be returned run = struct paragraphs = expandtabs(paragraphs) paragraphs = '%s%s%s' % ('\n\n', paragraphs, '\n\n') paragraphs = delimiter.split(paragraphs) paragraphs = filter(strip, paragraphs) if not paragraphs: return StructuredTextDocument() ind = [] # structure based on indention levels for paragraph in paragraphs: ind.append([indention(paragraph), paragraph]) currentindent = indention(paragraphs[0]) levels[0] = currentindent ############################################################# # updated # ############################################################# for indent,paragraph in ind : if indent == 0: level = level + 1 currentlevel = 0 currentindent = 0 levels = {0:0} struct.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel)) elif indent > currentindent: currentlevel = currentlevel + 1 currentindent = indent levels[currentlevel] = indent run = insert(struct,level,currentlevel) run.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel)) elif indent < currentindent: result = findlevel(levels,indent) if result > 0: currentlevel = result currentindent = indent if not level: struct.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel)) else: run = insert(struct,level,currentlevel) run.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel)) else: if insert(struct,level,currentlevel): run = insert(struct,level,currentlevel) else: run = struct currentindet = indent run.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel)) return StructuredTextDocument(struct) | 1880eb89d803f626014fe1c9609e6df12d5a4ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1880eb89d803f626014fe1c9609e6df12d5a4ed7/ST.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7362,
2862,
1528,
12,
22445,
87,
16,
5654,
33,
266,
18,
11100,
12,
25072,
67,
23822,
3719,
30,
3536,
7362,
2862,
1528,
8104,
24552,
16,
1492,
353,
279,
666,
434,
2362,
358,
506,
2707,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7362,
2862,
1528,
12,
22445,
87,
16,
5654,
33,
266,
18,
11100,
12,
25072,
67,
23822,
3719,
30,
3536,
7362,
2862,
1528,
8104,
24552,
16,
1492,
353,
279,
666,
434,
2362,
358,
506,
2707,
... |
return (status=True, shouldopen) | return dict(status=True, shouldopen=shouldopen) | def toggle_shouldopen(self, package): # Make sure the package exists try: pkg = model.Package.query.filter_by(name=package).one() except InvalidRequestError: return dict(status=False, message='Package %s does not exist' % package) pkg.shouldopen = not pkg.shouldopen try: session.flush() except sqlalchemy.exceptions.SQLError, e: # An error was generated return dict(status=False, message='Unable to modify PackageListing %s in %s' \ % (pkgList.id, pkgList.collection.id)) return (status=True, shouldopen) | f73d1743c065de5c8c6ac92394349f3fa4e606e0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9953/f73d1743c065de5c8c6ac92394349f3fa4e606e0/dispatcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10486,
67,
13139,
3190,
12,
2890,
16,
2181,
4672,
468,
4344,
3071,
326,
2181,
1704,
775,
30,
3475,
273,
938,
18,
2261,
18,
2271,
18,
2188,
67,
1637,
12,
529,
33,
5610,
2934,
476,
1435,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10486,
67,
13139,
3190,
12,
2890,
16,
2181,
4672,
468,
4344,
3071,
326,
2181,
1704,
775,
30,
3475,
273,
938,
18,
2261,
18,
2271,
18,
2188,
67,
1637,
12,
529,
33,
5610,
2934,
476,
1435,... |
if nm in [ 'alevel','olevel','zlevel']: | if nm in [ 'zlevel',]+e['general'].get('generic_levels','').split(): | def checkCMOR(fout,file,table,noerror=cmor.CMOR_CRITICAL,variable=None,from_bounds=None,other_tables=None,dodrs=True): req_glbl_att = ['title','Conventions','source','experiment','source','institution','project_id','table_id','realization',] opt_glbl_att = ['cmor_version','history','references','comment','parent_experiment'] nerr=0 nwarn=0 ncheck=0 IPCC_std_vars=[] IPCC_std_axes=[] tables=[table,] if other_tables is not None: for t in other_tables: if not t in tables and t is not None: tables.append(t) etables = [] for tbl in tables: manageLog(fout,VERBOSE, 'Reading table:',tbl) e=readTable(tbl) etables.append(e) Vars=e['variable'] Axes=e['axis'] extra_req = e['general'].get('required_global_attributes','').split() for ex in extra_req: if not ex in req_glbl_att: req_glbl_att.append(ex) for v in Vars.keys(): IPCC_std_vars.append(Vars[v].get('out_name',v)) for a in Axes.keys(): onm = Axes[a].get('out_name',a) if not onm in IPCC_std_axes: IPCC_std_axes.append(onm) ## if IPCC_std_axes[-1]=='lev' : ## IPCC_std_axes.pop(-1) ## IPCC_std_axes.append('eta') ## Axes[a]['out_name']='eta' ver = e['general'].get('cmor_version',2.0) ver = '%g' % float(ver) spver = ver.split('.') major = int(spver[0]) if major>1: req_glbl_att+=["contact",'experiment_id','physics_version','initialization_method','institute_id','institution','tracking_id','product','frequency','model_id','creation_date','frequency','modeling_realm'] else: opt_glbl_att+=["contact",'experiment_id','physics_version','initialization_method','institute_id','institution','tracking_id','product','frequency','model_id','forcing','creation_date','frequency','modeling_realm'] if isinstance(file,str): fnm=file file=cdms2.open(file) elif isinstance(file,cdms2.dataset.CdmsFile): fnm=str(file).split('file')[1].split(',')[0].strip()[1:-1] else: nerr+=manageLog(fout, noerror, 'You must pass a file name or cdms2 file object') if fnm.split("_")[-1]=="clim.nc": is_clim = True else: is_clim = False pthroot, shrt_fnm = os.path.split(fnm) if variable is None: manageLog(fout,VERBOSE, 'Checking file argument',IPCC_std_axes) manageLog(fout,VERBOSE, 'Checking path structure for path:',pthroot) manageLog(fout,VERBOSE, 'Checking file structure for file:',fnm) print >> fout, 'Checking the file starts with variable name' ok = False for v in IPCC_std_vars: n = len(v) if shrt_fnm[:n] == v and shrt_fnm[n]=='_': ok = True break if not ok: nerr+=manageLog(fout, noerror, ''+shrt_fnm+' does not start with standard %s variable name followed by _' % file.project_id) vf=v #Check the variable is actually in the file if not v in file.variables.keys(): nerr+=manageLog(fout,noerror,"Your file name says it contains variable",v,"but it is not in your file, your file contains:",file.variables.keys()) if hasattr(file,'cmor_version'): up = False rew = False ver = getattr(file,'cmor_version') if isinstance(ver,numpy.ndarray): ver = '%g' % float(ver[0]) spver = ver.split('.') fmajor = int(spver[0]) if len(spver)>1 : minor = int(spver[1]) if len(spver)>2: patch = int(spver[2]) else: patch = 0 else: minor=0 patch=0 if fmajor>cmor.CMOR_VERSION_MAJOR: up = True elif fmajor<cmor.CMOR_VERSION_MAJOR: rew=True else: # Major matches if minor>cmor.CMOR_VERSION_MINOR: up = True elif minor<cmor.CMOR_VERSION_MINOR: rew = True else: # minor matches if patch>cmor.CMOR_VERSION_PATCH: up = True elif patch<cmor.CMOR_VERSION_PATCH: rew = True ncheck+=1 if up: if fmajor==cmor.CMOR_VERSION_MAJOR: nwarn+=manageLog(fout,cmor.CMOR_WARNING,"You are using cmor version: %i.%i.%i, these files have been written with version: %i.%i.%i, you should upgrade your cmor" % (cmor.CMOR_VERSION_MAJOR,cmor.CMOR_VERSION_MINOR,cmor.CMOR_VERSION_PATCH,fmajor,minor,patch)) else: nerr+=manageLog(fout,noerror,"You are using cmor version: %i.%i.%i, these files have been written with version: %i.%i.%i, you need to upgrade cmor to check these files" % (cmor.CMOR_VERSION_MAJOR,cmor.CMOR_VERSION_MINOR,cmor.CMOR_VERSION_PATCH,fmajor,minor,patch)) ncheck+=1 if rew: nwarn+=manageLog(fout,cmor.CMOR_WARNING,"You are using cmor version: %i.%i.%i, these files have been written with version: %i.%i.%i, you should consider rewriting these files" % (cmor.CMOR_VERSION_MAJOR,cmor.CMOR_VERSION_MINOR,cmor.CMOR_VERSION_PATCH,fmajor,minor,patch)) ## 32bit systems only if os.uname()[-1].find("64")==-1: sz=os.path.getsize(fnm) manageLog(fout,VERBOSE, 'Checking file size (32bit systems only):',sz) if sz>2**31: if major>1: ncheck+=1 nwarn+=1 ec =cmor.CMOR_WARNING else: ec=noerror manageLog(fout,ec, 'File size too large',sz,' (>2Gb)!') #nerr+=manageLog(fout, noerror, 'file size too large (>2Gb)!') manageLog(fout,VERBOSE, 'Checking that file contains required global attributes') for att in req_glbl_att: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) if not hasattr(file,att) and not att in shrt_vals: i = req_glbl_att.index(att) if i==0 or req_glbl_att[i-1] not in shrt_vals: nerr+=manageLog(fout, noerror, 'File must have global attribute: '+att) else: pr = req_gbl_att[i-1] expt = getattr(file,"experiment","") shrt = shrt_vals[long_vals.index(expt)] if shrt == pr: nerr+=manageLog(fout, noerror, 'File must have global attribute: '+att) fval=getattr(file,att,'') if att=='experiment_id': ok = False for e in etables: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) for lv in shrt_vals: if fval==lv or (lv[-4:] =='XXXX' and fval[:-4]==lv[:-4]) or (lv[-4:] =='DDHH' and fval[:-10]==lv[:-10]): ok = True break if not ok: nerr+=manageLog(fout, noerror, 'experiment_id file attribute must be one of : %s, you have: %s' % (str(shrt_vals), fval) ) elif att=='experiment': ok = False for e in etables: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) for lv in long_vals: if fval==lv or (lv[-4:] =='XXXX' and fval[:-4]==lv[:-4]) or (lv[-4:] =='DDHH' and fval[:-10]==lv[:-10]): ok = True break if not ok: nerr+=manageLog(fout, noerror, 'experiment file attribute must be one of : %s, you have: %s' % (str(long_vals), fval) ) elif att=='parent_experiment_id': if fval == getattr(file,"experiment_id",""): nerr+=manageLog(fout,noerror,"parent_experiment_id and experiment_id cannot be the same you have %s for both" % fval) ok = False for e in etables: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) shrt_vals.append("N/A") for lv in shrt_vals: if fval==lv or (lv[-4:] =='XXXX' and fval[:-4]==lv[:-4]) or (lv[-4:] =='DDHH' and fval[:-10]==lv[:-10]): ok = True break if not ok: nerr+=manageLog(fout, noerror, 'parent_experiment_id file attribute must be one of : %s, you have: %s' % (str(shrt_vals), fval) ) elif att == 'forcing': sp = fval.split(',') forcings=e['general'].get("forcings") for vl in sp: if not vl.strip() in forcings: nerr+=manageLog(fout,noerror,"file attribute forcing must be a comma separated list with values in: %s, yours is: %s (offending value: %s)" % (forcings,fval,vl.strip())) elif att == 'frequency': if not fval in ['yr','mon','day','6hr','3hr','subhr','fx','monClim']: nerr+=manageLog(fout,noerror, 'frequency must be one of:','yr','mon','day','6hr','3hr','subhr','fx','monClim') elif att in ['realization']: if isinstance(fval,numpy.ndarray): if len(fval)>1: nerr+=manageLog(fout, noerror, 'realization attribute must be an integer') fval=fval[0] if not isinstance(fval,(int,numpy.int,numpy.int32)): nerr+=manageLog(fout, noerror, 'realization attribute must be an integer') elif att in ['table_id']: manageLog(fout,VERBOSE, '\ttable_id is: ', fval) elif att == "creation_date": # checks that it matches: YYYY-MM-DDTHH:MM:SSZ fmt = "%Y-%m-%dT%H:%M:%SZ" try: t =time.strptime(fval,fmt) except: nerr+=manageLog(fout, noerror, 'Creation Date must be in format: %s yours is: %s' % (fmt,fval)) elif att == "branch_time": try: myval=float(fval) except: nerr+=manageLog(fout, noerror, 'branch_time must be convertible to float, you have %s' % (fval)) if getattr(file,"parent_experiment_id","").strip()=="N/A": if float(fval)!=0.: nerr+=manageLog(fout, noerror, 'if global attribute parent_experiment_id is N/A then branch_time must be 0., you have %s' % (fval)) elif att == "project_id": if e['general'].get("project_id") != fval: nerr+=manageLog(fout, noerror, 'project_id must be %s' % (e['general'].get("project_id"))) else: val=e['general'].get(att,None) if isinstance(fval,str) : fval=fval.strip().lower() if isinstance(val,str) : val=val.strip().lower() if val is not None: if isinstance(fval,str): res=fval.find(val) if res==-1: res=False else: res=True else: res=fval==val manageLog(fout,VERBOSE, '**************',att,val,fval) if not res: nerr+=manageLog(fout, noerror, 'attribute '+att+' must be set to: -'+val+'- +'+fval+'+ '+str(res)) for att in opt_glbl_att: ncheck+=1 if not hasattr(file,att): nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\tIt is often helpful to define the global attribute: ',att) for att in file.attributes.keys(): ncheck+=1 if not att in req_glbl_att and not att in opt_glbl_att: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\tYou have global attribute: %s which is neither required nor optional ' % att) if major>=2: # more file structure there try: tmp_tbl_nm = getattr(file,'table_id') tbl_id = tmp_tbl_nm.split()[1] tbl_date= tmp_tbl_nm.split('(')[1].split(')')[0].strip() try: tbl_md5 = tmp_tbl_nm.split('(')[1].split(')')[1].strip() if len(tbl_md5)==32: ncheck+=1 #ok it looks like we got an md5 tag if tbl_md5!=e['general']['actual_md5']: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\tYour file claims it has been generated with a table whose md5 was %s, but you are sending a table with md5: %s to the checker ' % (tbl_md5,e['general']['actual_md5'])) ncheck+=1 pmd5s=ctrl_md5s.get(file.project_id,{}) if pmd5s=={}: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\tCould not obtain any control md5s for any table for project %s ' % (file.project_id)) else: ncheck+=1 tmd5s=pmd5s.get(tbl_id,{}) if tmd5s=={}: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\tCould not obtain any control md5s for table %s for project %s ' % (tbl_id,file.project_id)) else: ncheck+=1 ctrlmd5=tmd5s.get(tbl_date,None) if ctrlmd5 is None: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\tCould not obtain control md5s for table %s for project %s dated on %s, valid tables dates are: ' % (tbl_id,file.project_id,tbl_date),sorted(tmd5s.keys())) else: ncheck+=1 if ctrlmd5!=tbl_md5: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\tYour file claims it has been ran through table id %s, dated %s for project_id %s, with an md5 of: %s, but our control files indicate the md5 should be: %s' % (tbl_id,tbl_date,file.project_id,tbl_md5,ctrlmd5)) except Exception,err: #no md5 stored in file pass ttbl_id = e['general'].get("table_id").split()[1] ttbl_date = e['general'].get("table_date").strip() if tbl_date!=ttbl_date: nwarn+=1 ncheck+=1 manageLog(fout,cmor.CMOR_WARNING,"File says table date was %s, but the table you passed to the checker is dated from: %s" %( tbl_date,ttbl_date)) if tbl_id!=ttbl_id: nerr+=manageLog(fout, noerror, 'your file indicates a table id of %s while your table id is %s' % (tbl_id,ttbl_id)) except: manageLog(fout,VERBOSE,"File says table is %s, this is not a correct name, correct format is something like: Table 3hr (24 May 2010) af8b1d3d63376942a55d779d0fb9f504" % (tmp_tbl_nm)) sp = shrt_fnm.split(v)[1].split("_") t = file[v].getTime() if t is not None: n=6 t=t.clone() else: n=4 if is_clim: n+=1 expt = getattr(file,"experiment","") try: shrt = shrt_vals[long_vals.index(expt)] except: #Ok we must be in one of the XXXX or DDHH cases... for i in range(len(long_vals)): if long_vals[i][:-4]==expt[:-4]: shrt=shrt_vals[i][:-4]+expt[-4:] break if long_vals[i][:-10]==expt[:-10]: shrt=shrt_vals[i][:-10]+expt[-10:] break if shrt=="": n-=1 spoffset=-1 else: spoffset=0 print len(sp) if len(sp)<n: nerr+=manageLog(fout, noerror, 'your file name does not seem to match the profile: varid_tableid_modelid_exptid_rid[iid][pid][_startdate-enddate][_suffix][_clim].nc') if sp[1]!=tbl_id: nerr+=manageLog(fout, noerror, 'your file name indicates a table id of %s while your table id should be %s' % (sp[1],tbl_id)) if sp[2]!=getattr(file,'model_id'): fmodid = hyphenize(getattr(file,'model_id')) if sp[2]!=fmodid: nerr+=manageLog(fout, noerror, 'your file name indicates model_id is: %s but your file says it is: %s' % (sp[2],getattr(file,'model_id'))) if shrt!="": if shrt!=sp[3]: nerr+=manageLog(fout, noerror, 'your file name indicates exp_id is: %s but your file says it should be: %s' % (sp[3],shrt)) real = sp[4+spoffset] rsp=real.split("p") if hasattr(file,"physics_version"): if len(rsp)==1: nerr+=manageLog(fout, noerror, 'your file name does not indicate physics_version but your file says it should be: %s' % (file.physics_version)) elif int(rsp[0].split('i')[0][1:])!=int(file.physics_version): nerr+=manageLog(fout, noerror, 'your file name indicates physics_version is: %s but your file says it should be: %s' % (rsp[1],file.physics_version)) elif len(rsp)!=1: nerr+=manageLog(fout, noerror, 'your file name indicates physics_version to be %s but your file says it has not physics: %s' % (rsp[1])) real=rsp[0] rsp=real.split("i") if hasattr(file,"initialization_method"): if len(rsp)==1: nerr+=manageLog(fout, noerror, 'your file name does not indicate initialization_method but your file says it should be: %s' % (file.initialization_method)) elif int(rsp[1])!=int(file.initialization_method): nerr+=manageLog(fout, noerror, 'your file name indicates initialization_method is: %s but your file says it should be: %s' % (rsp[1],file.initialization_method)) elif len(rsp)!=1: nerr+=manageLog(fout, noerror, 'your file name indicates initialization_method to be %s but your file says it has not initialization_method: %s' % (rsp[1])) real=rsp[0] if int(real[1:])!=int(getattr(file,'realization')): nerr+=manageLog(fout, noerror, 'your file name indicates realization is: %s but your file says it is: %i' % (sp[3][3:],int(getattr(file,'realization')))) ## skip the following if it has no time if t is not None: # here we check the clim b4 going further checking into date clim_att = getattr(t,'climatology',None) if clim_att is None: has_clim = False else: has_clim = True if is_clim!=has_clim: if is_clim: nerr+=manageLog(fout, noerror, 'your file name indicates climatology, but the time axis does not have the climatology attribute') else: nerr+=manageLog(fout, noerror, 'your file name does not indicates climatology (_clim.nc), but the time axis has the climatology attribute') if is_clim: tmp = file(t.climatology,slice(0,1)) ft0 = tmp[0][0] tmp = file(t.climatology,slice(-1,None)) ft1 = tmp[-1][1] else: ft0=t[0] ft1=t[-1] ft0= cdtime.reltime(ft0,t.units).tocomp(t.getCalendar()) ft1= cdtime.reltime(ft1,t.units).tocomp(t.getCalendar()) dates = sp[5+spoffset].split("-") # now determines the frequency units = t.units.split("since")[0].strip() interval = float(e['general'].get("approx_interval")) interval = genutil.udunits(interval,units).to("s").value # determine what the frequency drname should be if (interval<2500.) : frequency = "subhr" elif (interval<15000.): frequency = "3hr" elif (interval<30000.): frequency = "6hr" elif (interval<100000.): frequency = "day" elif (interval<3.E6): frequency = "mon" else: frequency = "yr" if (interval == 0.): strcpy(tmp,"fx") #Now checks the frequecny attribute matches the one we just decided if file.frequency[-4:]=='Clim': frequency=frequency+"Clim" if file.frequency!=frequency: nerr+=manageLog(fout, noerror, 'your file indicates a frequency of "%s" but the approximate_interval suggests it should be: "%s"' % (file.frequency,frequency)) try: yr0=int(dates[0][:4]) except: nerr+=manageLog(fout, noerror, 'could not convert the years section start date iun your file',dates[0][:4]) frequency = 'yr' if interval<29.E6: frequency='mon' if len(dates[0])<6: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years only when the approximate interval says it should have months') try: m0 = int(dates[0][4:6]) except: nerr+=manageLog(fout, noerror, 'could not convert the months section start date iun your file',dates[0][4:6]) else: m0=ft0.month if interval < 2E6: frequency='mon' if len(dates[0])<8: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years and months only when the approximate interval says it should have days') try: d0 = int(dates[0][6:8]) except: nerr+=manageLog(fout, noerror, 'could not convert the day section start date iun your file',dates[0][6:8]) else: d0=ft0.day if interval < 86000: if len(dates[0])<12: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days and hours only when the approximate interval says it should have minutes') try: h0 = int(dates[0][8:10]) except: nerr+=manageLog(fout, noerror, 'could not convert the hours section start date iun your file',dates[0][8:10]) try: mn0 = int(dates[0][10:12]) except: nerr+=manageLog(fout, noerror, 'could not convert the miuntes section start date iun your file',dates[0][10:12]) else: h0= ft0.hour mn0=ft0.minute if interval < 3000: if len(dates[0])<14: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days, hours and minutes only when the approximate interval says it should have seconds') try: s0 = int(dates[0][12:14]) except: nerr+=manageLog(fout, noerror, 'could not convert the seconds section start date iun your file',dates[0][12:14]) else: s0=ft0.second t0 = cdtime.comptime(yr0,m0,d0,h0,mn0,s0) try: yr1=int(dates[1][:4]) except: nerr+=manageLog(fout, noerror, 'could not convert the years section end date iun your file',dates[1][:4]) if interval<29.E6: if len(dates[1])<6: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years only when the approximate interval says it should have months') try: m1 = int(dates[1][4:6]) except: nerr+=manageLog(fout, noerror, 'could not convert the months section end date iun your file',dates[1][4:6]) else: m1=ft1.month if interval < 2.E6: if len(dates[1])<8: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years and months only when the approximate interval says it should have days') try: d1 = int(dates[1][6:8]) except: nerr+=manageLog(fout, noerror, 'could not convert the days section end date iun your file',dates[1][6:8]) else: d1=ft1.day if interval < 90000: if len(dates[1])<10: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months and days only when the approximate interval says it should have hours') try: h1 = int(dates[1][8:10]) except: nerr+=manageLog(fout, noerror, 'could not convert the hours section end date iun your file',dates[1][8:10]) else: h1=ft1.hour if interval < 4000: if len(dates[1])<12: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days and hours only when the approximate interval says it should have minutes') try: mn1 = int(dates[1][10:12]) except: nerr+=manageLog(fout, noerror, 'could not convert the minutes section end date iun your file',dates[1][10:12]) else: mn1=ft1.minute if interval < 100: if len(dates[1])<14: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days, hours and minutes only when the approximate interval says it should have seconds') try: s1 = int(dates[1][12:14]) except: nerr+=manageLog(fout, noerror, 'could not convert the seconds section end date iun your file',dates[1][12:14]) else: s1=ft1.second t1 = cdtime.comptime(yr1,m1,d1,h1,mn1,s1) if (ft0.year!=t0.year) or (ft0.month!=t0.month) or (ft0.day!=t0.day): nerr+=manageLog(fout, noerror, 'your file name indicates a start time of %i-%i-%i but the actual value in the file says: %i-%i-%i' % (t0.year,t0.month,t0.day,ft0.year,ft0.month,ft0.day)) if (ft1.year!=t1.year) or (ft1.month!=t1.month) or (ft1.day!=t1.day): nerr+=manageLog(fout, noerror, 'your file name indicates an end time of %i-%i-%i but the actual value in the file says: %i-%i-%i' % (t1.year,t1.month,t1.day,ft1.year,ft1.month,ft1.day)) manageLog(fout,VERBOSE, 'Checking that file contains only 1 variable') vars=file.listvariable() ## removes dims and other complementary vars # First bounds ## manageLog(fout,VERBOSE, vars) vars2=file.listvariable() vars3=[] vars4=[] for v in vars2: ## manageLog(fout,VERBOSE, v) V=file[v] b=getattr(V,'bounds',None) if b is not None: vars.pop(vars.index(b)) b=getattr(V,'ancillary_variables',None) if b is not None: for sp in b.split(): if sp.trip() in vars: vars.pop(sp.strip()) for ax in V.getAxisList(): b=getattr(ax,'bounds',None) if b is not None: if b in vars: vars.pop(vars.index(b)) Ab=file[b] # recovers associated bounds with axis f=getattr(Ab,'formula_terms',None) if f is not None: ## figures out the names of formula_terms sp=f.split(':') ## manageLog(fout,VERBOSE, sp) for t in sp: ## manageLog(fout,VERBOSE, 't is:',t) t=t.split()[-1] ## manageLog(fout,VERBOSE, 'Now it is:',t) sp2=f.split(t+':')[1].split()[0] if sp2 in vars: vars3.append(vars.pop(vars.index(sp2))) vars4.append(True) f=getattr(ax,'formula_terms',None) if f is not None: ## figures out the names of formula_terms sp=f.split(':') ## manageLog(fout,VERBOSE, sp) for t in sp: ## manageLog(fout,VERBOSE, 't is:',t) t=t.split()[-1] ## manageLog(fout,VERBOSE, 'Now it is:',t) sp2=f.split(t+':')[1].split()[0] if sp2 in vars: vars3.append(vars.pop(vars.index(sp2))) vars4.append(False) coords=getattr(V,'coordinates',None) if coords is not None: coords = coords.split() for c in coords: if c in vars: vars.pop(vars.index(c)) if hasattr(V,"grid_mapping"): if V.grid_mapping in vars: vars.pop(vars.index(V.grid_mapping)) manageLog(fout,VERBOSE, "Grid_mapping attribute found, we cannot check these files yet") ncheck+=1 nwarn+=1 return nwarn,ncheck,nerr t = V.getTime() if t is not None and hasattr(t,"climatology"): c = t.climatology if c in vars: vars.pop(vars.index(c)) if len(vars)!=1: nerr+=manageLog(fout, noerror, 'file must contain only 1 variable, you have: '+str(len(vars))+':'+str(vars)) var=vars[0] if major>=2 and dodrs: #Now checks for the DRS file structure prj_id = file.project_id.strip().replace(" ","_") prod = file.product inst = file.institute_id if inst == 'not specified' : inst = "INSTITUTE_ID" mod = file.model_id exp = file.experiment_id #by pass no sht for now... noff=0 fq = file.frequency realm = file.modeling_realm r = str(int(file.realization)) if hasattr(file,"initialization_method"): r+="i"+str(int(file.initialization_method)) if hasattr(file,"physics_version"): r+="p"+str(int(file.physics_version)) path = os.path.dirname(fnm).split("/") nerr += drs_check_pos(1,path,fout,noerror,'r%s' % r, 'realization') nerr += drs_check_pos(2,path,fout,noerror,var, 'variable') nerr += drs_check_pos(3,path,fout,noerror,realm, 'modeling realm') nerr += drs_check_pos(4,path,fout,noerror,fq, 'frequency') if exp == file.experiment: noff=1 else: nerr += drs_check_pos(5,path,fout,noerror,exp, 'experiment id') nerr += drs_check_pos(6-noff,path,fout,noerror,hyphenize(mod), 'model id') nerr += drs_check_pos(7-noff,path,fout,noerror,inst, 'insitution id') nerr += drs_check_pos(8-noff,path,fout,noerror,prod, 'product') nerr += drs_check_pos(9-noff,path,fout,noerror,prj_id, 'project id') fb=False if variable is not None: var=variable fb=from_bounds manageLog(fout,VERBOSE, 'Ok user asked to check the following variable:',variable,'with from bounds =',fb) manageLog(fout,VERBOSE, 'Checking variable name is %s compliant' % file.project_id) if not var in IPCC_std_vars: if var in Vars.keys(): nerr+=manageLog(fout, noerror, var+' is not valid, did you mean :'+Vars[var]['out_name']+' ?') else: nerr+=manageLog(fout, noerror, 'Variable name :'+var+' is not %s compliant' % file.project_id) if variable is None: manageLog(fout,VERBOSE, 'Checking that variable name in file matches file indications') if not var == vf: nerr+=manageLog(fout, noerror, 'File indicates it stores variable:'+vf+' but actually '+var+' is stored in it') V=file[var] axes=V.getAxisList() hasLat=0 hasLon=0 hasTime=0 hasLevel=0 ax_dict_name=[] for ax in axes: manageLog(fout,VERBOSE, 'Checking axis name is valid for:',ax.id,'on var:',V.id) if not ax.id in IPCC_std_axes: if ax.id in Axes.keys(): if major <2: ncheck+=1 nwarn+=1 nerr+=manageLog(fout,cmor.CMOR_WARNING, '\t\t'+ax.id+' is not preferred. We suggest you rename it:'+Axes[ax.id]['out_name']) else: manageLog(fout,noerror, '\t\tAxis name '+ax.id+' is not valid. We require you rename it:'+Axes[ax.id]['out_name']) elif (fb == False) or (fb == True and V.rank()!=2): nerr+=manageLog(fout, noerror, 'axis id: '+ax.id+' is not a valid IPCC name') if ax.isLatitude(): hasLat=1 if ax.isLongitude(): hasLon=1 if ax.isTime(): hasTime=1 if ax.isLevel(): hasLevel=1 old_ordering=0 o=V.getOrder(ids=1) if old_ordering: manageLog(fout,VERBOSE, 'Checking dimensions order') if hasTime: manageLog(fout,VERBOSE, '\tChecking time position') if o[0]=='t': o=o[1:] else: nerr+=manageLog(fout, noerror, 'time must be first dimension your ordering is:'+o) manageLog(fout,VERBOSE, '\tChecking none tzxy dims position') sp=o.split('(') if len(sp)>1: if o[0]!='(': nerr+=manageLog(fout, noerror, 'none zyx dimensions must come right after time dimension, you have:'+o) o=o.split(')')[-1] manageLog(fout,VERBOSE, '\tChecking level position') if hasLevel: if o[0]=='z': o=o[1:] else: nerr+=manageLog(fout, noerror, 'level must be ordered after time your order is:'+o) manageLog(fout,VERBOSE, '\tChecking latitude position') if hasLat: if o[0]=='y': o=o[1:] else: nerr+=manageLog(fout, noerror, 'latitude must be ordered after time and level your order is:'+o) manageLog(fout,VERBOSE, '\tChecking longitude position') if hasLon: if o[0]=='x': o=o[1:] else: nerr+=manageLog(fout, noerror, 'longitude must be ordered after time, level and latitude your order is:'+o) g=None if hasLat and hasLon: manageLog(fout,VERBOSE, 'Checking grid') g=V.getGrid() if not isinstance(g,cdms2.grid.AbstractRectGrid): nerr+=manageLog(fout, noerror, 'lat/lon variable ('+var+') must have Rectilinear grids') axes_nmes=Vars[var].get('dimensions',None) if axes_nmes is not None: manageLog(fout,VERBOSE, 'Checking rest of things on axes') axes_nmes=axes_nmes[::-1] axes_nmes_for_ordering=Vars[var]['dimensions'][::-1] coord=getattr(V,'coordinates',None) for nm in axes_nmes: req_Att=['standard_name','units'] anm = nm if nm in [ 'alevel','olevel','zlevel']: gnm=nm manageLog(fout,VERBOSE, '\tChecking special case %s, i.e' % (nm),'') tmpax=V.getLevel() print>>fout, tmpax.id,tmpax.standard_name for x in Axes.keys(): tmp=Axes[x].get('standard_name',None) if tmp is not None: tmp=tmp.strip() if tmp is not None and tmp==tmpax.standard_name: nm=x Nm=Axes[x]['out_name'] anm=x req_Att.append('formula') req_Att.append('formula_terms') if getattr(tmpax,"formula","")==Axes[x]['formula']: break axes_nmes_for_ordering[axes_nmes_for_ordering.index(gnm)]=nm elif not nm in V.getAxisIds(): try: Nm=Axes[nm]['out_name'] except: nerr+=manageLog(fout, noerror, 'with axis: '+nm+' not found for variable: '+var, noerror) else: Nm=nm if major>1: if Axes[anm].get("must_have_bounds","no")=="yes": req_Att.append("bounds") if Axes[anm].get("axis",None) is not None: req_Att.append("axis") else: req_Att.append("bounds") if nm == 'time' and is_clim: req_Att.pop(req_Att.index("bounds")) manageLog(fout,VERBOSE, '\tChecking',Nm) axindx=V.getAxisIndex(Nm) val=Axes[nm].get('value',None) if val is not None: #singleton dimension ? manageLog(fout,VERBOSE, '\t\tSingleton dimension') if val is None: nerr+=manageLog(fout, noerror, 'cannot retrieve needed axis:'+Nm) else: val=float(val) if axindx!=-1: nerr+=manageLog(fout, noerror, 'singleton dimension '+Nm+' must be defined via coordinates attributes on variable '+var+' not as an axis') else: manageLog(fout,VERBOSE, '\t\tChecking coordinates attribute exists on '+var) aval=getattr(V,'coordinates',None) if aval is None: nerr+=manageLog(fout, noerror, 'singleton dimension must be defined via coordinates attribute') manageLog(fout,VERBOSE, '\t\tChecking coordinates attribute matches for '+var) if not Nm in aval.split(): nerr+=manageLog(fout, noerror, 'coordinates atrtribute on '+var+' should be '+Nm+' it is '+aval) ax=file[Nm] mn,mx=Axes[nm].get('valid_min',None), Axes[nm].get('valid_max',None) manageLog(fout,VERBOSE, '\t\tChecks for value') if ax != val: manageLog(fout,VERBOSE, '\t\t\tNot matching, checking if valid range is defined in table') if mn is None and mx is None: nerr+=manageLog(fout, noerror, 'singleton dimension value for '+Nm+' must be '+str(val)) manageLog(fout,VERBOSE, '\t\t\tChecking if value is within range defined in table') if mn is not None: if mx is not None: if not( float(mn)<ax<float(mx)): nerr+=manageLog(fout, noerror, 'invalid value for singleton dimension '+Nm+': '+str(ax)+' must be between '+mn+' and '+mx) elif ax<float(mn): nerr+=manageLog(fout, noerror, 'invalid min for singleton dimension '+Nm+': '+str(ax)+' must be greater than '+mn) elif ax>float(mx): nerr+=manageLog(fout, noerror, 'invalid max for singleton dimension '+Nm+': '+str(ax)+' must be less than '+mx) manageLog(fout,VERBOSE, '\t\tChecking for bounds information') b=getattr(ax,'bounds',None) bv=Axes[nm].get('bounds_values',None) if bv is not None: manageLog(fout,VERBOSE, '\t\t\tBounds information defined in table, checking vs file') bv=bv.split() bv=float(bv[0]),float(bv[1]) if b is not None: manageLog(fout,VERBOSE, '\t\t\tBounds information defined in file, checking if matches') abv=file[b] ncheck+=1 if abv[0]!=bv[0] or abv[1]!=bv[1]: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\t\t\tbounds_value for singleton dimension '+Nm+': '+str(abv)+' do not match requested bounds:'+str(bv)) else: nerr+=manageLog(fout, noerror, 'singleton dimension: '+Nm+' bounds required') else: ncheck+=1 if b is not None: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\t\t\tSingleton dimension: '+Nm+' bounds should not be included') axes_nmes_for_ordering.pop(0) continue # singleton dimension checked no need to continue further if axindx==-1: nerr+=manageLog(fout, noerror, 'Variable '+var+' should have an axis called '+Axes[Nm]) ax=V.getAxis(axindx) manageLog(fout,VERBOSE, '\t\tChecking that dimension order is positioned:',axes_nmes_for_ordering.index(nm)+1,axes_nmes) if axindx!=axes_nmes_for_ordering.index(nm): nerr+=manageLog(fout, noerror, 'in ordering for dimension '+nm+' position is: '+str(axindx)+' but it should be: '+str(axes_nmes_for_ordering.index(nm))) if ('cell_bounds' in Axes[nm].get('ignored',[])) or ('cell_bounds' in Axes[nm].get('forbidden',[])) or ('cell_bounds' in Axes[nm].get('optional',[])): req_Att.pop(req_Att.index('bounds')) if 'units' in Axes[nm].get('ignored',[]) or 'units' in Axes[nm].get('optional',[]): try: req_Att.pop(req_Att.index('units')) except: pass ## Ok here we're trying to do the region thing, i.e coordinate attribute exist docoord=False if coord is not None: for c in coord.split(): nax=file[c] if ax.id in nax.getAxisIds(): oldax=ax ax=nax docoord=True manageLog(fout,VERBOSE, '\t\tChecking if required attributes are set:','') for r in req_Att: manageLog(fout,VERBOSE, r,'') val=getattr(ax,r,None) if val is None: print >>fout nerr+=manageLog(fout, noerror, 'attribute '+r+' is required for axis '+ax.id) if r!='units': good_val=Axes[nm].get(r,None) if good_val is not None: if val!=good_val: nerr+=manageLog(fout, noerror, 'axis attribute '+r+' should be: '+str(good_val)+' but is:'+str(val)) if r=='formula_terms': print 'Formula:',Axes[anm]['formula'],val print >>fout if not 'units' in Axes[nm].get('ignored',[]): if not 'units' in Axes[nm].get('optional',[]) or ('units' in Axes[nm].get('optional',[]) and hasattr(ax,'units')): if not ax.isTime(): manageLog(fout,VERBOSE, '\t\tChecking units',ax.units) if major<2: u1=genutil.udunits(1,ax.units) try: u2=u1.to(Axes[nm]['units']) if u2.value!=1: nerr+=manageLog(fout, noerror, 'units:'+ax.units+' are not compatible with required:'+Axes[nm]['units']) except: nerr+=manageLog(fout, noerror, 'units:'+ax.units+' are not compatible with required:'+Axes[nm]['units']) else: if ax.units != Axes[nm]['units']: nerr+=manageLog(fout, noerror, 'units: '+ax.units+' are not the required units:'+Axes[nm]['units']) else: manageLog(fout,VERBOSE, '\t\tChecking units',ax.units) if major>1: if ax.units.lower().find("days since")==-1: nerr+=manageLog(fout,noerror,'Time units must be in "days since", you have:',ax.units) bnds = ax.getBounds() if bnds is not None: for i in range(len(ax)): if ax[i]!=(bnds[i][0]+bnds[i][1])/2.: nerr+=manageLog(fout,noerror,"Time values are not average of time bounds") try: u=cdtime.reltime(1,ax.units) except: nerr+=manageLog(fout, noerror, 'invalid time units:'+ax.units+', should be in the form: "'+Axes[nm]['units']+'"') try: c=ax.calendar except: c='none' if not c in ["gregorian","standard", "proleptic_gregorian","noleap","365_day","360_day","julian","none","non_standard"]: nerr+=manageLog(fout,noerror,"calendar must be one of [","gregorian","standard", "proleptic_gregorian","noleap","365_day","360_day","julian","none","non_standard ] yours is",c) if c=='365_day': c=cdtime.NoLeapCalendar else: c=ax.getCalendar() manageLog(fout,VERBOSE, '\t\tView First and Last times:\t',ax.asComponentTime(c)[0],'\t',ax.asComponentTime(c)[-1]) tmpbnds=ax.getBounds() if tmpbnds is not None: manageLog(fout,VERBOSE, '\t\tView Bounds for first time:\t',cdtime.reltime(tmpbnds[0,0],ax.units).tocomp(c),'\t',cdtime.reltime(tmpbnds[0,1],ax.units).tocomp(c)) manageLog(fout,VERBOSE, '\t\tView Bounds for last time:\t',cdtime.reltime(tmpbnds[-1,0],ax.units).tocomp(c),'\t',cdtime.reltime(tmpbnds[-1,1],ax.units).tocomp(c)) else: manageLog(fout,VERBOSE,'\t\tNo Bounds for time') tp=Axes[nm].get('type','double') manageLog(fout,VERBOSE, '\t\tChecking axis is type',tp) if tp == 'double' : tp='d' elif tp == 'real' : tp='f' elif tp == 'character' : tp='c' elif tp == 'integer' : tp='l' else: nerr+=manageLog(fout, noerror, 'encountered unknown type:'+tp) if ax.typecode()!=tp: nerr+=manageLog(fout, noerror, 'required typecode for '+Nm+' should be '+tp+' not '+ax.typecode()) if ax.isLongitude(): manageLog(fout,VERBOSE, '\t\tChecking for axis attribute') a=getattr(ax,'axis',None) if a is None: nerr+=manageLog(fout, noerror, 'longitude axis must have associated axis attribute') if a!='X': nerr+=manageLog(fout, noerror, 'longitude axis must have associated axis attribute set to X not: '+a) manageLog(fout,VERBOSE, '\t\tChecking name') if not ax.id in ['lon','longitude']: nerr+=manageLog(fout, noerror, 'longitude axis name must be longitude or lon (prefered) not: '+ax.id) | 29d36713a64eb1da95dcb8b6a704941a7c7f0d53 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9170/29d36713a64eb1da95dcb8b6a704941a7c7f0d53/check_CMOR_compliant.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
9611,
916,
12,
617,
322,
16,
768,
16,
2121,
16,
2135,
1636,
33,
7670,
280,
18,
9611,
916,
67,
5093,
21377,
16,
6105,
33,
7036,
16,
2080,
67,
10576,
33,
7036,
16,
3011,
67,
9373,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
9611,
916,
12,
617,
322,
16,
768,
16,
2121,
16,
2135,
1636,
33,
7670,
280,
18,
9611,
916,
67,
5093,
21377,
16,
6105,
33,
7036,
16,
2080,
67,
10576,
33,
7036,
16,
3011,
67,
9373,... |
sta = np.zeros(len(a), dtype='float64') lta = np.zeros(len(a), dtype='float64') for i in range(Nlta + Nsta + 1, m): | sta = np.zeros(m, dtype='float64') lta = np.zeros(m, dtype='float64') for i in xrange(m): | def delayedStaLta(a, Nsta, Nlta): """ Delayed STA/LTA, (see Withers et al. 1998 p. 97) @type a: Numpy ndarray @param a: Seismic Trace @type Nsta: Int @param Nsta: Length of short time average window in samples @type Nlta: Int @param Nlta: Length of long time average window in samples @rtype: Numpy ndarray @return: Charactristic function of delayed STA/LTA """ m = len(a) # # compute the short time average (STA) and long time average (LTA) # don't start for STA at Nsta because it's muted later anyway sta = np.zeros(len(a), dtype='float64') lta = np.zeros(len(a), dtype='float64') for i in range(Nlta + Nsta + 1, m): sta[i] = (a[i] ** 2 + a[i - Nsta] ** 2) / Nsta + sta[i - 1] lta[i] = (a[i - Nsta - 1] ** 2 + a[i - Nsta - Nlta - 1] ** 2) / \ Nlta + lta[i - 1] sta[0:Nlta + Nsta + 50] = 0 return sta / lta | ea4c7ece41544c44ddf36d8239db27ef9e2868d1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10470/ea4c7ece41544c44ddf36d8239db27ef9e2868d1/trigger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15278,
510,
69,
48,
2351,
12,
69,
16,
423,
334,
69,
16,
423,
80,
2351,
4672,
3536,
20165,
329,
2347,
37,
19,
48,
9833,
16,
261,
5946,
3423,
414,
3393,
524,
18,
23673,
28,
293,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15278,
510,
69,
48,
2351,
12,
69,
16,
423,
334,
69,
16,
423,
80,
2351,
4672,
3536,
20165,
329,
2347,
37,
19,
48,
9833,
16,
261,
5946,
3423,
414,
3393,
524,
18,
23673,
28,
293,
18,
... |
'debut_actors' : '<tr><td colspan="2" valign="top"><h4 style="color: | 'debut_actors' : '<tr><td.*?><h2[^>]*>Acteurs</h2>', | def __init__(self): self.__baseURL = 'http://www.allocine.fr' self.__basePath = '/film/fichefilm_gen_cfilm' self.__castPath = '/film/casting_gen_cfilm' self.__searchURL= 'http://www.allocine.fr/recherche/?motcle=%s&f=3&rub=1' self.__movieURL = self.__baseURL + self.__basePath self.__castURL = self.__baseURL + self.__castPath | 6b5ef6b3ec5b50dd95604f8f1bd8e5f3e50cf894 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1698/6b5ef6b3ec5b50dd95604f8f1bd8e5f3e50cf894/fr.allocine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
16186,
1969,
1785,
225,
202,
33,
296,
2505,
2207,
5591,
18,
9853,
558,
18,
4840,
11,
365,
16186,
27605,
273,
1173,
7540,
81,
19,
74,
335,
580,
754... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
16186,
1969,
1785,
225,
202,
33,
296,
2505,
2207,
5591,
18,
9853,
558,
18,
4840,
11,
365,
16186,
27605,
273,
1173,
7540,
81,
19,
74,
335,
580,
754... |
"""Formats a dictionary in a nice way | """Format a dictionary in a nice way | def prettyDict(aDict, entrySepStr = "\n", keyValSepStr = ": "): """Formats a dictionary in a nice way Inputs: aDict: the dictionary to pretty-print entrySepStr: string separating each dictionary entry keyValSepStr: string separating key and value for each entry Returns a string containing the pretty-printed dictionary """ sortedKeys = aDict.keys() sortedKeys.sort() eltList = [] for aKey in sortedKeys: eltList.append(str(aKey) + keyValSepStr + str(aDict[aKey])) return entrySepStr.join(eltList) | a5c12743960cc44ddb0aa0f21361c8697521f18c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6354/a5c12743960cc44ddb0aa0f21361c8697521f18c/StringUtil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7517,
5014,
12,
69,
5014,
16,
1241,
5097,
1585,
273,
1548,
82,
3113,
498,
3053,
5097,
1585,
273,
6398,
315,
4672,
3536,
1630,
279,
3880,
316,
279,
13752,
4031,
225,
24472,
30,
279,
5014,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7517,
5014,
12,
69,
5014,
16,
1241,
5097,
1585,
273,
1548,
82,
3113,
498,
3053,
5097,
1585,
273,
6398,
315,
4672,
3536,
1630,
279,
3880,
316,
279,
13752,
4031,
225,
24472,
30,
279,
5014,... |
print "SAIU DO VENTO" | def evtHit(self, entry): #Function that controls the event when the airplane hit something #print "INTO " + entry.getIntoNodePath().getName() #print "FROM " + entry.getFromNodePath().getName() #print "PARENT " + entry.getIntoNodePath().getParent().getName() | 5e9a1d19a32ed2d24e7ed4f8184ae8a0f209640a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4878/5e9a1d19a32ed2d24e7ed4f8184ae8a0f209640a/Gaivota.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6324,
13616,
12,
2890,
16,
1241,
4672,
468,
2083,
716,
11022,
326,
871,
1347,
326,
23350,
21314,
6800,
5943,
468,
1188,
315,
3217,
51,
315,
397,
1241,
18,
588,
5952,
907,
743,
7675,
1799... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6324,
13616,
12,
2890,
16,
1241,
4672,
468,
2083,
716,
11022,
326,
871,
1347,
326,
23350,
21314,
6800,
5943,
468,
1188,
315,
3217,
51,
315,
397,
1241,
18,
588,
5952,
907,
743,
7675,
1799... | |
return os.listdir(os.path.join(basedir.get(), dir)) | d = os.path.join(basedir.get(), dir) if os.path.exists(d): return os.listdir(d) else: return None | def __remotes_from_dir(dir): return os.listdir(os.path.join(basedir.get(), dir)) | 98330c2962a26759c110ff91bf347c0652a3df23 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12366/98330c2962a26759c110ff91bf347c0652a3df23/git.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2764,
6366,
67,
2080,
67,
1214,
12,
1214,
4672,
302,
273,
1140,
18,
803,
18,
5701,
12,
31722,
18,
588,
9334,
1577,
13,
309,
1140,
18,
803,
18,
1808,
12,
72,
4672,
327,
1140,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2764,
6366,
67,
2080,
67,
1214,
12,
1214,
4672,
302,
273,
1140,
18,
803,
18,
5701,
12,
31722,
18,
588,
9334,
1577,
13,
309,
1140,
18,
803,
18,
1808,
12,
72,
4672,
327,
1140,
18... |
if self._tofill: for item in self._tofill: self._canvas.itemconfigure(item, fill=self._color) self._items.append(item) | def fill(self, flag): """ Call fill(1) before drawing the shape you want to fill, and fill(0) when done. | 70a17faf4e4e8896faec18608fcc2098b0932d58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/70a17faf4e4e8896faec18608fcc2098b0932d58/turtle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
12,
2890,
16,
2982,
4672,
3536,
3049,
3636,
12,
21,
13,
1865,
16327,
326,
2179,
1846,
2545,
358,
3636,
16,
471,
3636,
12,
20,
13,
1347,
2731,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
12,
2890,
16,
2982,
4672,
3536,
3049,
3636,
12,
21,
13,
1865,
16327,
326,
2179,
1846,
2545,
358,
3636,
16,
471,
3636,
12,
20,
13,
1347,
2731,
18,
2,
-100,
-100,
-100,
-100,
-100,... | |
result.write('From: ' + config['NAME'] + ' <' + config['MAIL'] + '>\n') result.write('Sender: ' + config['MAIL'] + '\n\n') | result.write('From: ' + config['NAME'] + ' <' + config['MAIL'] + '>\n\n') | def generate_checkgroups(config, passphrase=None, serial=None): """List the groups of the hierarchy.""" while serial not in range(0,100): try: print 'If it is your first checkgroups for today, leave it blank (default is 1).' print 'Otherwise, increment this revision number by one.' serial = int(raw_input('Revision to use (1-99): ')) print except: serial = 1 serial = '%02d' % serial file_checkgroups = 'checkgroups-' + str(SECONDS) result = file(file_checkgroups + '.txt', 'wb') result.write('X-Signed-Headers: Subject,Control,Message-ID,Date,From,Sender\n') result.write('Subject: cmsg checkgroups ' + config['CHECKGROUPS_SCOPE'] + ' #' + serial_time(SECONDS) + serial + '\n') result.write('Control: checkgroups ' + config['CHECKGROUPS_SCOPE'] + ' #' + serial_time(SECONDS) + serial + '\n') message_id = '<checkgroups-' + str(SECONDS) + '@' + config['HOST'] + '>' result.write('Message-ID: ' + message_id + '\n') result.write('Date: ' + pretty_time(SECONDS) + '\n') result.write('From: ' + config['NAME'] + ' <' + config['MAIL'] + '>\n') result.write('Sender: ' + config['MAIL'] + '\n\n') for line in file(config['CHECKGROUPS_FILE'], 'r'): result.write(line.rstrip() + '\n') result.close() sign_message(config, file_checkgroups, config['ADMIN_GROUP'], message_id, 'checkgroups', passphrase) | b7a92e7a475b4249a82eb52e04a2c59fc090dcdf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5987/b7a92e7a475b4249a82eb52e04a2c59fc090dcdf/signcontrol.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
1893,
4650,
12,
1425,
16,
15244,
33,
7036,
16,
2734,
33,
7036,
4672,
3536,
682,
326,
3252,
434,
326,
9360,
12123,
1323,
2734,
486,
316,
1048,
12,
20,
16,
6625,
4672,
775,
30,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
1893,
4650,
12,
1425,
16,
15244,
33,
7036,
16,
2734,
33,
7036,
4672,
3536,
682,
326,
3252,
434,
326,
9360,
12123,
1323,
2734,
486,
316,
1048,
12,
20,
16,
6625,
4672,
775,
30,... |
return rvdeclared def writeResultDecl(f, type, varname): | def writeResultDecl(f, type): | def writeArgumentUnboxing(f, i, name, type, haveCcx, optional, rvdeclared): # f - file to write to # i - int or None - Indicates the source jsval. If i is an int, the source # jsval is argv[i]; otherwise it is *vp. But if Python i >= C++ argc, # which can only happen if optional is True, the argument is missing; # use JSVAL_NULL as the source jsval instead. # name - str - name of the native C++ variable to create. # type - xpidl.{Interface,Native,Builtin} - IDL type of argument # optional - bool - True if the parameter is optional. # rvdeclared - bool - False if no |nsresult rv| has been declared earlier. isSetter = (i is None) if isSetter: argPtr = "vp" argVal = "*vp" elif optional: argPtr = '! /* TODO - optional parameter of this type not supported */' argVal = "(%d < argc ? argv[%d] : JSVAL_NULL)" % (i, i) else: argVal = "argv[%d]" % i argPtr = "&" + argVal params = { 'name': name, 'argVal': argVal, 'argPtr': argPtr } typeName = getBuiltinOrNativeTypeName(type) if typeName is not None: template = argumentUnboxingTemplates.get(typeName) if template is not None: if optional and ("${argPtr}" in template): warn("Optional parameters of type %s are not supported." % type.name) f.write(substitute(template, params)) return rvdeclared # else fall through; the type isn't supported yet. elif isInterfaceType(type): if type.name == 'nsIVariant': # Totally custom. assert haveCcx template = ( " nsCOMPtr<nsIVariant> ${name}(already_AddRefed<nsIVariant>(" "XPCVariant::newVariant(ccx, ${argVal})));\n" " if (!${name})\n" " return JS_FALSE;\n") f.write(substitute(template, params)) return rvdeclared elif type.name == 'nsIAtom': # Should have special atomizing behavior. Fall through. pass else: if not rvdeclared: f.write(" nsresult rv;\n"); f.write(" nsCOMPtr<%s> %s;\n" % (type.name, name)) f.write(" rv = xpc_qsUnwrapArg<%s>(" "cx, %s, getter_AddRefs(%s));\n" % (type.name, argVal, name)) f.write(" if (NS_FAILED(rv)) {\n") if isSetter: f.write(" xpc_qsThrowBadSetterValue(" "cx, rv, JSVAL_TO_OBJECT(*tvr.addr()), id);\n") elif haveCcx: f.write(" xpc_qsThrowBadArgWithCcx(ccx, rv, %d);\n" % i) else: f.write(" xpc_qsThrowBadArg(cx, rv, vp, %d);\n" % i) f.write(" return JS_FALSE;\n" " }\n") return True warn("Unable to unbox argument of type %s" % type.name) if i is None: src = '*vp' else: src = 'argv[%d]' % i f.write(" !; // TODO - Unbox argument %s = %s\n" % (name, src)) return rvdeclared | 6f558ca9eddc5be4f0e7a99f5054cd7d74be2155 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11102/6f558ca9eddc5be4f0e7a99f5054cd7d74be2155/qsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
1379,
984,
2147,
310,
12,
74,
16,
277,
16,
508,
16,
618,
16,
1240,
39,
71,
92,
16,
3129,
16,
5633,
16571,
4672,
468,
284,
300,
585,
358,
1045,
358,
468,
277,
300,
509,
578,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
1379,
984,
2147,
310,
12,
74,
16,
277,
16,
508,
16,
618,
16,
1240,
39,
71,
92,
16,
3129,
16,
5633,
16571,
4672,
468,
284,
300,
585,
358,
1045,
358,
468,
277,
300,
509,
578,
5... |
last_row = (num_tables - diff) * [num_answers] + diff * [-1] | last_row = diff * [num_answers] + (num_tables - diff) * [-1] | def __table_geometry(num_questions, num_answers, num_tables): """Returns the geometry of the answer tables. The result is a tuple (tables, question_numbers) where: - 'tables' is a bidimensional list such that table[row][column] represents the number of answers for the question in 'row' / 'column'. If 0, the question does not exist. If -1, a first row of infobits should be placed there; if -2, a second row. - 'question_numbers' is a list with the number of question of the first row of each table. The first question is numbered as 1. """ rows_per_table = num_questions // num_tables tables = rows_per_table * [num_tables * [num_answers]] question_numbers = [] for i in range(0, num_tables): question_numbers.append(1 + i * rows_per_table) diff = num_questions - num_tables * rows_per_table if diff > 0: last_row = (num_tables - diff) * [num_answers] + diff * [-1] tables.append(last_row) acc = 0 for i in range(1, num_tables): if i <= diff: acc += 1 question_numbers[i] += acc tables.append((num_tables - diff) * [-1] + diff * [-2]) tables.append((num_tables - diff) * [-2] + diff * [0]) return tables, question_numbers | 6854403125127435aad9a934ec69279200ddc635 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12267/6854403125127435aad9a934ec69279200ddc635/exammaker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2121,
67,
14330,
12,
2107,
67,
9758,
16,
818,
67,
22340,
16,
818,
67,
9373,
4672,
3536,
1356,
326,
5316,
434,
326,
5803,
4606,
18,
225,
1021,
563,
353,
279,
3193,
261,
9373,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2121,
67,
14330,
12,
2107,
67,
9758,
16,
818,
67,
22340,
16,
818,
67,
9373,
4672,
3536,
1356,
326,
5316,
434,
326,
5803,
4606,
18,
225,
1021,
563,
353,
279,
3193,
261,
9373,
16,
... |
def bt_cb_is_save(bt, fs, *args, **kwargs): | def bt_cb_is_save(bt, fs): | def bt_cb_is_save(bt, fs, *args, **kwargs): print "Toggle is save" fs.is_save_set(not fs.is_save_get()) | ef127faaba8fc06ebbb7bd48a4185405cdfc6a4e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12343/ef127faaba8fc06ebbb7bd48a4185405cdfc6a4e/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10921,
67,
7358,
67,
291,
67,
5688,
12,
23602,
16,
2662,
4672,
1172,
315,
17986,
353,
1923,
6,
2662,
18,
291,
67,
5688,
67,
542,
12,
902,
2662,
18,
291,
67,
5688,
67,
588,
10756,
2,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10921,
67,
7358,
67,
291,
67,
5688,
12,
23602,
16,
2662,
4672,
1172,
315,
17986,
353,
1923,
6,
2662,
18,
291,
67,
5688,
67,
542,
12,
902,
2662,
18,
291,
67,
5688,
67,
588,
10756,
2,
... |
res = self.__getPhysicalFileAccessUrl(pfns,storageElementName) | res = self.__getPhysicalFileAccessUrl(pfnDict.keys(),storageElementName) | def getReplicaAccessUrl(self,lfn,storageElementName): """ Obtain the metadata for physical files | 5323c175ee7e5efc3b41475c7560468752e93cff /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12864/5323c175ee7e5efc3b41475c7560468752e93cff/ReplicaManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5561,
6996,
1862,
1489,
12,
2890,
16,
80,
4293,
16,
5697,
30584,
4672,
3536,
24850,
326,
1982,
364,
11640,
1390,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5561,
6996,
1862,
1489,
12,
2890,
16,
80,
4293,
16,
5697,
30584,
4672,
3536,
24850,
326,
1982,
364,
11640,
1390,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
axis=0, ddof=1).""", DeprecationWarning) | axis=0, ddof=0), scipy.stats.var(a, bias=False) by var(x, axis=0, ddof=1).""", DeprecationWarning) | def var(a, axis=0, bias=False): """ | 6233dbcb4fec3b57079edd4776107117c42432ea /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12971/6233dbcb4fec3b57079edd4776107117c42432ea/stats.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
569,
12,
69,
16,
2654,
33,
20,
16,
12005,
33,
8381,
4672,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
569,
12,
69,
16,
2654,
33,
20,
16,
12005,
33,
8381,
4672,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self.assertEqual(check_line('def intersection(list1, list2):', REPORTER), None) | self.assertEqual(check_line('def intersection(list1, list2):'), None) | self.assertEqual(check_line('def intersection(list1, list2):', REPORTER), None) | 455beb61539a40eb35dfd637d0cd015a7cbec7a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/928/455beb61539a40eb35dfd637d0cd015a7cbec7a0/test_format.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
365,
18,
11231,
5812,
12,
1893,
67,
1369,
2668,
536,
7619,
12,
1098,
21,
16,
666,
22,
4672,
2187,
2438,
52,
916,
2560,
3631,
599,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
365,
18,
11231,
5812,
12,
1893,
67,
1369,
2668,
536,
7619,
12,
1098,
21,
16,
666,
22,
4672,
2187,
2438,
52,
916,
2560,
3631,
599,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
def _list_files(self): ignore_dirs = ['dist', '.git'] ignore_files = ['.gitignore', 'MANIFEST', '*.pyc', '*~', '*.bak'] return list_files(self.config.source_dir, ignore_dirs, ignore_files) class BuildPackager(Packager): def get_files(self): files = self.config.bundle.get_files() if not files: logging.error('No files found, fixing the MANIFEST.') self.fix_manifest() files = self.config.bundle.get_files() return files def _check_manifest(self): missing_files = [] allfiles = self._list_files() for path in allfiles: if path not in self.config.bundle.manifest: missing_files.append(path) return missing_files def fix_manifest(self): manifest = self.config.bundle.manifest for path in self._check_manifest(): manifest.append(path) f = open(os.path.join(self.config.source_dir, "MANIFEST"), "wb") for line in manifest: f.write(line + "\n") class XOPackager(BuildPackager): def __init__(self, config): BuildPackager.__init__(self, config) | class XOPackager(Packager): def __init__(self, builder): Packager.__init__(self, builder.config) self.builder = builder | def _list_files(self): ignore_dirs = ['dist', '.git'] ignore_files = ['.gitignore', 'MANIFEST', '*.pyc', '*~', '*.bak'] return list_files(self.config.source_dir, ignore_dirs, ignore_files) | aecba37572ec3baab7f1e846b19e09650600ccc2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3114/aecba37572ec3baab7f1e846b19e09650600ccc2/bundlebuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1098,
67,
2354,
12,
2890,
4672,
2305,
67,
8291,
273,
10228,
4413,
2187,
2418,
6845,
3546,
2305,
67,
2354,
273,
10228,
18,
6845,
6185,
2187,
296,
9560,
30050,
2187,
19962,
2074,
71,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1098,
67,
2354,
12,
2890,
4672,
2305,
67,
8291,
273,
10228,
4413,
2187,
2418,
6845,
3546,
2305,
67,
2354,
273,
10228,
18,
6845,
6185,
2187,
296,
9560,
30050,
2187,
19962,
2074,
71,
... |
signal.alarm(20) | signal_alarm(20) | def setUp(self): signal.alarm(20) # Kill deadlocks after 20 seconds. self.port_seed = 0 self.test_files = [] | 3d83d2bcdfd4a178974be1629cb35b7c208f29ba /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/3d83d2bcdfd4a178974be1629cb35b7c208f29ba/test_socketserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
4277,
67,
20681,
12,
3462,
13,
225,
468,
20520,
8363,
23581,
1839,
4200,
3974,
18,
365,
18,
655,
67,
12407,
273,
374,
365,
18,
3813,
67,
2354,
273,
5378,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
4277,
67,
20681,
12,
3462,
13,
225,
468,
20520,
8363,
23581,
1839,
4200,
3974,
18,
365,
18,
655,
67,
12407,
273,
374,
365,
18,
3813,
67,
2354,
273,
5378,
2,
-100... |
digest_auth_handler = DigestAuthHandler() | def __init__(self, digest_auth_handler, *args, **kwargs): self.digest_auth_handler = digest_auth_handler BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, *args, **kwargs) | def handle_request(self, request_handler): """Performs digest authentication on the given HTTP request handler. Returns True if authentication was successful, False otherwise. | 5ca1d2f6c2e5d52b6cfc2a93de4179cc0779e42a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/5ca1d2f6c2e5d52b6cfc2a93de4179cc0779e42a/test_urllib2_localnet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
2293,
12,
2890,
16,
590,
67,
4176,
4672,
3536,
9409,
5403,
5107,
603,
326,
864,
2239,
590,
1838,
18,
225,
2860,
1053,
309,
5107,
1703,
6873,
16,
1083,
3541,
18,
2,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
2293,
12,
2890,
16,
590,
67,
4176,
4672,
3536,
9409,
5403,
5107,
603,
326,
864,
2239,
590,
1838,
18,
225,
2860,
1053,
309,
5107,
1703,
6873,
16,
1083,
3541,
18,
2,
-100,
-100... |
else: | continue | def _dorewriteloop(connection, sessionDict, rules): for p, r in rules: if callable(p): if p(connection, sessionDict): _dorewriteloop(connection, sessionDict, r) else: m = _getcompiled(p).search(connection.uri) if m is not None: if Configuration.rewriteEnableHooks: key=(p, r) sessionDict['rewriteRules'][key] = {} sessionDict['rewriteCurrentRule'] = key try: DEBUG(REWRITE, 'executing PreRewrite hook') PreRewrite(connection, sessionDict) DEBUG(REWRITE, 'survived PreRewrite hook') except: logException() _dorewrite(m, connection, sessionDict, r, key) if Configuration.rewriteEnableHooks: try: DEBUG(REWRITE, 'executing PostRewrite hook') PostRewrite(connection, sessionDict) DEBUG(REWRITE, 'survived PostRewrite hook') except: logException() try: del sessionDict['rewriteCurrentRule'] except KeyError: pass if not Configuration.rewriteApplyAll: break | 4b4173bf9fcfcb4f9d8cfb79af60b388349f63d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2304/4b4173bf9fcfcb4f9d8cfb79af60b388349f63d9/rewrite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
72,
479,
5363,
24214,
556,
12,
4071,
16,
1339,
5014,
16,
2931,
4672,
364,
293,
16,
436,
316,
2931,
30,
309,
4140,
12,
84,
4672,
309,
293,
12,
4071,
16,
1339,
5014,
4672,
389,
72... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
72,
479,
5363,
24214,
556,
12,
4071,
16,
1339,
5014,
16,
2931,
4672,
364,
293,
16,
436,
316,
2931,
30,
309,
4140,
12,
84,
4672,
309,
293,
12,
4071,
16,
1339,
5014,
4672,
389,
72... |
should_create=True): | should_create=True, should_use_urlopen=True): | def test_scrape_bug_status_and_mark_as_closed(self, mock_urlopen, project_name='Mercurial', should_create=True): if Project.objects.filter(name=project_name): roundup_project = Project.objects.get(name=project_name) else: roundup_project = Project.create_dummy(name=project_name) | c9f5f3597fe299ece35e515d0bac6b05a67b0edf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11976/c9f5f3597fe299ece35e515d0bac6b05a67b0edf/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1017,
25360,
67,
925,
67,
2327,
67,
464,
67,
3355,
67,
345,
67,
12204,
12,
2890,
16,
5416,
67,
295,
18589,
16,
1984,
67,
529,
2218,
8478,
1397,
649,
2187,
1410,
67,
2640,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1017,
25360,
67,
925,
67,
2327,
67,
464,
67,
3355,
67,
345,
67,
12204,
12,
2890,
16,
5416,
67,
295,
18589,
16,
1984,
67,
529,
2218,
8478,
1397,
649,
2187,
1410,
67,
2640,
3... |
for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ | for myFile in fnmatch.filter(filesOmega,\ | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.exists(wikiFilename) and maxCount < 15: sys.stdout.write("File %s already exists.\n"%\ os.path.split(wikiFilename)[1]) wikiFilename=wikiFilename+".wiki" maxCount=maxCount+1 # #Create the wikipage object etc # wikiPage=wiki(wikiFilename) # # Create top two trigger params tables # cTable=wikiPage.wikiTable(2,9) cTable.data=[ ["Trigger Type", "Rank", "FAR", "SNR", "IFOS(Coinc)", "Instruments(Active)", "Coincidence Time (s)", "Total Mass (mSol)", "Chirp Mass (mSol)" ], ["%s"%(wikiCoinc.type), "%s"%(wikiCoinc.rank), "%s"%(wikiCoinc.far), "%s"%(wikiCoinc.snr), "%s"%(wikiCoinc.ifos), "%s"%(wikiCoinc.instruments), "%s"%(wikiCoinc.time), "%s"%(wikiCoinc.mass), "%s"%(wikiCoinc.mchirp) ] ] pTable=wikiPage.wikiTable(len(wikiCoinc.sngls_in_coinc())+1,7) pTable.data[0]=[ "IFO", "GPS Time(s)", "SNR", "CHISQR", "Mass 1", "Mass 2", "Chirp Mass" ] for row,cSngl in enumerate(wikiCoinc.sngls_in_coinc()): pTable.data[row+1]=[ "%s"%(cSngl.ifo), "%s"%(cSngl.time), "%s"%(cSngl.snr), "%s"%(cSngl.chisqr), "%s"%(cSngl.mass1), "%s"%(cSngl.mass2), "%s"%(cSngl.mchirp) ] #Write the tables into the Wiki object wikiPage.putText("Coincident Trigger Event Information: %s\n"\ %(stfu_pipe.gpsTimeToReadableDate(wikiCoinc.time))) wikiPage.insertTable(cTable) wikiPage.putText("Corresponding Coincident Single IFO Trigger Information\n") wikiPage.insertTable(pTable) #Generate a table of contents to appear after candidate params table wikiPage.tableOfContents(3) #Begin including each checklist item as section with subsections wikiPage.section("Follow-up Checklist") #Put each checklist item wikiPage.subsection("Checklist Summary") wikiPage.subsubsection("Does this candidate pass this checklist?") wikiPage.subsubsection("Answer") wikiPage.subsubsection("Relevant Information and Comments") wikiPage.insertHR() # #First real checklist item wikiPage.subsection("#0 False Alarm Probability") wikiPage.subsubsection("Question") wikiPage.putText("What is the false alarm rate associated with this candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") farTable=wikiPage.wikiTable(2,1) farTable.setTableStyle("background-color: yellow; text-align center;") farTable.data[0][0]="False Alarm Rate" farTable.data[1][0]="%s"%(wikiCoinc.far) wikiPage.insertTable(farTable) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#1 Data Quality Flags") wikiPage.subsubsection("Question") wikiPage.putText("Can the data quality flags coincident with this candidate be safely disregarded?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPath=os.path.split(wikiFilename)[0] dqFileList=wikiFileFinder.get_findFlags() if len(dqFileList) != 1: sys.stdout.write("Warning: DQ flags data product import problem.\n") print "Found %i files."%len(dqFileList) for mf in dqFileList: print mf for myFile in dqFileList: wikiPage.putText("%s\n"%(file(myFile).read())) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#2 Veto Investigations") wikiPage.subsubsection("Question") wikiPage.putText("Does the candidate survive the veto investigations performed at its time?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") vetoFileList=wikiFileFinder.get_findVetos() if len(vetoFileList) != 1: sys.stdout.write("Warning: Veto flags data product import problem.\n") for myFile in vetoFileList:print myFile for myFile in vetoFileList: wikiPage.putText("%s\n"%(file(myFile).read())) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#3 IFO Status") wikiPage.subsubsection("Question") wikiPage.putText("Are the interferometers operating normally with a reasonable level of sensitivity around the time of the candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") #Add link to Daily Stats if wikiCoinc.time <= endOfS5: statsLink=wikiPage.makeExternalLink("http://blue.ligo-wa.caltech.edu/scirun/S5/DailyStatistics/",\ "S5 Daily Stats Page") else: statsLink="This should be a link to S6 Daily Stats!\n" wikiPage.putText(statsLink) #Link figures of merit #Get link for all members of wikiCoinc wikiPage.putText("Figures of Merit\n") if wikiCoinc.time > endOfS5: fomLinks=dict() elems=0 for wikiSngl in wikiCoinc.sngls: if not(wikiSngl.ifo.upper().rstrip().lstrip() == 'V1'): fomLinks[wikiSngl.ifo]=stfu_pipe.getFOMLinks(wikiCoinc.time,wikiSngl.ifo) elems=elems+len(fomLinks[wikiSngl.ifo]) else: for myLabel,myLink,myThumb in stfu_pipe.getFOMLinks(wikiCoinc.time,wikiSngl.ifo): wikiPage.putText("%s\n"%(wikiPage.makeExternalLink(myLink,myLabel))) cols=4 rows=(elems/3)+1 fTable=wikiPage.wikiTable(rows,cols) fTable.data[0]=["IFO,Shift","FOM1","FOM2","FOM3"] currentIndex=0 for myIFOKey in fomLinks.keys(): for label,link,thumb in fomLinks[myIFOKey]: myRow=currentIndex/int(3)+1 myCol=currentIndex%int(3)+1 fTable.data[myRow][0]=label thumbURL=thumb fTable.data[myRow][myCol]="%s"%(wikiPage.linkedRemoteImage(thumb,link)) currentIndex=currentIndex+1 wikiPage.insertTable(fTable) else: wikiPage.putText("Can not automatically fetch S5 FOM links.") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#4 Candidate Appearance") wikiPage.subsubsection("Question") wikiPage.putText("Do the Qscan figures show what we would expect for a gravitational-wave event?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") imageDict=dict() indexDict=dict() thumbDict=dict() for sngl in wikiCoinc.sngls: frametype,channelName=stfu_pipe.figure_out_type(sngl.time,sngl.ifo,'hoft') indexDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_hoft_frame(),\ "*/%s/*/%s/*index.html"%(frametype,sngl.time)) imageDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_hoft_frame(),\ "*%s*_%s_16.00_spectrogram_whitened.png"\ %(sngl.time,channelName)) thumbDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_hoft_frame(),\ "*%s*_%s_16.00_spectrogram_whitened?thumb.png"\ %(sngl.time,channelName)) # #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("GW data channel scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >= 1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >= 1 if enoughImage and enoughIndex: wikiPage.insertQscanTable(imageDict,\ thumbDict,\ indexDict) else: sys.stdout.write("Warning: Candidate appearance plot import problem.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#5 Seismic Plots") wikiPage.subsubsection("Question") wikiPage.putText("Is the seismic activity insignificant around the time of the candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") imageDict=dict() indexDict=dict() thumbDict=dict() zValueDict=dict() imageDictAQ=dict() indexDictAQ=dict() thumbDictAQ=dict() zValueDictAQ=dict() # for sngl in wikiCoinc.sngls_in_coinc(): indexDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*index.html"%(sngl.ifo,sngl.time)) imageDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*SEI*_512.00_spectrogram_whitened.png"%\ (sngl.ifo,sngl.time)) thumbDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*SEI*_512.00_spectrogram_whitened?thumb.png"%\ (sngl.ifo,sngl.time)) #Search for corresponding Omega summary.txt file zValueFiles=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)) zValueDict[sngl.ifo]=list() if (len(zValueFiles) > 0): for zFile in zValueFiles: zValueDict[sngl.ifo].extend(wikiFileFinder.__readSummary__(zFile)) #Reparse only keeping SEI channels tmpList=list() for chan in zValueDict[sngl.ifo]: if "SEI" in chan[0]: tmpList.append(chan) zValueDict[sngl.ifo]=tmpList else: sys.stdout.write("Omega scan summary file not for for %s. ...skipping...\n"%sngl.ifo) #Search for analyzeQscan files #/L1-analyseQscan_L1_932797512_687_seis_rds_L1_SEI-ETMX_X_z_scat-unspecified-gpstime.png timeString=str(float(sngl.time)).replace(".","_") zValueFiles=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*_%s_%s_*.txt"%(sngl.ifo,timeString)) indexDictAQ[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*_%s_%s_*.html"%(sngl.ifo,timeString)) thumbDictAQ[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*%s-*_%s_*_SEI*_z_scat-unspecified-gpstime_thumb.png"\ %(sngl.ifo,timeString)) imageDictAQ[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*%s-*_%s_*_SEI*_z_scat-unspecified-gpstime.png"\ %(sngl.ifo,timeString)) #Process zValue ranking file if found for IFO zValueDictAQ[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDictAQ[sngl.ifo].extend(wikiFileFinder.__readZranks__(zFile)) #Reparse keeping SEI channels tmpList=list() for chan in zValueDictAQ[sngl.ifo]: if "SEI" in chan[0]: tmpList.append(chan) zValueDictAQ[sngl.ifo]=tmpList else: sys.stdout.write("Analyze Qscan Z ranking file not found for %s. ...skipping...\n"%sngl.ifo) #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] imageDictAQ[sngl.ifo]=[file2URL.convert(x) for x in imageDictAQ[sngl.ifo]] indexDictAQ[sngl.ifo]=[file2URL.convert(x) for x in indexDictAQ[sngl.ifo]] thumbDictAQ[sngl.ifo]=[file2URL.convert(x) for x in thumbDictAQ[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("Seismic scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >=1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >=1 if enoughImage and enoughIndex: wikiPage.insertAnalyzeQscanTable(imageDict, thumbDict, indexDict, zValueDict, imageDictAQ, thumbDictAQ, indexDictAQ, zValueDictAQ) else: sys.stdout.write("Warning: Seismic plots product import problem.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#6 Other environmental causes") wikiPage.subsubsection("Question") wikiPage.putText("Were the environmental disturbances (other than seismic) insignificant at the time of the candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") imageDict=dict() indexDict=dict() thumbDict=dict() zValueDict=dict() imageDictAQ=dict() indexDictAQ=dict() thumbDictAQ=dict() zValueDictAQ=dict() #Select only PEM channels for sngl in wikiCoinc.sngls_in_coinc(): imageDict[sngl.ifo]=list() indexDict[sngl.ifo]=list() thumbDict[sngl.ifo]=list() for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*html"%(sngl.ifo,sngl.time)): indexDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened.png"%\ (sngl.ifo,sngl.time)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): imageDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened?thumb.png"%\ (sngl.ifo,sngl.time)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): thumbDict[sngl.ifo].append(myFile) #Search for corresponding Omega summary.txt file zValueFiles=fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)) zValueDict[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDict[sngl.ifo].extend(wikiFileFinder.__readSummary__(zFile)) #Reparse only keeping PEM and not SEI channels tmpList=list() for chan in zValueDict[sngl.ifo]: if "PEM" in chan[0] and not "SEI" in chan[0]: tmpList.append(chan) zValueDict[sngl.ifo]=tmpList else: sys.stdout.write("Omega scan summary file not for for %s. ...skipping...\n"%sngl.ifo) #Select associated analyzeQscans imageDictAQ[sngl.ifo]=list() indexDictAQ[sngl.ifo]=list() thumbDictAQ[sngl.ifo]=list() timeString=str(float(sngl.time)).replace(".","_") for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*html"%(sngl.ifo,timeString)): indexDictAQ[sngl.ifo].append(myFile) zValueFiles=fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*txt"%(sngl.ifo,timeString)) zValueDictAQ[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDictAQ[sngl.ifo].extend(wikiFileFinder.__readZranks__(zFile)) for chan in zValueDictAQ[sngl.ifo]: if "PEM" in chan[0] and not "SEI" in chan[0]: tmpList.append(chan) zValueDictAQ[sngl.ifo]=tmpList else: sys.stdout.write("Analyze Qscan Z ranking file not found for %s. ...skipping...\n"%sngl.ifo) #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime_thumb.png #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime.png for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime.png"%\ (sngl.ifo,timeString)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): imageDictAQ[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime?thumb.png"%\ (sngl.ifo,timeString)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): thumbDictAQ[sngl.ifo].append(myFile) #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] imageDictAQ[sngl.ifo]=[file2URL.convert(x) for x in imageDictAQ[sngl.ifo]] indexDictAQ[sngl.ifo]=[file2URL.convert(x) for x in indexDictAQ[sngl.ifo]] thumbDictAQ[sngl.ifo]=[file2URL.convert(x) for x in thumbDictAQ[sngl.ifo]] if len(imageDict[sngl.ifo]) < 1: wikiPage.putText("PEM scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >=1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >=1 if enoughImage and enoughIndex: wikiPage.insertAnalyzeQscanTable(imageDict, thumbDict, indexDict, zValueDict, imageDictAQ, thumbDictAQ, indexDictAQ, zValueDictAQ) else: sys.stdout.write("Warning: PEM plots import trouble.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#7 Auxiliary degree of freedom") wikiPage.subsubsection("Question") wikiPage.putText("Were the auxiliary channel transients coincident with the candidate insignificant?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") imageDict=dict() indexDict=dict() thumbDict=dict() zValueDict=dict() imageDictAQ=dict() indexDictAQ=dict() thumbDictAQ=dict() zValueDictAQ=dict() #Select only AUX channels for sngl in wikiCoinc.sngls: imageDict[sngl.ifo]=list() indexDict[sngl.ifo]=list() thumbDict[sngl.ifo]=list() for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*html"%(sngl.ifo,sngl.time)): indexDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened.png"%\ (sngl.ifo,sngl.time)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): imageDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened?thumb.png"%\ (sngl.ifo,sngl.time)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): thumbDict[sngl.ifo].append(myFile) zValueFiles=fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)) zValueDict[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDict[sngl.ifo].extend(wikiFileFinder.__readSummary__(zFile)) #Reparse NOT keeping PEM or SEI channels tmpList=list() for chan in zValueDict[sngl.ifo]: if not "PEM" in chan[0] or not "SEI" in chan[0]: tmpList.append(chan) zValueDict[sngl.ifo]=tmpList else: sys.stdout.write("Omega scan summary file not for for %s. ...skipping...\n"%sngl.ifo) #Select associated analyzeQscans imageDictAQ[sngl.ifo]=list() indexDictAQ[sngl.ifo]=list() thumbDictAQ[sngl.ifo]=list() timeString=str(float(sngl.time)).replace(".","_") #H1-analyseQscan_H1_931176926_116_rds-unspecified-gpstime.html for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*html"%(sngl.ifo,timeString)): indexDictAQ[sngl.ifo].append(myFile) zValueFiles=fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*txt"%(sngl.ifo,timeString)) #Process zValue ranking file if found for IFO zValueDictAQ[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDictAQ[sngl.ifo].extend(wikiFileFinder.__readZranks__(zFile)) #Reparse NOT keeping PEM or SEI channels tmpList=list() for chan in zValueDictAQ[sngl.ifo]: if not "PEM" in chan[0] or not "SEI" in chan[0]: tmpList.append(chan) zValueDictAQ[sngl.ifo]=tmpList else: sys.stdout.write("Z ranking file not found for %s. ...skipping...\n"%sngl.ifo) #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime_thumb.png #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime.png for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime.png"%\ (sngl.ifo,timeString)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): imageDictAQ[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime?thumb.png"%\ (sngl.ifo,timeString)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): thumbDictAQ[sngl.ifo].append(myFile) #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] imageDictAQ[sngl.ifo]=[file2URL.convert(x) for x in imageDictAQ[sngl.ifo]] indexDictAQ[sngl.ifo]=[file2URL.convert(x) for x in indexDictAQ[sngl.ifo]] thumbDictAQ[sngl.ifo]=[file2URL.convert(x) for x in thumbDictAQ[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("Other scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >=1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >=1 if enoughImage and enoughIndex: wikiPage.insertAnalyzeQscanTable(imageDict, thumbDict, indexDict, zValueDict, imageDictAQ, thumbDictAQ, indexDictAQ, zValueDictAQ) else: sys.stdout.write("Warning: AUX plots import trouble.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#8 Electronic Log Book") wikiPage.subsubsection("Question") wikiPage.putText("Were the instruments behaving normally according to the comments posted by the sci-mons or the operators in the e-log?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiLinkLHOlog=wikiPage.makeExternalLink(stfu_pipe.getiLogURL(myCoinc.time,"H1"), "Hanford eLog") wikiLinkLLOlog=wikiPage.makeExternalLink(stfu_pipe.getiLogURL(myCoinc.time,"L1"), "Livingston eLog") wikiPage.putText("%s\n\n%s\n\n"%(wikiLinkLHOlog,wikiLinkLLOlog)) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#9 Glitch Report") wikiPage.subsubsection("Question") wikiPage.putText("Were the instruments behaving normally according to the weekly glitch report?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") if int(wikiCoinc.time) >= endOfS5: wikiLinkGlitch=wikiPage.makeExternalLink( "https://www.lsc-group.phys.uwm.edu/twiki/bin/view/DetChar/GlitchStudies", "Glitch Reports for S6" ) else: wikiLinkGlitch=wikiPage.makeExternalLink( "http://www.lsc-group.phys.uwm.edu/glitch/investigations/s5index.html#shift", "Glitch Reports for S5" ) wikiPage.putText("%s\n"%(wikiLinkGlitch)) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#10 Snr versus time") wikiPage.subsubsection("Question") wikiPage.putText("Is this trigger significant in a SNR versus time plot of all triggers in its analysis chunk?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#11 Parameters of the candidate") wikiPage.subsubsection("Question") wikiPage.putText("Does the candidate have a high likelihood of being a gravitational-wave according to its parameters?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Effective Distance Ratio Test\n") effDList=wikiFileFinder.get_effDRatio() if len(effDList) != 1: sys.stdout.write("Warning: Effective Distance Test import problem.\n") for myFile in effDList: wikiPage.putText("%s\n"%(file(myFile).read())) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#12 Snr and Chisq") wikiPage.subsubsection("Question") wikiPage.putText("Are the SNR and CHISQ time series consistent with our expectations for a gravitational wave?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") # #Put plots SNR and Chi sqr # indexList=fnmatch.filter(wikiFileFinder.get_plotsnrchisq(),"*.html") thumbList=fnmatch.filter(wikiFileFinder.get_plotsnrchisq(),"*_snr-*thumb.png") thumbList.extend(fnmatch.filter(wikiFileFinder.get_plotsnrchisq(),"*_chisq-*thumb.png")) thumbList.sort() indexList=[file2URL.convert(x) for x in indexList] thumbList=[file2URL.convert(x) for x in thumbList] #Two thumb types possible "_thumb.png" or ".thumb.png" imageList=[x.replace("_thumb.png",".png").replace(".thumb.png",".png") for x in thumbList] ifoCount=len(wikiCoinc.sngls) rowLabel={"SNR":1,"CHISQ":2} rowCount=len(rowLabel) colCount=ifoCount if len(indexList) >= 1: snrTable=wikiPage.wikiTable(rowCount+1,colCount+1) for i,sngl in enumerate(wikiCoinc.sngls): myIndex="" for indexFile in indexList: if indexFile.__contains__("_pipe_%s_FOLLOWUP_"%sngl.ifo): myIndex=indexFile if myIndex=="": snrTable.data[0][i+1]=" %s "%sngl.ifo else: snrTable.data[0][i+1]=wikiPage.makeExternalLink(myIndex,sngl.ifo) for col,sngl in enumerate(wikiCoinc.sngls): for row,label in enumerate(rowLabel.keys()): snrTable.data[row+1][0]=label for k,image in enumerate(imageList): if (image.__contains__("_%s-"%label.lower()) \ and image.__contains__("pipe_%s_FOLLOWUP"%sngl.ifo)): snrTable.data[row+1][col+1]=" %s "%(wikiPage.linkedRemoteImage(thumbList[k],thumbList[k])) wikiPage.insertTable(snrTable) else: sys.stdout.write("Warning: SNR and CHISQ plots not found.\n") wikiPage.putText("SNR and CHISQ plots not found.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#13 Template bank veto") wikiPage.subsubsection("Question") wikiPage.putText("Is the bank veto value consistent with our expectations for a gravitational wave?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#14 Coherent studies") wikiPage.subsubsection("Question") wikiPage.putText("Are the triggers found in multiple interferometers coherent with each other?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") indexList=fnmatch.filter(wikiFileFinder.get_plotchiatimeseries(),"*.html") if len(indexList) >= 1: myIndex=file2URL.convert(indexList[0]) wikiPage.putText(wikiPage.makeExternalLink(myIndex,\ "%s Coherence Study Results"%(wikiCoinc.ifos))) thumbList=fnmatch.filter(wikiFileFinder.get_plotchiatimeseries(),\ "PLOT_CHIA_%s_snr-squared*thumb.png"%(wikiCoinc.time)) imageList=[x.replace("_thumb.png",".png").replace(".thumb.png",".png") for x in thumbList] rowCount=len(imageList) colCount=1 cohSnrTimeTable=wikiPage.wikiTable(rowCount+1,colCount) cohSnrTimeTable.data[0][0]="%s Coherent SNR Squared Times Series"%(wikiCoinc.ifos) for i,image in enumerate(imageList): cohSnrTimeTable.data[i+1][0]=wikiPage.linkedRemoteImage(image,thumbList[i]) wikiPage.insertTable(cohSnrTimeTable) else: sys.stdout.write("Warning: Coherent plotting jobs not found.\n") wikiPage.putText("Coherent Studies plots not found.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#15 Segmentation Stability") wikiPage.subsubsection("Question") wikiPage.putText("Is the candidate stable against changes in segmentation?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#16 Calibration Stability") wikiPage.subsubsection("Question") wikiPage.putText("Is the candidate stable against changes in calibration that are consistent with systematic uncertainties?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # | fb84ac33aba836b8fcb61075cfaec34ced2846c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/fb84ac33aba836b8fcb61075cfaec34ced2846c0/makeCheckListWiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1564,
1098,
12,
13044,
5359,
33,
7036,
16,
13044,
27055,
71,
33,
7036,
16,
13044,
2471,
33,
7036,
16,
768,
22,
1785,
33,
7036,
4672,
3536,
2985,
358,
2911,
279,
866,
1098,
1625,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1564,
1098,
12,
13044,
5359,
33,
7036,
16,
13044,
27055,
71,
33,
7036,
16,
13044,
2471,
33,
7036,
16,
768,
22,
1785,
33,
7036,
4672,
3536,
2985,
358,
2911,
279,
866,
1098,
1625,
... |
entriesbygid = {} entriesbyname = {} | def test_values(self): entries = grp.getgrall() entriesbygid = {} entriesbyname = {} | 10712bf02edf9dc6453a644a1361efdd2ba7215a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/10712bf02edf9dc6453a644a1361efdd2ba7215a/test_grp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2372,
12,
2890,
4672,
3222,
273,
14295,
18,
588,
3197,
454,
1435,
3222,
1637,
15780,
273,
2618,
3222,
1637,
529,
273,
2618,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2372,
12,
2890,
4672,
3222,
273,
14295,
18,
588,
3197,
454,
1435,
3222,
1637,
15780,
273,
2618,
3222,
1637,
529,
273,
2618,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
('/a/OL1A/cover', '/a/OL1A/fake/cover') | (u'/a/OL1A/cover', u'/a/OL1A/fake/cover') | >>> def fake_get_object(key): return fakes[key] | 350b3c7c6ebaa34f67f7f02d0c90659464ff5032 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3913/350b3c7c6ebaa34f67f7f02d0c90659464ff5032/processors.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
10517,
67,
588,
67,
1612,
12,
856,
4672,
327,
284,
3223,
63,
856,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
10517,
67,
588,
67,
1612,
12,
856,
4672,
327,
284,
3223,
63,
856,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
Unpacks bulk spec tarfile, searches for required spec passed to script as argument $1 | Unpacks bulk spec tarfile, for real bulk submission we have to use job arrays and construct the jobSpecName from the job index | def bulkUnpackerScript(bulkSpecTarName): """ _bulkUnpackerScript_ Unpacks bulk spec tarfile, searches for required spec passed to script as argument $1 If file not found, it generates a failure report and exits Otherwise, JOB_SPEC_FILE will be set to point to the script to invoke the run.sh command """ lines = [ "JOB_SPEC_NAME=$1\n", "BULK_SPEC_NAME=\"%s\"\n" % bulkSpecTarName, "echo \"This Job Using Spec: $JOB_SPEC_NAME\"\n", "tar -zxf $BULK_SPEC_NAME\n", ] lines.append(bulkUnpackerScriptMain) return lines | a662b056f66dcf00e177cf4e0a54e29a0c513138 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8887/a662b056f66dcf00e177cf4e0a54e29a0c513138/T0LSFSubmitter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8280,
23649,
264,
3651,
12,
14597,
1990,
20464,
461,
4672,
3536,
389,
14597,
23649,
264,
3651,
67,
225,
25411,
87,
8280,
857,
25857,
16,
225,
364,
2863,
8280,
8515,
732,
1240,
358,
999,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8280,
23649,
264,
3651,
12,
14597,
1990,
20464,
461,
4672,
3536,
389,
14597,
23649,
264,
3651,
67,
225,
25411,
87,
8280,
857,
25857,
16,
225,
364,
2863,
8280,
8515,
732,
1240,
358,
999,
... |
[Fractional ideal (w)] | [Fractional ideal (-w)] | def prime_factors(self): """ Return a list of the prime ideal factors of self | af5d3e7e1332c8930f1bc6bfe8a077dcedde05a4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/af5d3e7e1332c8930f1bc6bfe8a077dcedde05a4/number_field_ideal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17014,
67,
22108,
12,
2890,
4672,
3536,
2000,
279,
666,
434,
326,
17014,
23349,
14490,
434,
365,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17014,
67,
22108,
12,
2890,
4672,
3536,
2000,
279,
666,
434,
326,
17014,
23349,
14490,
434,
365,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
_pending = [] self._install(dwnpkg, cs, lk, _pending, depth) if _pending: self._pending(cs, lk, _pending, depth) | self._install(dwnpkg, cs, lk, None, depth) | def _updown(self, pkg, changeset, locked, depth=0): #print "[%03d] _updown(%s)" % (depth, pkg) #depth += 1 | fa863c9ad9e8fb247c36224ac1e88ebd00689a16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8317/fa863c9ad9e8fb247c36224ac1e88ebd00689a16/transaction.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
416,
2378,
12,
2890,
16,
3475,
16,
22463,
16,
8586,
16,
3598,
33,
20,
4672,
468,
1188,
30048,
4630,
72,
65,
389,
416,
2378,
9275,
87,
2225,
738,
261,
5979,
16,
3475,
13,
468,
59... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
416,
2378,
12,
2890,
16,
3475,
16,
22463,
16,
8586,
16,
3598,
33,
20,
4672,
468,
1188,
30048,
4630,
72,
65,
389,
416,
2378,
9275,
87,
2225,
738,
261,
5979,
16,
3475,
13,
468,
59... |
def CheckContributor(ui, repo): user = ui.config("ui", "username") | def CheckContributor(ui, repo, user=None): | def CheckContributor(ui, repo): user = ui.config("ui", "username") if not user: raise util.Abort("[ui] username is not configured in .hgrc") try: f = open(repo.root + '/CONTRIBUTORS', 'r') except: raise util.Abort("cannot open %s: %s" % (repo.root+'/CONTRIBUTORS', ExceptionDetail())) for line in f.readlines(): if line.rstrip() == user.rstrip(): return raise util.Abort("cannot find %s in CONTRIBUTORS" % (user,)) | 552488c0a2c9ad31e3e6aba82b8e2a038e34c4ef /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5761/552488c0a2c9ad31e3e6aba82b8e2a038e34c4ef/codereview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2073,
442,
19293,
12,
4881,
16,
3538,
16,
729,
33,
7036,
4672,
309,
486,
729,
30,
1002,
1709,
18,
13572,
2932,
63,
4881,
65,
2718,
353,
486,
4351,
316,
263,
26981,
1310,
7923,
775,
30,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2073,
442,
19293,
12,
4881,
16,
3538,
16,
729,
33,
7036,
4672,
309,
486,
729,
30,
1002,
1709,
18,
13572,
2932,
63,
4881,
65,
2718,
353,
486,
4351,
316,
263,
26981,
1310,
7923,
775,
30,... |
self._create_private_docs = kwargs.get('private', 1) self._top_page = self._find_top_page(kwargs.get('top', None)) | self._create_private_docs = kwargs.get('show_private', 1) self._top_page = self._find_top_page(kwargs.get('top_page', None)) | def __init__(self, docindex, **kwargs): """ Construct a new HTML writer, using the given documentation index. @param docmap: The documentation index. @type prj_name: C{string} @keyword prj_name: The name of the project. Defaults to none. @type prj_url: C{string} @keyword prj_url: The target for the project hopeage link on the navigation bar. If C{prj_url} is not specified, then no hyperlink is created. @type prj_link: C{string} @keyword prj_link: The label for the project link on the navigation bar. This link can contain arbitrary HTML code (e.g. images). By default, a label is constructed from C{prj_name}. @type top: C{string} @keyword top: The top page for the documentation. This is the default page shown main frame, when frames are enabled. C{top} can be a URL, the name of a module, the name of a class, or one of the special strings C{"trees.html"}, C{"indices.html"}, or C{"help.html"}. By default, the top-level package or module is used, if there is one; otherwise, C{"trees"} is used. @type css: C{string} @keyword css: The CSS stylesheet file. If C{css} is a file name, then the specified file's conents will be used. Otherwise, if C{css} is the name of a CSS stylesheet in L{epydoc.css}, then that stylesheet will be used. Otherwise, an error is reported. If no stylesheet is specified, then the default stylesheet is used. @type private_css: C{string} @keyword private_css: The CSS stylesheet file for the private API documentation. If C{css} is a file name, then the specified file's conents will be used. Otherwise, if C{css} is the name of a CSS stylesheet in L{epydoc.css}, then that stylesheet will be used. Otherwise, an error is reported. If no stylesheet is specified, then the private API documentation will use the same stylesheet as the public API documentation. @type help: C{string} @keyword help: The name of the help file. If no help file is specified, then the default help file will be used. @type private: C{boolean} @keyword private: Whether to create documentation for private objects. By default, private objects are documented. @type frames: C{boolean}) @keyword frames: Whether to create a frames-based table of contents. By default, it is produced. @type show_imports: C{boolean} @keyword show_imports: Whether or not to display lists of imported functions and classes. By default, they are not shown. @type index_parameters: C{boolean} @keyword index_parameters: Whether or not to include function parameters in the identifier index. By default, they are not included. @type variable_maxlines: C{int} @keyword variable_maxlines: The maximum number of lines that should be displayed for the value of a variable in the variable details section. By default, 8 lines are displayed. @type variable_linelength: C{int} @keyword variable_linelength: The maximum line length used for displaying the values of variables in the variable details sections. If a line is longer than this length, then it will be wrapped to the next line. The default line length is 70 characters. @type variable_summary_linelength: C{int} @keyword variable_summary_linelength: The maximum line length used for displaying the values of variables in the summary section. If a line is longer than this length, then it will be truncated. The default is 40 characters. @type variable_tooltip_linelength: C{int} @keyword variable_tooltip_linelength: The maximum line length used for tooltips for the values of variables. If a line is longer than this length, then it will be truncated. The default is 600 characters. @type property_function_linelength: C{int} @keyword property_function_linelength: The maximum line length used to dispaly property functions (C{fget}, C{fset}, and C{fdel}) that contain something other than a function object. The dfeault length is 40 characters. @type inheritance: C{string} @keyword inheritance: How inherited objects should be displayed. If C{inheritance='grouped'}, then inherited objects are gathered into groups; if C{inheritance='listed'}, then inherited objects are listed in a short list at the end of their group; if C{inheritance='included'}, then inherited objects are mixed in with non-inherited objects. The default is 'grouped'. """ self.docindex = docindex | dc4c4ce7e7eaf9ed22525aa996b282990149c11f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/dc4c4ce7e7eaf9ed22525aa996b282990149c11f/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
997,
1615,
16,
2826,
4333,
4672,
3536,
14291,
279,
394,
3982,
2633,
16,
1450,
326,
864,
7323,
770,
18,
225,
632,
891,
997,
1458,
30,
1021,
7323,
770,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
997,
1615,
16,
2826,
4333,
4672,
3536,
14291,
279,
394,
3982,
2633,
16,
1450,
326,
864,
7323,
770,
18,
225,
632,
891,
997,
1458,
30,
1021,
7323,
770,
18,... |
def guess_payload_class(self): | def guess_payload_class(self, payload): | def guess_payload_class(self): | 190a2c770bdd967748dea32a325afc5b1e65f8ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/190a2c770bdd967748dea32a325afc5b1e65f8ee/scapy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7274,
67,
7648,
67,
1106,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7274,
67,
7648,
67,
1106,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
sql2="""SELECT sum(qty) as qty,l.price_unit*sum(l.qty) as amt,t.name as name from product_product p, product_template t, pos_order_line l where order_id IN %s and p.product_tmpl_id=t.id and l.product_id=p.id group by t.name, l.price_unit""",(tuple(a_l),) | sql2="""SELECT sum(qty) as qty,l.price_unit*sum(l.qty) as amt,t.name as name from product_product p, product_template t, pos_order_line l where order_id = %d and p.product_tmpl_id=t.id and l.product_id=p.id group by t.name, l.price_unit"""%(o.id) | def _get_data(self,o): data={} sql1=""" SELECT distinct(o.id) from account_bank_statement s, account_bank_statement_line l,pos_order o,pos_order_line i where i.order_id=o.id and o.state='paid' and l.statement_id=s.id and l.pos_statement_id=o.id and s.id=%d"""%(o.id) self.cr.execute(sql1) data = self.cr.dictfetchall() a_l=[] for r in data: a_l.append(r['id']) if len(a_l): sql2="""SELECT sum(qty) as qty,l.price_unit*sum(l.qty) as amt,t.name as name from product_product p, product_template t, pos_order_line l where order_id IN %s and p.product_tmpl_id=t.id and l.product_id=p.id group by t.name, l.price_unit""",(tuple(a_l),) self.cr.execute(sql2) data = self.cr.dictfetchall() for d in data: self.total += d['amt'] return data | e5bef4c1d0badf41aa1f09a6793de244e726648c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e5bef4c1d0badf41aa1f09a6793de244e726648c/pos_users_product.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
892,
12,
2890,
16,
83,
4672,
501,
12938,
1847,
21,
1546,
3660,
9111,
10217,
12,
83,
18,
350,
13,
628,
2236,
67,
10546,
67,
11516,
272,
16,
2236,
67,
10546,
67,
11516,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
892,
12,
2890,
16,
83,
4672,
501,
12938,
1847,
21,
1546,
3660,
9111,
10217,
12,
83,
18,
350,
13,
628,
2236,
67,
10546,
67,
11516,
272,
16,
2236,
67,
10546,
67,
11516,
6... |
return self.__class__(dict(self).copy()) | return self.__class__(dict(self)) | def copy(self): return self.__class__(dict(self).copy()) | 7e0e80345f9bd913ba5ed7c9957e475781ad145d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2304/7e0e80345f9bd913ba5ed7c9957e475781ad145d/pydo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
4672,
327,
365,
16186,
1106,
972,
12,
1576,
12,
2890,
2934,
3530,
10756,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
4672,
327,
365,
16186,
1106,
972,
12,
1576,
12,
2890,
2934,
3530,
10756,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return code, self.untagged_responses.get(code, [None]) | return self._untagged_response(code, code) | def response(self, code): """Return data for response 'code' if received, or None. | 46586822058b54c93e36247f31b13b4d7286f0a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/46586822058b54c93e36247f31b13b4d7286f0a2/imaplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
766,
12,
2890,
16,
981,
4672,
3536,
990,
501,
364,
766,
296,
710,
11,
309,
5079,
16,
578,
599,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
766,
12,
2890,
16,
981,
4672,
3536,
990,
501,
364,
766,
296,
710,
11,
309,
5079,
16,
578,
599,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Listener.__init__(self, uiPort, UserInterface, uiArgs) | Listener.__init__(self, uiPort, UserInterface, uiArgs, socketMap=socketMap) | def __init__(self, uiPort, bayes): uiArgs = (bayes,) Listener.__init__(self, uiPort, UserInterface, uiArgs) | bb67db5e2dc016a7be764205cf241b78d334ff9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/bb67db5e2dc016a7be764205cf241b78d334ff9b/pop3proxy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5915,
2617,
16,
324,
528,
281,
4672,
5915,
2615,
273,
261,
70,
528,
281,
16,
13,
10652,
16186,
2738,
972,
12,
2890,
16,
5915,
2617,
16,
21369,
16,
5915,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5915,
2617,
16,
324,
528,
281,
4672,
5915,
2615,
273,
261,
70,
528,
281,
16,
13,
10652,
16186,
2738,
972,
12,
2890,
16,
5915,
2617,
16,
21369,
16,
5915,
... |
self.cb.action_showconfig() | self.do_action('showconfig') | def cb_alternative(self, *args): self.cb.action_showconfig() | 3a1645abf43763b728adb5faaaaea49a6103d01c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2233/3a1645abf43763b728adb5faaaaea49a6103d01c/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2875,
67,
27071,
12,
2890,
16,
380,
1968,
4672,
365,
18,
7358,
18,
1128,
67,
4500,
1425,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2875,
67,
27071,
12,
2890,
16,
380,
1968,
4672,
365,
18,
7358,
18,
1128,
67,
4500,
1425,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
assert_almost_equal(actualr, desiredr) assert_almost_equal(actuali, desiredi) | assert_almost_equal(actualr, desiredr, decimal=decimal) assert_almost_equal(actuali, desiredi, decimal=decimal) | def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=True): """ Raise an assertion if two items are not equal up to desired precision. The test is equivalent to abs(desired-actual) < 0.5 * 10**(-decimal) Given two objects (numbers or ndarrays), check that all elements of these objects are almost equal. An exception is raised at conflicting values. For ndarrays this delegates to assert_array_almost_equal Parameters ---------- actual : number or ndarray The object to check. desired : number or ndarray The expected object. decimal : integer (decimal=7) desired precision err_msg : string The error message to be printed in case of failure. verbose : bool If True, the conflicting values are appended to the error message. Raises ------ AssertionError If actual and desired are not equal up to specified precision. See Also -------- assert_array_almost_equal: compares array_like objects assert_equal: tests objects for equality Examples -------- >>> npt.assert_almost_equal(2.3333333333333, 2.33333334) >>> npt.assert_almost_equal(2.3333333333333, 2.33333334, decimal=10) ... <type 'exceptions.AssertionError'>: Items are not equal: ACTUAL: 2.3333333333333002 DESIRED: 2.3333333399999998 >>> npt.assert_almost_equal(np.array([1.0,2.3333333333333]), \t\t\tnp.array([1.0,2.33333334]), decimal=9) ... <type 'exceptions.AssertionError'>: Arrays are not almost equal <BLANKLINE> (mismatch 50.0%) x: array([ 1. , 2.33333333]) y: array([ 1. , 2.33333334]) """ from numpy.core import ndarray from numpy.lib import iscomplexobj, real, imag # Handle complex numbers: separate into real/imag to handle # nan/inf/negative zero correctly # XXX: catch ValueError for subclasses of ndarray where iscomplex fail try: usecomplex = iscomplexobj(actual) or iscomplexobj(desired) except ValueError: usecomplex = False if usecomplex: if iscomplexobj(actual): actualr = real(actual) actuali = imag(actual) else: actualr = actual actuali = 0 if iscomplexobj(desired): desiredr = real(desired) desiredi = imag(desired) else: desiredr = desired desiredi = 0 try: assert_almost_equal(actualr, desiredr) assert_almost_equal(actuali, desiredi) except AssertionError: raise AssertionError("Items are not equal:\n" \ "ACTUAL: %s\n" \ "DESIRED: %s\n" % (str(actual), str(desired))) if isinstance(actual, ndarray) or isinstance(desired, ndarray): return assert_array_almost_equal(actual, desired, decimal, err_msg) msg = build_err_msg([actual, desired], err_msg, verbose=verbose, header='Arrays are not almost equal') try: # If one of desired/actual is not finite, handle it specially here: # check that both are nan if any is a nan, and test for equality # otherwise if not (gisfinite(desired) and gisfinite(actual)): if gisnan(desired) or gisnan(actual): if not (gisnan(desired) and gisnan(actual)): raise AssertionError(msg) else: if not desired == actual: raise AssertionError(msg) return except TypeError: pass if round(abs(desired - actual),decimal) != 0 : raise AssertionError(msg) | 2537604cbcb61027706c358d6dd6afcd99a30686 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/2537604cbcb61027706c358d6dd6afcd99a30686/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
67,
287,
10329,
67,
9729,
12,
18672,
16,
30458,
16,
12586,
33,
27,
16,
370,
67,
3576,
2218,
2187,
11369,
33,
5510,
4672,
3536,
20539,
392,
11240,
309,
2795,
1516,
854,
486,
3959,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
67,
287,
10329,
67,
9729,
12,
18672,
16,
30458,
16,
12586,
33,
27,
16,
370,
67,
3576,
2218,
2187,
11369,
33,
5510,
4672,
3536,
20539,
392,
11240,
309,
2795,
1516,
854,
486,
3959,
... |
contract = cr.dictfetchone() | contract = cr.dictfetchone() contract = contract and contract or {} | def get_contract(self, cr, uid, employee, date, context={}): sql_req= ''' SELECT c.id as id, c.wage as wage, struct_id as function FROM hr_contract c LEFT JOIN hr_employee emp on (c.employee_id=emp.id) LEFT JOIN hr_contract_wage_type cwt on (cwt.id = c.wage_type_id) LEFT JOIN hr_contract_wage_type_period p on (cwt.period_id = p.id) WHERE (emp.id=%s) AND (date_start <= %s) AND (date_end IS NULL OR date_end >= %s) LIMIT 1 ''' cr.execute(sql_req, (employee.id, date, date)) contract = cr.dictfetchone() return contract | 8a7e4a26173a9e06db8fe443b746014f7b8806d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8a7e4a26173a9e06db8fe443b746014f7b8806d2/hr_payroll.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
16351,
12,
2890,
16,
4422,
16,
4555,
16,
24539,
1340,
16,
1509,
16,
819,
12938,
4672,
1847,
67,
3658,
33,
9163,
9111,
276,
18,
350,
487,
612,
16,
276,
18,
91,
410,
487,
341,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
16351,
12,
2890,
16,
4422,
16,
4555,
16,
24539,
1340,
16,
1509,
16,
819,
12938,
4672,
1847,
67,
3658,
33,
9163,
9111,
276,
18,
350,
487,
612,
16,
276,
18,
91,
410,
487,
341,... |
self.errorClearTime = ERROR_CLEAR_TIME self.errorTicketTime = ERROR_TICKET_TIME self.errorMailAddress = DIRAC.errorMail self.alarmMailAddress = DIRAC.alarmMail self.mailFromAddress = FROM_MAIL | self.errorClearTime = ERROR_CLEAR_TIME self.errorTicketTime = ERROR_TICKET_TIME self.errorMailAddress = DIRAC.errorMail self.alarmMailAddress = DIRAC.alarmMail self.mailFromAddress = FROM_MAIL | def __init__( self, submitPool): """ Define the logger and some defaults """ | 65482708e833fd2f044badf2f7e0684898d23e4b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/65482708e833fd2f044badf2f7e0684898d23e4b/PilotDirector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
4879,
2864,
4672,
3536,
13184,
326,
1194,
471,
2690,
3467,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
4879,
2864,
4672,
3536,
13184,
326,
1194,
471,
2690,
3467,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
keep_elem_refs(pForm, data) retval = _fl_set_form_atactivate(pForm, c_cb, data) | keep_elem_refs(pForm, data, pdata) retval = _fl_set_form_atactivate(pForm, c_cb, pdata) | def fl_set_form_atactivate(pForm, py_cb, data): """ fl_set_form_atactivate(pForm, py_cb, data) -> form atactivate Register a callback that is called when activation status of a forms is enabled <pForm> : form activated <py_cb> : python callback function called <data> : argument to be passed to function """ _fl_set_form_atactivate = cfuncproto( load_so_libforms(), "fl_set_form_atactivate", \ FL_FORM_ATACTIVATE, [cty.POINTER(FL_FORM), FL_FORM_ATACTIVATE, cty.c_void_p], \ """FL_FORM_ATACTIVATE fl_set_form_atactivate(FL_FORM * form, FL_FORM_ATACTIVATE cb, void * data) """) c_cb = FL_FORM_ATACTIVATE(py_cb) keep_cfunc_refs(c_cb) keep_elem_refs(pForm, data) retval = _fl_set_form_atactivate(pForm, c_cb, data) return retval | bd6cf497d94f877a33a2bba90b9d74b9e4c950cb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/bd6cf497d94f877a33a2bba90b9d74b9e4c950cb/library.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
67,
687,
67,
396,
299,
954,
12,
84,
1204,
16,
2395,
67,
7358,
16,
501,
4672,
3536,
1183,
67,
542,
67,
687,
67,
396,
299,
954,
12,
84,
1204,
16,
2395,
67,
7358,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
67,
687,
67,
396,
299,
954,
12,
84,
1204,
16,
2395,
67,
7358,
16,
501,
4672,
3536,
1183,
67,
542,
67,
687,
67,
396,
299,
954,
12,
84,
1204,
16,
2395,
67,
7358,
16,
... |
return [entry for entry in entries if pattern(entry)] | return [entry for entry in self._entries if pattern(entry)] | def find_all(self, pattern, *fields): """Searchs this phonebook for certain patterns. `pattern` may either be | 7caf7af8620f36787fcc5d3a1634ba919cd8202c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2215/7caf7af8620f36787fcc5d3a1634ba919cd8202c/phonebook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
454,
12,
2890,
16,
1936,
16,
380,
2821,
4672,
3536,
2979,
87,
333,
7353,
3618,
364,
8626,
6884,
18,
1375,
4951,
68,
2026,
3344,
506,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
454,
12,
2890,
16,
1936,
16,
380,
2821,
4672,
3536,
2979,
87,
333,
7353,
3618,
364,
8626,
6884,
18,
1375,
4951,
68,
2026,
3344,
506,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
o = scripts.Long("opt").min(0).max(5).optional() a = scripts.String("a").values("foo", "bar") b = scripts.Long("b").out() | o = scripts.Long("opt", min=0, max=5) a = scripts.String("a", values=("foo", "bar"), optional=True) b = scripts.Long("b", optional=True).out() | def demo(self, args): SCRIPT = """#!/usr/bin/env python | 289e20cb678804a7371cd511e0a7cacd821eba4c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/289e20cb678804a7371cd511e0a7cacd821eba4c/script.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21477,
12,
2890,
16,
833,
4672,
22812,
273,
3536,
7,
5,
19,
13640,
19,
4757,
19,
3074,
5790,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21477,
12,
2890,
16,
833,
4672,
22812,
273,
3536,
7,
5,
19,
13640,
19,
4757,
19,
3074,
5790,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.Core.setActivated(True) | self.Core.setActivated(False) | def quit(self): ### Do anything that needs to be done before quitting. logging.info("Caffeine is preparing to quit") | 941357d61d3ff9036ff03944f1d0b4ad6797a889 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1563/941357d61d3ff9036ff03944f1d0b4ad6797a889/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9706,
12,
2890,
4672,
11849,
2256,
6967,
716,
4260,
358,
506,
2731,
1865,
9706,
1787,
18,
2907,
18,
1376,
2932,
39,
7329,
73,
558,
353,
675,
12583,
358,
9706,
7923,
2,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9706,
12,
2890,
4672,
11849,
2256,
6967,
716,
4260,
358,
506,
2731,
1865,
9706,
1787,
18,
2907,
18,
1376,
2932,
39,
7329,
73,
558,
353,
675,
12583,
358,
9706,
7923,
2,
-100,
-100,
-100,
... |
declare_opcode_set(op_get_prop_len, 0x84, 2, 0x10) | declare_opcode_set(op_get_prop_len, 0x84, 3, 0x10) | def op_get_prop_len(self, *args): """""" | 92af643ed01cfa78abdc1df4c1f1030d7e8c8acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2052/92af643ed01cfa78abdc1df4c1f1030d7e8c8acd/zcpu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1061,
67,
588,
67,
5986,
67,
1897,
12,
2890,
16,
380,
1968,
4672,
3536,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1061,
67,
588,
67,
5986,
67,
1897,
12,
2890,
16,
380,
1968,
4672,
3536,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.body.append( '\\begin{list}{}{}\n' ) | self.out.append( '\\begin{list}{}{}\n' ) | def visit_bullet_list (self, node): # NOTE: required by the loss of 'topic_classes' in docutils 0.6 # TODO: so what replaces it? if (hasattr (self, 'topic_classes') and ('contents' in self.topic_classes)): if self.use_latex_toc: raise nodes.SkipNode self.body.append( '\\begin{list}{}{}\n' ) else: begin_str = '\\begin{itemize}' if self.overlay_bullets: begin_str += '[<+-| alert@+>]' begin_str += '\n' self.body.append (begin_str) | 37db8ffa549b63ebad9bbc3310aeafe2a276f03b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5620/37db8ffa549b63ebad9bbc3310aeafe2a276f03b/rst2beamer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
70,
19994,
67,
1098,
261,
2890,
16,
756,
4672,
468,
5219,
30,
1931,
635,
326,
8324,
434,
296,
10476,
67,
4701,
11,
316,
997,
5471,
374,
18,
26,
468,
2660,
30,
1427,
4121,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
70,
19994,
67,
1098,
261,
2890,
16,
756,
4672,
468,
5219,
30,
1931,
635,
326,
8324,
434,
296,
10476,
67,
4701,
11,
316,
997,
5471,
374,
18,
26,
468,
2660,
30,
1427,
4121,
1... |
print "Finished, thank you for waiting." | def scatter_plot(group_info,scatter_info,data_set): #data_set is a dictionary keyed by quantity containing lists of groups and X and Y data points. #print "Group Info:", group_info for quantity_number in scatter_info: #print "Dataset for quantity number "+str(quantity_number)+": ", data_set[quantity_number] if data_set[quantity_number] == []: print "No Scatter Plot Data in Quantity "+str(quantity_number)+" Dataset.\n" else: print "Scatter Plot Data for Quantity "+str(quantity_number)+" Dataset." # Set variables for Plot extracted from the first group of lines in config file starting with 'q'. # Variables for plot. plot_title = scatter_info[int(quantity_number)]['Scatter_Plot_Title'] print plot_title x_title = scatter_info[int(quantity_number)]['X_Title'] y_title = scatter_info[int(quantity_number)]['Y_Title'] min_x = float(scatter_info[int(quantity_number)]['Plot_Min']) #print min_x max_x = float(scatter_info[int(quantity_number)]['Plot_Max']) #print max_x min_y = float(scatter_info[int(quantity_number)]['Plot_Min']) max_y = float(scatter_info[int(quantity_number)]['Plot_Max']) percent_error = int(scatter_info[int(quantity_number)]['%error']) title_quadrant = int(scatter_info[int(quantity_number)]['Title_Quadrant']) key_pos = scatter_info[int(quantity_number)]['Key_Position'] key_dist = 0.2*unit.v_cm plot_width = int(scatter_info[int(quantity_number)]['Plot_Width(cm)']) #Create filename from fields in input file record. plot_file_name = scatter_info[int(quantity_number)]['Plot_Filename'] #print plot_file_name # Determine the location for the key, alignment based on key_quadrant setting. if key_pos == "tl" or "tc" or "tr" or "ml" or "mc" or "mr" or "bl" or "bc" or "br": () #print "Key Position =", key_pos else: print "The key position was not specified./nUsing the default bottom right position." key_pos = "br" #Begin Plotting #print exp_data #print mod_data # Initialize graph object g = graph.graphxy(width=plot_width, ratio=1/1, key=graph.key.key(pos=key_pos, dist=key_dist), x=graph.axis.linear(title=x_title, min=min_x, max=max_x), y=graph.axis.linear(title=y_title, min=min_y, max=max_y)) #Plot Midline and Error bounds lines. errorLineCenterPoints = [[min_x,min_y],[max_x,max_y]] #print errorLineCenterPoints lower_bound = max_y - max_y * percent_error / 100 #print lower_bound errorLineLowerPoints = [[min_x,min_y],[max_x,lower_bound]] #print errorLineLowerPoints upper_bound = max_y + max_y * percent_error / 100.0 #print upper_bound errorLineUpperPoints = [[min_x,min_y],[max_x,upper_bound]] #print errorLineUpperPoints g.plot(graph.data.points(errorLineCenterPoints, title=None, x=1, y=2), [graph.style.line([style.linewidth.Thin, style.linestyle.solid])]) g.plot(graph.data.points(errorLineLowerPoints, title=None, x=1, y=2), [graph.style.line([style.linewidth.Thin, style.linestyle.dashed])]) g.plot(graph.data.points(errorLineUpperPoints, title=None, x=1, y=2), [graph.style.line([style.linewidth.Thin, style.linestyle.dashed])]) # mystyle = graph.style.symbol(graph.style.symbol.changetriangletwice, size=0.1*unit.v_cm, # symbolattrs=[graph.style.symbol.changefilledstroked, # attr.changelist([color.rgb.red, color.rgb.green, color.rgb.blue])]) #One point at a time added to plot from each data set. # Iterate over items in scatter data dictionary key for items that are not []. # Append data sets to scatter_plot_data_list # colors for symbols are from http://pyx.sourceforge.net/manual/colorname.html scatter_plot_data_list = [] grouped_data = {} grouped_data_list = range(len(group_quantity_data_dicts[0])+1) #print "Grouped Data List:", grouped_data_list #print "DataSet for Quantity "+str(quantity_number)+":", data_set[quantity_number] if len(data_set[quantity_number]) > 1: #print "Grouped Scatter Data:" #print data_set[quantity_number] for arr_temp in grouped_data_list: grouped_data_list[arr_temp] = [] for data_set_item in data_set[quantity_number]: #print data_set_item #print "Data for group "+data_set_item[0]+":", data_set_item[1] grouped_data_list[int(data_set_item[0])].append(data_set_item[1]) print "Grouped data list:", grouped_data_list #g.plot(graph.data.points(scatter_plot_data, x=1, y=2, title=group_info[int(data_set[quantity_number][0][0])]["Group_Title"]), [mystyle]) group_counter = 0 for j in grouped_data_list: print "J =", j if j != []: print group_counter # Pull group symbol specifications from config file. config_group_symbol = group_info[group_counter]["Symbol"] #print config_group_symbol group_symbol = "graph.style.symbol."+config_group_symbol #print group_symbol config_group_symbol_color = group_info[group_counter]["Color"] #print config_group_symbol_color #group_color = "color.rgb."+config_group_symbol_color config_group_symbol_filled = group_info[group_counter]["Filled"] #print config_group_symbol_filled if config_group_symbol_filled == 'yes': fillstyle = "deco.filled([color.rgb."+config_group_symbol_color+"])" else: fillstyle = "deco.stroked([color.rgb."+config_group_symbol_color+"])" print group_symbol, fillstyle #Create temporary symbol style. tempstyle = "graph.style.symbol("+group_symbol+", size=0.1*unit.v_cm, symbolattrs=["+fillstyle+"])" print "TempStyle:", tempstyle scatterpointstyle = eval(tempstyle) #print group_info[group_counter]["Group_Title"] g.plot(graph.data.points(j, x=1, y=2, title=group_info[group_counter]["Group_Title"]), [scatterpointstyle]) else: pass group_counter = group_counter + 1 else: print "Non-Grouped Scatter Data:" print data_set[quantity_number] scatter_plot_data = [] scatter_plot_data.append(data_set[quantity_number][0][1]) print scatter_plot_data #print grouped_data_list # Now plot the Title text, alignment based on title quadrant setting. if title_quadrant == 1: g.text(0.1, g.height - 0.2, plot_title, [text.halign.left, text.valign.top, text.size.small]) elif title_quadrant == 2: g.text(g.width-0.1, g.height - 0.2, plot_title, [text.halign.right, text.valign.top, text.size.normalsize]) elif title_quadrant == 3: g.text(0.1, 0.2, plot_title, [text.halign.left, text.valign.bottom, text.size.normalsize]) elif title_quadrant == 4: g.text(g.width-0.1, 0.2, plot_title, [text.halign.right, text.valign.bottom, text.size.normalsize]) else: print "A title location was not specified./nUsing the default top left quadrant." g.text(0.1, g.height - 0.2, plot_title, [text.halign.left, text.valign.top, text.size.small]) # Write the output plot_file_path = output_directory+plot_file_name #print plot_file_path g.writePDFfile(plot_file_path) print "Plot to: \n", plot_file_path+".PDF\n" | ad91d4eb3f67d10bfa5d623cd1280d36462603e1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12/ad91d4eb3f67d10bfa5d623cd1280d36462603e1/Validation_Data_Processor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14644,
67,
4032,
12,
1655,
67,
1376,
16,
31320,
67,
1376,
16,
892,
67,
542,
4672,
468,
892,
67,
542,
353,
279,
3880,
17408,
635,
10457,
4191,
6035,
434,
3252,
471,
1139,
471,
1624,
501... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14644,
67,
4032,
12,
1655,
67,
1376,
16,
31320,
67,
1376,
16,
892,
67,
542,
4672,
468,
892,
67,
542,
353,
279,
3880,
17408,
635,
10457,
4191,
6035,
434,
3252,
471,
1139,
471,
1624,
501... | |
print self.skip, self.stack, | print '!'*self.debugging, 'process:', self.skip, self.stack, | def process(self, accu): if self.debugging > 1: print self.skip, self.stack, if accu: print accu[0][:30], if accu[0][30:] or accu[1:]: print '...', print if self.stack and self.stack[-1] == 'menu': # XXX should be done differently for line in accu: mo = miprog.match(line) if not mo: line = string.strip(line) + '\n' self.expand(line) continue bgn, end = mo.span(0) a, b = mo.span(1) c, d = mo.span(2) e, f = mo.span(3) g, h = mo.span(4) label = line[a:b] nodename = line[c:d] if nodename[0] == ':': nodename = label else: nodename = line[e:f] punct = line[g:h] self.write(' <LI><A HREF="', makefile(nodename), '">', nodename, '</A>', punct, '\n') self.expand(line[end:]) else: text = string.joinfields(accu, '') self.expand(text) | 6dbcc8f6eb9e3b136c03d11137b7c0c7afb8d4a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/6dbcc8f6eb9e3b136c03d11137b7c0c7afb8d4a4/texi2html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12,
2890,
16,
4078,
89,
4672,
309,
365,
18,
4148,
1998,
405,
404,
30,
1172,
15502,
14,
2890,
18,
4148,
1998,
16,
296,
2567,
30,
2187,
365,
18,
7457,
16,
365,
18,
3772,
16,
309,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12,
2890,
16,
4078,
89,
4672,
309,
365,
18,
4148,
1998,
405,
404,
30,
1172,
15502,
14,
2890,
18,
4148,
1998,
16,
296,
2567,
30,
2187,
365,
18,
7457,
16,
365,
18,
3772,
16,
309,... |
if ( os.isdir(pathname) ): | if ( os.path.isdir(pathname) ): | def _scanDirToChannel(self, config, channel, dir): result = 1 log("scanning directory %s" % (dir,) ) for file in os.listdir(dir): pathname = os.path.join(dir, file) if ( os.isdir(pathname) ): result = result and (0 != self._scanDirToChannel(config, channel, pathname) ) if ( os.isfile(pathname) ): result = result and ( 0 != self._addRpmPackage(config, pathname, channel) ) log ("returning result of %d for dir %s" % (result, dir) ) return result | 94f33c0d3397bd529868956db17e5edca73e0585 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5092/94f33c0d3397bd529868956db17e5edca73e0585/postgres.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9871,
1621,
774,
2909,
12,
2890,
16,
642,
16,
1904,
16,
1577,
4672,
563,
273,
404,
613,
2932,
1017,
10903,
1867,
738,
87,
6,
738,
261,
1214,
16,
13,
262,
364,
585,
316,
1140,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9871,
1621,
774,
2909,
12,
2890,
16,
642,
16,
1904,
16,
1577,
4672,
563,
273,
404,
613,
2932,
1017,
10903,
1867,
738,
87,
6,
738,
261,
1214,
16,
13,
262,
364,
585,
316,
1140,
18... |
executeInSecs = period if elapsedTime: executeInSecs -= elapsedTime retVal = self.__scheduleTask( taskId, executeInSecs ) | retVal = self.__scheduleTask( taskId, elapsedTime ) | def addPeriodicTask( self, period, taskFunc, taskArgs = (), executions = 0, elapsedTime = 0 ): if not callable( taskFunc ): return S_ERROR( "%s is not callable" % str( taskFunc ) ) period = max( period, self.__minPeriod ) elapsedTime = min( elapsedTime, period - 1 ) md = md5.new() task = { 'period' : period, 'func' : taskFunc, 'args' : taskArgs, } md.update( str( task ) ) taskId = md.hexdigest() if taskId in self.__taskDict: return S_ERROR( "Task %s is already added" % taskId ) if executions: task[ 'executions' ] = executions self.__taskDict[ taskId ] = task executeInSecs = period if elapsedTime: executeInSecs -= elapsedTime retVal = self.__scheduleTask( taskId, executeInSecs ) if not retVal[ 'OK' ]: return retVal self.__createExecutorIfNeeded() return S_OK( taskId ) | bc726cc4a54f92f64c8cfd45aaaf12319ef78e35 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/bc726cc4a54f92f64c8cfd45aaaf12319ef78e35/ThreadScheduler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
31461,
2174,
12,
365,
16,
3879,
16,
1562,
2622,
16,
1562,
2615,
273,
1832,
16,
26845,
273,
374,
16,
9613,
950,
273,
374,
262,
30,
309,
486,
4140,
12,
1562,
2622,
262,
30,
327,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
31461,
2174,
12,
365,
16,
3879,
16,
1562,
2622,
16,
1562,
2615,
273,
1832,
16,
26845,
273,
374,
16,
9613,
950,
273,
374,
262,
30,
309,
486,
4140,
12,
1562,
2622,
262,
30,
327,
3... |
version='0.2.0dev', | version='0.2dev', | def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() | fdff27f60b4e611431088f1284ba9df68d9c724b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4163/fdff27f60b4e611431088f1284ba9df68d9c724b/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
30857,
86,
1973,
4672,
327,
1696,
12,
538,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
972,
768,
972,
3631,
380,
86,
1973,
13,
2934,
896,
1435,
225,
2,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
30857,
86,
1973,
4672,
327,
1696,
12,
538,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
972,
768,
972,
3631,
380,
86,
1973,
13,
2934,
896,
1435,
225,
2,
-100,
-100,
-100,... |
simplename = r'(?!_)\w([-.\w]*(?!_)\w)?' | simplename = r'(?:(?!_)\w)+(?:[-._](?:(?!_)\w)+)*' | def parse(self, text, lineno, memo, parent): """ Return 2 lists: nodes (text and inline elements), and system_messages. | 83317549327c7718c3d29c8e4065fc85c6a55580 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/83317549327c7718c3d29c8e4065fc85c6a55580/states.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
977,
16,
7586,
16,
11063,
16,
982,
4672,
3536,
2000,
576,
6035,
30,
2199,
261,
955,
471,
6370,
2186,
3631,
471,
2619,
67,
6833,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
977,
16,
7586,
16,
11063,
16,
982,
4672,
3536,
2000,
576,
6035,
30,
2199,
261,
955,
471,
6370,
2186,
3631,
471,
2619,
67,
6833,
18,
2,
-100,
-100,
-100,
-100,
-100,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.