rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
os.remove(join(root, name)) | os.remove(os.path.join(root, name)) | def test_traversal(self): import os from os.path import join | ff73f25c05059ab59aea0fb3afcba97e2cf7243a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/ff73f25c05059ab59aea0fb3afcba97e2cf7243a/test_os.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
31750,
287,
12,
2890,
4672,
1930,
1140,
628,
1140,
18,
803,
1930,
1233,
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,
... | [
1,
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,
1842,
67,
31750,
287,
12,
2890,
4672,
1930,
1140,
628,
1140,
18,
803,
1930,
1233,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
nusers = len(self.getUserNames()) | nusers = len(self.getUsers()) | def tpValues(self): # Avoid returning HUUUUUUGE lists # Use the cache at first if self._v_no_tree and self._v_cache_no_tree > time.time(): return [] # Do not use the tree | 349a95cc3d754ca8884f37d7aef37803b7793cb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/349a95cc3d754ca8884f37d7aef37803b7793cb3/GroupUserFolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8071,
1972,
12,
2890,
4672,
468,
17843,
5785,
670,
57,
57,
57,
57,
57,
57,
7113,
6035,
468,
2672,
326,
1247,
622,
1122,
309,
365,
6315,
90,
67,
2135,
67,
3413,
471,
365,
6315,
90,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8071,
1972,
12,
2890,
4672,
468,
17843,
5785,
670,
57,
57,
57,
57,
57,
57,
7113,
6035,
468,
2672,
326,
1247,
622,
1122,
309,
365,
6315,
90,
67,
2135,
67,
3413,
471,
365,
6315,
90,
67... |
cmd = dotdots + "built/bin/interrogate" | cmd = dotdots + PREFIX+"/bin/interrogate" | def Interrogate(ipath=0, opts=0, outd=0, outc=0, src=0, module=0, library=0, files=0): if ((ipath==0)|(opts==0)|(outd==0)|(outc==0)|(src==0)|(module==0)|(library==0)|(files==0)): sys.exit("syntax error in Interrogate directive"); ipath = ["built/tmp"] + ipath + ["built/include"] outd = "built/etc/"+outd outc = "built/tmp/"+outc paths = xpaths(src+"/",files,"") dep = CxxCalcDependenciesAll(paths, ipath) dotdots = "" for i in range(0,src.count("/")+1): dotdots = dotdots + "../" ALLIN.append(outd) building = 0; for x in opts: if (x[:9]=="BUILDING_"): building = x[9:] if (older(outc, dep) or older(outd, dep)): if (COMPILER=="MSVC7"): cmd = dotdots + "built/bin/interrogate.exe" cmd = cmd + ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -longlong __int64 -D_X86_ -DWIN32_VC -D_WIN32' cmd = cmd + ' -D"_declspec(param)=" -D_near -D_far -D__near -D__far -D__stdcall' if (OPTIMIZE==1): cmd = cmd + ' ' if (OPTIMIZE==2): cmd = cmd + ' ' if (OPTIMIZE==3): cmd = cmd + ' -DFORCE_INLINING' if (OPTIMIZE==4): cmd = cmd + ' -DFORCE_INLINING' cmd = cmd + ' -S"' + dotdots + 'built/include/parser-inc"' cmd = cmd + ' -I"' + dotdots + 'built/python/include"' if (COMPILER=="LINUXA"): cmd = dotdots + "built/bin/interrogate" cmd = cmd + ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__i386__ -D__const=const' if (OPTIMIZE==1): cmd = cmd + ' ' if (OPTIMIZE==2): cmd = cmd + ' ' if (OPTIMIZE==3): cmd = cmd + ' ' if (OPTIMIZE==4): cmd = cmd + ' ' cmd = cmd + ' -S"' + dotdots + 'built/include/parser-inc" -S"/usr/include"' cmd = cmd + ' -I"' + dotdots + 'built/python/include"' cmd = cmd + " -oc "+dotdots+outc+" -od "+dotdots+outd cmd = cmd + ' -fnames -string -refcount -assert -python' for x in ipath: cmd = cmd + ' -I"' + dotdots + x + '"' if (building): cmd = cmd + " -DBUILDING_"+building if (opts.count("WITHINPANDA")): cmd = cmd + " -DWITHIN_PANDA" for pkg in PACKAGES: if (PkgSelected(opts,pkg)): cmd = cmd + ' -I"' + dotdots + STDTHIRDPARTY + pkg.lower() + "/include" + '"' cmd = cmd + ' -module "' + module + '" -library "' + library + '"' if ((COMPILER=="MSVC7") and opts.count("DXSDK")): cmd = cmd + ' -I"' + DirectXSDK + '/include"' if ((COMPILER=="MSVC7") and opts.count("MAYA5")): cmd = cmd + ' -I"' + Maya5SDK + 'include"' if ((COMPILER=="MSVC7") and opts.count("MAYA6")): cmd = cmd + ' -I"' + Maya6SDK + 'include"' for x in files: cmd = cmd + ' ' + x oscdcmd(src, cmd) updatefiledate(outd) updatefiledate(outc) | aa9700942409f59dfc63d4542d0bad0a01230726 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/aa9700942409f59dfc63d4542d0bad0a01230726/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5294,
15283,
12,
625,
421,
33,
20,
16,
1500,
33,
20,
16,
596,
72,
33,
20,
16,
596,
71,
33,
20,
16,
1705,
33,
20,
16,
1605,
33,
20,
16,
5313,
33,
20,
16,
1390,
33,
20,
4672,
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,
5294,
15283,
12,
625,
421,
33,
20,
16,
1500,
33,
20,
16,
596,
72,
33,
20,
16,
596,
71,
33,
20,
16,
1705,
33,
20,
16,
1605,
33,
20,
16,
5313,
33,
20,
16,
1390,
33,
20,
4672,
309... |
return dict([(key, copy(val)) for key, val in self.d_val_prev.items()]) | return dict([(key, Copy(val)) for key, val in self.d_val_prev.items()]) | def _D(self, x, Vars=None, fixedVars = None, sameDerivativeVariables=True, asSparse = 'auto'): if self.is_oovar: return {} if fixedVars is not None and self in fixedVars else {self.name:Eye(self(x).size) if asSparse is not False else eye(self(x).size)} if self.discrete: raise FuncDesignerException('The oofun or oovar instance has been declared as discrete, no derivative is available') | 01a37cd2fa899ac6934e80846e911715d8ebba95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6196/01a37cd2fa899ac6934e80846e911715d8ebba95/ooFun.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
40,
12,
2890,
16,
619,
16,
27289,
33,
7036,
16,
5499,
5555,
273,
599,
16,
1967,
26239,
1535,
6158,
33,
5510,
16,
487,
20565,
273,
296,
6079,
11,
4672,
309,
365,
18,
291,
67,
516... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
40,
12,
2890,
16,
619,
16,
27289,
33,
7036,
16,
5499,
5555,
273,
599,
16,
1967,
26239,
1535,
6158,
33,
5510,
16,
487,
20565,
273,
296,
6079,
11,
4672,
309,
365,
18,
291,
67,
516... |
retVal['waitlisted_students'] = User.objects.filter(userbit__qsc = qsc_waitlist, userbit__verb = verb).distinct() | retVal['waitlisted_students'] = User.objects.filter(userbit__qsc = qsc_waitlist, userbit__verb = verb, userbit__startdate__lte=now, userbit__enddate__gte=now).distinct() | def students(self, QObject = False): verb = GetNode('V/Flags/Public') verb2 = GetNode('V/Flags/Registration/Attended') STUDREP_VERB = GetNode('V/Flags/UserRole/StudentRep') STUDREP_QSC = GetNode('Q') qsc = GetNode("/".join(self.program_anchor_cached().tree_encode()) + "/Confirmation") qsc_waitlist = GetNode("/".join(self.program_anchor_cached().tree_encode()) + "/Waitlist") | 0e5e9cdd2d296834e1b2fc250566b83a6dbac190 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12041/0e5e9cdd2d296834e1b2fc250566b83a6dbac190/studentregcore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10068,
4877,
12,
2890,
16,
2238,
921,
273,
1083,
4672,
6405,
273,
968,
907,
2668,
58,
19,
5094,
19,
4782,
6134,
6405,
22,
273,
968,
907,
2668,
58,
19,
5094,
19,
7843,
19,
3075,
3934,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10068,
4877,
12,
2890,
16,
2238,
921,
273,
1083,
4672,
6405,
273,
968,
907,
2668,
58,
19,
5094,
19,
4782,
6134,
6405,
22,
273,
968,
907,
2668,
58,
19,
5094,
19,
7843,
19,
3075,
3934,
... |
try: child = children[start] except IndexError: sys.stderr.write( "skip_leading_nodes() failed at index %d\n" % start) raise | child = children[start] | def skip_leading_nodes(children, start, i): i = min(i, len(children)) while i > start: # skip over leading comments and whitespace: try: child = children[start] except IndexError: sys.stderr.write( "skip_leading_nodes() failed at index %d\n" % start) raise nodeType = child.nodeType if nodeType == xml.dom.core.COMMENT: start = start + 1 elif nodeType == xml.dom.core.TEXT: data = child.data shortened = string.lstrip(data) if shortened: if data != shortened: # break into two nodes: whitespace and non-whitespace child.splitText(len(data) - len(shortened)) return start + 1, i + 1 break # all whitespace, just skip start = start + 1 elif nodeType == xml.dom.core.ELEMENT: if child.tagName in PARA_LEVEL_ELEMENTS + PARA_LEVEL_PRECEEDERS: start = start + 1 else: break else: break return start, i | 8d20f30e2bb3a6cee170c7f74006722d05264c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/8d20f30e2bb3a6cee170c7f74006722d05264c26/docfixer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2488,
67,
27200,
67,
4690,
12,
5906,
16,
787,
16,
277,
4672,
277,
273,
1131,
12,
77,
16,
562,
12,
5906,
3719,
1323,
277,
405,
787,
30,
468,
2488,
1879,
7676,
5678,
471,
7983,
30,
115... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2488,
67,
27200,
67,
4690,
12,
5906,
16,
787,
16,
277,
4672,
277,
273,
1131,
12,
77,
16,
562,
12,
5906,
3719,
1323,
277,
405,
787,
30,
468,
2488,
1879,
7676,
5678,
471,
7983,
30,
115... |
res = collection_obj.get_schedule_outbox_URL(cr, uid, ids, context=ctx) | res = dirobj.get_schedule_outbox_URL(cr, uid, ids, context=ctx) | def _get_caldav_schedule_outbox_URL(self, cr): import xml.dom.minidom import urllib dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) ids = [self.dir_id] res = collection_obj.get_schedule_outbox_URL(cr, uid, ids, context=ctx) doc = xml.dom.minidom.getDOMImplementation().createDocument(None, 'href', None) href = doc.documentElement href.tagName = 'D:href' huri = doc.createTextNode(urllib.quote('/%s/%s' % (cr.dbname, res))) href.appendChild(huri) return href | 4cc0c97a1bfb43a8fed4a22ab38d853af273e0ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4cc0c97a1bfb43a8fed4a22ab38d853af273e0ee/caldav_node.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
771,
20752,
67,
10676,
67,
659,
2147,
67,
1785,
12,
2890,
16,
4422,
4672,
1930,
2025,
18,
9859,
18,
1154,
350,
362,
1930,
11527,
4314,
303,
441,
273,
365,
18,
2472,
6315,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
771,
20752,
67,
10676,
67,
659,
2147,
67,
1785,
12,
2890,
16,
4422,
4672,
1930,
2025,
18,
9859,
18,
1154,
350,
362,
1930,
11527,
4314,
303,
441,
273,
365,
18,
2472,
6315,... |
self.code_text += line + os.linesep | self.code_buf.append(line) | def handle_code_block(self, line): if line.strip() == WikiParser.STARTBLOCK: self.in_code_block += 1 if self.in_code_block == 1: self.code_processor = None self.code_text = '' else: self.code_text += line + os.linesep if not self.code_processor: self.code_processor = WikiProcessor(self, 'default') elif line.strip() == WikiParser.ENDBLOCK: self.in_code_block -= 1 if self.in_code_block == 0 and self.code_processor: self.close_table() self.close_paragraph() processed = self.code_processor.process(self.code_text) self.out.write(_markup_to_unicode(processed)) | 9a6750c9bdc9bed440215156b80bec21e78a557d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9317/9a6750c9bdc9bed440215156b80bec21e78a557d/formatter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
710,
67,
2629,
12,
2890,
16,
980,
4672,
309,
980,
18,
6406,
1435,
422,
28268,
2678,
18,
7570,
11403,
30,
365,
18,
267,
67,
710,
67,
2629,
1011,
404,
309,
365,
18,
267,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
710,
67,
2629,
12,
2890,
16,
980,
4672,
309,
980,
18,
6406,
1435,
422,
28268,
2678,
18,
7570,
11403,
30,
365,
18,
267,
67,
710,
67,
2629,
1011,
404,
309,
365,
18,
267,
67,
... |
print f0,alpha,delta,float(sF1), 2*float(sF1th), float(sF2), 2*float(sF2th),abs(float(sf1)-float(sf2)),h0,i+1,counter,float(counter)/float(i+1) print ' ' print 'Ninj,tolerance,dh0= ',Ninj,tol,dh0 print 'current confidence,target confidence: ',float(counter)/float(i+1),c0 | def usage(): msg = """\ | 1b4bbf9c3921d29af92cf37d52124f32dd7c8e88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/1b4bbf9c3921d29af92cf37d52124f32dd7c8e88/allsky_pulsar_pipe_upper_limit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1234,
273,
3536,
64,
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,
0,
0,
0... | [
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1234,
273,
3536,
64,
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,
-100,
-... | |
sage: M=E.modular_symbol() | def modular_symbol(self, sign=1, use_eclib = False, normalize = "L_ratio"): r""" Return the modular symbol associated to this elliptic curve, with given sign and base ring. This is the map that sends `r/s` to a fixed multiple of the integral of `2 \pi i f(z) dz` from `\infty` to `r/s`, normalized so that all values of this map take values in `\QQ`. | 30be9d12c724c13a62417b00fbc1b13092236bfe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/30be9d12c724c13a62417b00fbc1b13092236bfe/ell_rational_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
681,
2490,
67,
7175,
12,
2890,
16,
1573,
33,
21,
16,
999,
67,
557,
2941,
273,
1083,
16,
3883,
273,
315,
48,
67,
9847,
6,
4672,
436,
8395,
2000,
326,
681,
2490,
3273,
3627,
358,
333,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
681,
2490,
67,
7175,
12,
2890,
16,
1573,
33,
21,
16,
999,
67,
557,
2941,
273,
1083,
16,
3883,
273,
315,
48,
67,
9847,
6,
4672,
436,
8395,
2000,
326,
681,
2490,
3273,
3627,
358,
333,
... | |
os.execle(xulrunnerBinary, xulrunnerBinary, applicationIni, "-jsconsole", newEnv) | os.execle(xulrunnerBinary, xulrunnerBinary, applicationIni, "-jsconsole", "-console", newEnv) | def run(self): # Build extensions and add results to child search path build = self.reinitialize_command('build') build.build_base = self.bdist_base build.run() if build.build_platlib is not None: self.childPythonPaths.append(build.build_platlib) if build.build_lib is not None: self.childPythonPaths.append(build.build_lib) | 5a05510d177509c044b084c55b5a0cdf98cac9dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12354/5a05510d177509c044b084c55b5a0cdf98cac9dc/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
468,
3998,
4418,
471,
527,
1686,
358,
1151,
1623,
589,
1361,
273,
365,
18,
266,
11160,
67,
3076,
2668,
3510,
6134,
1361,
18,
3510,
67,
1969,
273,
365,
18,
70,
441... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1086,
12,
2890,
4672,
468,
3998,
4418,
471,
527,
1686,
358,
1151,
1623,
589,
1361,
273,
365,
18,
266,
11160,
67,
3076,
2668,
3510,
6134,
1361,
18,
3510,
67,
1969,
273,
365,
18,
70,
441... |
def test_ogrinfo_10(): | def test_ogrinfo_11(): | def test_ogrinfo_10(): if test_cli_utilities.get_ogrinfo_path() is None: return 'skip' ret = gdaltest.runexternal(test_cli_utilities.get_ogrinfo_path() + ' ../ogr/data/poly.shp poly -fields=no') if ret.find('AREA (Real') != -1: return 'fail' if ret.find('POLYGON (') == -1: return 'fail' return 'success' | 5077bd973abbb454514d973f21ea3484cc616c25 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10290/5077bd973abbb454514d973f21ea3484cc616c25/test_ogrinfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
717,
86,
1376,
67,
2499,
13332,
309,
1842,
67,
4857,
67,
1367,
1961,
18,
588,
67,
717,
86,
1376,
67,
803,
1435,
353,
599,
30,
327,
296,
7457,
11,
225,
325,
273,
15551,
2390... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
717,
86,
1376,
67,
2499,
13332,
309,
1842,
67,
4857,
67,
1367,
1961,
18,
588,
67,
717,
86,
1376,
67,
803,
1435,
353,
599,
30,
327,
296,
7457,
11,
225,
325,
273,
15551,
2390... |
if typ == 'OK': self.state = 'SELECTED' elif typ == 'NO': self.state = 'AUTH' if not readonly and not self.untagged_responses.has_key('READ-WRITE'): raise self.error('%s is not writable' % mailbox) | if typ != 'OK': self.state = 'AUTH' return typ, dat self.state = 'SELECTED' if not self.untagged_responses.has_key('READ-WRITE') \ and not readonly: if __debug__ and self.debug >= 1: _dump_ur(self.untagged_responses) raise self.readonly('%s is not writable' % mailbox) | def select(self, mailbox='INBOX', readonly=None): """Select a mailbox. | b10c0e30e74484a3863b7dcd5a9fd8e9e5849364 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/b10c0e30e74484a3863b7dcd5a9fd8e9e5849364/imaplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
12,
2890,
16,
14187,
2218,
706,
16876,
2187,
17102,
33,
7036,
4672,
3536,
3391,
279,
14187,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
2027,
12,
2890,
16,
14187,
2218,
706,
16876,
2187,
17102,
33,
7036,
4672,
3536,
3391,
279,
14187,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
str += ' <td><font size="-2">[show private |' str += ' <a href="../' + self._uid_to_uri(uid) str += '">hide private</a>]</font></td>\n' | return ('<font size="-2">[show private | ' + '<a href="../public/' + uri + '">hide private' + '</a>]</font>') | def _public_private_link(self, uid): """ @return: The HTML code for a link between the public & private copies of the documentation. @rtype: C{string} """ if self._show_private and self._is_private(uid.name()): return '' | dd7fc26b7d69af6d4765be2a892edca4603899ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/dd7fc26b7d69af6d4765be2a892edca4603899ee/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
482,
67,
1152,
67,
1232,
12,
2890,
16,
4555,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
1692,
3086,
326,
1071,
473,
3238,
13200,
434,
326,
7323,
18,
632,
86,
723,
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,
389,
482,
67,
1152,
67,
1232,
12,
2890,
16,
4555,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
1692,
3086,
326,
1071,
473,
3238,
13200,
434,
326,
7323,
18,
632,
86,
723,
30,
... |
self.minlen[i] = min(center[i]-rad, self.minlen[i]) self.maxlen[i] = max(center[i]+rad, self.maxlen[i]) | if self.minlen[i] == None or center[i]-rad < self.minlen[i]: self.minlen[i] = center[i]-rad if self.maxlen[i] == None or center[i]+rad > self.maxlen[i]: self.maxlen[i] = center[i]+rad | def parseLines(self, lines): """ Parse the lines """ for line in lines: if string.find(line,"ATOM") == 0: subline = string.replace(line[30:], "-", " -") words = string.split(subline) if len(words) < 4: continue self.gotatom = self.gotatom + 1 self.q = self.q + float(words[3]) rad = float(words[4]) center = [] for word in words[0:3]: center.append(float(word)) for i in range(3): self.minlen[i] = min(center[i]-rad, self.minlen[i]) self.maxlen[i] = max(center[i]+rad, self.maxlen[i]) elif string.find(line, "HETATM") == 0: self.gothet = self.gothet + 1 # Special handling for no ATOM entries in the pqr file, only HETATM entries if self.gotatom == 0: subline = string.replace(line[30:], "-", " -") words = string.split(subline) if len(words) < 4: continue self.q = self.q + float(words[3]) rad = float(words[4]) center = [] for word in words[0:3]: center.append(float(word)) for i in range(3): self.minlen[i] = min(center[i]-rad, self.minlen[i]) self.maxlen[i] = max(center[i]+rad, self.maxlen[i]) | d54d597c605db13c106080494dc7d0d242243d10 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8179/d54d597c605db13c106080494dc7d0d242243d10/psize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
5763,
12,
2890,
16,
2362,
4672,
3536,
2884,
326,
2362,
3536,
364,
980,
316,
2362,
30,
309,
533,
18,
4720,
12,
1369,
10837,
28146,
7923,
422,
374,
30,
17809,
558,
273,
533,
18,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5763,
12,
2890,
16,
2362,
4672,
3536,
2884,
326,
2362,
3536,
364,
980,
316,
2362,
30,
309,
533,
18,
4720,
12,
1369,
10837,
28146,
7923,
422,
374,
30,
17809,
558,
273,
533,
18,
20... |
sage: print L | sage: L | def column_containing_sym(L, r, x): """ Given an improper latin square L with L[r, c1] = L[r, c2] = x, return c1 or c2 with equal probability. This is an internal function and should only be used in LatinSquare_generator(). EXAMPLES: sage: from sage.combinat.matrices.latin import * sage: L = matrix([(1, 0, 2, 3), (0, 2, 3, 0), (2, 3, 0, 1), (3, 0, 1, 2)]) sage: print L [1 0 2 3] [0 2 3 0] [2 3 0 1] [3 0 1 2] sage: c = column_containing_sym(L, 1, 0) sage: print c == 0 or c == 3 True """ c1 = -1 c2 = -1 for c in range(L.ncols()): if c1 >= 0 and c2 >= 0: break if L[r, c] == x and c1 < 0: c1 = c continue if L[r, c] == x and c2 < 0: c2 = c break assert c1 >= 0 and c2 >= 0 if coin(): return c1 else: return c2 | 79588eb9f6225f31a0fe90ef3cb590193d4561c1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/79588eb9f6225f31a0fe90ef3cb590193d4561c1/latin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1057,
67,
1213,
3280,
67,
8117,
12,
48,
16,
436,
16,
619,
4672,
3536,
16803,
392,
13069,
457,
30486,
8576,
511,
598,
511,
63,
86,
16,
276,
21,
65,
273,
511,
63,
86,
16,
276,
22,
65... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1057,
67,
1213,
3280,
67,
8117,
12,
48,
16,
436,
16,
619,
4672,
3536,
16803,
392,
13069,
457,
30486,
8576,
511,
598,
511,
63,
86,
16,
276,
21,
65,
273,
511,
63,
86,
16,
276,
22,
65... |
sage: print check_bitrade_generators(a, b, G.identity()) | sage: check_bitrade_generators(a, b, gap('()')) | def check_bitrade_generators(a, b, c): """ Three group elements a, b, c will generate a bitrade if a*b*c = 1 and the subgroups <a>, <b>, <c> intersect (pairwise) in just the identity. EXAMPLES: sage: from sage.combinat.matrices.latin import * sage: a, b, c, G = p3_group_bitrade_generators(3) sage: print check_bitrade_generators(a, b, c) True sage: print check_bitrade_generators(a, b, G.identity()) False """ A = PermutationGroup([a]) B = PermutationGroup([b]) C = PermutationGroup([c]) if a*b != c**(-1): return False X = gap.Intersection(gap.Intersection(A, B), C) return X.Size() == 1 | 0d333d6beb48cce2a6cb9f6c18b5d14e9b0765b2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/0d333d6beb48cce2a6cb9f6c18b5d14e9b0765b2/latin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
3682,
354,
323,
67,
25959,
12,
69,
16,
324,
16,
276,
4672,
3536,
935,
992,
1041,
2186,
279,
16,
324,
16,
276,
903,
2103,
279,
2831,
354,
323,
309,
279,
14,
70,
14,
71,
273... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
3682,
354,
323,
67,
25959,
12,
69,
16,
324,
16,
276,
4672,
3536,
935,
992,
1041,
2186,
279,
16,
324,
16,
276,
903,
2103,
279,
2831,
354,
323,
309,
279,
14,
70,
14,
71,
273... |
which case it returns the default refresentation. | which case it returns the default representation. | def __str__(self): """ str(G) returns the name of the graph, unless it doesn't have one, in which case it returns the default refresentation. | a520fa15cff86fbbd1335f8b6f9d36203c74d574 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/a520fa15cff86fbbd1335f8b6f9d36203c74d574/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
3536,
609,
12,
43,
13,
1135,
326,
508,
434,
326,
2667,
16,
3308,
518,
3302,
1404,
1240,
1245,
16,
316,
1492,
648,
518,
1135,
326,
805,
1278,
1581,
367,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
3536,
609,
12,
43,
13,
1135,
326,
508,
434,
326,
2667,
16,
3308,
518,
3302,
1404,
1240,
1245,
16,
316,
1492,
648,
518,
1135,
326,
805,
1278,
1581,
367,
... |
for (func, cmd) in self.sub_commands: | for (func, cmd_name) in self.sub_commands: | def run (self): | ba38d12063919288d6593593493cd37057d0ba67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba38d12063919288d6593593493cd37057d0ba67/install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
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,
0,
0,
0,
0,
0,
0... | [
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
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,
-100,
-100,
-100,
... |
def buildTestrunner(self, job="test"): console.info("Building Testrunner for %s %s... " %(self.parent.name, self.name)) if not (self.hasGenerator and self.hasUnitTests): console.write("Nothing to do.", "info") return rcode, output, errout = runGenerator(self.path, job) if rcode > 0: self.issues.append( {"testrunnerBuild" : errout} ) console.write("ERROR: ") console.indent() console.error(errout) console.outdent() else: console.write(" Done.", "info") | def _checkUnitTests(self): try: classPath = self.manifest["provides"]["class"] namespace = self.manifest["provides"]["namespace"] fullClassPath = os.path.join(self.path, classPath, namespace) testPath = os.path.join(fullClassPath, "test") if os.path.isdir(testPath): testPathContents = os.listdir(testPath) for entry in testPathContents: if entry[-3:] == ".js" and entry != "DemoTest.js": return True except: pass return False | 395584285eff657daadad29d91e452f29306eeeb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/395584285eff657daadad29d91e452f29306eeeb/repository.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
2802,
14650,
12,
2890,
4672,
775,
30,
22503,
273,
365,
18,
14357,
9614,
685,
13427,
6,
6362,
6,
1106,
11929,
1981,
273,
365,
18,
14357,
9614,
685,
13427,
6,
6362,
6,
4937,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1893,
2802,
14650,
12,
2890,
4672,
775,
30,
22503,
273,
365,
18,
14357,
9614,
685,
13427,
6,
6362,
6,
1106,
11929,
1981,
273,
365,
18,
14357,
9614,
685,
13427,
6,
6362,
6,
4937,
1... | |
s = string.strip(s) | s = s.strip() | def split_quoted(s): s = string.strip(s) words = [] pos = 0 while s: m = _wordchars_re.match(s, pos) end = m.end() if end == len(s): words.append(s[:end]) break if s[end] in string.whitespace: # unescaped, unquoted whitespace: now words.append(s[:end]) # we definitely have a word delimiter s = string.lstrip(s[end:]) pos = 0 elif s[end] == '\\': # preserve whatever is being escaped; # will become part of the current word s = s[:end] + s[end+1:] pos = end+1 else: if s[end] == "'": # slurp singly-quoted string m = _squote_re.match(s, end) elif s[end] == '"': # slurp doubly-quoted string m = _dquote_re.match(s, end) else: raise RuntimeError("this can't happen (bad char '%c')" % s[end]) if m is None: raise ValueError("bad string (mismatched %s quotes?)" % s[end]) (beg, end) = m.span() if _has_white_re.search(s[beg+1:end-1]): s = s[:beg] + s[beg+1:end-1] + s[end:] pos = m.end() - 2 else: # Keeping quotes when a quoted word does not contain # white-space. XXX: send a patch to distutils pos = m.end() if pos >= len(s): words.append(s) break return words | b072669a495a6e50acb5ab0a25301b721c3875d9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/b072669a495a6e50acb5ab0a25301b721c3875d9/ccompiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
67,
15179,
12,
87,
4672,
272,
273,
272,
18,
6406,
1435,
4511,
273,
5378,
949,
273,
374,
225,
1323,
272,
30,
312,
273,
389,
1095,
7549,
67,
266,
18,
1916,
12,
87,
16,
949,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1416,
67,
15179,
12,
87,
4672,
272,
273,
272,
18,
6406,
1435,
4511,
273,
5378,
949,
273,
374,
225,
1323,
272,
30,
312,
273,
389,
1095,
7549,
67,
266,
18,
1916,
12,
87,
16,
949,
13,
... |
self.__disconnectDB__() | def __init__(self,default=False): """ The __init__ method which can be overrridden using other methods defined in this class. """ self.defaultVersion=99 self.activeRecords="1" self.db=None self.dbSocket=None self.myHome=None self.myHome=os.getenv("HOME") self.urlPattern="http://ldas-cit.ligo.caltech.edu/segments/S5/%s/dq_segments.txt" self.pathPattern="%s/%s/dq_segments.txt" self.sqlFile="/followupDQ.sqlite" self.sqlPath=self.myHome self.ifoList=["L1","H1","H2"] self.dbFiles=[] for ifo in self.ifoList: thisFile=self.pathPattern%(self.myHome,ifo) thisUrl=self.urlPattern%(ifo) thisIfo=ifo thisFileExists=os.path.isfile(thisFile) self.dbFiles.append([thisIfo,thisFile,thisUrl,thisFileExists]) #Default Behavior Code Below if not(default) and os.path.isfile(self.sqlPath+self.sqlFile): self.__connectDB__() try: x=self.__createRawCursor__() for table in self.ifoList: x.execute("select * from %s limit 100"%(table)) del x except: sys.stderr.write("Sqlite database at %s seems\ | 9c6993da3a5b5222cb1f9dd8dc46f664b40e60f8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/9c6993da3a5b5222cb1f9dd8dc46f664b40e60f8/fu_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1886,
33,
8381,
4672,
3536,
1021,
1001,
2738,
972,
707,
1492,
848,
506,
5713,
1691,
13002,
1450,
1308,
2590,
2553,
316,
333,
667,
18,
3536,
365,
18,
1886,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1886,
33,
8381,
4672,
3536,
1021,
1001,
2738,
972,
707,
1492,
848,
506,
5713,
1691,
13002,
1450,
1308,
2590,
2553,
316,
333,
667,
18,
3536,
365,
18,
1886,
... | |
if action != "Browse": | if action != "Browse" and req: | 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... |
""" This Node class performs a parameter consistency check using the sites claiming to detect the trigger and the observed effective distance at each site. A command line example is below: followupRatioTest.py -R /archive/home/ctorres/public_html/DQstuff/ratioTest.pickle -iL1 -jH1 -kV1 -I10 -J10 -K5 -A 1 -B 1 -C 1.0001 -pmoinmoin -o mmTable.wiki """ defaults={"section":"effDRatio", "options":{"output-file":"effDRatio.wiki", "output-format":"moinmoin", "snr-ratio-test":"/archive/home/ctorres/public_html/DQstuff/ratioTest.pickle"} } def __init__(self, dag, job, cp, opts, coincEvent=None): """ """ self.__conditionalLoadDefaults__(effDRatioNode.defaults,cp) pipeline.CondorDAGNode.__init__(self,job) oFilename="%s_%s"%(str("%10.3f"%(coincEvent.time)).replace(".","_"),cp.get('effDRatio','output-file')) self.add_var_opt("output-file",job.outputPath+'/DataProducts/'+oFilename) index=1 for ifo,snglEvent in coincEvent.sngl_inspiral.items(): myIFO=snglEvent.ifo mySNR=snglEvent.snr myTIME=snglEvent.time self.add_var_opt("ifo%i"%(index),myIFO) self.add_var_opt("snr%i"%(index),mySNR) self.add_var_opt("time%i"%(index),myTIME) dag.add_node(self) | """ This Node class performs a parameter consistency check using the sites claiming to detect the trigger and the observed effective distance at each site. A command line example is below: followupRatioTest.py -R /archive/home/ctorres/public_html/DQstuff/ratioTest.pickle -iL1 -jH1 -kV1 -I10 -J10 -K5 -A 1 -B 1 -C 1.0001 -pmoinmoin -o mmTable.wiki """ defaults={"section":"effDRatio", "options":{"output-file":"effDRatio.wiki", "output-format":"moinmoin", "snr-ratio-test":"/archive/home/ctorres/public_html/DQstuff/ratioTest.pickle"} } def __init__(self, dag, job, cp, opts, coincEvent=None): """ """ self.__conditionalLoadDefaults__(effDRatioNode.defaults,cp) pipeline.CondorDAGNode.__init__(self,job) oFilename="%s_%s"%(str("%10.3f"%(coincEvent.time)).replace(".","_"),cp.get('effDRatio','output-file')) self.add_var_opt("output-file",job.outputPath+'/DataProducts/'+oFilename) index=1 for ifo,snglEvent in coincEvent.sngl_inspiral.items(): myIFO=snglEvent.ifo mySNR=snglEvent.snr myTIME=snglEvent.time self.add_var_opt("ifo%i"%(index),myIFO) self.add_var_opt("snr%i"%(index),mySNR) self.add_var_opt("time%i"%(index),myTIME) dag.add_node(self) | def __init__(self, dag, job, cp, opts, time): """ """ self.__conditionalLoadDefaults__(findVetosNode.defaults,cp) pipeline.CondorDAGNode.__init__(self,job) self.add_var_opt("trigger-time",time) #Output filename oFilename="%s_%s"%(str(int(float(time))),cp.get('findFlags','output-file')) self.add_var_opt("output-file",job.outputPath+'/DataProducts/'+oFilename) self.add_var_opt("segment-url",cp.get('findFlags','segment-url')) self.add_var_opt("output-format",cp.get('findFlags','output-format')) self.add_var_opt("window",cp.get('findFlags','window')) dag.add_node(self) | cbd6ac162cb6bf2eb4ad5ce9c3d03753b881f67f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/cbd6ac162cb6bf2eb4ad5ce9c3d03753b881f67f/stfu_pipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
22940,
16,
1719,
16,
3283,
16,
1500,
16,
813,
4672,
3536,
3536,
365,
16186,
22019,
2563,
7019,
972,
12,
4720,
58,
278,
538,
907,
18,
7606,
16,
4057,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
22940,
16,
1719,
16,
3283,
16,
1500,
16,
813,
4672,
3536,
3536,
365,
16186,
22019,
2563,
7019,
972,
12,
4720,
58,
278,
538,
907,
18,
7606,
16,
4057,
13,
... |
if not host: return addinfo(open(url2pathname(file), 'r'), noheaders()) | if not host: return addinfourl(open(url2pathname(file), 'r'), noheaders(), self.openedurl) | def open_local_file(self, url): host, file = splithost(url) if not host: return addinfo(open(url2pathname(file), 'r'), noheaders()) host, port = splitport(host) if not port and socket.gethostbyname(host) in ( localhost(), thishost()): file = unquote(file) return addinfo(open(url2pathname(file), 'r'), noheaders()) raise IOError, ('local file error', 'not on local host') | e6ad8913e20766e3769b346450dc952f0140462c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6ad8913e20766e3769b346450dc952f0140462c/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
3729,
67,
768,
12,
2890,
16,
880,
4672,
1479,
16,
585,
273,
6121,
483,
669,
12,
718,
13,
309,
486,
1479,
30,
327,
527,
10625,
477,
80,
12,
3190,
12,
718,
22,
28336,
12,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1696,
67,
3729,
67,
768,
12,
2890,
16,
880,
4672,
1479,
16,
585,
273,
6121,
483,
669,
12,
718,
13,
309,
486,
1479,
30,
327,
527,
10625,
477,
80,
12,
3190,
12,
718,
22,
28336,
12,
7... |
def spew(trace_names=None): """ """ sys.settrace(Spew(trace_names)) | def spew(trace_names=None, show_values=False): """ """ sys.settrace(Spew(trace_names, show_values)) | def spew(trace_names=None): """ """ sys.settrace(Spew(trace_names)) | 0126774236028cae94b8199f4d5fa6026cdc2d43 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10078/0126774236028cae94b8199f4d5fa6026cdc2d43/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17785,
91,
12,
5129,
67,
1973,
33,
7036,
16,
2405,
67,
2372,
33,
8381,
4672,
3536,
3536,
2589,
18,
542,
5129,
12,
55,
347,
91,
12,
5129,
67,
1973,
16,
2405,
67,
2372,
3719,
282,
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,
17785,
91,
12,
5129,
67,
1973,
33,
7036,
16,
2405,
67,
2372,
33,
8381,
4672,
3536,
3536,
2589,
18,
542,
5129,
12,
55,
347,
91,
12,
5129,
67,
1973,
16,
2405,
67,
2372,
3719,
282,
2,
... |
t.byteswap(True) | if Image.VERSION in ['1.1.4','1.1.5','1.1.6']: t.byteswap(True) | def LoadFrameFromMonolithic(filename=None,frameNum=0): #f='C:/Documents and Settings/Owner/Desktop/Stack_Zproject_GBR_DC.gif' if filename==None: filename=wx.FileSelector() im=Image.open(filename) if im.format in _tif_names: datatype=np.uint16 elif im.format in _gif_names: datatype=np.uint8 t=None i=0 while 1: if i==frameNum: t = np.asarray(im.getdata(),dtype=datatype) t.resize(numFrames,im.size[1],im.size[0]) break i+=1 try: im.seek(im.tell()+1) except EOFError: break # end of sequence if t==None: print 'Frame not able to be loaded' return t else: # Patch around PIL's Tiff stupidity... if im.format=='TIFF': fid=open(filename,'rb') endianness=fid.read(2) fid.close() if endianness=='MM': t.byteswap(True) elif endianness=='II': pass else: print "Just so you know... that ain't no tiff!" return t | 473180b2e6ff319ae3b1793f4ad8496a5f4b900c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10587/473180b2e6ff319ae3b1793f4ad8496a5f4b900c/GifTiffLoader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4444,
3219,
1265,
11415,
355,
483,
335,
12,
3459,
33,
7036,
16,
3789,
2578,
33,
20,
4672,
468,
74,
2218,
39,
27824,
12922,
471,
8709,
19,
5541,
19,
27583,
19,
2624,
67,
62,
4406,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4444,
3219,
1265,
11415,
355,
483,
335,
12,
3459,
33,
7036,
16,
3789,
2578,
33,
20,
4672,
468,
74,
2218,
39,
27824,
12922,
471,
8709,
19,
5541,
19,
27583,
19,
2624,
67,
62,
4406,
67,
... |
self.AddFunction(f) f.type_handler.AddImmediateFunction(self, f) f.type_handler.AddBucketFunction(self, f) | gen_cmd = f.GetInfo('gen_cmd') if gen_cmd == True or gen_cmd == None: self.AddFunction(f) f.type_handler.AddImmediateFunction(self, f) f.type_handler.AddBucketFunction(self, f) | def ParseGLH(self, filename): """Parses the GL2.h file and extracts the functions""" for line in _GL_FUNCTIONS.splitlines(): match = self._function_re.match(line) if match: func_name = match.group(2)[2:] func_info = self.GetFunctionInfo(func_name) if func_info.type != 'Noop': return_type = match.group(1).strip() arg_string = match.group(3) (args, num_pointer_args, is_gl_enum) = self.ParseArgs(arg_string) # comment in to find out which functions use bare enums. # if is_gl_enum: # self.Log("%s uses bare GLenum" % func_name) args_for_cmds = args if hasattr(func_info, 'cmd_args'): (args_for_cmds, num_pointer_args, is_gl_enum) = ( self.ParseArgs(getattr(func_info, 'cmd_args'))) cmd_args = [] for arg in args_for_cmds: arg.AddCmdArgs(cmd_args) init_args = [] for arg in args_for_cmds: arg.AddInitArgs(init_args) return_arg = CreateArg(return_type + " result") if return_arg: init_args.append(return_arg) f = Function(func_name, func_name, func_info, return_type, args, args_for_cmds, cmd_args, init_args, num_pointer_args) self.original_functions.append(f) self.AddFunction(f) f.type_handler.AddImmediateFunction(self, f) f.type_handler.AddBucketFunction(self, f) | ee42ed4a69c7e3b162746340666f981a90cdd8be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ee42ed4a69c7e3b162746340666f981a90cdd8be/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
11261,
44,
12,
2890,
16,
1544,
4672,
3536,
6656,
326,
10252,
22,
18,
76,
585,
471,
16469,
326,
4186,
8395,
364,
980,
316,
389,
11261,
67,
7788,
55,
18,
4939,
3548,
13332,
845,
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,
2884,
11261,
44,
12,
2890,
16,
1544,
4672,
3536,
6656,
326,
10252,
22,
18,
76,
585,
471,
16469,
326,
4186,
8395,
364,
980,
316,
389,
11261,
67,
7788,
55,
18,
4939,
3548,
13332,
845,
27... |
d = s.stopService() l = [] d.addCallback(l.append) util.spinWhile(lambda :not l) | util.wait(defer.maybeDeferred(s.stopService)) util.wait(TestEcho.d) TestEcho.d = defer.Deferred() | def lineReceived(self, line): self.factory.line = line | a4c16eda12d2a3a160a03099e1d1503f9bb4eb02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a4c16eda12d2a3a160a03099e1d1503f9bb4eb02/test_application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
980,
8872,
12,
2890,
16,
980,
4672,
365,
18,
6848,
18,
1369,
273,
980,
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,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
980,
8872,
12,
2890,
16,
980,
4672,
365,
18,
6848,
18,
1369,
273,
980,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
pass | assert self.ready, "List not ready" | def OnExpand(self, item): pass | fea0b7a7659af1638af9474d61b04512d0ea647f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9686/fea0b7a7659af1638af9474d61b04512d0ea647f/list.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
12271,
12,
2890,
16,
761,
4672,
1815,
365,
18,
1672,
16,
315,
682,
486,
5695,
6,
225,
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,
2755,
12271,
12,
2890,
16,
761,
4672,
1815,
365,
18,
1672,
16,
315,
682,
486,
5695,
6,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
class AdminPluginForm(forms.Model): | class AdminPluginForm(forms.ModelForm): | def clean_label(self): value = self.cleaned_data["label"] return validate_label(value) | 98f8580a05cbc3565c8ab5104e59b9694b4537c0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11093/98f8580a05cbc3565c8ab5104e59b9694b4537c0/forms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
67,
1925,
12,
2890,
4672,
460,
273,
365,
18,
6200,
329,
67,
892,
9614,
1925,
11929,
327,
1954,
67,
1925,
12,
1132,
13,
2,
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,
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,
2721,
67,
1925,
12,
2890,
4672,
460,
273,
365,
18,
6200,
329,
67,
892,
9614,
1925,
11929,
327,
1954,
67,
1925,
12,
1132,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.get_widget(path).set_sensitive(comment_sensitive) | self._actiongroup.get_action(path).set_sensitive(comment_sensitive) | def set_sensitivities(self): | e6a2bb0f854d131baa7feea110f314792ba32c5b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14624/e6a2bb0f854d131baa7feea110f314792ba32c5b/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
87,
773,
305,
427,
1961,
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,... | [
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,
444,
67,
87,
773,
305,
427,
1961,
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,
-... |
triageStatusClickSequence = { TriageEnum.now: TriageEnum.done, TriageEnum.done: TriageEnum.later, TriageEnum.later: TriageEnum.now } | triageStatusClickSequence = { TriageEnum.now: TriageEnum.later, TriageEnum.later: TriageEnum.done, TriageEnum.done: TriageEnum.now } | def getTriageStatusName(value): return triageStatusNames[value] | fd7cd9521fcd085849ad32b394d8cebb4c10a608 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/fd7cd9521fcd085849ad32b394d8cebb4c10a608/triage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3181,
27935,
1482,
461,
12,
1132,
4672,
327,
6882,
410,
1482,
1557,
63,
1132,
65,
225,
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,
3181,
27935,
1482,
461,
12,
1132,
4672,
327,
6882,
410,
1482,
1557,
63,
1132,
65,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if key.code <= 127 and (not key.mask & modifier.ALT_MASK + modifier.CONTROL_MASK): | if key.code <= 127 and ( unichr(key.code) not in self._valid_input_chars ) \ and (not key.mask & modifier.ALT_MASK + modifier.CONTROL_MASK): | def _table_mode_process_key_event (self, key): '''Xingma Mode Process Key Event''' cond_letter_translate = lambda (c): \ self._convert_to_full_width (c) if self._full_width_letter [self._mode] else c cond_punct_translate = lambda (c): \ self._convert_to_full_width (c) if self._full_width_punct [self._mode] else c # We have to process the pinyin mode change key event here, # because we ignore all Release event below. if self._match_hotkey (key, keysyms.Shift_R, modifier.SHIFT_MASK + modifier.RELEASE_MASK) and self._ime_py: res = self._editor.r_shift () self._refresh_properties () self._update_ui () return res # process commit to preedit if self._match_hotkey (key, keysyms.Shift_R, modifier.SHIFT_MASK + modifier.RELEASE_MASK) or self._match_hotkey (key, keysyms.Shift_L, modifier.SHIFT_MASK + modifier.RELEASE_MASK): res = self._editor.l_shift () self._update_ui () return res # Match single char mode switch hotkey if self._match_hotkey (key, keysyms.comma, modifier.CONTROL_MASK): self.property_activate ( u"onechar" ) return True # Match direct commit mode switch hotkey if self._match_hotkey (key, keysyms.slash, modifier.CONTROL_MASK): self.property_activate ( u"dcommit" ) return True # Match Chinese mode shift if self._match_hotkey (key, keysyms.semicolon, modifier.CONTROL_MASK): self.property_activate ( u"cmode" ) return True # Match speedmeter shift if self._match_hotkey (key, keysyms.apostrophe, modifier.CONTROL_MASK): self._sm_on = not self._sm_on if self._sm_on: self._sm.Show () else: self._sm.Hide () return True # Ignore key release event now :) if key.mask & modifier.RELEASE_MASK: return True | 1e894cf358814f0972159b9bd44fc282dad387c6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/544/1e894cf358814f0972159b9bd44fc282dad387c6/table.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2121,
67,
3188,
67,
2567,
67,
856,
67,
2575,
261,
2890,
16,
498,
4672,
9163,
60,
310,
2540,
8126,
4389,
1929,
2587,
26418,
6941,
67,
13449,
67,
13929,
273,
3195,
261,
71,
4672,
52... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2121,
67,
3188,
67,
2567,
67,
856,
67,
2575,
261,
2890,
16,
498,
4672,
9163,
60,
310,
2540,
8126,
4389,
1929,
2587,
26418,
6941,
67,
13449,
67,
13929,
273,
3195,
261,
71,
4672,
52... |
A naive implementation of __pow__ | A naive implementation of ``__pow__`` | def _pow_naive(self, n): r""" A naive implementation of __pow__ | f7adc4547fa59894ffbc320f0b3a2c47db617853 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/f7adc4547fa59894ffbc320f0b3a2c47db617853/monoids.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
23509,
67,
6582,
688,
12,
2890,
16,
290,
4672,
436,
8395,
432,
28224,
4471,
434,
1001,
23509,
972,
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,
389,
23509,
67,
6582,
688,
12,
2890,
16,
290,
4672,
436,
8395,
432,
28224,
4471,
434,
1001,
23509,
972,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
print "FAIL: " + str(e.reason) | print "FAIL: " + str(e) | def link_exists(host, selector): """ Check to see if the given host exists and is reachable """ try: site = urllib2.urlopen("http://" + host + selector) meta = site.info() except urllib2.URLError, e: print "FAIL: graph server does not resolve" print "FAIL: " + str(e.reason) return 0 return 1 | 03fb0e0b51e34a751338a8387a762c36d62e2f1e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13067/03fb0e0b51e34a751338a8387a762c36d62e2f1e/post_file.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1692,
67,
1808,
12,
2564,
16,
3451,
4672,
3536,
2073,
358,
2621,
309,
326,
864,
1479,
1704,
471,
353,
19234,
3536,
775,
30,
2834,
273,
11527,
22,
18,
295,
18589,
2932,
2505,
14334,
397,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1692,
67,
1808,
12,
2564,
16,
3451,
4672,
3536,
2073,
358,
2621,
309,
326,
864,
1479,
1704,
471,
353,
19234,
3536,
775,
30,
2834,
273,
11527,
22,
18,
295,
18589,
2932,
2505,
14334,
397,
... |
if audio.info: | if audio and audio.info: | def udpate_id3(bean, counter=None): if bean and bean.path and os.path.isfile(bean.path): try: audio = get_mutagen_audio(bean.path) except Exception, e: LOG.warn("ID3 NOT MP3", e, bean.path) return bean if audio and audio.has_key('artist'): bean.artist = decode_cp866(audio["artist"][0]) if audio and audio.has_key('title'): bean.title = decode_cp866(audio["title"][0]) #if audio and audio.has_key('tracknumber'): bean.tracknumber = audio["tracknumber"][0] #else: #if audio and not audio.has_key('tracknumber'): bean.tracknumber = counter duration_sec = bean.duration_sec if not bean.duration_sec: if audio.info and audio.info.length: duration_sec = int(audio.info.length) if audio.info: bean.info = audio.info.pprint() if bean.artist and bean.title: bean.text = bean.artist + " - " + bean.title if bean.tracknumber: try: bean.tracknumber = int(bean.tracknumber) except: bean.tracknumber = "" bean = update_bean_from_normilized_text(bean) bean.time = normilize_time(duration_sec) return bean | 3e074dce7317511195db3db0d4572f28e52865d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14563/3e074dce7317511195db3db0d4572f28e52865d1/id3_util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16673,
340,
67,
350,
23,
12,
14496,
16,
3895,
33,
7036,
4672,
309,
3931,
471,
3931,
18,
803,
471,
1140,
18,
803,
18,
291,
768,
12,
14496,
18,
803,
4672,
775,
30,
7447,
273,
336,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16673,
340,
67,
350,
23,
12,
14496,
16,
3895,
33,
7036,
4672,
309,
3931,
471,
3931,
18,
803,
471,
1140,
18,
803,
18,
291,
768,
12,
14496,
18,
803,
4672,
775,
30,
7447,
273,
336,
67,
... |
c = self.db.cursor() c.execute(mysqlcommand, (title,)) | if host2 != None and 'host' in tablenames: mysqlcommand+=u" AND host=%s" c = self.db.cursor() if host2 != None: c.execute(mysqlcommand, (title, host2)) else: c.execute(mysqlcommand, (title,)) | def getTitleId(self, title, subtitle=None, season=None, episode=None, array=False): """ Finds the MythVideo metadata id for the given Title from the MythDB, if any. Searches can be more specific if additional fields are supplied. If array is True return an array of intid's for the record(s) matching the search criteria. Without the array option a search with multiple matches will return a random result if more than one match was found. Non-array return results are only supported for backward compatibilty with older scripts. Returns None if no metadata was found. """ tablenames = self.getTableFieldNames('videometadata') | cbd031af868a22b20efa5009641d2f15a4d893ba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/cbd031af868a22b20efa5009641d2f15a4d893ba/MythVideo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10786,
548,
12,
2890,
16,
2077,
16,
20281,
33,
7036,
16,
15874,
33,
7036,
16,
17054,
33,
7036,
16,
526,
33,
8381,
4672,
3536,
4163,
87,
326,
8005,
451,
10083,
1982,
612,
364,
326,
864,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10786,
548,
12,
2890,
16,
2077,
16,
20281,
33,
7036,
16,
15874,
33,
7036,
16,
17054,
33,
7036,
16,
526,
33,
8381,
4672,
3536,
4163,
87,
326,
8005,
451,
10083,
1982,
612,
364,
326,
864,... |
size and each of the specified options will be passed to it (if the option is in the feature set the server advertises). If EHLO fails, HELO will be tried and ESMTP options suppressed. | size and each of the specified options will be passed to it. If EHLO fails, HELO will be tried and ESMTP options suppressed. | def sendmail(self,from_addr,to_addrs,msg,options=[]): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. - encoding : list of ESMTP options (such as 8bitmime) | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
4408,
12,
2890,
16,
2080,
67,
4793,
16,
869,
67,
23305,
16,
3576,
16,
2116,
33,
8526,
4672,
3536,
1220,
1296,
11199,
392,
7278,
4791,
2492,
18,
1021,
1775,
854,
30,
300,
628,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
4408,
12,
2890,
16,
2080,
67,
4793,
16,
869,
67,
23305,
16,
3576,
16,
2116,
33,
8526,
4672,
3536,
1220,
1296,
11199,
392,
7278,
4791,
2492,
18,
1021,
1775,
854,
30,
300,
628,
67,... |
if certInfo == None or not certInfo.has_key('DN') or not certInfo['DN']: return | DebugPrint(4, "DEBUG: certInfo: " + str(certInfo)) if certInfo == None or (not certInfo.has_key('DN')) or (not certInfo['DN']): DebugPrint(4, "Returning without processing certInfo") return | def verifyFromCertInfo(xmlDoc, userIdentityNode, namespace, prefix): " Use localJobID and probeName to find cert info file and insert info into XML record" # Collect data needed by certinfo reader DebugPrint(4, "DEBUG: Get JobIdentity") JobIdentityNode = GetNode(xmlDoc.getElementsByTagNameNS(namespace, 'JobIdentity')) if JobIdentityNode == None: return DebugPrint(4, "DEBUG: Get JobIdentity: OK") localJobId = GetNodeData(JobIdentityNode.getElementsByTagNameNS(namespace, 'LocalJobId')) DebugPrint(4, "DEBUG: Get localJobId: ", localJobId) usageRecord = userIdentityNode.parentNode probeName = GetNodeData(usageRecord.getElementsByTagNameNS(namespace, 'ProbeName')) DebugPrint(4, "DEBUG: Get probeName: ", probeName) # Read certinfo DebugPrint(4, "DEBUG: call readCertinfo") certInfo = readCertInfo(localJobId, probeName) DebugPrint(4, "DEBUG: call readCertinfo: OK") if certInfo == None or not certInfo.has_key('DN') or not certInfo['DN']: return # Use certinfo certInfo['DN'] = FixDN(certInfo['DN']) # "Standard" slash format # First, find a KeyInfo node if it is there keyInfoNS = 'http://www.w3.org/2000/09/xmldsig#'; keyInfoNode = GetNode(userIdentityNode.getElementsByTagNameNS(keyInfoNS, 'KeyInfo')) DNnode = GetNode(userIdentityNode.getElementsByTagNameNS(namespace, 'DN')) if DNnode and DN.firstChild: # Override DN.firstChild.data = certInfo['DN'] else: if not DNnode: DNnode = xmlDoc.createElementNS(namespace, 'DN') textNode = xmlDoc.createTextNode(certInfo['DN']) DNnode.appendChild(textNode) if not DNnode.parentNode: userIdentityNode.appendChild(DNnode) # Return VO information for insertion in a common place. return { 'VOName': certInfo['FQAN'], 'ReportableVOName': certInfo['VO']} | acbae47f05e07a99f734092965efc47de80a393b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/637/acbae47f05e07a99f734092965efc47de80a393b/Gratia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
1265,
5461,
966,
12,
2902,
1759,
16,
729,
4334,
907,
16,
1981,
16,
1633,
4672,
315,
2672,
1191,
2278,
734,
471,
10695,
461,
358,
1104,
3320,
1123,
585,
471,
2243,
1123,
1368,
3167,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3929,
1265,
5461,
966,
12,
2902,
1759,
16,
729,
4334,
907,
16,
1981,
16,
1633,
4672,
315,
2672,
1191,
2278,
734,
471,
10695,
461,
358,
1104,
3320,
1123,
585,
471,
2243,
1123,
1368,
3167,... |
locks = self.wl_lockmapping() locks.clear() | try: locks = self.wl_lockmapping() locks.clear() except: if hasattr(self, '_dav_writelocks'): del self._dav_writelocks if WriteLockInterface.isImplementedBy(self): self._dav_writelocks = PersistentMapping() | def wl_clearLocks(self): # Called by lock management machinery to quickly and effectively # destroy all locks. locks = self.wl_lockmapping() locks.clear() if hasattr(Acquisition.aq_base(self), '__no_valid_write_locks__'): self.__no_valid_write_locks__() | 49983bae020147a5b579c1da6de0d910c254555d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/49983bae020147a5b579c1da6de0d910c254555d/Lockable.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19564,
67,
8507,
19159,
12,
2890,
4672,
468,
11782,
635,
2176,
11803,
25046,
267,
627,
358,
23459,
471,
23500,
468,
5546,
777,
13046,
18,
775,
30,
13046,
273,
365,
18,
21504,
67,
739,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19564,
67,
8507,
19159,
12,
2890,
4672,
468,
11782,
635,
2176,
11803,
25046,
267,
627,
358,
23459,
471,
23500,
468,
5546,
777,
13046,
18,
775,
30,
13046,
273,
365,
18,
21504,
67,
739,
67... |
curs.execute("set local session_replication_role = 'local'") | dst_curs.execute("set local session_replication_role = 'local'") | def handle_execute_event(self, ev, dst_curs): """handle one EXECUTE event""" | 65866afaa77f02c628cd1a3fbdf185fb161b1260 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14597/65866afaa77f02c628cd1a3fbdf185fb161b1260/playback.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
8837,
67,
2575,
12,
2890,
16,
2113,
16,
3046,
67,
2789,
4672,
3536,
4110,
1245,
24508,
9099,
871,
8395,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
8837,
67,
2575,
12,
2890,
16,
2113,
16,
3046,
67,
2789,
4672,
3536,
4110,
1245,
24508,
9099,
871,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
elif o in ('--title'): | elif o in ('--title',): | def do_func(self, argv): """ """ format = 'ascii' function_name = '_main' tail = None | 67b8280e3e3a5fcdde21a536adf595f1d889e4da /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12817/67b8280e3e3a5fcdde21a536adf595f1d889e4da/scons-time.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
644,
12,
2890,
16,
5261,
4672,
3536,
3536,
740,
273,
296,
9184,
11,
445,
67,
529,
273,
2070,
5254,
11,
5798,
273,
599,
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,
1652,
741,
67,
644,
12,
2890,
16,
5261,
4672,
3536,
3536,
740,
273,
296,
9184,
11,
445,
67,
529,
273,
2070,
5254,
11,
5798,
273,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
ladder graph. :: | ladder graph. :: | def GeneralizedPetersenGraph(self, n,k): r""" Returns a generalized Petersen graph with `2n` nodes. The variables `n`, `k` are integers such that `n>2` and `0<k\leq\lfloor(n-1)`/`2\rfloor` | 0e5038cb8dec30dc04cb436c8c29b5b147d63987 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/0e5038cb8dec30dc04cb436c8c29b5b147d63987/graph_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9544,
1235,
52,
1032,
275,
4137,
12,
2890,
16,
290,
16,
79,
4672,
436,
8395,
2860,
279,
7470,
1235,
453,
1032,
275,
2667,
598,
1375,
22,
82,
68,
2199,
18,
1021,
3152,
1375,
82,
9191,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9544,
1235,
52,
1032,
275,
4137,
12,
2890,
16,
290,
16,
79,
4672,
436,
8395,
2860,
279,
7470,
1235,
453,
1032,
275,
2667,
598,
1375,
22,
82,
68,
2199,
18,
1021,
3152,
1375,
82,
9191,
... |
time_series = Extension('sage.finance.time_series',['sage/finance/time_series.pyx'], | time_series = Extension('sage.finance.time_series', ['sage/finance/time_series.pyx'], | def is_newer(file1, file2): """ Return True if either file2 does not exist or is older than file1. If file1 does not exist, always return False. """ if not os.path.exists(file1): return False if not os.path.exists(file2): return True if os.path.getmtime(file2) < os.path.getmtime(file1): return True return False | 12aff705aa1e2b2dc6e401b763fe2e9e51bdf02d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/12aff705aa1e2b2dc6e401b763fe2e9e51bdf02d/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
2704,
264,
12,
768,
21,
16,
585,
22,
4672,
3536,
2000,
1053,
309,
3344,
585,
22,
1552,
486,
1005,
578,
353,
12156,
2353,
585,
21,
18,
225,
971,
585,
21,
1552,
486,
1005,
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,
353,
67,
2704,
264,
12,
768,
21,
16,
585,
22,
4672,
3536,
2000,
1053,
309,
3344,
585,
22,
1552,
486,
1005,
578,
353,
12156,
2353,
585,
21,
18,
225,
971,
585,
21,
1552,
486,
1005,
16,... |
print "Content-type: text/xml\n\n" | print "Content-type: text/xml\n" | def __str__(self): | 42f99c655f247f5c04897e714fd0d30faba7ee02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10967/42f99c655f247f5c04897e714fd0d30faba7ee02/Exceptions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
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,
0,
0,
0,
... | [
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
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,
-100,
-10... |
self.syntax, self.__newSyntax = self.__newSyntax, None | self.syntax = self.__oldSyntax self.__newSyntax = self.__oldSyntax = None | def writeUndo(self, name, val, idx, (acFun, acCtx)): # Revive previous value self.syntax, self.__newSyntax = self.__newSyntax, None | eb9ed7cdc5a1dfd6cf877403e2575f77fd7f8a5b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/587/eb9ed7cdc5a1dfd6cf877403e2575f77fd7f8a5b/SNMPv2-SMI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
31224,
12,
2890,
16,
508,
16,
1244,
16,
2067,
16,
261,
1077,
22783,
16,
1721,
6442,
3719,
30,
468,
14477,
688,
2416,
460,
365,
18,
14308,
16,
365,
16186,
2704,
8070,
273,
365,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
31224,
12,
2890,
16,
508,
16,
1244,
16,
2067,
16,
261,
1077,
22783,
16,
1721,
6442,
3719,
30,
468,
14477,
688,
2416,
460,
365,
18,
14308,
16,
365,
16186,
2704,
8070,
273,
365,
16... |
""" Get a list of available wireless networks. | """ Get a list of available wireless networks. | def GetNetworks(self): """ Get a list of available wireless networks. Returns: A list containing available wireless networks. """ cmd = 'iwlist ' + self.iface + ' scan' if self.verbose: print cmd results = misc.Run(cmd) | 8064be227246aa688af0551bc7128f1ad261b0fe /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/353/8064be227246aa688af0551bc7128f1ad261b0fe/wnettools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
19999,
12,
2890,
4672,
3536,
968,
279,
666,
434,
2319,
6636,
2656,
13884,
18,
225,
2860,
30,
432,
666,
4191,
2319,
6636,
2656,
13884,
18,
225,
3536,
1797,
273,
296,
22315,
1098,
296... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
968,
19999,
12,
2890,
4672,
3536,
968,
279,
666,
434,
2319,
6636,
2656,
13884,
18,
225,
2860,
30,
432,
666,
4191,
2319,
6636,
2656,
13884,
18,
225,
3536,
1797,
273,
296,
22315,
1098,
296... |
self.shownRecd = recd | def showPhoto( self, recd ): pixbuf = self.getPhotoPixbuf( recd ) if (pixbuf != None): self.shownRecd = recd | 0c6929a40e375a1e68e80b6eab61ef3ef2e98006 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6451/0c6929a40e375a1e68e80b6eab61ef3ef2e98006/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
19934,
12,
365,
16,
1950,
72,
262,
30,
11871,
4385,
273,
365,
18,
588,
19934,
21816,
4385,
12,
1950,
72,
262,
309,
261,
14861,
4385,
480,
599,
4672,
365,
18,
674,
995,
426,
4315,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2405,
19934,
12,
365,
16,
1950,
72,
262,
30,
11871,
4385,
273,
365,
18,
588,
19934,
21816,
4385,
12,
1950,
72,
262,
309,
261,
14861,
4385,
480,
599,
4672,
365,
18,
674,
995,
426,
4315,... | |
assert gc.collect() > 0 | if gc.collect() == 0: raise TestFailed | def __init__(self): self.init = self.__init__ | a84d7e902d565e6ea53dab3d21a5e721598dd168 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a84d7e902d565e6ea53dab3d21a5e721598dd168/test_gc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
2738,
273,
365,
16186,
2738,
972,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
2890,
4672,
365,
18,
2738,
273,
365,
16186,
2738,
972,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
tol = self._fmiReal('0.0') | tol = self._fmiReal(0.0) | def initialize(self): """ Initialize the model. """ #Set the start attributes if len(self._XMLStartRealValues) > 0: self.set_fmiReal(self._XMLStartRealKeys, self._XMLStartRealValues) | 3dd5da86a1b141eb432677907f6a34c96e5144ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7711/3dd5da86a1b141eb432677907f6a34c96e5144ef/fmi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
4672,
3536,
9190,
326,
938,
18,
3536,
468,
694,
326,
787,
1677,
309,
562,
12,
2890,
6315,
4201,
1685,
6955,
1972,
13,
405,
374,
30,
365,
18,
542,
67,
74,
9197,
6955,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
4672,
3536,
9190,
326,
938,
18,
3536,
468,
694,
326,
787,
1677,
309,
562,
12,
2890,
6315,
4201,
1685,
6955,
1972,
13,
405,
374,
30,
365,
18,
542,
67,
74,
9197,
6955,
... |
'build', approvedStatus.statuscodeid) | 'build', self.approvedStatus.statuscodeid) | def edit_package(self, package, **changes): '''Add a new package to the database. ''' # Check that the tg.identity is allowed to make changes to the package if not identity.in_any_group('cvsadmin'): return dict(status=False, message='User must be in cvsadmin') | 48b4c95df35399b9205c63bf94720f75862df541 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9953/48b4c95df35399b9205c63bf94720f75862df541/dispatcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
67,
5610,
12,
2890,
16,
2181,
16,
2826,
6329,
4672,
9163,
986,
279,
394,
2181,
358,
326,
2063,
18,
9163,
468,
2073,
716,
326,
18289,
18,
10781,
353,
2935,
358,
1221,
3478,
358,
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,
3874,
67,
5610,
12,
2890,
16,
2181,
16,
2826,
6329,
4672,
9163,
986,
279,
394,
2181,
358,
326,
2063,
18,
9163,
468,
2073,
716,
326,
18289,
18,
10781,
353,
2935,
358,
1221,
3478,
358,
3... |
assert len(cat_links) == 3 | assert len(cat_links) == 4 | def test_index(self): response = self.app.get('/') assert response.html.find('h1',{'class':'title'}).string == 'All Projects' projects = response.html.findAll('div',{'class':'border card'}) assert len(projects) == 7, len(projects) assert projects[0].find('a').get('href') == '/adobe/adobe-1/' assert projects[0].find('img').get('alt') == 'adobe-1 Logo' cat_links = response.html.find('div',{'id':'sidebar'}).findAll('li') assert len(cat_links) == 3 assert cat_links[0].find('a').get('href') == '/browse/clustering' assert cat_links[0].find('a').get('class') == 'nav_child' assert cat_links[0].find('a').find('span').string == 'Clustering' | 4e013fc5df9359631cf222e0b78dea2c289e5515 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1036/4e013fc5df9359631cf222e0b78dea2c289e5515/test_root.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1615,
12,
2890,
4672,
766,
273,
365,
18,
2910,
18,
588,
2668,
2473,
13,
1815,
766,
18,
2620,
18,
4720,
2668,
76,
21,
2187,
27828,
1106,
11,
2497,
2649,
11,
97,
2934,
1080,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1615,
12,
2890,
4672,
766,
273,
365,
18,
2910,
18,
588,
2668,
2473,
13,
1815,
766,
18,
2620,
18,
4720,
2668,
76,
21,
2187,
27828,
1106,
11,
2497,
2649,
11,
97,
2934,
1080,
... |
""" score according to chinese rules (area, instead of territory) """ | def score(self, color): """ score according to chinese rules (area, instead of territory) """ if color == WHITE: count = KOMI + self.black_dead else: count = self.white_dead for square in self.squares: if square.color() == color: count += 1 elif square.color() == EMPTY: surround = 0 for neighbour in square.neighbours: if neighbour.color() == color: surround += 1 if surround == len(square.neighbours): count += 1 return count | b93265f9827cb41167492d438d904c50adf13529 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6661/b93265f9827cb41167492d438d904c50adf13529/go.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4462,
12,
2890,
16,
2036,
4672,
309,
2036,
422,
24353,
30,
1056,
273,
1475,
1872,
45,
397,
365,
18,
11223,
67,
22097,
469,
30,
1056,
273,
365,
18,
14739,
67,
22097,
364,
8576,
316,
365... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4462,
12,
2890,
16,
2036,
4672,
309,
2036,
422,
24353,
30,
1056,
273,
1475,
1872,
45,
397,
365,
18,
11223,
67,
22097,
469,
30,
1056,
273,
365,
18,
14739,
67,
22097,
364,
8576,
316,
365... | |
list_display = ('__str__', 'activation_key_expired') | list_display = ('__unicode__', 'activation_key_expired') | def delete_expired_users(self): """ Removes expired instances of ``RegistrationProfile`` and their associated ``User``s. Accounts to be deleted are identified by searching for instances of ``RegistrationProfile`` with expired activation keys, and then checking to see if their associated ``User`` instances have the field ``is_active`` set to ``False``; any ``User`` who is both inactive and has an expired activation key will be deleted. It is recommended that this method be executed regularly as part of your routine site maintenance; the file ``bin/delete_expired_users.py`` in this application provides a standalone script, suitable for use as a cron job, which will call this method. Regularly clearing out accounts which have never been activated serves two useful purposes: 1. It alleviates the ocasional need to reset a ``RegistrationProfile`` and/or re-send an activation email when a user does not receive or does not act upon the initial activation email; since the account will be deleted, the user will be able to simply re-register and receive a new activation key. 2. It prevents the possibility of a malicious user registering one or more accounts and never activating them (thus denying the use of those usernames to anyone else); since those accounts will be deleted, the usernames will become available for use again. If you have a troublesome ``User`` and wish to disable their account while keeping it in the database, simply delete the associated ``RegistrationProfile``; an inactive ``User`` which does not have an associated ``RegistrationProfile`` will not be deleted. """ for profile in self.all(): if profile.activation_key_expired(): user = profile.user if not user.is_active: user.delete() | 60c89fad8624e98414e0143997be79d05c1b5880 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9129/60c89fad8624e98414e0143997be79d05c1b5880/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
15820,
67,
5577,
12,
2890,
4672,
3536,
20284,
7708,
3884,
434,
12176,
7843,
4029,
10335,
471,
3675,
3627,
12176,
1299,
10335,
87,
18,
225,
30849,
358,
506,
4282,
854,
9283,
635,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
15820,
67,
5577,
12,
2890,
4672,
3536,
20284,
7708,
3884,
434,
12176,
7843,
4029,
10335,
471,
3675,
3627,
12176,
1299,
10335,
87,
18,
225,
30849,
358,
506,
4282,
854,
9283,
635,
... |
self._signalConnAlias(True) | self.disableSignal(False) | def _loadAliases(self, conn): self._signalConnAlias(False) self.list_alias.clear() self.list_alias.addItem(self._text['new_alias']) self.aliases = self.storage.aliases(unicode(conn)) self.list_alias.addItems([l for l, b in self.aliases]) self._signalConnAlias(True) self._loadAlias(0) | 201b1c9e4adf26ba529bd9bf36b9e00c8fe2621e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8560/201b1c9e4adf26ba529bd9bf36b9e00c8fe2621e/gui_option.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
945,
9667,
12,
2890,
16,
1487,
4672,
365,
6315,
10420,
3543,
2936,
12,
8381,
13,
365,
18,
1098,
67,
4930,
18,
8507,
1435,
365,
18,
1098,
67,
4930,
18,
1289,
1180,
12,
2890,
6315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
945,
9667,
12,
2890,
16,
1487,
4672,
365,
6315,
10420,
3543,
2936,
12,
8381,
13,
365,
18,
1098,
67,
4930,
18,
8507,
1435,
365,
18,
1098,
67,
4930,
18,
1289,
1180,
12,
2890,
6315,
... |
self.player.set_state(gst.STATE_READY) self.update() | def load( self, uri, mimetype): self.debug("load --> %r %r" % (uri, mimetype)) _,state,_ = self.player.get_state() if( state == gst.STATE_PLAYING or state == gst.STATE_PAUSED): self.stop() | 56a690641745e5de48e43c2d6f0dd10f24a0e22c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11626/56a690641745e5de48e43c2d6f0dd10f24a0e22c/gstreamer_renderer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
12,
365,
16,
2003,
16,
12595,
4672,
365,
18,
4148,
2932,
945,
15431,
738,
86,
738,
86,
6,
738,
261,
1650,
16,
12595,
3719,
389,
16,
2019,
16,
67,
273,
365,
18,
14872,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1262,
12,
365,
16,
2003,
16,
12595,
4672,
365,
18,
4148,
2932,
945,
15431,
738,
86,
738,
86,
6,
738,
261,
1650,
16,
12595,
3719,
389,
16,
2019,
16,
67,
273,
365,
18,
14872,
18,
588,
... | |
def execute(self, iterations = 1, nprocs = None, args = ''): | def run_once(self, nprocs = None, args = ''): | def execute(self, iterations = 1, nprocs = None, args = ''): # only supports combined server+client model at the moment # should support separate I suppose, but nobody uses it if not nprocs: nprocs = self.job.cpu_count() args += ' %s' % nprocs results = [] profilers = self.job.profilers if not profilers.only(): for i in range(iterations): results.append(self.run_tbench(args)) | 2f88c3fbf893f00648da22a59d93e1b5487cf4b3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/2f88c3fbf893f00648da22a59d93e1b5487cf4b3/tbench.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
8243,
12,
2890,
16,
290,
27537,
273,
599,
16,
833,
273,
875,
4672,
468,
1338,
6146,
8224,
1438,
15,
2625,
938,
622,
326,
10382,
468,
1410,
2865,
9004,
467,
1169,
4150,
16,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1086,
67,
8243,
12,
2890,
16,
290,
27537,
273,
599,
16,
833,
273,
875,
4672,
468,
1338,
6146,
8224,
1438,
15,
2625,
938,
622,
326,
10382,
468,
1410,
2865,
9004,
467,
1169,
4150,
16,
14... |
sage: sage.symbolic.units.is_unit(1) False sage: sage.symbolic.units.is_unit(units.length.meter) True | sage: sage.symbolic.units.is_unit(1) False sage: sage.symbolic.units.is_unit(units.length.meter) True | def is_unit(s): """ Returns a boolean when asked whether the input is in the list of units. INPUT: - `s` -- an object OUTPUT: - ``bool`` EXAMPLES:: sage: sage.symbolic.units.is_unit(1) False sage: sage.symbolic.units.is_unit(units.length.meter) True The square of a unit is not a unit:: sage: sage.symbolic.units.is_unit(units.length.meter^2) False You can also directly create units using var, though they won't have a nice docstring describing the unit:: sage: sage.symbolic.units.is_unit(var('meter')) True """ return unit_to_type.has_key(str(s)) | ed891e5784edd8a5e4d544f1ef837edc82b93924 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ed891e5784edd8a5e4d544f1ef837edc82b93924/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
4873,
12,
87,
4672,
3536,
2860,
279,
1250,
1347,
19279,
2856,
326,
810,
353,
316,
326,
666,
434,
4971,
18,
225,
12943,
30,
225,
300,
1375,
87,
68,
1493,
392,
733,
225,
11550,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
353,
67,
4873,
12,
87,
4672,
3536,
2860,
279,
1250,
1347,
19279,
2856,
326,
810,
353,
316,
326,
666,
434,
4971,
18,
225,
12943,
30,
225,
300,
1375,
87,
68,
1493,
392,
733,
225,
11550,
... |
Switch to Build Atoms modewhen user double clicks on an object | Switch to Build Atoms mode when user double clicks on an object | def leftDouble(self, event): """ | cdecb01c944bb883d08fc418b2d05b4a9b06bd83 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/cdecb01c944bb883d08fc418b2d05b4a9b06bd83/selectMolsMode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2002,
5265,
12,
2890,
16,
871,
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,
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,
2002,
5265,
12,
2890,
16,
871,
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,
-100,
-100... |
def Identifer(self): """ dublin core getId method""" return self.getId() | def Identifer(self): """ dublin core getId method""" return self.getId() | 3e7cf7ab40fec2d85ae51d8fa2a6f1f58cb63251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/3e7cf7ab40fec2d85ae51d8fa2a6f1f58cb63251/ExtensibleMetadata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13128,
21549,
12,
2890,
4672,
3536,
302,
29056,
2922,
2634,
707,
8395,
327,
365,
18,
26321,
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,
... | [
1,
1,
1,
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,
13128,
21549,
12,
2890,
4672,
3536,
302,
29056,
2922,
2634,
707,
8395,
327,
365,
18,
26321,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
make_original('threading') | def monkey_patch(all=True, os=False, select=False, socket=False, thread=False, time=False): """Globally patches certain system modules to be greenthread-friendly. The keyword arguments afford some control over which modules are patched. If *all* is True, then all modules are patched regardless of the other arguments. If it's False, then the rest of the keyword arguments control patching of specific subsections of the standard library. Most patch the single module of the same name (os, time, select). The exceptions are socket, which also patches the ssl module if present; and thread, which patches thread, threading, and Queue. It's safe to call monkey_patch multiple times. """ modules_to_patch = [] if all or os and not already_patched.get('os'): modules_to_patch += _green_os_modules() already_patched['os'] = True if all or select and not already_patched.get('select'): make_original('select') modules_to_patch += _green_select_modules() already_patched['select'] = True if all or socket and not already_patched.get('socket'): modules_to_patch += _green_socket_modules() already_patched['socket'] = True if all or thread and not already_patched.get('thread'): make_original('threading') # hacks ahead threading = original('threading') import eventlet.green.threading as greenthreading greenthreading._patch_main_thread(threading) modules_to_patch += _green_thread_modules() already_patched['thread'] = True if all or time and not already_patched.get('time'): make_original('time') modules_to_patch += _green_time_modules() already_patched['time'] = True for name, mod in modules_to_patch: orig_mod = sys.modules.get(name) for attr in mod.__patched__: orig_attr = getattr(orig_mod, attr, None) patched_attr = getattr(mod, attr, None) if patched_attr is not None: setattr(orig_mod, attr, patched_attr) | ee682dab9384172e5909744194828bcdca5c5eee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10078/ee682dab9384172e5909744194828bcdca5c5eee/patcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6921,
856,
67,
2272,
12,
454,
33,
5510,
16,
1140,
33,
8381,
16,
2027,
33,
8381,
16,
2987,
33,
8381,
16,
2650,
33,
8381,
16,
813,
33,
8381,
4672,
3536,
13499,
1230,
16482,
8626,
2619,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6921,
856,
67,
2272,
12,
454,
33,
5510,
16,
1140,
33,
8381,
16,
2027,
33,
8381,
16,
2987,
33,
8381,
16,
2650,
33,
8381,
16,
813,
33,
8381,
4672,
3536,
13499,
1230,
16482,
8626,
2619,
... | |
query = obj+".state <> 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s) OR id IN (%s)) %s %s" % (fiscalyear_clause, periods, where_move_state, where_move_lines_by_date) | query = obj+".state <> 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s) AND id IN (%s)) %s %s" % (fiscalyear_clause, periods, where_move_state, where_move_lines_by_date) | def _query_get(self, cr, uid, obj='l', context=None): fiscalyear_obj = self.pool.get('account.fiscalyear') fiscalperiod_obj = self.pool.get('account.period') account_obj = self.pool.get('account.account') fiscalyear_ids = [] if context is None: context = {} initial_bal = context.get('initial_bal', False) company_clause = " " if context.get('company_id', False): company_clause = " AND " +obj+".company_id = %s" % context.get('company_id', False) if not context.get('fiscalyear', False): fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('state', '=', 'draft')]) else: #for initial balance as well as for normal query, we check only the selected FY because the best practice is to generate the FY opening entries fiscalyear_ids = [context['fiscalyear']] | 55ef479cf0b40fbf6bb0aec9660af00df2104a24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/55ef479cf0b40fbf6bb0aec9660af00df2104a24/account_move_line.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2271,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1081,
2218,
80,
2187,
819,
33,
7036,
4672,
15324,
771,
6874,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
4631,
18,
74,
291,
771... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2271,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1081,
2218,
80,
2187,
819,
33,
7036,
4672,
15324,
771,
6874,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
4631,
18,
74,
291,
771... |
if getattr(doc, SurveyTool.portal_id, None) is None: return doc | if not doc.__dict__.get(SurveyTool.portal_id, None): return doc | def _verify_doc(self, doc): """See super""" if getattr(doc, SurveyTool.portal_id, None) is None: return doc | fe2be118c6e1b8c41c87afdaf8759ddf714fa2e7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3287/fe2be118c6e1b8c41c87afdaf8759ddf714fa2e7/add_survey_tool_to_nysite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8705,
67,
2434,
12,
2890,
16,
997,
4672,
3536,
9704,
2240,
8395,
309,
3869,
12,
2434,
16,
16680,
9062,
6364,
18,
24386,
67,
350,
16,
599,
13,
353,
599,
30,
327,
997,
2,
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,
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,
389,
8705,
67,
2434,
12,
2890,
16,
997,
4672,
3536,
9704,
2240,
8395,
309,
3869,
12,
2434,
16,
16680,
9062,
6364,
18,
24386,
67,
350,
16,
599,
13,
353,
599,
30,
327,
997,
2,
-100,
-1... |
log.info("saving modelcache") start = time.time() | log.info("saving %s", tcPath) | def _updateTroves(cfg, applyList, **kwargs): # Take out the apply-related keyword arguments applyDefaults = dict( replaceFiles = False, replaceManagedFiles = False, replaceUnmanagedFiles = False, replaceModifiedFiles = False, replaceModifiedConfigFiles = False, tagScript = None, justDatabase = False, skipCapsuleOps = False, info = False, keepJournal = False, noRestart = False, noScripts = False, ) applyKwargs = {} for k in applyDefaults: if k in kwargs: applyKwargs[k] = kwargs.pop(k) callback = kwargs.pop('callback') loadTroveCache = kwargs.pop('loadTroveCache', False) applyKwargs['test'] = kwargs.get('test', False) applyKwargs['localRollbacks'] = cfg.localRollbacks applyKwargs['autoPinList'] = cfg.pinTroves model = kwargs.pop('systemModel', None) if model: modelFile = kwargs.pop('systemModelFile', None) noRestart = applyKwargs.get('noRestart', False) client = conaryclient.ConaryClient(cfg) client.setUpdateCallback(callback) if kwargs.pop('disconnected', False): client.disconnectRepos() migrate = kwargs.get('migrate', False) # even though we no longer differentiate forceMigrate, we still # remove it from kwargs to avoid confusing prepareUpdateJob kwargs.pop('forceMigrate', False) restartInfo = kwargs.get('restartInfo', None) # Initialize the critical update set applyCriticalOnly = kwargs.get('applyCriticalOnly', False) if kwargs.get('criticalUpdateInfo') is not None: kwargs['criticalUpdateInfo'].criticalOnly = applyCriticalOnly else: kwargs['criticalUpdateInfo'] = CriticalUpdateInfo(applyCriticalOnly) info = applyKwargs.pop('info', False) # Rename depCheck to resolveDeps depCheck = kwargs.pop('depCheck', True) kwargs['resolveDeps'] = depCheck if not info: client.checkWriteableRoot() updJob = client.newUpdateJob() changeSetList = kwargs.pop('fromChangesets', []) try: if model: from conary.conaryclient import modelupdate tc = modelupdate.SystemModelTroveCache(client.getDatabase(), client.getRepos(), callback = callback, changeSetList = changeSetList) tcPath = cfg.root + '/var/lib/conarydb/modelcache' import time start = time.time() if loadTroveCache: log.info("loading modelcache") if os.path.exists(tcPath): tc.load(tcPath) log.info("done %.2f", time.time() - start) ts = client.systemModelGraph( model, changeSetList = changeSetList) suggMap = client._updateFromTroveSetGraph(updJob, ts, tc, fromChangesets = changeSetList) if tc.cacheModified(): log.info("saving modelcache") start = time.time() tc.save(tcPath) log.info("done %.2f", time.time() - start) else: suggMap = client.prepareUpdateJob(updJob, applyList, **kwargs) except: callback.done() client.close() raise if info: callback.done() displayUpdateInfo(updJob, cfg) if restartInfo: callback.done() newJobs = set(itertools.chain(*updJob.getJobs())) oldJobs = set(updJob.getItemList()) addedJobs = newJobs - oldJobs removedJobs = oldJobs - newJobs if addedJobs or removedJobs: print print 'NOTE: after critical updates were applied, the contents of the update were recalculated:' print displayChangedJobs(addedJobs, removedJobs, cfg) updJob.close() client.close() return if suggMap: callback.done() dcfg = display.DisplayConfig() dcfg.setTroveDisplay(fullFlavors = cfg.fullFlavors, fullVersions = cfg.fullVersions, showLabels = cfg.showLabels) formatter = display.TroveTupFormatter(dcfg) print "Including extra troves to resolve dependencies:" print " ", items = sorted(set(formatter.formatNVF(*x) for x in itertools.chain(*suggMap.itervalues()))) print " ".join(items) askInteractive = cfg.interactive if restartInfo: callback.done() newJobs = set(itertools.chain(*updJob.getJobs())) oldJobs = set(updJob.getItemList()) addedJobs = newJobs - oldJobs removedJobs = oldJobs - newJobs if addedJobs or removedJobs: print 'NOTE: after critical updates were applied, the contents of the update were recalculated:' displayChangedJobs(addedJobs, removedJobs, cfg) else: askInteractive = False if not updJob.jobs: # Nothing to do updJob.close() client.close() return elif askInteractive: print 'The following updates will be performed:' displayUpdateInfo(updJob, cfg) if migrate and cfg.interactive: print ('Migrate erases all troves not referenced in the groups' ' specified.') if askInteractive: if migrate: style = 'migrate' else: style = 'update' okay = cmdline.askYn('continue with %s? [Y/n]' % style, default=True) if not okay: updJob.close() client.close() return if not noRestart and updJob.getCriticalJobs(): print "Performing critical system updates, will then restart update." try: restartDir = client.applyUpdateJob(updJob, **applyKwargs) finally: updJob.close() client.close() if restartDir: params = sys.argv # Write command line to disk import xmlrpclib cmdlinefile = open(os.path.join(restartDir, 'cmdline'), "w") cmdlinefile.write(xmlrpclib.dumps((params, ), methodresponse = True)) cmdlinefile.close() # CNY-980: we should have the whole script of changes to perform in # the restart directory (in the job list); if in migrate mode, re-exec # as regular update if migrate and 'migrate' in params: params[params.index('migrate')] = 'update' params.extend(['--restart-info=%s' % restartDir]) client.close() raise errors.ReexecRequired( 'Critical update completed, rerunning command...', params, restartDir) else: if (not kwargs.get('test', False)) and model: modelFile.closeSnapshot() | eb430353d15bc1930e7d04ae12beecbb56337728 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8747/eb430353d15bc1930e7d04ae12beecbb56337728/updatecmd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
56,
303,
3324,
12,
7066,
16,
2230,
682,
16,
2826,
4333,
4672,
468,
17129,
596,
326,
2230,
17,
9243,
4932,
1775,
2230,
7019,
273,
2065,
12,
1453,
2697,
273,
1083,
16,
1453,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2725,
56,
303,
3324,
12,
7066,
16,
2230,
682,
16,
2826,
4333,
4672,
468,
17129,
596,
326,
2230,
17,
9243,
4932,
1775,
2230,
7019,
273,
2065,
12,
1453,
2697,
273,
1083,
16,
1453,
1... |
self._server_spawn(connection_args) | try: self._server_spawn(connection_args) except SpawnError, se: ce.set_additional_exception(se) raise ce | def _connect_with_autospawn(self, connection_args, autospawn): """Establish new connection (and/or autospawn server)""" try: self._conn = _SSIP_Connection(**connection_args) except SSIPCommunicationError: # Suppose server might not be running, try the autospawn mechanism if autospawn != False: # Autospawn is however not guaranteed to start the server. The server # will decide, based on it's configuration, whether to honor the request. self._server_spawn(connection_args) self._conn = _SSIP_Connection(**connection_args) else: raise | e2e6f21edadea187cb66107dfbcff257cdd4f36f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7484/e2e6f21edadea187cb66107dfbcff257cdd4f36f/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3612,
67,
1918,
67,
21996,
84,
9533,
12,
2890,
16,
1459,
67,
1968,
16,
13133,
84,
9533,
4672,
3536,
9122,
23385,
394,
1459,
261,
464,
19,
280,
13133,
84,
9533,
1438,
15574,
775,
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,
389,
3612,
67,
1918,
67,
21996,
84,
9533,
12,
2890,
16,
1459,
67,
1968,
16,
13133,
84,
9533,
4672,
3536,
9122,
23385,
394,
1459,
261,
464,
19,
280,
13133,
84,
9533,
1438,
15574,
775,
3... |
r""" $a(1) = 1$, $a(prime(i)) = i + 1$ for $i > 0$ and $a(u \cdot v) = a(u) \cdot a(v)$ for $u, v > 0$. INPUT: n -- positive integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A064553;a a(1) = 1, a(prime(i)) = i+1 for i > 0 and a(u*v) = a(u)*a(v) for u,v > 0 sage: a(0) Traceback (most recent call last): ... ValueError: input n (=0) must be a positive integer sage: a(1) 1 sage: a(2) 2 sage: a(9) 9 sage: a.list(16) [1, 2, 3, 4, 4, 6, 5, 8, 9, 8, 6, 12, 7, 10, 12, 16] AUTHOR: -- Jaap Spies (2007-02-04) """ def __init__(self): | def __init__(self): r""" $a(1) = 1$, $a(prime(i)) = i + 1$ for $i > 0$ and $a(u \cdot v) = a(u) \cdot a(v)$ for $u, v > 0$. INPUT: n -- positive integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A064553;a a(1) = 1, a(prime(i)) = i+1 for i > 0 and a(u*v) = a(u)*a(v) for u,v > 0 sage: a(0) Traceback (most recent call last): ... ValueError: input n (=0) must be a positive integer sage: a(1) 1 sage: a(2) 2 sage: a(9) 9 sage: a.list(16) [1, 2, 3, 4, 4, 6, 5, 8, 9, 8, 6, 12, 7, 10, 12, 16] AUTHOR: -- Jaap Spies (2007-02-04) """ | def _eval(self, n): return prime_pi(n) | 69a199217d612e1c590af73e16003812c85b93ec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/69a199217d612e1c590af73e16003812c85b93ec/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8622,
12,
2890,
16,
290,
4672,
327,
17014,
67,
7259,
12,
82,
13,
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,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8622,
12,
2890,
16,
290,
4672,
327,
17014,
67,
7259,
12,
82,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
fpar=param_file(self.datadir+'index.pro',False,precision=self.precision) | fpar=param_file(os.path.join(self.datadir,'index.pro'),False,precision=self.precision) | def __read_index(self): ''' Read index.pro file and write corresponding data Should only be called by set_param''' if self.__updating: print "Reading index.pro...", fpar=param_file(self.datadir+'index.pro',False,precision=self.precision) while True: (descr,res)=fpar.readline() if descr=='p': try: self.param['index'].create_dataset(res[0],data=res[1]) except(ValueError): print "Multiple parameter "+res[0]+" in index.pro file..." try: self.param['index'][res[0]][...]=res[1] except TypeError: print "Parameter "+res[0]+" defined with different multiplicty." del self.param['index/'+res[0]] self.param['index'].create_dataset(res[0],data=res[1]) elif descr=='e': break del(fpar) print "Done." | 082bf2268d2d7b8de598296ccb109e521a6c42dc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1377/082bf2268d2d7b8de598296ccb109e521a6c42dc/hdf5.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
896,
67,
1615,
12,
2890,
4672,
9163,
2720,
770,
18,
685,
585,
471,
1045,
4656,
501,
9363,
1338,
506,
2566,
635,
444,
67,
891,
26418,
309,
365,
16186,
5533,
1776,
30,
1172,
315,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
896,
67,
1615,
12,
2890,
4672,
9163,
2720,
770,
18,
685,
585,
471,
1045,
4656,
501,
9363,
1338,
506,
2566,
635,
444,
67,
891,
26418,
309,
365,
16186,
5533,
1776,
30,
1172,
315,
1... |
id, numreg = self.__handlers[self.eventtype] self.__handlers[self.eventtype] = id, numreg+1 except KeyError: | id, numreg = self.__handlers[self.canvas, self.eventtype] self.__handlers[self.canvas, self.eventtype] = id, numreg+1 except KeyError: | def schedule(self): """ Activate the object so that it will start receiving matplotlib events and calling the callback function. If the object is already active, it will be put in front of the list of active objects so that its callback function will be called before others. """ | ad2a3ddd1f3456ca4b5fbd3f51ed261dc62f3625 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/508/ad2a3ddd1f3456ca4b5fbd3f51ed261dc62f3625/mplutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4788,
12,
2890,
4672,
3536,
30936,
326,
733,
1427,
716,
518,
903,
787,
15847,
13892,
2641,
471,
4440,
326,
1348,
445,
18,
971,
326,
733,
353,
1818,
2695,
16,
518,
903,
506,
1378,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4788,
12,
2890,
4672,
3536,
30936,
326,
733,
1427,
716,
518,
903,
787,
15847,
13892,
2641,
471,
4440,
326,
1348,
445,
18,
971,
326,
733,
353,
1818,
2695,
16,
518,
903,
506,
1378,
316,
... |
while( data[self.index] != '\n' ): self.index = self.index + 1 self.index = self.index + 1 | def __init__(self, data): # ` HP-PCL XL;3;0 index = data.index("` HP-PCL XL;") data = data[index:] self.data = data # parse out data order and protocol self.binding = data[0] self.protocol = data[12] self.revision = data[14] | 2d7671b9f0578c4879102993259128cb1a09b076 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/675/2d7671b9f0578c4879102993259128cb1a09b076/pxlasm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
4672,
468,
1375,
670,
52,
17,
3513,
48,
1139,
48,
31,
23,
31,
20,
770,
273,
501,
18,
1615,
2932,
68,
670,
52,
17,
3513,
48,
1139,
48,
4868,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4672,
468,
1375,
670,
52,
17,
3513,
48,
1139,
48,
31,
23,
31,
20,
770,
273,
501,
18,
1615,
2932,
68,
670,
52,
17,
3513,
48,
1139,
48,
4868,
13,
... | |
raw_fieldname = fieldname[len(form.prefix)+len('widgets.'):] | marker = form.widgets.prefix index = fieldname.find(marker) + len(marker) raw_fieldname = fieldname[index:] | def validate_input(self, formname, fieldname, fieldset=None, value=None): """Given a form (view) name, a field name and the submitted value, validate the given field. """ | 09a8e2a3d31583eb78f3ea4bcace3c35b8c3ebed /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12252/09a8e2a3d31583eb78f3ea4bcace3c35b8c3ebed/validation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
2630,
12,
2890,
16,
646,
529,
16,
14680,
16,
16885,
33,
7036,
16,
460,
33,
7036,
4672,
3536,
6083,
279,
646,
261,
1945,
13,
508,
16,
279,
652,
508,
471,
326,
9638,
460,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
2630,
12,
2890,
16,
646,
529,
16,
14680,
16,
16885,
33,
7036,
16,
460,
33,
7036,
4672,
3536,
6083,
279,
646,
261,
1945,
13,
508,
16,
279,
652,
508,
471,
326,
9638,
460,
16,... |
Default is ``256 * 1024**2``. | Default is ``0`` (due to issue | def __str__(self): return '{%s}' % ', '.join(self.jobnames) | c5f464c02304d9773052515cc04050e1425f873c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/373/c5f464c02304d9773052515cc04050e1425f873c/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
2292,
9,
87,
1713,
738,
2265,
2418,
5701,
12,
2890,
18,
4688,
1973,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
701,
972,
12,
2890,
4672,
327,
2292,
9,
87,
1713,
738,
2265,
2418,
5701,
12,
2890,
18,
4688,
1973,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
s = re.sub(r'%(?!\()', '%%', s) | s = protect_non_subst_percents(s) | def process_output(s): # protect any non-substitution '%'s (not followed by '(') s = re.sub(r'%(?!\()', '%%', s) # protects cpu-specific symbols too s = protect_cpu_symbols(s) return substBitOps(s % templateMap) | 11cb904ad7c617e6653ce1ca52a92f10efe53025 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/11cb904ad7c617e6653ce1ca52a92f10efe53025/isa_parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2844,
12,
87,
4672,
468,
17151,
1281,
1661,
17,
1717,
14278,
9089,
87,
261,
902,
10860,
635,
7321,
13,
87,
273,
17151,
67,
5836,
67,
1717,
334,
67,
8849,
87,
12,
87,
13,
46... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
2844,
12,
87,
4672,
468,
17151,
1281,
1661,
17,
1717,
14278,
9089,
87,
261,
902,
10860,
635,
7321,
13,
87,
273,
17151,
67,
5836,
67,
1717,
334,
67,
8849,
87,
12,
87,
13,
46... |
if summary == None: | if summary_commandline == None: | def main(): gen = None # How we want to retrieve information on which pages need to be changed. # Can either be 'xmldump', 'textfile' or 'userinput'. source = None # summary message summary_commandline = None # Array which will collect commandline parameters. # First element is original text, second element is replacement text. commandline_replacements = [] # A list of 2-tuples of original text and replacement text. replacements = [] # Don't edit pages which contain certain texts. exceptions = [] # Should the elements of 'replacements' and 'exceptions' be interpreted # as regular expressions? regex = False # Predefined fixes from dictionary 'fixes' (see above). fix = None # the dump's path, either absolute or relative, which will be used when source # is 'xmldump'. xmlFilename = None useSql = False # the textfile's path, either absolute or relative, which will be used when # source is 'textfile'. textfilename = None # the category name which will be used when source is 'category'. categoryname = None # pages which will be processed when the -page parameter is used PageTitles = [] # a page whose referrers will be processed when the -ref parameter is used referredPageTitle = None # an image page whose file links will be processed when the -filelinks parameter is used fileLinksPageTitle = None # a page whose links will be processed when the -links parameter is used linkingPageTitle = None # will become True when the user presses a ('yes to all') or uses the -always # commandline paramater. acceptall = False # Which namespaces should be processed? # default to [] which means all namespaces will be processed namespaces = [] # Which page to start startpage = None # Google query googleQuery = None # Load default summary message. wikipedia.setAction(wikipedia.translate(wikipedia.getSite(), msg)) # Read commandline parameters. for arg in wikipedia.handleArgs(): if arg == '-regex': regex = True elif arg.startswith('-filelinks'): if len(arg) == 10: fileLinksPageTitle = wikipedia.input(u'Links to which image page should be processed?') else: fileLinksPageTitle = arg[11:] #TODO: Replace 'Image:' with something that automatically gets the name of images based on the language. fileLinksPage = wikipedia.Page(wikipedia.getSite(), 'Image:' + fileLinksPageTitle) gen = pagegenerators.FileLinksGenerator(fileLinksPage) elif arg.startswith('-file'): if len(arg) >= 6: textfilename = arg[6:] gen = pagegenerators.TextfilePageGenerator(textfilename) elif arg.startswith('-cat'): if len(arg) == 4: categoryname = wikipedia.input(u'Please enter the category name:') else: categoryname = arg[5:] cat = catlib.Category(wikipedia.getSite(), 'Category:%s' % categoryname) gen = pagegenerators.CategorizedPageGenerator(cat) elif arg.startswith('-xml'): if len(arg) == 4: xmlFilename = wikipedia.input(u'Please enter the XML dump\'s filename:') else: xmlFilename = arg[5:] elif arg =='-sql': useSql = True elif arg.startswith('-page'): if len(arg) == 5: PageTitles.append(wikipedia.input(u'Which page do you want to chage?')) else: PageTitles.append(arg[6:]) source = 'specificPages' elif arg.startswith('-ref'): if len(arg) == 4: referredPageTitle = wikipedia.input(u'Links to which page should be processed?') else: referredPageTitle = arg[5:] referredPage = wikipedia.Page(wikipedia.getSite(), referredPageTitle) gen = pagegenerators.ReferringPageGenerator(referredPage) elif arg.startswith('-links'): if len(arg) == 6: linkingPageTitle = wikipedia.input(u'Links from which page should be processed?') else: linkingPageTitle = arg[7:] linkingPage = wikipedia.Page(wikipedia.getSite(), linkingPageTitle) gen = pagegenerators.LinkedPageGenerator(linkingPage) elif arg.startswith('-start'): if len(arg) == 6: firstPageTitle = wikipedia.input(u'Which page do you want to chage?') else: firstPageTitle = arg[7:] namespace = wikipedia.Page(wikipedia.getSite(), firstPageTitle).namespace() firstPageTitle = wikipedia.Page(wikipedia.getSite(), firstPageTitle).titleWithoutNamespace() gen = pagegenerators.AllpagesPageGenerator(firstPageTitle, namespace) elif arg.startswith('-google'): if len(arg) >= 8: googleQuery = arg[8:] gen = pagegenerators.GoogleSearchPageGenerator(googleQuery) elif arg.startswith('-except:'): exceptions.append(arg[8:]) elif arg.startswith('-fix:'): fix = arg[5:] elif arg == '-always': acceptall = True elif arg.startswith('-namespace:'): namespaces.append(int(arg[11:])) elif arg.startswith('-summary:'): wikipedia.setAction(arg[9:]) summary_commandline = True else: commandline_replacements.append(arg) if (len(commandline_replacements) == 2 and fix == None): replacements.append((commandline_replacements[0], commandline_replacements[1])) if summary == None: wikipedia.setAction(wikipedia.translate(wikipedia.getSite(), msg ) % ' (-' + commandline_replacements[0] + ' +' + commandline_replacements[1] + ')') elif fix == None: old = wikipedia.input(u'Please enter the text that should be replaced:') new = wikipedia.input(u'Please enter the new text:') change = '(-' + old + ' +' + new replacements.append((old, new)) while True: old = wikipedia.input(u'Please enter another text that should be replaced, or press Enter to start:') if old == '': change = change + ')' break new = wikipedia.input(u'Please enter the new text:') change = change + ' & -' + old + ' +' + new replacements.append((old, new)) if not summary_commandline == True: default_summary_message = wikipedia.translate(wikipedia.getSite(), msg) % change wikipedia.output(u'The summary message will default to: %s' % default_summary_message) summary_message = wikipedia.input(u'Press Enter to use this default message, or enter a description of the changes your bot will make:') if summary_message == '': summary_message = default_summary_message wikipedia.setAction(summary_message) else: # Perform one of the predefined actions. try: fix = fixes[fix] except KeyError: wikipedia.output(u'Available predefined fixes are: %s' % fixes.keys()) wikipedia.stopme() sys.exit() if fix.has_key('regex'): regex = fix['regex'] if fix.has_key('msg'): wikipedia.setAction(wikipedia.translate(wikipedia.getSite(), fix['msg'])) if fix.has_key('exceptions'): exceptions = fix['exceptions'] replacements = fix['replacements'] # already compile all regular expressions here to save time later for i in range(len(replacements)): old, new = replacements[i] if not regex: old = re.escape(old) oldR = re.compile(old, re.UNICODE) replacements[i] = oldR, new for i in range(len(exceptions)): exception = exceptions[i] if not regex: exception = re.escape(exception) exceptionR = re.compile(exception, re.UNICODE) exceptions[i] = exceptionR if xmlFilename: gen = XmlDumpReplacePageGenerator(xmlFilename, replacements, exceptions) elif useSql: whereClause = 'WHERE (%s)' % ' OR '.join(["old_text RLIKE '%s'" % prepareRegexForMySQL(old.pattern) for (old, new) in replacements]) if exceptions: exceptClause = 'AND NOT (%s)' % ' OR '.join(["old_text RLIKE '%s'" % prepareRegexForMySQL(exc.pattern) for exc in exceptions]) else: exceptClause = '' query = u""" | e1fc9b894c1b0281116c57d6d59f7e255e93d772 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/e1fc9b894c1b0281116c57d6d59f7e255e93d772/replace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3157,
273,
599,
468,
9017,
732,
2545,
358,
4614,
1779,
603,
1492,
4689,
1608,
358,
506,
3550,
18,
468,
4480,
3344,
506,
296,
2902,
8481,
2187,
296,
955,
768,
11,
578,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13332,
3157,
273,
599,
468,
9017,
732,
2545,
358,
4614,
1779,
603,
1492,
4689,
1608,
358,
506,
3550,
18,
468,
4480,
3344,
506,
296,
2902,
8481,
2187,
296,
955,
768,
11,
578,
296,
... |
return __format_obj().time(time, format, tzinfo=self.tzinfo, locale=self.locale) | return __format_obj().time(time, format) | def format_time(self, time=None, format='medium'): """Return a time formatted according to the given pattern. >>> from pytz import timezone >>> fmt = Format('en_US', tzinfo=timezone('US/Eastern')) >>> fmt.time(datetime(2007, 4, 1, 15, 30)) u'11:30:00 AM' :see: `babel.dates.format_time` """ return __format_obj().time(time, format, tzinfo=self.tzinfo, locale=self.locale) | 3190892a7dbc4479555e4e58433e285291b62bf1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5825/3190892a7dbc4479555e4e58433e285291b62bf1/i18n.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
957,
12,
2890,
16,
813,
33,
7036,
16,
740,
2218,
19011,
11,
4672,
3536,
990,
279,
813,
4955,
4888,
358,
326,
864,
1936,
18,
225,
4080,
628,
29039,
1930,
6371,
4080,
1325,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
740,
67,
957,
12,
2890,
16,
813,
33,
7036,
16,
740,
2218,
19011,
11,
4672,
3536,
990,
279,
813,
4955,
4888,
358,
326,
864,
1936,
18,
225,
4080,
628,
29039,
1930,
6371,
4080,
1325,
273,... |
fp = open(MOFILE, 'w') | fp = open(MOFILE, 'wb') | def setup(): os.makedirs(LOCALEDIR) fp = open(MOFILE, 'w') fp.write(base64.decodestring(GNU_MO_DATA)) fp.close() | e31a7e6cf0b073bf6e7b29556ba805e09197a12c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e31a7e6cf0b073bf6e7b29556ba805e09197a12c/test_gettext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13332,
1140,
18,
81,
9477,
10539,
12,
25368,
4537,
13,
4253,
273,
1696,
12,
5980,
3776,
16,
296,
9464,
6134,
4253,
18,
2626,
12,
1969,
1105,
18,
4924,
1145,
371,
12,
8318,
57,
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,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13332,
1140,
18,
81,
9477,
10539,
12,
25368,
4537,
13,
4253,
273,
1696,
12,
5980,
3776,
16,
296,
9464,
6134,
4253,
18,
2626,
12,
1969,
1105,
18,
4924,
1145,
371,
12,
8318,
57,
67... |
summary += _(' At least %dMB needed on the %s filesystem.\n') % (disk[k], k) | summary += _(' At least %dMB more space needed on the %s filesystem.\n') % (disk[k], k) | def errorSummary(self, errstring): """ parse the error string for 'interesting' errors which can be grouped, such as disk space issues """ summary = '' # do disk space report first p = re.compile('needs (\d+)MB on the (\S+) filesystem') disk = {} for m in p.finditer(errstring): if not disk.has_key(m.group(2)): disk[m.group(2)] = int(m.group(1)) if disk[m.group(2)] < int(m.group(1)): disk[m.group(2)] = int(m.group(1)) if disk: summary += _('Disk Requirements:\n') for k in disk: summary += _(' At least %dMB needed on the %s filesystem.\n') % (disk[k], k) | 510d9769ac31ec9cd91b2e9b418c018682cfea9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/510d9769ac31ec9cd91b2e9b418c018682cfea9d/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
555,
4733,
12,
2890,
16,
393,
1080,
4672,
3536,
1109,
326,
555,
533,
364,
296,
2761,
10100,
11,
1334,
1492,
848,
506,
10303,
16,
4123,
487,
4234,
3476,
8296,
3536,
4916,
273,
875,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
555,
4733,
12,
2890,
16,
393,
1080,
4672,
3536,
1109,
326,
555,
533,
364,
296,
2761,
10100,
11,
1334,
1492,
848,
506,
10303,
16,
4123,
487,
4234,
3476,
8296,
3536,
4916,
273,
875,
468,
... |
return addinfo(self.ftpcache[key].retrfile(file, type), noheaders()) | return addinfourl(self.ftpcache[key].retrfile(file, type), noheaders(), self.openedurl) | def open_ftp(self, url): host, path = splithost(url) if not host: raise IOError, ('ftp error', 'no host given') host, port = splitport(host) user, host = splituser(host) if user: user, passwd = splitpasswd(user) else: passwd = None host = socket.gethostbyname(host) if not port: import ftplib port = ftplib.FTP_PORT path, attrs = splitattr(path) dirs = string.splitfields(path, '/') dirs, file = dirs[:-1], dirs[-1] if dirs and not dirs[0]: dirs = dirs[1:] key = (user, host, port, string.joinfields(dirs, '/')) try: if not self.ftpcache.has_key(key): self.ftpcache[key] = \ ftpwrapper(user, passwd, host, port, dirs) if not file: type = 'D' else: type = 'I' for attr in attrs: attr, value = splitvalue(attr) if string.lower(attr) == 'type' and \ value in ('a', 'A', 'i', 'I', 'd', 'D'): type = string.upper(value) return addinfo(self.ftpcache[key].retrfile(file, type), noheaders()) except ftperrors(), msg: raise IOError, ('ftp error', msg) | 4a397fc6e5c7c0ec3275879d8882cb6e0c6798d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/4a397fc6e5c7c0ec3275879d8882cb6e0c6798d1/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
11727,
12,
2890,
16,
880,
4672,
1479,
16,
589,
273,
6121,
483,
669,
12,
718,
13,
309,
486,
1479,
30,
1002,
8340,
16,
7707,
11727,
555,
2187,
296,
2135,
1479,
864,
6134,
1479,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1696,
67,
11727,
12,
2890,
16,
880,
4672,
1479,
16,
589,
273,
6121,
483,
669,
12,
718,
13,
309,
486,
1479,
30,
1002,
8340,
16,
7707,
11727,
555,
2187,
296,
2135,
1479,
864,
6134,
1479,... |
bin = [x for x in fname.split('@') if x.startswith('binary-')][0][7:] if bin not in bdeps: bdeps[bin] = dict() bprov[bin] = dict() | barch = [x for x in fname.split('@') if x.startswith('binary-')][0][7:] if barch not in bdeps: bdeps[barch] = dict() bprov[barch] = dict() | def read_files(self): bdeps = dict() bprov = dict() for fname in self.files: bin = [x for x in fname.split('@') if x.startswith('binary-')][0][7:] if bin not in bdeps: bdeps[bin] = dict() bprov[bin] = dict() try: reader = gzip.GzipFile(fname) except: print("Failed to read file %s" % fname) raise Exception() continue for line in reader.readlines(): words = line.strip().split(':', 1) if words[0] == 'Package': pkgname = words[1].strip().rstrip() self.pkgnames.add(pkgname) elif words[0] == 'Depends': bdeps[bin][pkgname] = [] vindex = 0 for dep in words[1].split(','): raw_dep = re.sub('\(.*\)', '', dep) if '|' in raw_dep: dyn_dname = "choice-%s-%s-%s" % (pkgname, bin, vindex) vindex += 1 bdeps[bin][pkgname].append(dyn_dname) dyn_list = [x.strip() for x in raw_dep.split('|')] bprov[bin][dyn_dname] = set(dyn_list) else: raw_dep = raw_dep.rstrip().strip() bdeps[bin][pkgname].append(raw_dep) elif words[0] == 'Provides': for pkg in words[1].split(','): dname = pkg.rstrip().strip() if dname not in bprov[bin]: bprov[bin][dname] = set() bprov[bin][dname].add(pkgname) | fb209805adfc35c07e127215f4f828bd44151f00 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11867/fb209805adfc35c07e127215f4f828bd44151f00/Packages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
2354,
12,
2890,
4672,
324,
14877,
273,
2065,
1435,
324,
25529,
273,
2065,
1435,
364,
5299,
316,
365,
18,
2354,
30,
324,
991,
273,
306,
92,
364,
619,
316,
5299,
18,
4939,
2668,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
855,
67,
2354,
12,
2890,
4672,
324,
14877,
273,
2065,
1435,
324,
25529,
273,
2065,
1435,
364,
5299,
316,
365,
18,
2354,
30,
324,
991,
273,
306,
92,
364,
619,
316,
5299,
18,
4939,
2668,... |
handshake(csock) | if not do_handshake(csock): continue | def start_server(listen_port, delay=500): global errors, send_cnt, recv_cnt lsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) lsock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) lsock.bind(('', listen_port)) lsock.listen(100) while True: try: csock = None print 'listening on port %s' % listen_port csock, address = lsock.accept() print 'Got client connection from %s' % address[0] handshake(csock) send_cnt = 0 recv_cnt = 0 responder(csock, delay=delay) except Exception: print "accumulated errors:", errors errors = 0 print "Ignoring exception:" print traceback.format_exc() if csock: csock.close() | 1e633bc8eeef5e92f134ec0cf705a1f7644b9f93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13207/1e633bc8eeef5e92f134ec0cf705a1f7644b9f93/wstest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
3567,
12,
18085,
67,
655,
16,
4624,
33,
12483,
4672,
2552,
1334,
16,
1366,
67,
13085,
16,
10665,
67,
13085,
7180,
975,
273,
2987,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
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,
787,
67,
3567,
12,
18085,
67,
655,
16,
4624,
33,
12483,
4672,
2552,
1334,
16,
1366,
67,
13085,
16,
10665,
67,
13085,
7180,
975,
273,
2987,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
16,
... |
done.release() | done.set() | def task(N, done, done_tasks, errors): try: # We don't use modulefinder but still import it in order to stress # importing of different modules from several threads. if len(done_tasks) % 2: import modulefinder import random else: import random import modulefinder # This will fail if random is not completely initialized x = random.randrange(1, 3) except Exception as e: errors.append(e.with_traceback(None)) finally: done_tasks.append(thread.get_ident()) finished = len(done_tasks) == N if finished: done.release() | ddd0db41851548230c4c9b3960cf097c699fc4c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/ddd0db41851548230c4c9b3960cf097c699fc4c0/test_threaded_import.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1562,
12,
50,
16,
2731,
16,
2731,
67,
9416,
16,
1334,
4672,
775,
30,
468,
1660,
2727,
1404,
999,
1605,
15356,
1496,
4859,
1930,
518,
316,
1353,
358,
384,
663,
468,
25077,
434,
3775,
43... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1562,
12,
50,
16,
2731,
16,
2731,
67,
9416,
16,
1334,
4672,
775,
30,
468,
1660,
2727,
1404,
999,
1605,
15356,
1496,
4859,
1930,
518,
316,
1353,
358,
384,
663,
468,
25077,
434,
3775,
43... |
if cls.debug: print "keystrokes: %s" % normalized | if cls.debug: dprint("keystrokes: %s" % normalized) | def normalizeAccelerators(cls, acc): # find the individual keystrokes from a more emacs style # list, where the keystrokes are separated by whitespace. normalized = [] i = 0 while i<len(acc): while acc[i].isspace() and i < len(acc): i += 1 | 476dc3196d2afa19075d465a7cf6d317d7db99a2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11522/476dc3196d2afa19075d465a7cf6d317d7db99a2/multikey.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3883,
18019,
264,
3062,
12,
6429,
16,
4078,
4672,
468,
1104,
326,
7327,
498,
334,
3250,
281,
628,
279,
1898,
801,
28965,
2154,
468,
666,
16,
1625,
326,
498,
334,
3250,
281,
854,
8936,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3883,
18019,
264,
3062,
12,
6429,
16,
4078,
4672,
468,
1104,
326,
7327,
498,
334,
3250,
281,
628,
279,
1898,
801,
28965,
2154,
468,
666,
16,
1625,
326,
498,
334,
3250,
281,
854,
8936,
... |
if modobj: | if modobj and perform_checks: | def load_module_graph(cr, graph, status=None, check_access_rules=True, **kwargs): # **kwargs is passed directly to convert_xml_import if not status: status={} status = status.copy() package_todo = [] statusi = 0 pool = pooler.get_pool(cr.dbname) # update the graph with values from the database (if exist) ## First, we set the default values for each package in graph additional_data = dict.fromkeys([p.name for p in graph], {'id': 0, 'state': 'uninstalled', 'dbdemo': False, 'installed_version': None}) ## Then we get the values from the database cr.execute('SELECT name, id, state, demo AS dbdemo, latest_version AS installed_version' ' FROM ir_module_module' ' WHERE name in (%s)' % (','.join(['%s'] * len(graph))), additional_data.keys() ) ## and we update the default values with values from the database additional_data.update(dict([(x.pop('name'), x) for x in cr.dictfetchall()])) for package in graph: for k, v in additional_data[package.name].items(): setattr(package, k, v) migrations = MigrationManager(cr, graph) check_rules = False modobj = None for package in graph: status['progress'] = (float(statusi)+0.1)/len(graph) m = package.name mid = package.id migrations.migrate_module(package, 'pre') register_class(m) logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s loading objects' % m) modules = pool.instanciate(m, cr) if modobj is None: modobj = pool.get('ir.module.module') if modobj: modobj.check(cr, 1, [mid]) idref = {} status['progress'] = (float(statusi)+0.4)/len(graph) if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'): check_rules = True init_module_objects(cr, m, modules) for kind in ('init', 'update'): for filename in package.data.get('%s_xml' % kind, []): mode = 'update' if hasattr(package, 'init') or package.state=='to install': mode = 'init' logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: loading %s' % (m, filename)) name, ext = os.path.splitext(filename) fp = tools.file_open(opj(m, filename)) if ext == '.csv': tools.convert_csv_import(cr, m, os.path.basename(filename), fp.read(), idref, mode=mode) elif ext == '.sql': queries = fp.read().split(';') for query in queries: new_query = ' '.join(query.split()) if new_query: cr.execute(new_query) else: tools.convert_xml_import(cr, m, fp, idref, mode=mode, **kwargs) fp.close() if hasattr(package, 'demo') or (package.dbdemo and package.state != 'installed'): status['progress'] = (float(statusi)+0.75)/len(graph) for xml in package.data.get('demo_xml', []): name, ext = os.path.splitext(xml) logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: loading %s' % (m, xml)) fp = tools.file_open(opj(m, xml)) if ext == '.csv': tools.convert_csv_import(cr, m, os.path.basename(xml), fp.read(), idref, noupdate=True) else: tools.convert_xml_import(cr, m, fp, idref, noupdate=True, **kwargs) fp.close() cr.execute('update ir_module_module set demo=%s where id=%s', (True, mid)) package_todo.append(package.name) ver = release.major_version + '.' + package.data.get('version', '1.0') # update the installed version in database... #cr.execute("update ir_module_module set state='installed', latest_version=%s where id=%s", (ver, mid,)) # Set new modules and dependencies modobj.write(cr, 1, [mid], {'state':'installed', 'latest_version':ver}) cr.commit() # Update translations for all installed languages if modobj: modobj.update_translations(cr, 1, [mid], None) cr.commit() migrations.migrate_module(package, 'post') statusi+=1 if check_access_rules and check_rules: cr.execute("""select model,name from ir_model where id not in (select model_id from ir_model_access)""") for (model,name) in cr.fetchall(): logger.notifyChannel('init', netsvc.LOG_WARNING, 'object %s (%s) has no access rules!' % (model,name)) cr.execute('select model from ir_model where state=%s', ('manual',)) for model in cr.dictfetchall(): pool.get('ir.model').instanciate(cr, 1, model['model'], {}) pool.get('ir.model.data')._process_end(cr, 1, package_todo) cr.commit() | f8e9998c256e5bbfdca2aaccf9e0eaee21303fa2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/f8e9998c256e5bbfdca2aaccf9e0eaee21303fa2/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
2978,
67,
4660,
12,
3353,
16,
2667,
16,
1267,
33,
7036,
16,
866,
67,
3860,
67,
7482,
33,
5510,
16,
2826,
4333,
4672,
468,
2826,
4333,
353,
2275,
5122,
358,
1765,
67,
2902,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1262,
67,
2978,
67,
4660,
12,
3353,
16,
2667,
16,
1267,
33,
7036,
16,
866,
67,
3860,
67,
7482,
33,
5510,
16,
2826,
4333,
4672,
468,
2826,
4333,
353,
2275,
5122,
358,
1765,
67,
2902,
... |
TargetAdd('p3dpython.exe', opts=['TINYXML', 'WINUSER']) | TargetAdd('p3dpython.exe', opts=['PYTHON', 'TINYXML', 'WINUSER']) | def CreatePandaVersionFiles(): # First, move any conflicting files out of the way. if os.path.isfile("dtool/src/dtoolutil/pandaVersion.h"): os.rename("dtool/src/dtoolutil/pandaVersion.h", "dtool/src/dtoolutil/pandaVersion.h.moved") if os.path.isfile("dtool/src/dtoolutil/checkPandaVersion.h"): os.rename("dtool/src/dtoolutil/checkPandaVersion.h", "dtool/src/dtoolutil/checkPandaVersion.h.moved") if os.path.isfile("dtool/src/dtoolutil/checkPandaVersion.cxx"): os.rename("dtool/src/dtoolutil/checkPandaVersion.cxx", "dtool/src/dtoolutil/checkPandaVersion.cxx.moved") version1=int(VERSION.split(".")[0]) version2=int(VERSION.split(".")[1]) version3=int(VERSION.split(".")[2]) nversion=version1*1000000+version2*1000+version3 pandaversion_h = PANDAVERSION_H.replace("VERSION1",str(version1)) pandaversion_h = pandaversion_h.replace("VERSION2",str(version2)) pandaversion_h = pandaversion_h.replace("VERSION3",str(version3)) pandaversion_h = pandaversion_h.replace("NVERSION",str(nversion)) checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("VERSION1",str(version1)) checkpandaversion_cxx = checkpandaversion_cxx.replace("VERSION2",str(version2)) checkpandaversion_cxx = checkpandaversion_cxx.replace("VERSION3",str(version3)) checkpandaversion_cxx = checkpandaversion_cxx.replace("NVERSION",str(nversion)) checkpandaversion_h = CHECKPANDAVERSION_H.replace("VERSION1",str(version1)) checkpandaversion_h = checkpandaversion_h.replace("VERSION2",str(version2)) checkpandaversion_h = checkpandaversion_h.replace("VERSION3",str(version3)) checkpandaversion_h = checkpandaversion_h.replace("NVERSION",str(nversion)) ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h) ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx) ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h) ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","") | 9d7fc0bd2fec84b25a79193fd1849cc2d5d7ef13 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8543/9d7fc0bd2fec84b25a79193fd1849cc2d5d7ef13/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
52,
464,
69,
1444,
2697,
13332,
468,
5783,
16,
3635,
1281,
21462,
1390,
596,
434,
326,
4031,
18,
309,
1140,
18,
803,
18,
291,
768,
2932,
72,
6738,
19,
4816,
19,
72,
6738,
1367,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1788,
52,
464,
69,
1444,
2697,
13332,
468,
5783,
16,
3635,
1281,
21462,
1390,
596,
434,
326,
4031,
18,
309,
1140,
18,
803,
18,
291,
768,
2932,
72,
6738,
19,
4816,
19,
72,
6738,
1367,
... |
dest = udir.join("test_expect_safefilename.py") dest.write(source) from pypy import conftest col = conftest.Module(dest, config="dummy") methcol = col.join('ExpectTestOne').join('()').join('test_one') name = 'test_expect_safefilename_ExpectTestOne_paren_test_one.py' assert methcol.safe_filename() == name udir.ensure(name) assert methcol.safe_filename() == name[:-3] + '_1.py' | ev, = sorter.getnamed("itemtestreport") assert ev.passed sfn = ev.colitem.safe_filename() print sfn assert sfn == 'test_safe_filename_test_safe_filename_ExpectTestOne_paren_test_one_1.py' | def test_one(self): pass | bdadb575274ee4b0b5924254fc75663055032293 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/bdadb575274ee4b0b5924254fc75663055032293/test_pytestsupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
476,
12,
2890,
4672,
1342,
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,
0,
0... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
476,
12,
2890,
4672,
1342,
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,
-100... |
self.view.initializeViewSettings () | self.initializeViewSettings () | def initializeAndShowInitialView (self): self.view.initializeViewSettings () | aabafd03a0e4aa2f34c589d4a2e7cacd119dcfce /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9028/aabafd03a0e4aa2f34c589d4a2e7cacd119dcfce/candy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
1876,
5706,
4435,
1767,
261,
2890,
4672,
365,
18,
1945,
18,
11160,
1767,
2628,
1832,
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,
... | [
1,
1,
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,
4046,
1876,
5706,
4435,
1767,
261,
2890,
4672,
365,
18,
1945,
18,
11160,
1767,
2628,
1832,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if e.message != 'unichr() arg not in range(0x10000) (narrow Python build)': | if e.args != ('unichr() arg not in range(0x10000) (narrow Python build)',): | def test_unicode(self): 'Verify the pretty-printing of unicode values' # Test the empty unicode string: self.assertGdbRepr(u'') | c6489376ba1913cc61f8635b59207ae02093f134 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/c6489376ba1913cc61f8635b59207ae02093f134/test_gdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9124,
12,
2890,
4672,
296,
8097,
326,
7517,
17,
1188,
310,
434,
5252,
924,
11,
468,
7766,
326,
1008,
5252,
533,
30,
365,
18,
11231,
43,
1966,
426,
683,
12,
89,
11,
6134,
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,
1842,
67,
9124,
12,
2890,
4672,
296,
8097,
326,
7517,
17,
1188,
310,
434,
5252,
924,
11,
468,
7766,
326,
1008,
5252,
533,
30,
365,
18,
11231,
43,
1966,
426,
683,
12,
89,
11,
6134,
2,... |
self.body_suffix.append('\\end{document}\n') | def depart_document(self, node): # Complete header with information gained from walkabout # a) conditional requirements (before style sheet) self.head_prefix += [self.latex_requirements[key] for key in sorted(self.latex_requirements.keys())] # b) coditional fallback definitions (after style sheet) self.head.append( '\n%%% Fallback definitions for Docutils-specific commands') self.head += [self.latex_fallbacks[key] for key in sorted(self.latex_fallbacks.keys())] # c) hyperlink setup and PDF metadata self.head.append(self.linking % (self.colorlinks, self.hyperlink_color, self.hyperlink_color)) if self.pdfinfo is not None and self.pdfauthor: self.pdfauthor = self.author_separator.join(self.pdfauthor) self.pdfinfo.append(' pdfauthor={%s}' % self.pdfauthor) if self.pdfinfo: self.head += [r'\hypersetup{'] + self.pdfinfo + ['}'] # d) Title metadata # NOTE: Docutils puts this into docinfo, so normally we do not want # LaTeX author/date handling (via \maketitle). # To deactivate it, self.astext() adds \title{...}, \author{...}, # \date{...}, even if the"..." are empty strings. if '\\maketitle\n\n' in self.body_prefix: title = [PreambleCmds.title % ( self.title, ' \\and\n'.join(['\\\\\n'.join(author_lines) for author_lines in self.author_stack]), self.date)] self.head += title # Add bibliography # TODO insertion point of bibliography should none automatic. if self._use_latex_citations and len(self._bibitems)>0: if not self.bibtex: widest_label = '' for bi in self._bibitems: if len(widest_label)<len(bi[0]): widest_label = bi[0] self.body.append('\n\\begin{thebibliography}{%s}\n' % widest_label) for bi in self._bibitems: # cite_key: underscores must not be escaped cite_key = bi[0].replace(r'{\_}','_') self.body.append('\\bibitem[%s]{%s}{%s}\n' % (bi[0], cite_key, bi[1])) self.body.append('\\end{thebibliography}\n') else: self.body.append('\n\\bibliographystyle{%s}\n' % self.bibtex[0]) self.body.append('\\bibliography{%s}\n' % self.bibtex[1]) | 46a0c8dd14843f2383711724a77c799cd55db324 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1278/46a0c8dd14843f2383711724a77c799cd55db324/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
5457,
12,
2890,
16,
756,
4672,
468,
14575,
1446,
598,
1779,
314,
8707,
628,
5442,
21071,
468,
279,
13,
11139,
8433,
261,
5771,
2154,
6202,
13,
365,
18,
1978,
67,
3239,
1011,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26000,
67,
5457,
12,
2890,
16,
756,
4672,
468,
14575,
1446,
598,
1779,
314,
8707,
628,
5442,
21071,
468,
279,
13,
11139,
8433,
261,
5771,
2154,
6202,
13,
365,
18,
1978,
67,
3239,
1011,
... | |
assert False, "unrecognised option for shownotes '%s'" % shownotes | assert False, "unrecognised option for shownotes '%s'" % shownotes | def __init__ (self, document): LaTeXTranslator.__init__ (self, document) # record the the settings for codeblocks self.cb_use_pygments = document.settings.cb_use_pygments self.cb_replace_tabs = document.settings.cb_replace_tabs self.cb_default_lang = document.settings.cb_default_lang self.head_prefix = [x for x in self.head_prefix if ('{typearea}' not in x)] #hyperref_posn = [i for i in range (len (self.head_prefix)) # if ('{hyperref}' in self.head_prefix[i])] hyperref_posn = index (self.head_prefix, lambda x: '{hyperref}\n' in x) if (hyperref_posn is None): self.head_prefix.extend ([ '\\usepackage{hyperref}\n' ]) | 7fa34d63a11663a7daeb27efb01eb826b364662a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1278/7fa34d63a11663a7daeb27efb01eb826b364662a/rst2beamer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
1668,
4672,
21072,
21575,
60,
12233,
16186,
2738,
972,
261,
2890,
16,
1668,
13,
225,
468,
1409,
326,
326,
1947,
364,
981,
7996,
365,
18,
7358,
67,
1202,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
261,
2890,
16,
1668,
4672,
21072,
21575,
60,
12233,
16186,
2738,
972,
261,
2890,
16,
1668,
13,
225,
468,
1409,
326,
326,
1947,
364,
981,
7996,
365,
18,
7358,
67,
1202,
... |
prefix = make_filename(repo, repo.changelog, prefix, node) | prefix = make_filename(repo, prefix, node) | def archive(ui, repo, dest, **opts): '''create unversioned archive of a repository revision By default, the revision used is the parent of the working directory; use "-r" to specify a different revision. To specify the type of archive to create, use "-t". Valid types are: "files" (default): a directory full of files "tar": tar archive, uncompressed "tbz2": tar archive, compressed using bzip2 "tgz": tar archive, compressed using gzip "uzip": zip archive, uncompressed "zip": zip archive, compressed using deflate The exact name of the destination archive or directory is given using a format string; see "hg help export" for details. Each member added to an archive file has a directory prefix prepended. Use "-p" to specify a format string for the prefix. The default is the basename of the archive, with suffixes removed. ''' if opts['rev']: node = repo.lookup(opts['rev']) else: node, p2 = repo.dirstate.parents() if p2 != nullid: raise util.Abort(_('uncommitted merge - please provide a ' 'specific revision')) dest = make_filename(repo, repo.changelog, dest, node) if os.path.realpath(dest) == repo.root: raise util.Abort(_('repository root cannot be destination')) dummy, matchfn, dummy = matchpats(repo, [], opts) kind = opts.get('type') or 'files' prefix = opts['prefix'] if dest == '-': if kind == 'files': raise util.Abort(_('cannot archive plain files to stdout')) dest = sys.stdout if not prefix: prefix = os.path.basename(repo.root) + '-%h' prefix = make_filename(repo, repo.changelog, prefix, node) archival.archive(repo, dest, node, kind, not opts['no_decode'], matchfn, prefix) | 8376de03fa80398a65fccaf939611864d6027421 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/8376de03fa80398a65fccaf939611864d6027421/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5052,
12,
4881,
16,
3538,
16,
1570,
16,
2826,
4952,
4672,
9163,
2640,
29645,
5052,
434,
279,
3352,
6350,
225,
2525,
805,
16,
326,
6350,
1399,
353,
326,
982,
434,
326,
5960,
1867,
31,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5052,
12,
4881,
16,
3538,
16,
1570,
16,
2826,
4952,
4672,
9163,
2640,
29645,
5052,
434,
279,
3352,
6350,
225,
2525,
805,
16,
326,
6350,
1399,
353,
326,
982,
434,
326,
5960,
1867,
31,
9... |
'Requirements':None | 'Test_method':None | def __init__(self): self.attr = { | 2aeab4d32c1031c6a6ce70b32191fd63e5b6158c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3589/2aeab4d32c1031c6a6ce70b32191fd63e5b6158c/LSCfileAdd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
1747,
273,
288,
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,... | [
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
1747,
273,
288,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return cram(cleanid(repr(x)), self.maxstring) | return cram(stripid(repr(x)), self.maxstring) | def repr_instance(self, x, level): try: return cram(cleanid(repr(x)), self.maxstring) except: return self.escape('<%s instance>' % x.__class__.__name__) | e5371c2448c12c8bbb9da43e271283aab2a57abb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5371c2448c12c8bbb9da43e271283aab2a57abb/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8480,
67,
1336,
12,
2890,
16,
619,
16,
1801,
4672,
775,
30,
327,
276,
1940,
12,
6406,
350,
12,
12715,
12,
92,
13,
3631,
365,
18,
1896,
1080,
13,
1335,
30,
327,
365,
18,
6939,
2668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8480,
67,
1336,
12,
2890,
16,
619,
16,
1801,
4672,
775,
30,
327,
276,
1940,
12,
6406,
350,
12,
12715,
12,
92,
13,
3631,
365,
18,
1896,
1080,
13,
1335,
30,
327,
365,
18,
6939,
2668,
... |
@bigmemtest(minsize=_2G + 2, memuse=8+3) | @bigmemtest(minsize=_2G + 2, memuse=8 + 3) | def test_repr_small(self, size): return self.basic_test_repr(size) | 0d0b2b4c8d86bb633173f2cdce1f7fef8107d496 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0d0b2b4c8d86bb633173f2cdce1f7fef8107d496/test_bigmem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
12715,
67,
12019,
12,
2890,
16,
963,
4672,
327,
365,
18,
13240,
67,
3813,
67,
12715,
12,
1467,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
12715,
67,
12019,
12,
2890,
16,
963,
4672,
327,
365,
18,
13240,
67,
3813,
67,
12715,
12,
1467,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
modname = options.python_script if '/' in modname: modname = modname.replace('/', '.') if modname[-3:] == '.py': modname = modname[:-3] | modname = options.python_script.replace('/', '.') if modname[-3:] == '.py': modname = modname[:-3] | def main(argv=[]): options = Options(argv) modname = options.python_script if '/' in modname: modname = modname.replace('/', '.') if modname[-3:] == '.py': modname = modname[:-3] exec "import %(modname)s as testmodule" % locals() if '(' in options.entry_function: entry_function, arguments = options.entry_function.split('(',1) else: entry_function, arguments = options.entry_function, ')' #print 'entry_functionText=',entry_function entry_function = getattr(testmodule, entry_function) #print 'entry_function=',entry_function if arguments != ')' and arguments.find(',') == -1: arguments = arguments[:-1] + ',)' arguments = [argument for argument in eval('('+arguments)] #print 'arguments=',arguments argumentTypes = [type(arg) for arg in arguments] #print 'argumentTypes=',argumentTypes t = Translator(entry_function) t.simplify() a = t.annotate(argumentTypes) a.simplify() if options.view_flow_graph: rtyper = RPythonTyper(t.annotator) rtyper.specialize() t.view() t = Translator(entry_function) t.simplify() a = t.annotate(argumentTypes) a.simplify() if options.show_source: if options.backend == 'org': print t.source() elif options.backend == 'c': print t.c() #note: this is a workaround until GenC can generate identical code multiple times t = Translator(entry_function) t.simplify() a = t.annotate([type(arg), type(arg) == type(int)]) # pass the list of args types a.simplify() elif options.backend == 'cl': print t.cl() elif options.backend == 'llvm': print t.llvm() elif options.backend == 'pyrex': print t.pyrex() if options.compile: if options.backend == 'c': a.specialize() # use low level operations (for C only) f = t.ccompile() elif options.backend == 'llvm': f = t.llvmcompile() elif options.backend == 'pyrex': f = t.pyrexcompile() else: print 'warning: backend', options.backend, 'has no compile phase' sys.exit(0) assert f print 'Backend', options.backend, 'compilation successful!' if f and options.test_compiled: #assert f(arg) == t.call(arg) # sanity check #XXX make args a commandline argument!!! print 'Backend', options.backend, 'test successful! (not tested actually)' | 609fdb7526c1e46b5a0002e6bd2832e8ea8c17fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/609fdb7526c1e46b5a0002e6bd2832e8ea8c17fc/compyle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
33,
8526,
4672,
702,
273,
5087,
12,
19485,
13,
225,
16037,
273,
702,
18,
8103,
67,
4263,
18,
2079,
2668,
19,
2187,
2611,
13,
309,
16037,
18919,
23,
26894,
422,
2418,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
33,
8526,
4672,
702,
273,
5087,
12,
19485,
13,
225,
16037,
273,
702,
18,
8103,
67,
4263,
18,
2079,
2668,
19,
2187,
2611,
13,
309,
16037,
18919,
23,
26894,
422,
2418,
2... |
Utils.GetRandomSeed()), digest, send_ack) | Utils.GetRandomSeed()), digest, noack) | def ChangeOptions(lst, category, cgi_info, document): dirty = 0 confirmed = 0 if cgi_info.has_key('newpw'): if cgi_info.has_key('confirmpw'): if cgi_info.has_key('adminpw'): try: lst.ConfirmAdminPassword(cgi_info['adminpw'].value) confirmed = 1 except Errors.MMBadPasswordError: m = "Error: incorrect administrator password" document.AddItem(Header(3, Italic(FontAttr(m, color="ff5060")))) confirmed = 0 if confirmed: new = cgi_info['newpw'].value confirm = cgi_info['confirmpw'].value if new == confirm: lst.password = crypt(new, Utils.GetRandomSeed()) dirty = 1 else: m = 'Error: Passwords did not match.' document.AddItem(Header(3, Italic(FontAttr(m, color="ff5060")))) else: m = 'Error: You must type in your new password twice.' document.AddItem( Header(3, Italic(FontAttr(m, color="ff5060")))) # # for some reason, the login page mangles important values for the list # such as .real_name so we only process these changes if the category # is not "members" and the request is not from the login page # -scott 19980515 # if category != 'members' and not cgi_info.has_key("request_login") and\ len(cgi_info.keys()) > 1: opt_list = GetConfigOptions(lst, category) for item in opt_list: if len(item) < 5: continue property, kind, args, deps, desc = (item[0], item[1], item[2], item[3], item[4]) if not cgi_info.has_key(property): if (kind <> mm_cfg.Text and kind <> mm_cfg.String and kind <> mm_cfg.EmailList): continue else: val = '' else: val = cgi_info[property].value value = GetValidValue(lst, property, kind, val, deps) if getattr(lst, property) != value: setattr(lst, property, value) dirty = 1 # # mass subscription processing for members category # if cgi_info.has_key('subscribees'): name_text = cgi_info['subscribees'].value name_text = string.replace(name_text, '\r', '') names = string.split(name_text, '\n') if '' in names: names.remove('') subscribe_success = [] subscribe_errors = [] if lst.send_welcome_msg: send_ack = 1 else: send_ack = 0 for new_name in map(string.strip,names): digest = 0 if not lst.digestable: digest = 0 if not lst.nondigestable: digest = 1 try: lst.ApprovedAddMember(new_name, (Utils.GetRandomSeed() + Utils.GetRandomSeed()), digest, send_ack) subscribe_success.append(new_name) except Errors.MMAlreadyAMember: subscribe_errors.append((new_name, 'Already a member')) except Errors.MMBadEmailError: subscribe_errors.append((new_name, "Bad/Invalid email address")) except Errors.MMHostileAddress: subscribe_errors.append((new_name, "Hostile Address (illegal characters)")) if subscribe_success: document.AddItem(Header(5, "Successfully Subscribed:")) document.AddItem(apply(UnorderedList, tuple((subscribe_success)))) document.AddItem("<p>") if subscribe_errors: document.AddItem(Header(5, "Error Subscribing:")) items = map(lambda x: "%s -- %s" % (x[0], x[1]), subscribe_errors) document.AddItem(apply(UnorderedList, tuple((items)))) document.AddItem("<p>") # # do the user options for members category # if cgi_info.has_key('user'): user = cgi_info["user"] if type(user) is type([]): users = [] for ui in range(len(user)): users.append(user[ui].value) else: users = [user.value] for user in users: if not cgi_info.has_key('%s_subscribed' % (user)): lst.DeleteMember(user) dirty = 1 continue if not cgi_info.has_key("%s_digest" % (user)): if user in lst.digest_members: list.digest_members.remove(user) dirty = 1 if user not in lst.members: lst.members.append(user) dirty = 1 else: if user not in lst.digest_members: lst.digest_members.append(user) dirty = 1 if user in lst.members: lst.members.remove(user) dirty = 1 for opt in ("hide", "nomail", "ack", "norcv", "plain"): if cgi_info.has_key("%s_%s" % (user, opt)): lst.SetUserOption(user, MailCommandHandler.option_info[opt], 1) dirty = 1 else: lst.SetUserOption(user, MailCommandHandler.option_info[opt], 0) dirty = 1 if dirty: lst.Save() | 7a413b821c410988c40b6b231c564725602d9763 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/7a413b821c410988c40b6b231c564725602d9763/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7576,
1320,
12,
16923,
16,
3150,
16,
276,
10052,
67,
1376,
16,
1668,
4672,
9603,
273,
374,
19979,
273,
374,
309,
276,
10052,
67,
1376,
18,
5332,
67,
856,
2668,
2704,
14921,
11,
4672,
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,
7576,
1320,
12,
16923,
16,
3150,
16,
276,
10052,
67,
1376,
16,
1668,
4672,
9603,
273,
374,
19979,
273,
374,
309,
276,
10052,
67,
1376,
18,
5332,
67,
856,
2668,
2704,
14921,
11,
4672,
3... |
if not Globals.wxApplication.insideSynchronizeFramework: counterpart = Globals.repository.find(self.counterpartUUID) newSize = self.GetSize() counterpart.size.width = newSize.width counterpart.size.height = newSize.height self.SetVirtualSize(newSize) | counterpart = Globals.repository.find(self.counterpartUUID) newSize = self.GetSize() counterpart.size.width = newSize.width counterpart.size.height = newSize.height self.SetVirtualSize(newSize) | def OnSize(self, event): if not Globals.wxApplication.insideSynchronizeFramework: counterpart = Globals.repository.find(self.counterpartUUID) newSize = self.GetSize() counterpart.size.width = newSize.width counterpart.size.height = newSize.height self.SetVirtualSize(newSize) event.Skip() | e3020fd766701978ddfa6b92ed9db8fc1b488f21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/e3020fd766701978ddfa6b92ed9db8fc1b488f21/CalendarBlocks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
1225,
12,
2890,
16,
871,
4672,
3895,
2680,
273,
18901,
1031,
18,
9071,
18,
4720,
12,
2890,
18,
7476,
2680,
5562,
13,
21402,
273,
365,
18,
967,
1225,
1435,
3895,
2680,
18,
1467,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1225,
12,
2890,
16,
871,
4672,
3895,
2680,
273,
18901,
1031,
18,
9071,
18,
4720,
12,
2890,
18,
7476,
2680,
5562,
13,
21402,
273,
365,
18,
967,
1225,
1435,
3895,
2680,
18,
1467,
1... |
wxLogError('Aborted: '+comDef+' is still used in the styles of the \n'\ | wx.LogError('Aborted: '+comDef+' is still used in the styles of the \n'\ | def OnRemovesharebtnButton(self, event): ownGroup = 'style.%s'%self.lang comDef = self.elementLb.GetStringSelection() | 1e19321bfb8d6ff348cd85bdad3a1a4c2f517fa0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/1e19321bfb8d6ff348cd85bdad3a1a4c2f517fa0/STCStyleEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
4579,
4607,
834,
11898,
3616,
12,
2890,
16,
871,
4672,
4953,
1114,
273,
296,
4060,
7866,
87,
11,
9,
2890,
18,
4936,
532,
3262,
273,
365,
18,
2956,
48,
70,
18,
967,
780,
6233,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
4579,
4607,
834,
11898,
3616,
12,
2890,
16,
871,
4672,
4953,
1114,
273,
296,
4060,
7866,
87,
11,
9,
2890,
18,
4936,
532,
3262,
273,
365,
18,
2956,
48,
70,
18,
967,
780,
6233,
1... |
self.emit(SIGNAL("majDownloadBar(int)"), pourcent) | if pourcent >= 0 and pourcent <= 100: self.emit(SIGNAL("majDownloadBar(int)"), pourcent) | def tryReadPourcent(self): line = self.readAll() r = re.findall("(\d{1,3}\.{0,1}\d{0,1})%", line) pourcent = 0 if len(r) > 0: pourcent = int(float(r[-1])) | c9eda704cdaefbbce024abc080f25eb9fbf2efe4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12953/c9eda704cdaefbbce024abc080f25eb9fbf2efe4/CDL.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
775,
1994,
52,
477,
2998,
12,
2890,
4672,
980,
273,
365,
18,
896,
1595,
1435,
436,
273,
283,
18,
4720,
454,
2932,
4713,
72,
95,
21,
16,
23,
97,
5834,
95,
20,
16,
21,
6280,
72,
95,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
775,
1994,
52,
477,
2998,
12,
2890,
4672,
980,
273,
365,
18,
896,
1595,
1435,
436,
273,
283,
18,
4720,
454,
2932,
4713,
72,
95,
21,
16,
23,
97,
5834,
95,
20,
16,
21,
6280,
72,
95,
... |
def fl_set_glcanvas_attributes(ob, config): """ fl_set_glcanvas_attributes(ob, config) """ _fl_set_glcanvas_attributes(ob, config) _fl_get_glcanvas_attributes = cfuncproto(so_libformsgl, "fl_get_glcanvas_attributes", | def fl_set_glcanvas_attributes(pObject, config): """ fl_set_glcanvas_attributes(pObject, config) """ _fl_set_glcanvas_attributes(pObject, config) _fl_get_glcanvas_attributes = cfuncproto(so_libformsgl, "fl_get_glcanvas_attributes", | def fl_set_glcanvas_attributes(ob, config): """ fl_set_glcanvas_attributes(ob, config) """ _fl_set_glcanvas_attributes(ob, config) | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
67,
7043,
15424,
67,
4350,
12,
947,
16,
642,
4672,
3536,
1183,
67,
542,
67,
7043,
15424,
67,
4350,
12,
947,
16,
642,
13,
3536,
225,
389,
2242,
67,
542,
67,
7043,
15424... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1183,
67,
542,
67,
7043,
15424,
67,
4350,
12,
947,
16,
642,
4672,
3536,
1183,
67,
542,
67,
7043,
15424,
67,
4350,
12,
947,
16,
642,
13,
3536,
225,
389,
2242,
67,
542,
67,
7043,
15424... |
calc_total = False | def get_results_by_hour(events, start_date, end_date): date_dic = {} total_label = _("Total") calc_total = False result = { 'series': [] } for event in events: key = get_hour_key(event.create_date) if event.type == EventType.ORDER_RATED: if not total_label in date_dic: date_dic[total_label] = {} calc_total = True if event.rating: label = event.rating else: continue else: label = event.get_label() if not label in date_dic: date_dic[label] = {} if key in date_dic[label]: date_dic[label][key] += 1 else: date_dic[label][key] = 1 if calc_total: if key in date_dic[total_label]: date_dic[total_label][key] += 1 else: date_dic[total_label][key] = 1 days_interval = (end_date - start_date).days for i in range(0,24): for status in date_dic.keys(): if i in date_dic[status]: date_dic[status][i] = float(date_dic[status][i]) / float(days_interval) else: date_dic[status][i] = 0 for status in date_dic.keys(): result['series'].append({ 'data': [[str(key) + ":00", date_dic[status][key]] for key in date_dic[status].keys()], 'name': status, 'type': 'spline' }) logging.info(result['series']) return result | f5e88e248cc25cd1d01bd0464b0372f02b8c9aed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7532/f5e88e248cc25cd1d01bd0464b0372f02b8c9aed/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4717,
67,
1637,
67,
12091,
12,
5989,
16,
787,
67,
712,
16,
679,
67,
712,
4672,
1509,
67,
15859,
273,
2618,
2078,
67,
1925,
273,
389,
2932,
5269,
7923,
563,
273,
288,
296,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4717,
67,
1637,
67,
12091,
12,
5989,
16,
787,
67,
712,
16,
679,
67,
712,
4672,
1509,
67,
15859,
273,
2618,
2078,
67,
1925,
273,
389,
2932,
5269,
7923,
563,
273,
288,
296,
10... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.