rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
def prepare(self, *args): return _tinyWRAP.ProxyAudioProducer_prepare(self, *args) def start(self): return _tinyWRAP.ProxyAudioProducer_start(self) def pause(self): return _tinyWRAP.ProxyAudioProducer_pause(self) def stop(self): return _tinyWRAP.ProxyAudioProducer_stop(self) def setActivate(self, *args): return _tinyWRAP.ProxyAudioProducer_setActivate(self, *args) | def prepare(self, *args): return _tinyWRAP.ProxyAudioProducer_prepare(self, *args) | 2b3ef33e1cad0b0ba9de339aee59ceb6fe65ef1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5606/2b3ef33e1cad0b0ba9de339aee59ceb6fe65ef1a/tinyWRAP.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
12,
2890,
16,
380,
1968,
4672,
327,
389,
88,
11652,
27664,
18,
3886,
12719,
12140,
67,
9366,
12,
2890,
16,
380,
1968,
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,
2911,
12,
2890,
16,
380,
1968,
4672,
327,
389,
88,
11652,
27664,
18,
3886,
12719,
12140,
67,
9366,
12,
2890,
16,
380,
1968,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
for i in range(0, 256): | for i in [0, 8, 16, 32, 64, 127, 128, 255]: | def test(expression, result, exception=None): try: r = eval(expression) except: if exception: if not isinstance(sys.exc_value, exception): print expression, "FAILED" # display name, not actual value if exception is sre.error: print "expected", "sre.error" else: print "expected", exception.__name__ print "got", sys.exc_type.__name__, str(sys.exc_value) else: print expression, "FAILED" traceback.print_exc(file=sys.stdout) else: if exception: print expression, "FAILED" if exception is sre.error: print "expected", "sre.error" else: print "expected", exception.__name__ print "got result", repr(r) else: if r != result: print expression, "FAILED" print "expected", repr(result) print "got result", repr(r) | d1722de32db85bca4407ac729781ad91b3d051e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d1722de32db85bca4407ac729781ad91b3d051e8/test_sre.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
12,
8692,
16,
563,
16,
1520,
33,
7036,
4672,
775,
30,
436,
273,
5302,
12,
8692,
13,
1335,
30,
309,
1520,
30,
309,
486,
1549,
12,
9499,
18,
10075,
67,
1132,
16,
1520,
4672,
1172... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
8692,
16,
563,
16,
1520,
33,
7036,
4672,
775,
30,
436,
273,
5302,
12,
8692,
13,
1335,
30,
309,
1520,
30,
309,
486,
1549,
12,
9499,
18,
10075,
67,
1132,
16,
1520,
4672,
1172... |
EXAMPLES: | Load and *execute* the content of ``filename`` in Macaulay2. :param filename: the name of the file to be loaded and executed. :type filename: string :returns: Macaulay2 command loading and executing commands in ``filename``, that is, ``'load "filename"'``. :rtype: string TESTS:: | def _read_in_file_command(self, filename): """ EXAMPLES: sage: from sage.misc.misc import tmp_filename sage: filename = tmp_filename() sage: f = open(filename, "w") sage: f.write("Hello") sage: f.close() sage: command = macaulay2._read_in_file_command(filename) sage: macaulay2.eval(command) #optional Hello sage: import os sage: os.unlink(filename) """ return 'get "%s"'%filename | 88852769d42439ef263d26499e84d200f6be49a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/88852769d42439ef263d26499e84d200f6be49a4/macaulay2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
67,
267,
67,
768,
67,
3076,
12,
2890,
16,
1544,
4672,
3536,
4444,
471,
380,
8837,
14,
326,
913,
434,
12176,
3459,
10335,
316,
13217,
69,
332,
528,
22,
18,
225,
294,
891,
15... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
896,
67,
267,
67,
768,
67,
3076,
12,
2890,
16,
1544,
4672,
3536,
4444,
471,
380,
8837,
14,
326,
913,
434,
12176,
3459,
10335,
316,
13217,
69,
332,
528,
22,
18,
225,
294,
891,
15... |
((?::%s:)?) ( | (?P<role>(:%s:)?) (?P<backquote> | def parse(self, text, lineno, memo, parent): """ Return 2 lists: nodes (text and inline elements), and system_messages. | 6782c922e166489b456fc617b1d5765e9532726e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1532/6782c922e166489b456fc617b1d5765e9532726e/states.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
977,
16,
7586,
16,
11063,
16,
982,
4672,
3536,
2000,
576,
6035,
30,
2199,
261,
955,
471,
6370,
2186,
3631,
471,
2619,
67,
6833,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
977,
16,
7586,
16,
11063,
16,
982,
4672,
3536,
2000,
576,
6035,
30,
2199,
261,
955,
471,
6370,
2186,
3631,
471,
2619,
67,
6833,
18,
2,
-100,
-100,
-100,
-100,
-100,... |
def GetMemberStrId(id, member_offset): | def GetMemberStrId(sid, member_offset): | def GetMemberStrId(id, member_offset): """ Get structure id of a member @param id: structure type ID @param member_offset: member offset. The offset can be any offset in the member. For example, is a member is 4 bytes long and starts at offset 2, then 2,3,4,5 denote the same structure member. @return: -1 if bad structure type ID is passed or no such member in the structure otherwise returns structure id of the member. If the current member is not a structure, returns -1. """ s = idaapi.get_struc(id) if not s: return -1 m = idaapi.get_member(s, member_offset) if not m: return -1 cs = idaapi.get_member_struc(m) if cs: return cs.id else: return -1 | 244a3cd02a580c0095170004ec30e922f0d1a8a6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6984/244a3cd02a580c0095170004ec30e922f0d1a8a6/idc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
4419,
1585,
548,
12,
7453,
16,
3140,
67,
3348,
4672,
3536,
968,
3695,
612,
434,
279,
3140,
225,
632,
891,
612,
30,
3695,
618,
1599,
632,
891,
3140,
67,
3348,
30,
3140,
1384,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
4419,
1585,
548,
12,
7453,
16,
3140,
67,
3348,
4672,
3536,
968,
3695,
612,
434,
279,
3140,
225,
632,
891,
612,
30,
3695,
618,
1599,
632,
891,
3140,
67,
3348,
30,
3140,
1384,
18,
... |
def getServerCheck(myT): ret = {} for key in SchedulerConfig().server_check: if SchedulerConfig().server_check[key] == 'ipaddr': ret.update({key: myT.target_ipaddr}) if SchedulerConfig().server_check[key] == 'name': ret.update({key: myT.target_name}) if SchedulerConfig().server_check[key] == 'uuid': ret.update({key: myT.target_uuid}) if SchedulerConfig().server_check[key] == 'macaddr': ret.update({key: myT.target_macaddr.split('||')[0]}) return ret; | def getServerCheck(myT): ret = {} for key in SchedulerConfig().server_check: if SchedulerConfig().server_check[key] == 'ipaddr': ret.update({key: myT.target_ipaddr}) if SchedulerConfig().server_check[key] == 'name': ret.update({key: myT.target_name}) if SchedulerConfig().server_check[key] == 'uuid': ret.update({key: myT.target_uuid}) if SchedulerConfig().server_check[key] == 'macaddr': ret.update({key: myT.target_macaddr.split('||')[0]}) return ret; | 66d6132e7dbeaabdf8b63cbb376fe8e543435e28 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5988/66d6132e7dbeaabdf8b63cbb376fe8e543435e28/scheduling.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11543,
1564,
12,
4811,
56,
4672,
325,
273,
2618,
364,
498,
316,
12620,
809,
7675,
3567,
67,
1893,
30,
309,
12620,
809,
7675,
3567,
67,
1893,
63,
856,
65,
422,
296,
625,
4793,
4278,
325... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11543,
1564,
12,
4811,
56,
4672,
325,
273,
2618,
364,
498,
316,
12620,
809,
7675,
3567,
67,
1893,
30,
309,
12620,
809,
7675,
3567,
67,
1893,
63,
856,
65,
422,
296,
625,
4793,
4278,
325... | |
if incomment: if len(line) < 3: continue if (line[-3:] == incomment): incomment = '' continue | def checkline(self, filename, lineno): """Return line number of first line at or after input argument such that if the input points to a 'def', the returned line number is the first non-blank/non-comment line to follow. If the input points to a blank or comment line, return 0. At end of file, also return 0.""" | e85c93f52109711f415e860ba41609ae22984d92 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e85c93f52109711f415e860ba41609ae22984d92/pdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
1369,
12,
2890,
16,
1544,
16,
7586,
4672,
3536,
990,
980,
1300,
434,
1122,
980,
622,
578,
1839,
810,
1237,
4123,
716,
309,
326,
810,
3143,
358,
279,
296,
536,
2187,
326,
2106,
980... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1369,
12,
2890,
16,
1544,
16,
7586,
4672,
3536,
990,
980,
1300,
434,
1122,
980,
622,
578,
1839,
810,
1237,
4123,
716,
309,
326,
810,
3143,
358,
279,
296,
536,
2187,
326,
2106,
980... | |
(role_ids, roles_names) = self.separate_types(value)[0:2] | (role_ids, role_names) = self.separate_types(value)[0:2] | def associate_roles(self, auth, field, value): | 3f5cfa865d7b3649445fbb9af290901bf65fd4fc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7598/3f5cfa865d7b3649445fbb9af290901bf65fd4fc/Persons.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13251,
67,
7774,
12,
2890,
16,
1357,
16,
652,
16,
460,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13251,
67,
7774,
12,
2890,
16,
1357,
16,
652,
16,
460,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
atoms.y.append(-(atoms.f-atoms.f_old)) atoms.rho.append(1/npy.vdot(atoms.y[ITR],atoms.s[ITR])) atoms.ITR += 1 | self.y.append(-(self.f-self.f_old)) self.rho.append(1/npy.vdot(self.y[ITR],self.s[ITR])) self.ITR += 1 | def step(self, f): atoms = self.atoms self.ni = atoms.nimages-2 # try: atoms.imax # except: atoms.imax=0 # if(not self.ni):atoms.imax=1 g = open('out','w') atoms.r = npy.zeros((self.ni, atoms.natoms, self.dim), 'd') for i in range(1, atoms.nimages-1): atoms.r[i-1] = atoms.images[i].get_positions() print >> g,'atoms.r',atoms.r atoms.f = npy.zeros((self.ni, atoms.natoms, self.dim), 'd') for i in range(1, atoms.nimages-1): atoms.f[i-1] = atoms.images[i].get_forces() print >> g,'atoms.f',atoms.f try: atoms.start except:atoms.start=0 if(not atoms.start): atoms.start = 1 atoms.a = npy.zeros(self.memory+1, 'd') self.ptmp = atoms self.maxstep = npy.sqrt(self.maxstep * self.ni) atoms.lbfgsinit = 0 try: atoms.lbfgsinit except:atoms.lbfgsinit=0 if(not atoms.lbfgsinit): atoms.lbfgsinit = 1 atoms.Ho = npy.ones((self.ni, atoms.natoms, self.dim), 'd') if (not self.min=='line'):atoms.Ho = atoms.Ho * self.alpha atoms.ITR = 1 atoms.s = [1.] atoms.y = [1.] atoms.rho = [1.] else: a1 = abs (npy.vdot(atoms.f, atoms.f_old)) a2 = npy.vdot(atoms.f_old, atoms.f_old) print 'a1,a2 created',a1,a2 if(self.min=='line'): if(a1<=0.5* a2 and a2!=0): reset_flag = 0 else: reset_flag = 1 else: reset_flag = 0 if(reset_flag==0): g1 = open('out1','w') g2 = open('out2','w') print >> g1,'atoms.r',atoms.r print >> g2,'atoms.r_old',atoms.r_old ITR = atoms.ITR#correctly generated if(ITR > self.memory): atoms.s.pop(1) atoms.y.pop(1) atoms.rho.pop(1) ITR=self.memory atoms.s.append(atoms.r - atoms.r_old)#!!atoms.r is not updating # boundry cond # for i in range(atoms.ni): # if(method=='min'):i=0 # try: # DBC(atoms.s[ITR][i],atoms.p[i].Box) #need to make matrix for box # except: # print "Box not found." # if(method=='min'):break atoms.y.append(-(atoms.f-atoms.f_old)) atoms.rho.append(1/npy.vdot(atoms.y[ITR],atoms.s[ITR])) atoms.ITR += 1 else: | f1d52cfd851a7584be9609c1169d9c87bae506fb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5735/f1d52cfd851a7584be9609c1169d9c87bae506fb/glbfgs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2235,
12,
2890,
16,
284,
4672,
9006,
273,
365,
18,
14937,
365,
18,
15834,
273,
9006,
18,
82,
7369,
17,
22,
468,
775,
30,
9006,
18,
381,
651,
468,
1335,
30,
9006,
18,
381,
651,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2235,
12,
2890,
16,
284,
4672,
9006,
273,
365,
18,
14937,
365,
18,
15834,
273,
9006,
18,
82,
7369,
17,
22,
468,
775,
30,
9006,
18,
381,
651,
468,
1335,
30,
9006,
18,
381,
651,
33,
... |
super(PLREGONField, self).__init__(r'^\d{7,9}$', | super(PLREGONField, self).__init__(r'^\d{9,14}$', | def __init__(self, *args, **kwargs): super(PLREGONField, self).__init__(r'^\d{7,9}$', max_length=None, min_length=None, *args, **kwargs) | d9daf18879107906d75bf168ed82ffda7bb27453 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9988/d9daf18879107906d75bf168ed82ffda7bb27453/forms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
2240,
12,
6253,
5937,
673,
974,
16,
365,
2934,
972,
2738,
972,
12,
86,
11,
17134,
72,
95,
29,
16,
3461,
22496,
2187,
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
2240,
12,
6253,
5937,
673,
974,
16,
365,
2934,
972,
2738,
972,
12,
86,
11,
17134,
72,
95,
29,
16,
3461,
22496,
2187,
9... |
(uid, gid, pid) = self.GetContext() tsumufs.cacheManager.access(uid, os.path.dirname(path), os.W_OK|os.X_OK) | context = self.GetContext() tsumufs.cacheManager.access(context['uid'], os.path.dirname(path), os.W_OK|os.X_OK) | def mkdir(self, path, mode): ''' Creates a new directory with the specified mode. | c3478d05944e6e6bef9ad5c70ada99c0c43c2db1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10739/c3478d05944e6e6bef9ad5c70ada99c0c43c2db1/fusethread.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6535,
12,
2890,
16,
589,
16,
1965,
4672,
9163,
10210,
279,
394,
1867,
598,
326,
1269,
1965,
18,
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,
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,
6535,
12,
2890,
16,
589,
16,
1965,
4672,
9163,
10210,
279,
394,
1867,
598,
326,
1269,
1965,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
install_boinc_files(self.dir(), self.web_only) | install_boinc_files(self.dir(), True, not self.web_only) | def install_project(self, scheduler_file = None): if os.path.exists(self.dir()): raise SystemExit('Project directory "%s" already exists; this would clobber it!'%self.dir()) | ab69b1c6c7a46446b67facee4727793e741b3c88 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10777/ab69b1c6c7a46446b67facee4727793e741b3c88/setup_project.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
67,
4406,
12,
2890,
16,
8129,
67,
768,
273,
599,
4672,
309,
1140,
18,
803,
18,
1808,
12,
2890,
18,
1214,
1435,
4672,
1002,
25454,
2668,
4109,
1867,
2213,
87,
6,
1818,
1704,
31,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
67,
4406,
12,
2890,
16,
8129,
67,
768,
273,
599,
4672,
309,
1140,
18,
803,
18,
1808,
12,
2890,
18,
1214,
1435,
4672,
1002,
25454,
2668,
4109,
1867,
2213,
87,
6,
1818,
1704,
31,
... |
jobParam = self.jobReport.setJobParameters(int(self.jobID),value) self.log.verbose('setJobParameters(%s,%s)' %(self.jobID,value)) if not jobParam['OK']: self.log.warn(jobParam['Message']) | jobParam = S_OK() if not self.jobID: jobReport = RPCClient('WorkloadManagement/JobStateUpdate') jobParam = jobReport.setJobParameters(int(self.jobID),value) self.log.verbose('setJobParameters(%s,%s)' %(self.jobID,value)) if not jobParam['OK']: self.log.warn(jobParam['Message']) else: self.log.verbose('JobID not defined, no parameter information will be reported') | def __setJobParamList(self,value): """Wraps around setJobParameters of state update client """ # FIXME: like the Watchdog, jobParam = self.jobReport.setJobParameters(int(self.jobID),value) self.log.verbose('setJobParameters(%s,%s)' %(self.jobID,value)) if not jobParam['OK']: self.log.warn(jobParam['Message']) | b03e51b6437930714ea21108f8c3e6e5dd0ccb3f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/b03e51b6437930714ea21108f8c3e6e5dd0ccb3f/JobWrapper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
2278,
786,
682,
12,
2890,
16,
1132,
4672,
3536,
20785,
6740,
444,
2278,
2402,
434,
919,
1089,
1004,
3536,
468,
9852,
30,
3007,
326,
9736,
20330,
16,
1719,
786,
273,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
2278,
786,
682,
12,
2890,
16,
1132,
4672,
3536,
20785,
6740,
444,
2278,
2402,
434,
919,
1089,
1004,
3536,
468,
9852,
30,
3007,
326,
9736,
20330,
16,
1719,
786,
273,
365,
18,
... |
if not self.evt.isSet(): | if not self.evt.is_set(): | def tearDown(self): # wait on the server thread to terminate self.evt.wait(4.0) if not self.evt.isSet(): self.evt.set() stop_serving() raise RuntimeError("timeout reached, test has failed") | cd178922af8eeccd93f58f2204b9cb231d2bac86 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/cd178922af8eeccd93f58f2204b9cb231d2bac86/test_xmlrpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
2890,
4672,
468,
2529,
603,
326,
1438,
2650,
358,
10850,
365,
18,
73,
11734,
18,
7048,
12,
24,
18,
20,
13,
309,
486,
365,
18,
73,
11734,
18,
291,
67,
542,
13332,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
268,
2091,
4164,
12,
2890,
4672,
468,
2529,
603,
326,
1438,
2650,
358,
10850,
365,
18,
73,
11734,
18,
7048,
12,
24,
18,
20,
13,
309,
486,
365,
18,
73,
11734,
18,
291,
67,
542,
13332,... |
print base_request_path | def view_report(request, entity=None, **args): ''' This is a generic view for two types of reports: - List reports, showing a list of values are rows - Table reports, showing in addition values per time buckets as columns The following arguments can be passed to the view: - report: Points to a subclass of Report. This is a required attribute. - extra_context: An additional set of records added to the context for rendering the view. ''' # Pick up the report class global reservedParameters; reportclass = args['report'] model = reportclass.model # Process uploaded data files if request.method == 'POST': if not reportclass.model or "csv_file" not in request.FILES: request.user.message_set.create(message=_('Invalid upload request')) return HttpResponseRedirect(request.get_full_path()) if not reportclass.editable or not request.user.has_perm('%s.%s' % (model._meta.app_label, model._meta.get_add_permission())): request.user.message_set.create(message=_('Not authorized')) return HttpResponseRedirect(request.get_full_path()) (warnings,errors) = parseUpload(request, reportclass, request.FILES['csv_file'].read()) if len(errors) > 0: request.user.message_set.create(message=_('File upload aborted with errors')) for i in errors: request.user.message_set.create(message=i) elif len(warnings) > 0: request.user.message_set.create(message=_('Uploaded file processed with warnings')) for i in warnings: request.user.message_set.create(message=i) else: request.user.message_set.create(message=_('Uploaded data successfully')) return HttpResponseRedirect(request.get_full_path()) # Verify if the page has changed since the previous request lastmodifiedrequest = request.META.get('HTTP_IF_MODIFIED_SINCE', None) try: lastmodifiedresponse = reportclass.lastmodified().replace(microsecond=0) lastmodifieduser = request.user.get_profile().lastmodified.replace(microsecond=0) if lastmodifieduser and lastmodifieduser > lastmodifiedresponse: # A change of user or user preferences must trigger recomputation lastmodifiedresponse = lastmodifieduser lastmodifiedresponse = (formatdate(timegm(lastmodifiedresponse.utctimetuple()))[:26] + 'GMT') if lastmodifiedrequest and lastmodifiedrequest.startswith(lastmodifiedresponse): # The report hasn't modified since the previous request return HttpResponseNotModified() except: lastmodifiedresponse = None # Verify the user is authorirzed to view the report for perm in reportclass.permissions: if not request.user.has_perm(perm): return HttpResponseForbidden('<h1>%s</h1>' % _('Permission denied')) # Pick up the list of time buckets if issubclass(reportclass, TableReport): (bucket,start,end,bucketlist) = getBuckets(request) else: bucket = start = end = bucketlist = None type = request.GET.get('reporttype','html') # HTML or CSV (table or list) output # Is this a popup window? is_popup = request.GET.has_key('pop') # Pick up the filter parameters from the url counter = reportclass.basequeryset fullhits = counter.count() if entity: # The url path specifies a single entity. # We ignore all other filters. counter = counter.filter(pk__exact=entity) else: # The url doesn't specify a single entity, but may specify filters # Convert URL parameters into queryset filters. for key, valuelist in request.GET.lists(): # Ignore arguments that aren't filters if key not in reservedParameters: # Loop over all values, since the same filter key can be # used multiple times! for value in valuelist: if len(value)>0: counter = counter.filter( **{smart_str(key): value} ) # Pick up the sort parameter from the url sortparam = request.GET.get('o', reportclass.default_sort) try: # Pick up the sorting arguments sortfield = 0 for i in sortparam: if i.isdigit(): sortfield = sortfield * 10 + int(i) else: break sortdirection = sortparam[-1] if not hasattr(reportclass,'default_sortfield'): # Create an attribute to store the index of the default sort reportclass.default_sortfield = 0 for i in reportclass.default_sort: if i.isdigit(): reportclass.default_sortfield = reportclass.default_sortfield * 10 + int(i) else: break reportclass.default_sortdirection = reportclass.default_sort[-1] if sortfield<=0 or sortfield > len(reportclass.rows) \ or (reportclass.rows[sortfield-1][1].has_key('sort') and reportclass.rows[sortfield-1][1]['sort']): # Invalid sort raise # Create sort parameters if sortfield == reportclass.default_sortfield: if sortdirection == 'd': sortparam = '%dd' % sortfield counter = counter.order_by('-%s' % (('order_by' in reportclass.rows[sortfield-1][1] and reportclass.rows[sortfield-1][1]['order_by']) or reportclass.rows[sortfield-1][0])) sortsql = '%d desc' % sortfield else: sortparam = '%da' % sortfield counter = counter.order_by(('order_by' in reportclass.rows[sortfield-1][1] and reportclass.rows[sortfield-1][1]['order_by']) or reportclass.rows[sortfield-1][0]) sortsql = '%d asc' % sortfield else: if sortdirection == 'd': sortparm = '%dd' % sortfield if reportclass.default_sortdirection == 'a': counter = counter.order_by( '-%s' % (('order_by' in reportclass.rows[sortfield-1][1] and reportclass.rows[sortfield-1][1]['order_by']) or reportclass.rows[sortfield-1][0]), ('order_by' in reportclass.rows[reportclass.default_sortfield-1][1] and reportclass.rows[reportclass.default_sortfield-1][1]['order_by']) or reportclass.rows[reportclass.default_sortfield-1][0] ) sortsql = '%d desc, %d asc' % (sortfield, reportclass.default_sortfield) else: counter = counter.order_by( '-%s' % (('order_by' in reportclass.rows[sortfield-1][1] and reportclass.rows[sortfield-1][1]['order_by']) or reportclass.rows[sortfield-1][0]), '-%s' % (('order_by' in reportclass.rows[reportclass.default_sortfield-1][1] and reportclass.rows[reportclass.default_sortfield-1][1]['order_by']) or reportclass.rows[reportclass.default_sortfield-1][0]) ) sortsql = '%d desc, %d desc' % (sortfield, reportclass.default_sortfield) else: sortparam = '%da' % sortfield if reportclass.default_sortdirection == 'a': counter = counter.order_by( ('order_by' in reportclass.rows[sortfield-1][1] and reportclass.rows[sortfield-1][1]['order_by']) or reportclass.rows[sortfield-1][0], ('order_by' in reportclass.rows[reportclass.default_sortfield-1][1] and reportclass.rows[reportclass.default_sortfield-1][1]['order_by']) or reportclass.rows[reportclass.default_sortfield-1][0] ) sortsql = '%d asc, %d asc' % (sortfield, reportclass.default_sortfield) else: counter = counter.order_by( ('order_by' in reportclass.rows[sortfield-1][1] and reportclass.rows[sortfield-1][1]['order_by']) or reportclass.rows[sortfield-1][0], '-%s' % (('order_by' in reportclass.rows[reportclass.default_sortfield-1][1] and reportclass.rows[reportclass.default_sortfield-1][1]['order_by']) or reportclass.rows[reportclass.default_sortfield-1][0]) ) sortsql = '%d asc, %d desc' % (sortfield, reportclass.default_sortfield) except: # A silent and safe exit in case of any exception sortparam = reportclass.default_sort sortfield = reportclass.default_sortfield sortdirection = reportclass.default_sortdirection sortsql = '%d asc' % sortfield if sortdirection == 'a': counter = counter.order_by(('order_by' in reportclass.rows[sortfield-1][1] and reportclass.rows[sortfield-1][1]['order_by']) or reportclass.rows[sortfield-1][0]) else: counter = counter.order_by('-%s' % (('order_by' in reportclass.rows[sortfield-1][1] and reportclass.rows[sortfield-1][1]['order_by']) or reportclass.rows[sortfield-1][0])) # HTML output or CSV output? if type[:3] == 'csv': # CSV output response = HttpResponse(mimetype='text/csv') response['Content-Disposition'] = 'attachment; filename=%s.csv' % reportclass.title.lower() if hasattr(reportclass,'resultlist2'): # SQL override provided of type 2 response._container = _generate_csv(reportclass, reportclass.resultlist2(counter, bucket, start, end, sortsql=sortsql), type, bucketlist) elif hasattr(reportclass,'resultlist1'): # SQL override provided of type 1 response._container = _generate_csv(reportclass, reportclass.resultlist1(counter, bucket, start, end, sortsql=sortsql), type, bucketlist) else: # No SQL override provided response._container = _generate_csv(reportclass, counter, type, bucketlist) response._is_string = False return response # Build paginator page = int(request.GET.get('p', '1')) paginator = QuerySetPaginator(counter, reportclass.paginate_by) if paginator.page(page).start_index(): counter = counter[paginator.page(page).start_index()-1:paginator.page(page).end_index()] # Calculate the content of the page if hasattr(reportclass,'resultlist1'): # SQL override provided try: objectlist1 = reportclass.resultlist1(counter, bucket, start, end, sortsql=sortsql) except InvalidPage: raise Http404 else: # No SQL override provided objectlist1 = counter if hasattr(reportclass,'resultlist2'): # SQL override provided try: objectlist2 = reportclass.resultlist2(counter, bucket, start, end, sortsql=sortsql) except InvalidPage: raise Http404 else: # No SQL override provided objectlist2 = objectlist1 # Build the paginator html page_htmls = _get_paginator_html(request, paginator, page) # Build the path for the complete list. # We need to treat URLs for a specific entity a bit differently if entity: base_request_path = "%s/" % request.path.rstrip("/").rpartition("/")[0] else: base_request_path = request.path print base_request_path # Prepare template context context = { 'reportclass': reportclass, 'model': model, 'hasaddperm': reportclass.editable and model and request.user.has_perm('%s.%s' % (model._meta.app_label, model._meta.get_add_permission())), 'haschangeperm': reportclass.editable and model and request.user.has_perm('%s.%s' % (model._meta.app_label, model._meta.get_change_permission())), 'request': request, 'objectlist1': objectlist1, 'objectlist2': objectlist2, 'reportbucket': bucket, 'reportstart': start, 'reportend': end, 'paginator': paginator, 'hits' : paginator.count, 'fullhits': fullhits, 'is_popup': is_popup, 'base_request_path': base_request_path, 'paginator_html': mark_safe(page_htmls), 'javascript_imports': _get_javascript_imports(reportclass), # Never reset the breadcrumbs if an argument entity was passed. # Otherwise depend on the value in the report class. 'reset_crumbs': reportclass.reset_crumbs and entity == None, 'title': (entity and '%s %s %s' % (unicode(reportclass.title),_('for'),entity)) or reportclass.title, 'rowheader': _create_rowheader(request, sortfield, sortdirection, reportclass, False), 'rowheaderfrozen': _create_rowheader(request, sortfield, sortdirection, reportclass, True), 'crossheader': issubclass(reportclass, TableReport) and _create_crossheader(request, reportclass), 'columnheader': issubclass(reportclass, TableReport) and _create_columnheader(request, reportclass, bucketlist), } if 'extra_context' in args: context.update(args['extra_context']) # Render the view, optionally setting the last-modified http header response = HttpResponse( loader.render_to_string(reportclass.template, context, context_instance=RequestContext(request)), ) if lastmodifiedresponse: response['Last-Modified'] = lastmodifiedresponse return response | e7647d32ff28871f88c36fd664da1b25d2ab7b36 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8604/e7647d32ff28871f88c36fd664da1b25d2ab7b36/report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1476,
67,
6006,
12,
2293,
16,
1522,
33,
7036,
16,
2826,
1968,
4672,
9163,
1220,
353,
279,
5210,
1476,
364,
2795,
1953,
434,
10557,
30,
300,
987,
10557,
16,
17253,
279,
666,
434,
924,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1476,
67,
6006,
12,
2293,
16,
1522,
33,
7036,
16,
2826,
1968,
4672,
9163,
1220,
353,
279,
5210,
1476,
364,
2795,
1953,
434,
10557,
30,
300,
987,
10557,
16,
17253,
279,
666,
434,
924,
8... | |
result = self.pool.get(action.action_id.type).read(cr, uid, action.action_id.id, context=context) return result | return self.pool.get(action.action_id.type)\ .read(cr, uid, action.action_id.id, context=context) | def run(self, cr, uid, ids, context={}): logger = netsvc.Logger() | b608b4568295e0b184359360e6f261d007a191fa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/b608b4568295e0b184359360e6f261d007a191fa/ir_actions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
1194,
273,
21954,
4227,
18,
3328,
1435,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
1194,
273,
21954,
4227,
18,
3328,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
winner_pos = gameover_font.size('WINNER') winner_pos = (width - gameover_pos[0]) / 2, \ (height - gameover_pos[1]) / 2 | winner_pos = winner_font.size('WINNER') winner_pos = (width - winner_pos[0]) / 2, \ (height - winner_pos[1]) / 2 | def run(): pygame.init() screen = pygame.display.set_mode(size) ship = Player.spawn_at(screen, width/2, height/2) speed = 2 black = (0,0,0) fps_timer = pygame.time.Clock() # fonts score_font = pygame.font.SysFont('courier', 25, bold = True) debug_font = pygame.font.SysFont('arial', 8) gameover_font = pygame.font.SysFont('arial', 18, bold = True) gameover_pos = gameover_font.size('GAME OVER') gameover_pos = (width - gameover_pos[0]) / 2, \ (height - gameover_pos[1]) / 2 winner_font = pygame.font.SysFont('arial', 18, bold = True) winner_pos = gameover_font.size('WINNER') winner_pos = (width - gameover_pos[0]) / 2, \ (height - gameover_pos[1]) / 2 user_input = Input() bullets = [] baddies = [] dw, dh = .1 * width, .1 * height spawn_points = [ SpawnPoint(screen, dw, dh, baddies), SpawnPoint(screen, dw, height - dh, baddies), SpawnPoint(screen, width - dw, dh, baddies), SpawnPoint(screen, width - dw, height - dh, baddies) ] score = 0 max_ships = 500 num_ships_spawned = 0 winner = False ###################################################################### # Main Loop # ###################################################################### while True: fps_timer.tick(60) #################################################################### # User Input # #################################################################### # Quitting and special keys. for event in pygame.event.get([pygame.QUIT, pygame.KEYUP]): if event.type == pygame.QUIT: sys.exit() if event.type == pygame.KEYUP and \ (event.key == pygame.K_q or event.key == pygame.K_w) and \ (event.mod == pygame.K_RCTRL or event.mod == pygame.K_LCTRL): sys.exit() if event.type == pygame.KEYUP and event.key == pygame.K_F7: spawn_points[random.randrange(len(spawn_points))].spawn() if event.type == pygame.KEYUP and event.key == pygame.K_F6: print 'stats:' print ' Num Baddies:', len(baddies) print ' Num Bullets:', len(bullets) pygame.event.clear() # Movement if ship.exploding: if ship.expl_prog >= 30: del ship ship = Player.spawn_at(screen, width/2, height/2) empty(bullets) empty(baddies) score = 0 num_ships_spawned = 0 else: js_dx = user_input.get_mx() js_dy = user_input.get_my() ship.traj = math.atan2(js_dy, js_dx) if abs(js_dx) > .1 or abs(js_dy) > .1: amt = math.sqrt(js_dx * js_dx + js_dy * js_dy) if amt > 1: amt = 1. elif amt < -1: amt = -1. ship.move_forward(speed * amt) # Fire js_fx = user_input.get_fx() js_fy = user_input.get_fy() if abs(js_fx) > .1 or abs(js_fy) > .1: bullet = ship.fire(math.atan2(js_fy, js_fx)) if bullet is not None: bullets.append(bullet) ################################################################## # Collision Detection # ################################################################## while ship._build_rect().left <= 0: ship.move(1,0) while ship._build_rect().right >= width: ship.move(-1,0) while ship._build_rect().top <= 0: ship.move(0,1) while ship._build_rect().bottom >= height: ship.move(0,-1) if num_ships_spawned < max_ships: if random.randrange(100) < 5: for s in spawn_points: s.spawn() num_ships_spawned += 1 elif len(baddies) <= 0: winner = True #################################################################### # Drawing Process # #################################################################### screen.fill(black) # draw the bullets or delete them if they've gone off screen indecies = range(len(bullets)) indecies.reverse() for i in indecies: # reverse search, because we're deleting elements bullets[i].move_forward() if bullets[i].pos[0] <= 0 or bullets[i].pos[0] >= width or \ bullets[i].pos[1] <= 0 or bullets[i].pos[1] >= height: del bullets[i] else: bullets[i].draw() # draw the baddies or delete baddie/bullet on collision indecies = range(len(baddies)) indecies.reverse() for i in indecies: baddies[i].tick() rect = baddies[i]._build_rect() remove_me = False for j in xrange(len(bullets)): if rect.collidepoint(bullets[j].pos): remove_me = True del bullets[j] score += 100 break if remove_me: del baddies[i] else: if rect.left <= 0 or rect.right >= width: baddies[i].traj = math.pi - baddies[i].traj while baddies[i]._build_rect().left <= 0: baddies[i].move(1,0) while baddies[i]._build_rect().right >= width: baddies[i].move(-1,0) if rect.top <= 0 or rect.bottom >= height: baddies[i].traj = -baddies[i].traj while baddies[i]._build_rect().top <= 0: baddies[i].move(0,1) while baddies[i]._build_rect().bottom >= height: baddies[i].move(0,-1) baddies[i].draw() if not ship.exploding: if rect.colliderect(ship._build_rect()): ship.explode() if winner: screen.blit(winner_font.render("WINNER", False, (255,255,255)), winner_pos) if ship.exploding: screen.blit(gameover_font.render("GAME OVER", False, (255,255,255)), gameover_pos) screen.blit(score_font.render('%d' % score, False, (255,255,255)), (20,20)) ship.draw() pygame.display.flip() | 266967f9e768a1e8f28436cd86a9a11fa0144bd4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4253/266967f9e768a1e8f28436cd86a9a11fa0144bd4/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
13332,
2395,
13957,
18,
2738,
1435,
5518,
273,
2395,
13957,
18,
5417,
18,
542,
67,
3188,
12,
1467,
13,
225,
24316,
273,
19185,
18,
1752,
9533,
67,
270,
12,
9252,
16,
1835,
19,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
13332,
2395,
13957,
18,
2738,
1435,
5518,
273,
2395,
13957,
18,
5417,
18,
542,
67,
3188,
12,
1467,
13,
225,
24316,
273,
19185,
18,
1752,
9533,
67,
270,
12,
9252,
16,
1835,
19,
22... |
MessageBox.__init__(self, session, _("Recording(s) are in progress or comming up in few seconds... really restart now?"), type = MessageBox.TYPE_YESNO, timeout = timeout) | MessageBox.__init__(self, session, _("Recording(s) are in progress or coming up in few seconds... really restart now?"), type = MessageBox.TYPE_YESNO, timeout = timeout) | def __init__(self, session, retvalue=1, timeout=-1): self.retval=retvalue recordings = len(session.nav.getRecordings()) self.connected = False next_rec_time = -1 if not recordings: next_rec_time = session.nav.RecordTimer.getNextRecordingTime() if recordings or (next_rec_time > 0 and (next_rec_time - time()) < 360): if retvalue == 1: MessageBox.__init__(self, session, _("Recording(s) are in progress or comming up in few seconds... really shutdown now?"), type = MessageBox.TYPE_YESNO, timeout = timeout) elif retvalue == 2: MessageBox.__init__(self, session, _("Recording(s) are in progress or comming up in few seconds... really reboot now?"), type = MessageBox.TYPE_YESNO, timeout = timeout) elif retvalue == 4: pass else: MessageBox.__init__(self, session, _("Recording(s) are in progress or comming up in few seconds... really restart now?"), type = MessageBox.TYPE_YESNO, timeout = timeout) self.skinName = "MessageBox" session.nav.record_event.append(self.getRecordEvent) self.connected = True self.onShow.append(self.__onShow) self.onHide.append(self.__onHide) else: self.skin = """<screen position="0,0" size="0,0"/>""" Screen.__init__(self, session) self.close(True) | 2a2ec738fb169d58f1d36b2fc0e1c509822c33f4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6652/2a2ec738fb169d58f1d36b2fc0e1c509822c33f4/Standby.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1339,
16,
325,
1132,
33,
21,
16,
2021,
29711,
21,
4672,
365,
18,
18341,
33,
1349,
1132,
1409,
899,
273,
562,
12,
3184,
18,
11589,
18,
588,
2115,
899,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1339,
16,
325,
1132,
33,
21,
16,
2021,
29711,
21,
4672,
365,
18,
18341,
33,
1349,
1132,
1409,
899,
273,
562,
12,
3184,
18,
11589,
18,
588,
2115,
899,
1... |
self.btn_update.connect('clicked', self.on_btn_update_clicked) | self.btn_update.connect('clicked', self.on_btn_update_clicked) | def build_inputw(self): # input window self.inputw = gtk.Window() self.inputw.set_default_size(300, 10) self.inputw.set_position(gtk.WIN_POS_CENTER) self.inputw.set_title(_("What's happening?")) hbox = gtk.HBox() | 1b72b0ee57eb1ab604e64b31b416cae895174552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12179/1b72b0ee57eb1ab604e64b31b416cae895174552/hotot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
2630,
91,
12,
2890,
4672,
468,
810,
2742,
365,
18,
2630,
91,
273,
22718,
18,
3829,
1435,
365,
18,
2630,
91,
18,
542,
67,
1886,
67,
1467,
12,
19249,
16,
1728,
13,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
2630,
91,
12,
2890,
4672,
468,
810,
2742,
365,
18,
2630,
91,
273,
22718,
18,
3829,
1435,
365,
18,
2630,
91,
18,
542,
67,
1886,
67,
1467,
12,
19249,
16,
1728,
13,
365,
18,
... |
ws = Workspace.objects.get(pk = ws_pk) | ws = DAMWorkspace.objects.get(pk = ws_pk) | def test_edit_1(self): | 774c03fcc85d5555c72b71c04da9a7d1a510e957 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4589/774c03fcc85d5555c72b71c04da9a7d1a510e957/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4619,
67,
21,
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... | [
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,
1842,
67,
4619,
67,
21,
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,
... |
verify(unicode(''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))), 'utf-8') == u'\U00023456' ) verify(unicode(''.join((chr(0xf0), chr(0x90), chr(0x80), chr(0x82))), 'utf-8') == u'\U00010002' ) verify(unicode(''.join((chr(0xe2), chr(0x82), chr(0xac))), 'utf-8') == u'\u20ac' ) | verify(unicode('\xf0\xa3\x91\x96', 'utf-8') == u'\U00023456' ) verify(unicode('\xf0\x90\x80\x82', 'utf-8') == u'\U00010002' ) verify(unicode('\xe2\x82\xac', 'utf-8') == u'\u20ac' ) | def __str__(self): return self.x | d0f8b80511e67229514f5b54cab614cae1402b4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/d0f8b80511e67229514f5b54cab614cae1402b4d/test_unicode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
365,
18,
92,
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,
1001,
701,
972,
12,
2890,
4672,
327,
365,
18,
92,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.warn(' !! FAILURE importing tests for %s' % mstr(module)) | sys.path[:] = old_sys_path self.warn('FAILURE importing tests for %s' % (mstr(module))) | def _get_module_tests(self,module,level,verbosity): mstr = self._module_str d,f = os.path.split(module.__file__) | 7adb2e2d0abc93ca9572ff451ff3ca1acdfce4cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/7adb2e2d0abc93ca9572ff451ff3ca1acdfce4cb/numpytest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
2978,
67,
16341,
12,
2890,
16,
2978,
16,
2815,
16,
16629,
8807,
4672,
312,
701,
273,
365,
6315,
2978,
67,
701,
302,
16,
74,
273,
1140,
18,
803,
18,
4939,
12,
2978,
1618... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
588,
67,
2978,
67,
16341,
12,
2890,
16,
2978,
16,
2815,
16,
16629,
8807,
4672,
312,
701,
273,
365,
6315,
2978,
67,
701,
302,
16,
74,
273,
1140,
18,
803,
18,
4939,
12,
2978,
1618... |
ctype must be either "text/plain" or "message/rfc822". The default content type is not stored in the Content-Type: header. """ if ctype not in ('text/plain', 'message/rfc822'): raise ValueError( 'first arg must be either "text/plain" or "message/rfc822"') | ctype should be either "text/plain" or "message/rfc822", although this is not enforced. The default content type is not stored in the Content-Type: header. """ | def set_default_type(self, ctype): """Set the `default' content type. | 8b6fb51a00b698e73dce077dd98e026502b96e90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8b6fb51a00b698e73dce077dd98e026502b96e90/Message.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
1886,
67,
723,
12,
2890,
16,
11920,
4672,
3536,
694,
326,
1375,
1886,
11,
913,
618,
18,
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,
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,
444,
67,
1886,
67,
723,
12,
2890,
16,
11920,
4672,
3536,
694,
326,
1375,
1886,
11,
913,
618,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.job_post(webbrowser.open_new, (UPDATES_URL, )) | self.job_post(open_new, (UPDATES_URL, )) | def do_updates(self, event): self.job_post(webbrowser.open_new, (UPDATES_URL, )) | 508de503486843496710110579297a0a5b009a40 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9402/508de503486843496710110579297a0a5b009a40/winpdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
14703,
12,
2890,
16,
871,
4672,
365,
18,
4688,
67,
2767,
12,
4875,
11213,
18,
3190,
67,
2704,
16,
261,
8217,
55,
67,
1785,
16,
8623,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
14703,
12,
2890,
16,
871,
4672,
365,
18,
4688,
67,
2767,
12,
4875,
11213,
18,
3190,
67,
2704,
16,
261,
8217,
55,
67,
1785,
16,
8623,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
'qu': [u"Sut'ichana qillqa", u'SJM'], | 'qu': [u"Sut'ichana qillqa", u'Disambig', u'SJM'], | def __init__(self): family.Family.__init__(self) self.name = 'wikipedia' | cf212e6d90e5c18d2e4fdfc6d63af4911fe41e56 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/cf212e6d90e5c18d2e4fdfc6d63af4911fe41e56/wikipedia_family.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
6755,
18,
9203,
16186,
2738,
972,
12,
2890,
13,
365,
18,
529,
273,
296,
11999,
13744,
11,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
6755,
18,
9203,
16186,
2738,
972,
12,
2890,
13,
365,
18,
529,
273,
296,
11999,
13744,
11,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
assert key.step is None, 'cannot handle slice with stride' | assert key.step in (None, 1), 'cannot handle slice with stride' | def __setitem__(self, key, item): if isinstance(key, UnicodeType) or isinstance(key, StringType): self.attributes[str(key)] = item elif isinstance(key, IntType): self.setup_child(item) self.children[key] = item elif isinstance(key, SliceType): assert key.step is None, 'cannot handle slice with stride' for node in item: self.setup_child(node) self.children[key.start:key.stop] = item else: raise TypeError, ('element index must be an integer, a slice, or ' 'an attribute name string') | 63986dc09bb8be7acac6756139a831ac047b912d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/63986dc09bb8be7acac6756139a831ac047b912d/nodes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1726,
972,
12,
2890,
16,
498,
16,
761,
4672,
309,
1549,
12,
856,
16,
9633,
559,
13,
578,
1549,
12,
856,
16,
31570,
4672,
365,
18,
4350,
63,
701,
12,
856,
25887,
273,
761,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
542,
1726,
972,
12,
2890,
16,
498,
16,
761,
4672,
309,
1549,
12,
856,
16,
9633,
559,
13,
578,
1549,
12,
856,
16,
31570,
4672,
365,
18,
4350,
63,
701,
12,
856,
25887,
273,
761,
... |
if hasattr(self, tag + '_attributes'): attributes = getattr(self, tag + '_attributes') | if hasattr(self, tagname + '_attributes'): attributes = getattr(self, tagname + '_attributes') | def parse_starttag(self, i): rawdata = self.rawdata # i points to start of tag end = endbracket.search(rawdata, i+1) if not end: return -1 j = end.start(0) res = tagfind.match(rawdata, i+1) if not res: raise RuntimeError, 'unexpected call to parse_starttag' k = res.end(0) tag = res.group(0) if not self.__seen_starttag and self.__seen_doctype: if tag != self.__seen_doctype: self.syntax_error('starttag does not match DOCTYPE') if self.__seen_starttag and not self.stack: self.syntax_error('multiple elements on top level') if hasattr(self, tag + '_attributes'): attributes = getattr(self, tag + '_attributes') else: attributes = None attrdict, k = self.parse_attributes(tag, k, j, attributes) res = starttagend.match(rawdata, k) if not res: self.syntax_error('garbage in start tag') self.finish_starttag(tag, attrdict) if res and res.group('slash') == '/': self.finish_endtag(tag) return end.end(0) | a410d6a227cd319b6aaccb60dced4660f1be0df3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a410d6a227cd319b6aaccb60dced4660f1be0df3/xmllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1937,
2692,
12,
2890,
16,
277,
4672,
1831,
892,
273,
365,
18,
1899,
892,
468,
277,
3143,
358,
787,
434,
1047,
679,
273,
679,
21025,
18,
3072,
12,
1899,
892,
16,
277,
15,
21... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
1937,
2692,
12,
2890,
16,
277,
4672,
1831,
892,
273,
365,
18,
1899,
892,
468,
277,
3143,
358,
787,
434,
1047,
679,
273,
679,
21025,
18,
3072,
12,
1899,
892,
16,
277,
15,
21... |
if self.Value == 0: return other return Sum((self, other)) | if isinstance(other, Constant): return Constant(self.Value + other.Value) if self.Value == 0: return other return Expression.__add__(self, other) | def __add__(self, other): if not isinstance(other, Expression): return Constant(self.Value + other) if self.Value == 0: return other return Sum((self, other)) | 0aea67b6248de24bf5c20988f84fdf8ba68e066d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12571/0aea67b6248de24bf5c20988f84fdf8ba68e066d/primitives.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
972,
12,
2890,
16,
1308,
4672,
309,
486,
1549,
12,
3011,
16,
5371,
4672,
327,
10551,
12,
2890,
18,
620,
397,
1308,
13,
309,
365,
18,
620,
422,
374,
30,
327,
1308,
327,
93... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
972,
12,
2890,
16,
1308,
4672,
309,
486,
1549,
12,
3011,
16,
5371,
4672,
327,
10551,
12,
2890,
18,
620,
397,
1308,
13,
309,
365,
18,
620,
422,
374,
30,
327,
1308,
327,
93... |
ntag.set_parent(otag.get_parent()) | if otag.has_parent(): opar = otag.get_parent() ntag.reparent(opar) | def rename_tag(self, oldname, newname): if len(newname) > 0 and \ oldname not in ['gtg-tags-none','gtg-tags-all']: if newname[0] != "@": newname = "@" + newname if newname != oldname and newname != None \ and not self.tree.has_node(newname): ntag = self.new_tag(newname) otag = self.tree.get_node(oldname) #copy attributes for att in otag.get_all_attributes(butname=True): ntag.set_attribute(att,otag.get_attribute(att)) #restore position in tree ntag.set_parent(otag.get_parent()) for ch in otag.get_children(): tagchild = self.get_tag(ch) tagchild.reparent(ntag) #copy tasks for tid in otag.get_tasks(): tas = self.req.get_task(tid) tas.rename_tag(oldname,newname) #remove the old one self.tree.remove_node(oldname,otag) | 77e0ef56b1c486b387985d31f0557cff0665419f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8234/77e0ef56b1c486b387985d31f0557cff0665419f/tagstore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6472,
67,
2692,
12,
2890,
16,
1592,
529,
16,
26722,
4672,
309,
562,
12,
2704,
529,
13,
405,
374,
471,
521,
1592,
529,
486,
316,
10228,
4521,
75,
17,
4156,
17,
6102,
17023,
4521,
75,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6472,
67,
2692,
12,
2890,
16,
1592,
529,
16,
26722,
4672,
309,
562,
12,
2704,
529,
13,
405,
374,
471,
521,
1592,
529,
486,
316,
10228,
4521,
75,
17,
4156,
17,
6102,
17023,
4521,
75,
... |
def check_sinc144(self): | def test_sinc144(self): | def check_sinc144(self): gc = self.generic_sun("sinc144") save(gc,test_name()+'.bmp') | 1d96ab014629902ff0c3275273182d01de39da50 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13166/1d96ab014629902ff0c3275273182d01de39da50/image_test_case.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
1652,
1842,
67,
87,
9523,
25339,
12,
2890,
4672,
8859,
273,
365,
18,
13540,
67,
16924,
2932,
87,
9523,
25339,
7923,
1923,
12,
13241,
16,
3813,
67,
529,
1435,
6797,
18,
70,
1291,
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,
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,
225,
1652,
1842,
67,
87,
9523,
25339,
12,
2890,
4672,
8859,
273,
365,
18,
13540,
67,
16924,
2932,
87,
9523,
25339,
7923,
1923,
12,
13241,
16,
3813,
67,
529,
1435,
6797,
18,
70,
1291,
6134,
2... |
cwd = os.path.normpath(os.path.join(cwd, match.group(1))) | cwd = os.path.join(cwd, match.group(1)) | def _do_strace(self, args, outfile, outname): """ Run strace on given command args, sending output to file. Return (status code, list of dependencies, list of outputs). """ shell('strace', '-fo', outname, '-e', 'trace=open,stat64,execve,exit_group,chdir,mkdir,rename', args, silent=False) | 0f925541c7e9b967846b9e6a7dbbf253666ef541 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7381/0f925541c7e9b967846b9e6a7dbbf253666ef541/fabricate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
701,
623,
12,
2890,
16,
833,
16,
8756,
16,
596,
529,
4672,
3536,
1939,
609,
623,
603,
864,
1296,
833,
16,
5431,
876,
358,
585,
18,
2000,
261,
2327,
981,
16,
666,
434,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2896,
67,
701,
623,
12,
2890,
16,
833,
16,
8756,
16,
596,
529,
4672,
3536,
1939,
609,
623,
603,
864,
1296,
833,
16,
5431,
876,
358,
585,
18,
2000,
261,
2327,
981,
16,
666,
434,
... |
if os.path.exists(local_filepath): | if os.path.exists(local_filename): | def repackBuild(self): zip_cmd = "7za a %s nonlocalized" % self.build shellCommand(zip_cmd) | e36822b26ce81ba3f89d96443ec62c28dbd6e70f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10262/e36822b26ce81ba3f89d96443ec62c28dbd6e70f/partner-repacks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2071,
484,
3116,
12,
2890,
4672,
3144,
67,
4172,
273,
315,
27,
11939,
279,
738,
87,
1661,
3729,
1235,
6,
738,
365,
18,
3510,
5972,
2189,
12,
4450,
67,
4172,
13,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2071,
484,
3116,
12,
2890,
4672,
3144,
67,
4172,
273,
315,
27,
11939,
279,
738,
87,
1661,
3729,
1235,
6,
738,
365,
18,
3510,
5972,
2189,
12,
4450,
67,
4172,
13,
2,
-100,
-100,
-100,
... |
clean_filename = getToolByName(self, 'plone_utils').normalizeString(filename) | clean_filename = self._cleanupFilename(filename) | def post_validate(self, REQUEST=None, errors=None): """Validates upload file and id """ id = REQUEST.form.get('id') field = self.getPrimaryField() f_name = field.getName() upload = REQUEST.form.get('%s_file' % f_name, None) filename = getattr(upload, 'filename', None) clean_filename = getToolByName(self, 'plone_utils').normalizeString(filename) used_id = (id and not self._isIDAutoGenerated(id)) and id or clean_filename | b4f72460e0adc8b0be463b8936143ad033c7f2a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11956/b4f72460e0adc8b0be463b8936143ad033c7f2a0/base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
67,
5662,
12,
2890,
16,
12492,
33,
7036,
16,
1334,
33,
7036,
4672,
3536,
9594,
3617,
585,
471,
612,
3536,
612,
377,
273,
12492,
18,
687,
18,
588,
2668,
350,
6134,
652,
225,
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,
1603,
67,
5662,
12,
2890,
16,
12492,
33,
7036,
16,
1334,
33,
7036,
4672,
3536,
9594,
3617,
585,
471,
612,
3536,
612,
377,
273,
12492,
18,
687,
18,
588,
2668,
350,
6134,
652,
225,
273,
... |
return date.strftime(self.lang_obj.date_format) | return date.strftime(str(self.lang_obj.date_format)) | def __str__(self): if self.val: if getattr(self,'name', None): date = datetime.strptime(self.name, DT_FORMAT) return date.strftime(self.lang_obj.date_format) return self.val | 7b6b348700f87f77f32c425435629d7c649986a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7b6b348700f87f77f32c425435629d7c649986a4/report_sxw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
309,
365,
18,
1125,
30,
309,
3869,
12,
2890,
11189,
529,
2187,
599,
4672,
1509,
273,
3314,
18,
701,
10650,
12,
2890,
18,
529,
16,
10696,
67,
7254,
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,
701,
972,
12,
2890,
4672,
309,
365,
18,
1125,
30,
309,
3869,
12,
2890,
11189,
529,
2187,
599,
4672,
1509,
273,
3314,
18,
701,
10650,
12,
2890,
18,
529,
16,
10696,
67,
7254,
13,
... |
sage: V = VectorSpace(QQ,5,sparse=True) sage: U = V.submodule([ V.gen(i) - V.gen(0) for i in range(1,5) ]) sage: print U | sage: VV = VectorSpace(QQ,5,sparse=True) sage: UU = VV.submodule([ VV.gen(i) - VV.gen(0) for i in range(1,5) ]) sage: print UU | def _repr_(self): """ The printing representation of self. EXAMPLES:: sage: V = VectorSpace(QQ,5) sage: U = V.submodule([ V.gen(i) - V.gen(0) for i in range(1,5) ]) sage: print U # indirect doctest Vector space of degree 5 and dimension 4 over Rational Field Basis matrix: [ 1 0 0 0 -1] [ 0 1 0 0 -1] [ 0 0 1 0 -1] [ 0 0 0 1 -1] sage: print U._repr_() Vector space of degree 5 and dimension 4 over Rational Field Basis matrix: [ 1 0 0 0 -1] [ 0 1 0 0 -1] [ 0 0 1 0 -1] [ 0 0 0 1 -1] The system representation can be overwritten, but leaves _repr_ unmodified. :: sage: U.rename('U') sage: print U U sage: print U._repr_() Vector space of degree 5 and dimension 4 over Rational Field Basis matrix: [ 1 0 0 0 -1] [ 0 1 0 0 -1] [ 0 0 1 0 -1] [ 0 0 0 1 -1] Sparse vector spaces print this fact. :: sage: V = VectorSpace(QQ,5,sparse=True) sage: U = V.submodule([ V.gen(i) - V.gen(0) for i in range(1,5) ]) sage: print U # indirect doctest Sparse vector space of degree 5 and dimension 4 over Rational Field Basis matrix: [ 1 0 0 0 -1] [ 0 1 0 0 -1] [ 0 0 1 0 -1] [ 0 0 0 1 -1] """ if self.is_sparse(): return "Sparse vector space of degree %s and dimension %s over %s\n"%( self.degree(), self.dimension(), self.base_field()) + \ "User basis matrix:\n%s"%self.basis_matrix() else: return "Vector space of degree %s and dimension %s over %s\n"%( self.degree(), self.dimension(), self.base_field()) + \ "User basis matrix:\n%s"%self.basis_matrix() | 2fa09a8465bf7f362ac70477b8b158b9afea0833 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/2fa09a8465bf7f362ac70477b8b158b9afea0833/free_module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12715,
67,
12,
2890,
4672,
3536,
1021,
19171,
4335,
434,
365,
18,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
776,
273,
5589,
3819,
12,
53,
53,
16,
25,
13,
272,
410,
30,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12715,
67,
12,
2890,
4672,
3536,
1021,
19171,
4335,
434,
365,
18,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
776,
273,
5589,
3819,
12,
53,
53,
16,
25,
13,
272,
410,
30,
58... |
itgname = _indexPathnameOf(self) | itgpathname = _indexPathnameOf(self) | def _g_move(self, newParent, newName): """ Move this node in the hierarchy. | 91bb37bd7823804c026d213294d296011d5abe76 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12687/91bb37bd7823804c026d213294d296011d5abe76/table.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
75,
67,
8501,
12,
2890,
16,
24818,
16,
13253,
4672,
3536,
9933,
333,
756,
316,
326,
9360,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
75,
67,
8501,
12,
2890,
16,
24818,
16,
13253,
4672,
3536,
9933,
333,
756,
316,
326,
9360,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
flattener = Flattener(sys.stderr) | flattener = Flattener(sys.stdout) | def substitute_locals(str): return NAME_RE.sub(substitute_name, str) | f8a36bb498ac91156a1707e8efd076976067d6ec /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5771/f8a36bb498ac91156a1707e8efd076976067d6ec/flattener.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14811,
67,
17977,
12,
701,
4672,
327,
6048,
67,
862,
18,
1717,
12,
1717,
17207,
67,
529,
16,
609,
13,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14811,
67,
17977,
12,
701,
4672,
327,
6048,
67,
862,
18,
1717,
12,
1717,
17207,
67,
529,
16,
609,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
sys.path = [os.path.join(os.path.expanduser("~"),".urk"),".",path] + sys.path | sys.path = [ os.path.join(os.path.expanduser("~"),".urk"), ".", path() ] + sys.path | def path(filename): urkpath = os.path.dirname(inspect.getfile(sys.modules[__name__])) return os.path.join(urkpath, filename) | 07aaf40dd608d84af3bb1701de05105a55cbef9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10693/07aaf40dd608d84af3bb1701de05105a55cbef9d/urk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
589,
12,
3459,
4672,
8896,
79,
803,
273,
1140,
18,
803,
18,
12287,
12,
12009,
18,
588,
768,
12,
9499,
18,
6400,
63,
972,
529,
972,
22643,
225,
327,
1140,
18,
803,
18,
5701,
12,
20628... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
589,
12,
3459,
4672,
8896,
79,
803,
273,
1140,
18,
803,
18,
12287,
12,
12009,
18,
588,
768,
12,
9499,
18,
6400,
63,
972,
529,
972,
22643,
225,
327,
1140,
18,
803,
18,
5701,
12,
20628... |
return AUC_i(res, -1, useWeights) | return AUC_i(res, -1, useWeights)[0] | def AUC_binary(res, useWeights = True): if res.numberOfIterations > 1: return AUC_iterations(AUC_i, splitByIterations(res), (-1, useWeights, res, res.numberOfIterations)) else: return AUC_i(res, -1, useWeights) | 30a18fe8cc7d71cea420646f5d2a15f3550b37b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/30a18fe8cc7d71cea420646f5d2a15f3550b37b0/orngStat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
432,
17479,
67,
8578,
12,
455,
16,
999,
16595,
273,
1053,
4672,
309,
400,
18,
2696,
951,
21213,
405,
404,
30,
327,
432,
17479,
67,
19330,
12,
14237,
39,
67,
77,
16,
1416,
858,
21213,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
432,
17479,
67,
8578,
12,
455,
16,
999,
16595,
273,
1053,
4672,
309,
400,
18,
2696,
951,
21213,
405,
404,
30,
327,
432,
17479,
67,
19330,
12,
14237,
39,
67,
77,
16,
1416,
858,
21213,
... |
return self.__param[name] | return self.__params[name] | def getParam(self,name): return self.__param[name] | caf5f0ac172712e782cfd95d9306099f41805441 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/886/caf5f0ac172712e782cfd95d9306099f41805441/asModel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9027,
12,
2890,
16,
529,
4672,
327,
365,
16186,
891,
63,
529,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9027,
12,
2890,
16,
529,
4672,
327,
365,
16186,
891,
63,
529,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
'nooutput', | >>> def f(x): | faa765cbc33156fb7f27ce9996741b296c21fc63 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/faa765cbc33156fb7f27ce9996741b296c21fc63/doctest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
284,
12,
92,
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,... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
284,
12,
92,
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... | |
self.voBoxUrls = randomize(voBoxUrls.split(',')) | self.voBoxUrls = randomize(voBoxUrls) | def __init__(self,useCertificates = False): """ Constructor of the RequestClient class """ voBoxUrls = fromChar(PathFinder.getServiceURL("RequestManagement/voBoxURLs")) self.voBoxUrls = [] if voBoxUrls: self.voBoxUrls = randomize(voBoxUrls.split(',')) | e3c87a9b1acdd7ba266a4effc4ee285a917acf15 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/e3c87a9b1acdd7ba266a4effc4ee285a917acf15/RequestClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1202,
14133,
273,
1083,
4672,
3536,
11417,
434,
326,
1567,
1227,
667,
3536,
19993,
3514,
10509,
273,
628,
2156,
12,
743,
8441,
18,
588,
1179,
1785,
2932,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1202,
14133,
273,
1083,
4672,
3536,
11417,
434,
326,
1567,
1227,
667,
3536,
19993,
3514,
10509,
273,
628,
2156,
12,
743,
8441,
18,
588,
1179,
1785,
2932,
6... |
v, s, g, r = self.parse(vs, rs) | v, s, g, r, backup = self.parse(vs, rs) if backup is True: yield {} return | def actions(self, vs=None, rs=None): """ List possible actions. | 7c642c83662e6df49097c3079102e8ab494ded57 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13049/7c642c83662e6df49097c3079102e8ab494ded57/alteon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4209,
12,
2890,
16,
6195,
33,
7036,
16,
3597,
33,
7036,
4672,
3536,
987,
3323,
4209,
18,
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,
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,
4209,
12,
2890,
16,
6195,
33,
7036,
16,
3597,
33,
7036,
4672,
3536,
987,
3323,
4209,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
return out | return PHC_Object(out, input_ring) | def __call__(self, polys, mode='b', cmd_list=['y', 'input', 'output'], verbose=False): """ Returns as a string the result of running PHC with the given polynomials, mode, and command list. The command list is a sequence of commands that would get input interactively to PHC if you ran it from the command line. | f7be136bb710dbba5eb2dbd3e6bfc2672cd81e39 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/f7be136bb710dbba5eb2dbd3e6bfc2672cd81e39/phc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
2952,
1900,
16,
1965,
2218,
70,
2187,
1797,
67,
1098,
33,
3292,
93,
2187,
296,
2630,
2187,
296,
2844,
17337,
3988,
33,
8381,
4672,
3536,
2860,
487,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
2952,
1900,
16,
1965,
2218,
70,
2187,
1797,
67,
1098,
33,
3292,
93,
2187,
296,
2630,
2187,
296,
2844,
17337,
3988,
33,
8381,
4672,
3536,
2860,
487,
279,
... |
self.optimize_loop(ops, 'Not, Not', expected) | expected = """ [i0, i1] jump(i0, i1) """ self.optimize_loop(ops, 'Not, Not', expected, preamble) | def test_int_is_true_of_bool(self): ops = """ [i0, i1] i2 = int_gt(i0, i1) i3 = int_is_true(i2) i4 = int_is_true(i3) guard_value(i4, 0) [i0, i1] jump(i0, i1) """ expected = """ [i0, i1] i2 = int_gt(i0, i1) guard_false(i2) [i0, i1] jump(i0, i1) """ self.optimize_loop(ops, 'Not, Not', expected) | 86d3ac7fcd8c34942685a0bee0fe0514a1a06a5a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/86d3ac7fcd8c34942685a0bee0fe0514a1a06a5a/test_optimizeopt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
474,
67,
291,
67,
3767,
67,
792,
67,
6430,
12,
2890,
4672,
6727,
273,
3536,
306,
77,
20,
16,
277,
21,
65,
277,
22,
273,
509,
67,
4521,
12,
77,
20,
16,
277,
21,
13,
277,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
474,
67,
291,
67,
3767,
67,
792,
67,
6430,
12,
2890,
4672,
6727,
273,
3536,
306,
77,
20,
16,
277,
21,
65,
277,
22,
273,
509,
67,
4521,
12,
77,
20,
16,
277,
21,
13,
277,... |
def get_sidebars(self, pagename): | def add_sidebars(self, pagename, ctx): | def get_sidebars(self, pagename): def has_wildcard(pattern): return any(char in pattern for char in '*?[') sidebars = None matched = None for pattern, patsidebars in self.config.html_sidebars.iteritems(): if patmatch(pagename, pattern): if matched: if has_wildcard(pattern): # warn if both patterns contain wildcards if has_wildcard(matched): self.warn('page %s matches two patterns in ' 'html_sidebars: %r and %r' % (pagename, matched, pattern)) # else the already matched pattern is more specific # than the present one, because it contains no wildcard continue matched = pattern sidebars = patsidebars if sidebars is None: sidebars = self.default_sidebars elif isinstance(sidebars, basestring): # 0.x compatible mode: insert custom sidebar before searchbox sidebars = self.default_sidebars[:-1] + [sidebars] + \ self.default_sidebars[-1:] return sidebars | 03b9d79b347737f73d05b0d3e47782e3183840c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5532/03b9d79b347737f73d05b0d3e47782e3183840c7/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
5564,
13518,
12,
2890,
16,
4262,
1069,
16,
1103,
4672,
1652,
711,
67,
22887,
12,
4951,
4672,
327,
1281,
12,
3001,
316,
1936,
364,
1149,
316,
14609,
35,
3292,
13,
4889,
13518,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
5564,
13518,
12,
2890,
16,
4262,
1069,
16,
1103,
4672,
1652,
711,
67,
22887,
12,
4951,
4672,
327,
1281,
12,
3001,
316,
1936,
364,
1149,
316,
14609,
35,
3292,
13,
4889,
13518,
... |
elev = self.store[self.store.elevname].getSlice(elevbounds,dataonly=True,cache=cachebasedata) | def setmask(mask,newmask): if mask is None: mask = numpy.empty(self.getShape(),dtype=numpy.bool) mask[...] = newmask else: mask = numpy.logical_or(mask,newmask) return mask | 7c4f47d94e4d097f849a4880efe8c7c83023cbee /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/381/7c4f47d94e4d097f849a4880efe8c7c83023cbee/data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
4455,
12,
4455,
16,
2704,
4455,
4672,
309,
3066,
353,
599,
30,
3066,
273,
3972,
18,
5531,
12,
2890,
18,
588,
8500,
9334,
8972,
33,
15974,
18,
6430,
13,
3066,
63,
2777,
65,
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,
444,
4455,
12,
4455,
16,
2704,
4455,
4672,
309,
3066,
353,
599,
30,
3066,
273,
3972,
18,
5531,
12,
2890,
18,
588,
8500,
9334,
8972,
33,
15974,
18,
6430,
13,
3066,
63,
2777,
65,
273,
... | |
if 'inherit_id' in vals: | if 'inherit_id' in vals and vals['inherit_id']: | def create(self, cr, uid, vals, context={}): if 'inherit_id' in vals: obj=self.browse(cr,uid,vals['inherit_id']) child=self.pool.get(vals['model']) error="Inherited view model [%s] and \ \n\n base view model [%s] do not match \ \n\n It should be same as base view model " \ %(vals['model'],obj.model) try: if obj.model==child._inherit: pass except: if not obj.model==vals['model']: raise Exception(error) | 179a924635943eaca4e52100b21df4d8aa7306bd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/179a924635943eaca4e52100b21df4d8aa7306bd/ir_ui_view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
4555,
16,
5773,
16,
819,
12938,
4672,
309,
296,
6018,
67,
350,
11,
316,
5773,
471,
5773,
3292,
6018,
67,
350,
3546,
30,
1081,
33,
2890,
18,
25731,
12,
33... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
752,
12,
2890,
16,
4422,
16,
4555,
16,
5773,
16,
819,
12938,
4672,
309,
296,
6018,
67,
350,
11,
316,
5773,
471,
5773,
3292,
6018,
67,
350,
3546,
30,
1081,
33,
2890,
18,
25731,
12,
33... |
raise KeyError('Invalid field %s' % field) | raise KeyError(u'Invalid field %s' % field) | def __getitem__(self, field): if field not in FIELDS: raise KeyError('Invalid field %s' % field) return self.fields[field] | 7caf7af8620f36787fcc5d3a1634ba919cd8202c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2215/7caf7af8620f36787fcc5d3a1634ba919cd8202c/phonebook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
652,
4672,
309,
652,
486,
316,
4011,
11608,
30,
1002,
4999,
12,
89,
11,
1941,
652,
738,
87,
11,
738,
652,
13,
327,
365,
18,
2821,
63,
1518,
65,
2,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
31571,
972,
12,
2890,
16,
652,
4672,
309,
652,
486,
316,
4011,
11608,
30,
1002,
4999,
12,
89,
11,
1941,
652,
738,
87,
11,
738,
652,
13,
327,
365,
18,
2821,
63,
1518,
65,
2,
-... |
if cr and (cr.path() == f or cr.path == c2.path()): | if of == f or of == c2.path(): | def checkcopies(f, m1, m2): '''check possible copies of f from m1 to m2''' of = None seen = set([f]) for oc in ctx(f, m1[f]).ancestors(): ocr = oc.rev() of = oc.path() if of in seen: # check limit late - grab last rename before if ocr < limit: break continue seen.add(of) | 24afcf7d206088820b3b601286045e5403b7706a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/24afcf7d206088820b3b601286045e5403b7706a/copies.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
22295,
606,
12,
74,
16,
312,
21,
16,
312,
22,
4672,
9163,
1893,
3323,
13200,
434,
284,
628,
312,
21,
358,
312,
22,
26418,
434,
273,
599,
5881,
273,
444,
3816,
74,
5717,
364,
133... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
22295,
606,
12,
74,
16,
312,
21,
16,
312,
22,
4672,
9163,
1893,
3323,
13200,
434,
284,
628,
312,
21,
358,
312,
22,
26418,
434,
273,
599,
5881,
273,
444,
3816,
74,
5717,
364,
133... |
ValueError, "BCH codes does not exist with the given input." | raise ValueError, "BCH codes does not exist with the given input." | def BCHCode(n,delta,F,b=0): r""" A 'Bose-Chaudhuri-Hockenghem code' (or BCH code for short) is the largest possible cyclic code of length n over field F=GF(q), whose generator polynomial has zeros (which contain the set) $Z = \{a^{b},a^{b+1}, ..., a^{b+delta-2}\}$, where a is a primitive $n^{th}$ root of unity in the splitting field $GF(q^m)$, b is an integer $0\leq b\leq n-delta+1$ and m is the multiplicative order of q modulo n. (The integers $b,...,b+delta-2$ typically lie in the range $1,...,n-1$.) The integer $delta \geq 1$ is called the "designed distance". The length n of the code and the size q of the base field must be relatively prime. The generator polynomial is equal to the least common multiple of the minimal polynomials of the elements of the set $Z$ above. Special cases are b=1 (resulting codes are called 'narrow-sense' BCH codes), and $n=q^m-1$ (known as 'primitive' BCH codes). It may happen that several values of delta give rise to the same BCH code. Thlargest one is called the Bose distance of the code. The true minimum distance, d, of the code is greater than or equal to the Bose distance, so $d\geq delta$. EXAMPLES: sage: FF.<a> = GF(3^2,"a") sage: x = PolynomialRing(FF,"x").gen() sage: L = [b.minpoly() for b in [a,a^2,a^3]]; g = LCM(L) sage: f = x^(8)-1 sage: g.divides(f) True sage: C = CyclicCode(8,g); C Linear code of length 8, dimension 4 over Finite Field of size 3 sage: C.minimum_distance() 4 sage: C = BCHCode(8,3,GF(3),1); C Linear code of length 8, dimension 4 over Finite Field of size 3 sage: C.minimum_distance() 4 sage: C = BCHCode(8,3,GF(3)); C Linear code of length 8, dimension 3 over Finite Field of size 3 sage: C.minimum_distance() 5 REFERENCES: [HP] W. C. Huffman, V. Pless, Fundamentals of Error-Correcting Codes, Cambridge Univ. Press, 2003. """ q = F.order() R = IntegerModRing(n) m = R(q).multiplicative_order() FF = GF(q**m,"a"); a = FF.gen() x = PolynomialRing(FF,"x").gen() L0 = [a**i for i in range(b,b+delta)] L1 = [b.minpoly() for b in L0] g = LCM(L1) if not(g.divides(x**n-1)): ValueError, "BCH codes does not exist with the given input." return CyclicCodeFromGeneratingPolynomial(n,g) | 555015023e6db780c06da8a0c7161654b7249886 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/555015023e6db780c06da8a0c7161654b7249886/code_constructions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
605,
1792,
1085,
12,
82,
16,
9878,
16,
42,
16,
70,
33,
20,
4672,
436,
8395,
432,
296,
38,
2584,
17,
782,
24901,
76,
1650,
17,
44,
975,
275,
17680,
351,
981,
11,
261,
280,
605,
1792... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
605,
1792,
1085,
12,
82,
16,
9878,
16,
42,
16,
70,
33,
20,
4672,
436,
8395,
432,
296,
38,
2584,
17,
782,
24901,
76,
1650,
17,
44,
975,
275,
17680,
351,
981,
11,
261,
280,
605,
1792... |
"""Exception related to the Network web service""" def __init__(self, network, status, details): self.status = status self.details = details @_string_output def __str__(self): return self.details def get_id(self): """Returns the exception ID, from one of the following: STATUS_INVALID_SERVICE = 2 STATUS_INVALID_METHOD = 3 STATUS_AUTH_FAILED = 4 STATUS_INVALID_FORMAT = 5 STATUS_INVALID_PARAMS = 6 STATUS_INVALID_RESOURCE = 7 STATUS_TOKEN_ERROR = 8 STATUS_INVALID_SK = 9 STATUS_INVALID_API_KEY = 10 STATUS_OFFLINE = 11 STATUS_SUBSCRIBERS_ONLY = 12 STATUS_TOKEN_UNAUTHORIZED = 14 STATUS_TOKEN_EXPIRED = 15 """ return self.status | """Exception related to the Network web service""" def __init__(self, network, status, details): self.status = status self.details = details self.network = network @_string_output def __str__(self): return self.details def get_id(self): """Returns the exception ID, from one of the following: STATUS_INVALID_SERVICE = 2 STATUS_INVALID_METHOD = 3 STATUS_AUTH_FAILED = 4 STATUS_INVALID_FORMAT = 5 STATUS_INVALID_PARAMS = 6 STATUS_INVALID_RESOURCE = 7 STATUS_TOKEN_ERROR = 8 STATUS_INVALID_SK = 9 STATUS_INVALID_API_KEY = 10 STATUS_OFFLINE = 11 STATUS_SUBSCRIBERS_ONLY = 12 STATUS_TOKEN_UNAUTHORIZED = 14 STATUS_TOKEN_EXPIRED = 15 """ return self.status | def get_top_tags(self, limit = None): """Returns a list of the most frequently used Tags on this object.""" doc = self._request(self.ws_prefix + '.getTopTags', True) elements = doc.getElementsByTagName('tag') list = [] for element in elements: if limit and len(list) >= limit: break tag_name = _extract(element, 'name') tagcount = _extract(element, 'count') list.append(TopItem(Tag(tag_name, self.network), tagcount)) return list | 312230e30b9a32836e57d3014b7461a466a3dbed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9926/312230e30b9a32836e57d3014b7461a466a3dbed/pylast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3669,
67,
4156,
12,
2890,
16,
1800,
273,
599,
4672,
3536,
1356,
279,
666,
434,
326,
4486,
13821,
23351,
1399,
8750,
603,
333,
733,
12123,
225,
997,
273,
365,
6315,
2293,
12,
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,
336,
67,
3669,
67,
4156,
12,
2890,
16,
1800,
273,
599,
4672,
3536,
1356,
279,
666,
434,
326,
4486,
13821,
23351,
1399,
8750,
603,
333,
733,
12123,
225,
997,
273,
365,
6315,
2293,
12,
2... |
file_list = self.paths(filepattern) | file_list = self.paths(filepattern,include_non_existing=False) | def add_data_files(self,*files): """ Add data files to configuration data_files. Argument(s) can be either - 2-sequence (<datadir prefix>,<path to data file(s)>) - paths to data files where python datadir prefix defaults to package dir. If path is not absolute then it's datadir prefix is package dir + dirname of the path. """ new_files = [] for p in files: if isinstance(p,str) and '*' in p: new_files.extend(self.paths(p)) else: new_files.append(p) files = new_files data_dict = {} new_files = [] for p in files: if not is_sequence(p): d = self.path_in_package if is_string(p) and not os.path.isabs(p): d = appendpath(d,os.path.dirname(p)) p = (d,p) new_files.append(p) files = [] for prefix,filepattern in new_files: if is_string(filepattern): file_list = self.paths(filepattern) elif callable(filepattern): file_list = [filepattern] else: file_list = self.paths(*filepattern) | e97d2da5c89a2dc2ee87bc67d54b7d6a946835a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/e97d2da5c89a2dc2ee87bc67d54b7d6a946835a9/misc_util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
892,
67,
2354,
12,
2890,
16,
14,
2354,
4672,
3536,
1436,
501,
1390,
358,
1664,
501,
67,
2354,
18,
5067,
12,
87,
13,
848,
506,
3344,
300,
576,
17,
6178,
261,
32,
3404,
361,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
892,
67,
2354,
12,
2890,
16,
14,
2354,
4672,
3536,
1436,
501,
1390,
358,
1664,
501,
67,
2354,
18,
5067,
12,
87,
13,
848,
506,
3344,
300,
576,
17,
6178,
261,
32,
3404,
361,
... |
buf.append(" Relationship: %s" % service.relationship.values[0]) | buf.append(" Relationship: %s" % service.relationship.value) | def display_service(service, pidf, buf): # display class if service.rpid_class is not None: buf.append(" Class: %s" % person.rpid_class) # display timestamp if service.timestamp is not None: buf.append(" Timestamp: %s" % service.timestamp) # display notes for note in service.notes: buf.append(" %s" % format_note(note)) # display status if service.status is not None and service.status.basic is not None: buf.append(" Status: %s" % service.status.basic) # display contact if service.contact is not None: buf.append(" Contact%s: %s" % ((service.contact.priority is not None) and (' priority %s' % service.contact.priority) or '', service.contact)) # display device ID if service.device_id is not None: buf.append(" Service offered by device id: %s" % service.device_id) # display relationship if service.relationship is not None: buf.append(" Relationship: %s" % service.relationship.values[0]) # display service-class if service.service_class is not None: buf.append(" Service class: %s" % service.service_class.values[0]) # display status icon if service.status_icon is not None: buf.append(" Status icon: %s" % service.status_icon) # display user input if service.user_input is not None: buf.append(" Service is %s" % service.user_input) if service.user_input.last_input: buf.append(" Last input at: %s" % service.user_input.last_input) if service.user_input.idle_threshold: buf.append(" Idle threshold: %s seconds" % service.user_input.idle_threshold) | eafb9298a1338b654b8c427140da1f4c521b4510 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3449/eafb9298a1338b654b8c427140da1f4c521b4510/sip_subscribe_presence.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
3278,
12,
3278,
16,
4231,
74,
16,
1681,
4672,
468,
2562,
667,
309,
1156,
18,
86,
6610,
67,
1106,
353,
486,
599,
30,
1681,
18,
6923,
2932,
565,
1659,
30,
738,
87,
6,
738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2562,
67,
3278,
12,
3278,
16,
4231,
74,
16,
1681,
4672,
468,
2562,
667,
309,
1156,
18,
86,
6610,
67,
1106,
353,
486,
599,
30,
1681,
18,
6923,
2932,
565,
1659,
30,
738,
87,
6,
738,
... |
print 'usage: texi2html [-d [-d]] [-p] [-c] inputfile outputdirectory' | print 'usage: texi2hh [-d [-d]] [-p] [-c] [-3] [-H htmlhelp]', \ 'inputfile outputdirectory' | def test(): import sys debugging = 0 print_headers = 0 cont = 0 html3 = 0 while sys.argv[1:2] == ['-d']: debugging = debugging + 1 del sys.argv[1:2] if sys.argv[1] == '-p': print_headers = 1 del sys.argv[1] if sys.argv[1] == '-c': cont = 1 del sys.argv[1] if sys.argv[1] == '-3': html3 = 1 del sys.argv[1] if len(sys.argv) <> 3: print 'usage: texi2html [-d [-d]] [-p] [-c] inputfile outputdirectory' sys.exit(2) if html3: parser = TexinfoParserHTML3() else: parser = TexinfoParser() parser.cont = cont parser.debugging = debugging parser.print_headers = print_headers file = sys.argv[1] parser.setdirname(sys.argv[2]) if file == '-': fp = sys.stdin else: parser.setincludedir(os.path.dirname(file)) try: fp = open(file, 'r') except IOError, msg: print file, ':', msg sys.exit(1) parser.parse(fp) fp.close() parser.report() | ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13332,
1930,
2589,
10450,
273,
374,
1172,
67,
2485,
273,
374,
466,
273,
374,
1729,
23,
273,
374,
225,
1323,
2589,
18,
19485,
63,
21,
30,
22,
65,
422,
10228,
17,
72,
3546,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13332,
1930,
2589,
10450,
273,
374,
1172,
67,
2485,
273,
374,
466,
273,
374,
1729,
23,
273,
374,
225,
1323,
2589,
18,
19485,
63,
21,
30,
22,
65,
422,
10228,
17,
72,
3546,
30,
1... |
prep_simple(tp, TYPESTR % (code, ct.sizeof(tp))) | prep_simple(tp, "%c%d" % (code, ct.sizeof(tp))) | def __array_interface__(self): return {'descr': [('', typestr)], '__ref': self, 'strides': None, 'shape': (), 'version': 3, 'typestr': typestr, 'data': (ct.addressof(self), False), } | 58b5fb94362947ae6c75d278a7bd25ae43cfbafd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14925/58b5fb94362947ae6c75d278a7bd25ae43cfbafd/ctypeslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1126,
67,
5831,
972,
12,
2890,
4672,
327,
13666,
28313,
4278,
306,
2668,
2187,
1953,
313,
13,
6487,
4940,
1734,
4278,
365,
16,
296,
701,
4369,
4278,
599,
16,
296,
4867,
4278,
1832,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1126,
67,
5831,
972,
12,
2890,
4672,
327,
13666,
28313,
4278,
306,
2668,
2187,
1953,
313,
13,
6487,
4940,
1734,
4278,
365,
16,
296,
701,
4369,
4278,
599,
16,
296,
4867,
4278,
1832,... |
ctx.find_program('vlog', var='VLOG', mandatory=True) | ctx.find_program('vlog', var='VLOG', mandatory=True, okmsg="ok") | def configure(ctx): """Detect modelsim executables and set default flags""" ctx.find_program('vlib', var='VLIB', mandatory=True) ctx.env['VLIBFLAGS'] = [] ctx.find_program('vsim', var='VSIM', mandatory=True) ctx.env['VSIMFLAGS'] = ['-quiet'] ctx.find_program('sccom', var='SCCOM', mandatory=True) ctx.env['SCCOMFLAGS'] = ['-nologo'] ctx.env['SCLINKFLAGS'] = ['-nologo'] ctx.find_program('scgenmod', var='SCGENMOD', mandatory=True) ctx.env['SCGENMODFLAGS'] = [] ctx.env['SCGENMODMAP'] = ['-bool', '-map', "std_logic_vector=sc_uint", '-createtemplate'] ctx.find_program('vcom', var='VCOM', mandatory=True) ctx.env['VCOMFLAGS'] = ['-quiet'] ctx.find_program('vlog', var='VLOG', mandatory=True) ctx.env['VLOGFLAGS'] = ['-quiet'] | 7c31064d730fec5e3b83aa4842fea01bd5df60db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/209/7c31064d730fec5e3b83aa4842fea01bd5df60db/modelsim.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
12,
5900,
4672,
3536,
12081,
3679,
381,
28743,
1538,
471,
444,
805,
2943,
8395,
1103,
18,
4720,
67,
12890,
2668,
90,
2941,
2187,
569,
2218,
58,
14484,
2187,
11791,
33,
5510,
13,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
12,
5900,
4672,
3536,
12081,
3679,
381,
28743,
1538,
471,
444,
805,
2943,
8395,
1103,
18,
4720,
67,
12890,
2668,
90,
2941,
2187,
569,
2218,
58,
14484,
2187,
11791,
33,
5510,
13,
11... |
print "Something happened last time we tried to write file. Temp file found, using it as normal." | Log.debug("Something happened to the tags file. Using backup") | def openxmlfile(zefile,root ): tmpfile = zefile+'__' try: if os.path.exists(zefile): f = open(zefile, "r") elif os.path.exists(tmpfile): print "Something happened last time we tried to write file. Temp file found, using it as normal." os.rename(tmpfile, zefile) f = open(zefile, "r") else: # Creating empty file doc,xmlproject = emptydoc(root) newfile = savexml(zefile, doc) # use our function to save file if not newfile: sys.exit(1) return openxmlfile(zefile, root) # recursive call doc = xml.dom.minidom.parse(f) cleanDoc(doc,tab,enter) xmlproject = doc.getElementsByTagName(root)[0] f.close() return doc,xmlproject except IOError, msg: print msg sys.exit(1) except xml.parsers.expat.ExpatError, msg: f.close() print "Error parsing XML file %s: %s" %(zefile, msg) if os.path.exists(tmpfile): print "Something happened last time we tried to write file. Temp file found, using it as normal." os.rename(tmpfile, zefile) # Ok, try one more time now return openxmlfile(zefile, root) sys.exit(1) | 8a60ae8dcd15aef600e0a1cdc966fc6196a85a48 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8234/8a60ae8dcd15aef600e0a1cdc966fc6196a85a48/cleanxml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
2902,
768,
12,
8489,
768,
16,
3085,
262,
30,
25613,
273,
26637,
768,
6797,
7250,
225,
775,
30,
309,
1140,
18,
803,
18,
1808,
12,
8489,
768,
4672,
284,
273,
1696,
12,
8489,
768,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2902,
768,
12,
8489,
768,
16,
3085,
262,
30,
25613,
273,
26637,
768,
6797,
7250,
225,
775,
30,
309,
1140,
18,
803,
18,
1808,
12,
8489,
768,
4672,
284,
273,
1696,
12,
8489,
768,
... |
print format3c(month_name[q], month_name[q+1], month_name[q+2]) format3c(header, header, header) | s = (s + '\n' * l + format3cstring(month_name[q], month_name[q+1], month_name[q+2], colwidth, c).rstrip() + '\n' * l + header + '\n' * l) | def prcal(year): """Print a year's calendar.""" header = weekheader(2) format3c('', `year`, '') for q in range(January, January+12, 3): print format3c(month_name[q], month_name[q+1], month_name[q+2]) format3c(header, header, header) data = [] height = 0 for month in range(q, q+3): cal = monthcalendar(year, month) if len(cal) > height: height = len(cal) data.append(cal) for i in range(height): for cal in data: if i >= len(cal): print ' '*_colwidth, else: prweek(cal[i], 2) print _spacing, print | ae7e10502b1c72951d51cfcc82ea8e73858e55c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ae7e10502b1c72951d51cfcc82ea8e73858e55c0/calendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
846,
771,
12,
6874,
4672,
3536,
5108,
279,
3286,
1807,
5686,
12123,
1446,
273,
4860,
3374,
12,
22,
13,
740,
23,
71,
2668,
2187,
1375,
6874,
9191,
28707,
364,
1043,
316,
1048,
12,
46,
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,
846,
771,
12,
6874,
4672,
3536,
5108,
279,
3286,
1807,
5686,
12123,
1446,
273,
4860,
3374,
12,
22,
13,
740,
23,
71,
2668,
2187,
1375,
6874,
9191,
28707,
364,
1043,
316,
1048,
12,
46,
3... |
util.fix_up_logger(_logger) | def get_logger(): return _logger | 5c466e93027488d5851465d93fd3bcd56c88edf7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/5c466e93027488d5851465d93fd3bcd56c88edf7/mp_distributing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4901,
13332,
327,
389,
4901,
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,
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,
336,
67,
4901,
13332,
327,
389,
4901,
225,
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... | |
log_info('upgrade to version 3') | self.log_info('upgrade to version 3') | def upgrade_db(self): """ Update the SQL database to reflect changes in the backend code. | 4e72c405fa4fb6ca79cc88217113a691d675376f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1906/4e72c405fa4fb6ca79cc88217113a691d675376f/rdbms_common.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8400,
67,
1966,
12,
2890,
4672,
3536,
2315,
326,
3063,
2063,
358,
3037,
3478,
316,
326,
4221,
981,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
8400,
67,
1966,
12,
2890,
4672,
3536,
2315,
326,
3063,
2063,
358,
3037,
3478,
316,
326,
4221,
981,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
When a new section is discovered, a new sectionType of | When a new section is discovered, a new section with type | def includeConfigFile(self, val): for cfgfile in util.braceGlob(val): self.read(cfgfile, exception=True) | 63192cb81c8c28d278a7a936af3a578b46993668 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/63192cb81c8c28d278a7a936af3a578b46993668/cfg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2341,
13705,
12,
2890,
16,
1244,
4672,
364,
2776,
768,
316,
1709,
18,
70,
9963,
13499,
12,
1125,
4672,
365,
18,
896,
12,
7066,
768,
16,
1520,
33,
5510,
13,
2,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2341,
13705,
12,
2890,
16,
1244,
4672,
364,
2776,
768,
316,
1709,
18,
70,
9963,
13499,
12,
1125,
4672,
365,
18,
896,
12,
7066,
768,
16,
1520,
33,
5510,
13,
2,
-100,
-100,
-100,
-100,
... |
r.worldEnd() | def performAimTest( self, projection, expectedImage, particleType ) : fragmentSource = """ void main() { gl_FragColor = vec4( 1, 1, 1, 1 ); } """ p = IECore.V3fVectorData() for x in range( -2, 3 ) : for y in range( -2, 3 ) : p.append( IECore.V3f( x, y, 0 ) ) r = IECoreGL.Renderer() r.setOption( "gl:mode", IECore.StringData( "immediate" ) ) | def testVertexAttributes( self ) : | dd15ce0d7b1e9f58d265411bdfcb8bea20e571df /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9042/dd15ce0d7b1e9f58d265411bdfcb8bea20e571df/PointsPrimitive.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
6475,
2498,
12,
365,
262,
294,
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,
6475,
2498,
12,
365,
262,
294,
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... |
color = GREEN if model[iter][model.BALANCE] < 0: color = RED | color = self.get_color(model, iter, model.BALANCE_PCT) | def _getcelldata_balancepct(self, column, cell, model, iter): is_ticker_only = model[iter][model.TICKER_ONLY] color = GREEN if model[iter][model.BALANCE] < 0: color = RED if is_ticker_only: cell.set_property('text', '') else: cell.set_property('markup', "<span foreground='%s'>%+.2f%%</span>" % (color, model[iter][model.BALANCE_PCT])) | 870b26c3854f7cdeb37c49d54a88b988242d4b36 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11078/870b26c3854f7cdeb37c49d54a88b988242d4b36/widgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
3855,
892,
67,
12296,
23989,
12,
2890,
16,
1057,
16,
2484,
16,
938,
16,
1400,
4672,
353,
67,
88,
5448,
67,
3700,
273,
938,
63,
2165,
6362,
2284,
18,
56,
16656,
654,
67,
108... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3855,
892,
67,
12296,
23989,
12,
2890,
16,
1057,
16,
2484,
16,
938,
16,
1400,
4672,
353,
67,
88,
5448,
67,
3700,
273,
938,
63,
2165,
6362,
2284,
18,
56,
16656,
654,
67,
108... |
setattr(data, key, [v, cdata]) | setattr(data, key, [v, cval]) | def import_children(self, data, node): """ Import child nodes into L{data} @param data: The current object being built. @type data: L{Object} @param node: The current node being proecessed. @type node: L{sax.Element} """ for child in node.children: cdata = self.__process(child) key = reserved.get(child.name, child.name) if key in data: v = getattr(data, key) if isinstance(v, list): v.append(cdata) else: setattr(data, key, [v, cdata]) continue if self.unbounded(cdata): if cdata is None: setattr(data, key, []) else: setattr(data, key, [cdata,]) else: setattr(data, key, cdata) | 692007d9afb0d2cc2f88cd84fc66410578df926d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5930/692007d9afb0d2cc2f88cd84fc66410578df926d/unmarshaller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
5906,
12,
2890,
16,
501,
16,
756,
4672,
3536,
6164,
1151,
2199,
1368,
511,
95,
892,
97,
632,
891,
501,
30,
1021,
783,
733,
3832,
6650,
18,
632,
723,
501,
30,
511,
95,
921,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1930,
67,
5906,
12,
2890,
16,
501,
16,
756,
4672,
3536,
6164,
1151,
2199,
1368,
511,
95,
892,
97,
632,
891,
501,
30,
1021,
783,
733,
3832,
6650,
18,
632,
723,
501,
30,
511,
95,
921,
... |
'%sif not hasattr(self, %s): self.%s = {}'%( ID3, self.attribute_typecode, self.attribute_typecode), | '%sif getattr(self, "attribute_typecode_dict", None) is None: %s = {}' %( ID3, self.attribute_typecode), | def _setContent(self): # TODO: Add derivation logic to constructors. if type(self.sKlass) in (types.ClassType, type): definition = [ '%sclass %s(%s, TypeDefinition):' \ % (ID1, self.getClassName(), self.sKlass), '%s# ComplexType/SimpleContent derivation of built-in type' %ID2, '%s%s' % (ID2, self.schemaTag()), '%s%s' % (ID2, self.typeTag()), '%s%s' % (ID2, self.pnameConstructor()), '%s%s = {}'%(ID3, self.attribute_typecode), ] for l in self.attrComponents: definition.append('%s%s'%(ID3, l)) | eb271c5f638fec1e5f16969448e4f6b18349e2ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/eb271c5f638fec1e5f16969448e4f6b18349e2ee/containers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
1350,
12,
2890,
4672,
468,
2660,
30,
1436,
4854,
8482,
4058,
358,
19874,
18,
309,
618,
12,
2890,
18,
87,
47,
459,
13,
316,
261,
2352,
18,
18328,
16,
618,
4672,
2379,
273,
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,
542,
1350,
12,
2890,
4672,
468,
2660,
30,
1436,
4854,
8482,
4058,
358,
19874,
18,
309,
618,
12,
2890,
18,
87,
47,
459,
13,
316,
261,
2352,
18,
18328,
16,
618,
4672,
2379,
273,
3... |
self.assertEqual(doc.xml_element_children[0].xml_local, u'a') | def test_basic_access(self): doc = amara.parse(XML) a = doc.xml_children[0] self.assertEqual(doc.xml_type, tree.entity.xml_type) #self.assertEqual(len(doc.xml_element_children), 1) self.assertEqual(len(doc.xml_children), 1) self.assertEqual(a.xml_type, tree.element.xml_type) self.assertEqual(doc.xml_element_children[0].xml_local, u'a') self.assertEqual(doc.xml_children[0].xml_local, u'a') self.assertEqual(a.xml_attributes[u'x'], u"1") self.assertEqual(a.xml_local, u'a') self.assertEqual(a.xml_qname, u'a') self.assertEqual(a.xml_name, (None, u'a')) self.assertEqual(len(a.xml_children), 3) self.assertEqual(a.xml_parent, doc) self.assertEqual(a.xml_attributes.items(), [((None, u'x'), u'1')]) | b23cb8affad0dc8d4b0f8e96d0ca4184d6d3c64c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14078/b23cb8affad0dc8d4b0f8e96d0ca4184d6d3c64c/test_quick_reference.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13240,
67,
3860,
12,
2890,
4672,
997,
273,
2125,
297,
69,
18,
2670,
12,
4201,
13,
279,
273,
997,
18,
2902,
67,
5906,
63,
20,
65,
365,
18,
11231,
5812,
12,
2434,
18,
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,
1842,
67,
13240,
67,
3860,
12,
2890,
4672,
997,
273,
2125,
297,
69,
18,
2670,
12,
4201,
13,
279,
273,
997,
18,
2902,
67,
5906,
63,
20,
65,
365,
18,
11231,
5812,
12,
2434,
18,
2902,
... | |
generate_cmds += 'Generate("%s");' % (filename + '.' + f) | generate_cmds += 'Generate("%s");' % (fontname + '.' + f) | def make_outputs (fontname, formats): """ run pfaedit to convert to other formats """ ff_command = get_fontforge_command () if not ff_command: shutil.copy2 (fontname + '.pfa.raw', fontname + '.pfa') return 0 # not used? if round_to_int : round_cmd = 'RoundToInt();\n' generate_cmds = '' for f in formats: generate_cmds += 'Generate("%s");' % (filename + '.' + f) simplify_cmd = '' if simplify_p: simplify_cmd ='''SelectAll (); | ef6fec6b5deb5caf58e3b8cab9a94cce2af0ae04 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/ef6fec6b5deb5caf58e3b8cab9a94cce2af0ae04/mftrace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
12295,
261,
5776,
529,
16,
6449,
4672,
3536,
1086,
293,
507,
4619,
358,
1765,
358,
1308,
6449,
3536,
225,
6875,
67,
3076,
273,
336,
67,
5776,
1884,
908,
67,
3076,
1832,
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,
1221,
67,
12295,
261,
5776,
529,
16,
6449,
4672,
3536,
1086,
293,
507,
4619,
358,
1765,
358,
1308,
6449,
3536,
225,
6875,
67,
3076,
273,
336,
67,
5776,
1884,
908,
67,
3076,
1832,
309,
... |
if sequences: | if len(sequences) > 1: | def MultiIter(*sequences): """ A generator for iterating over the elements of multiple sequences simultaneously. With N sequences given as input, the generator yields all possible distinct N-tuples that contain one element from each of the input sequences. Example: >>> x = MultiIter([0, 1, 2], [10, 11]) >>> list(x) [(0, 10), (1, 10), (2, 10), (0, 11), (1, 11), (2, 11)] The elements in each output tuple are in the order of the input sequences, and the left-most input sequence is iterated over first. The input sequences are each iterated over only once, so it is safe to pass generators as arguments. Also, this generator is significantly faster if the longest input sequence is given as the first argument. For example, this code >>> lengths = range(1, 12) >>> for x in MultiIter(*map(range, lengths)): ... pass ... runs approximately 5 times faster if the lengths list is reversed. """ if sequences: # FIXME: experiment with a generator expression in Python # >= 2.5 # FIXME: this loop is about 5% faster if done the other # way around, if the last list is iterated over in the # inner loop. but there is code, like snglcoinc.py in # pylal, that has been optimized for the current order and # would need to be reoptimized if this function were to be # reversed. head = tuple([(x,) for x in sequences[0]]) for t in MultiIter(*sequences[1:]): for h in head: yield h + t else: yield () | 9d47fccff021272acd871054c85d375aeee9a555 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5758/9d47fccff021272acd871054c85d375aeee9a555/iterutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5991,
2360,
30857,
17190,
4672,
3536,
432,
4456,
364,
13099,
1879,
326,
2186,
434,
3229,
8463,
27504,
715,
18,
225,
3423,
423,
8463,
864,
487,
810,
16,
326,
4456,
16932,
777,
3323,
10217,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5991,
2360,
30857,
17190,
4672,
3536,
432,
4456,
364,
13099,
1879,
326,
2186,
434,
3229,
8463,
27504,
715,
18,
225,
3423,
423,
8463,
864,
487,
810,
16,
326,
4456,
16932,
777,
3323,
10217,
... |
tmpfile = mkstemp_mkfifo(dirname, basename) | tmpfile = mkstemp_mkfifo(dirname, tmpprefix) | def extractCpio(self, filedata, read_data, filenamehash, devinode, filenames): filename = filedata[0] data = read_data(filedata[5]) fileinfo = filenamehash.get(filename) if fileinfo == None: self.printErr("cpio file %s not in rpm header" % filename) return (fn, flag, mode, mtime, dev, inode, user, group, rdev, linkto, i) = fileinfo del filenamehash[filename] uid = gid = None if self.owner: uid = self.uid.ugid[user] gid = self.gid.ugid[group] if self.relocated: filename = self.relocatedFile(filename) filename = "%s%s" % (self.buildroot, filename) (dirname, basename) = os.path.split(filename) makeDirs(dirname) if S_ISREG(mode): di = devinode.get((dev, inode)) if di == None or data: (fd, tmpfilename) = mkstemp_file(dirname, basename) os.write(fd, data) os.close(fd) setPerms(tmpfilename, uid, gid, mode, mtime) os.rename(tmpfilename, filename) if di: di.remove(i) for j in di: if self.relocated: fn2 = "%s%s" % (self.buildroot, self.relocatedFile(filenames[j])) else: fn2 = "%s%s" % (self.buildroot, filenames[j]) (dirname, basename) = os.path.split(fn2) makeDirs(dirname) tmpfilename = mkstemp_link(dirname, basename, filename) if tmpfilename == None: (fd, tmpfilename) = mkstemp_file(dirname, basename) os.write(fd, data) os.close(fd) setPerms(tmpfilename, uid, gid, mode, mtime) os.rename(tmpfilename, fn2) del devinode[(dev, inode)] elif S_ISDIR(mode): makeDirs(filename) setPerms(filename, uid, gid, mode, None) elif S_ISLNK(mode): #if os.path.islink(filename) \ # and os.readlink(filename) == linkto: # return tmpfile = mkstemp_symlink(dirname, basename, linkto) setPerms(tmpfile, uid, gid, None, None) os.rename(tmpfile, filename) elif S_ISFIFO(mode): tmpfile = mkstemp_mkfifo(dirname, basename) setPerms(tmpfile, uid, gid, mode, mtime) os.rename(tmpfile, filename) elif S_ISCHR(mode) or S_ISBLK(mode): if self.owner: tmpfile = mkstemp_mknod(dirname, basename, mode, rdev) setPerms(tmpfile, uid, gid, mode, mtime) os.rename(tmpfile, filename) # if not self.owner: we could give a warning here elif S_ISSOCK(mode): raise ValueError, "UNIX domain sockets can't be packaged." else: raise ValueError, "%s: not a valid filetype" % (oct(mode)) | 73fe5b4e17300fe703da079a2bdf4fefe1e4ee56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/73fe5b4e17300fe703da079a2bdf4fefe1e4ee56/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
28954,
1594,
12,
2890,
16,
585,
892,
16,
855,
67,
892,
16,
1544,
2816,
16,
4461,
267,
390,
16,
9066,
4672,
1544,
273,
585,
892,
63,
20,
65,
501,
273,
855,
67,
892,
12,
768,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2608,
28954,
1594,
12,
2890,
16,
585,
892,
16,
855,
67,
892,
16,
1544,
2816,
16,
4461,
267,
390,
16,
9066,
4672,
1544,
273,
585,
892,
63,
20,
65,
501,
273,
855,
67,
892,
12,
768,
8... |
""" underscores in literals shouldn't do unterlining """ | """ underscores in literals shouldn't do underlining """ | def testUnderscoresInLiteral2(self): """ underscores in literals shouldn't do unterlining """ | 3f6e2ae459b5a30ba3ce41daba7d96cdd1fe0431 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3f6e2ae459b5a30ba3ce41daba7d96cdd1fe0431/testStructuredText.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
984,
6794,
12906,
382,
6177,
22,
12,
2890,
4672,
3536,
24714,
316,
18228,
12044,
1404,
741,
640,
387,
7511,
310,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
984,
6794,
12906,
382,
6177,
22,
12,
2890,
4672,
3536,
24714,
316,
18228,
12044,
1404,
741,
640,
387,
7511,
310,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
running_job = test.parse_partial_test(self.job, None, job_name, "", current_kernel, started_time) | running_client = test.parse_partial_test(self.job, None, job_name, "", current_kernel, started_time) | def state_iterator(self, buffer): line = None new_tests = [] job_count, boot_count = 0, 0 min_stack_size = 0 stack = status_lib.status_stack() current_kernel = kernel("", []) # UNKNOWN current_status = status_lib.statuses[-1] current_reason = None started_time_stack = [None] subdir_stack = [None] running_test = None running_reasons = set() yield [] # we're ready to start running | 09427501e89d10011aa4645efe05f01667721d76 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12268/09427501e89d10011aa4645efe05f01667721d76/version_1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
919,
67,
9838,
12,
2890,
16,
1613,
4672,
980,
273,
599,
394,
67,
16341,
273,
5378,
1719,
67,
1883,
16,
4835,
67,
1883,
273,
374,
16,
374,
1131,
67,
3772,
67,
1467,
273,
374,
2110,
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,
919,
67,
9838,
12,
2890,
16,
1613,
4672,
980,
273,
599,
394,
67,
16341,
273,
5378,
1719,
67,
1883,
16,
4835,
67,
1883,
273,
374,
16,
374,
1131,
67,
3772,
67,
1467,
273,
374,
2110,
27... |
wired_detect_header_t = ('header',language["wired_detect"]) | wired_detect_header_t = ('header', language["wired_detect"]) | def __init__(self,body,pos,ui,dbus=None): global daemon, wireless, wired | 4fa245b79a41a22da17ae3febbf053c5dd751a5f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12280/4fa245b79a41a22da17ae3febbf053c5dd751a5f/prefs_curses.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3432,
16,
917,
16,
4881,
16,
1966,
407,
33,
7036,
4672,
2552,
8131,
16,
6636,
2656,
16,
341,
2921,
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,
1001,
2738,
972,
12,
2890,
16,
3432,
16,
917,
16,
4881,
16,
1966,
407,
33,
7036,
4672,
2552,
8131,
16,
6636,
2656,
16,
341,
2921,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.save_map(0, 0, 250, linha) | self.save_map(0, 0, 250, linha, 'initial') | def get_initial_map(self, linha): dbg('getting initial map for: %s', linha) if self.db.has_keyval('mapdata.%s.initial.done' % (linha)): dbg('already on db') return | 59a4a423a589a9dbd595d0ee31e8d6f399d53154 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14322/59a4a423a589a9dbd595d0ee31e8d6f399d53154/mapa.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
6769,
67,
1458,
12,
2890,
16,
4739,
3395,
4672,
28966,
2668,
588,
1787,
2172,
852,
364,
30,
738,
87,
2187,
4739,
3395,
13,
309,
365,
18,
1966,
18,
5332,
67,
856,
1125,
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,
336,
67,
6769,
67,
1458,
12,
2890,
16,
4739,
3395,
4672,
28966,
2668,
588,
1787,
2172,
852,
364,
30,
738,
87,
2187,
4739,
3395,
13,
309,
365,
18,
1966,
18,
5332,
67,
856,
1125,
2668,
... |
if isinstance(args[i], list): process_args(args[i]) if isinstance(args[i], tuple) \ and args[i][0] == 'to_location_warehouse': | if (isinstance(args[i], tuple) or \ (isinstance(args[i], list) and len(args[i]) > 2 and \ args[i][1] in OPERATORS)) and \ args[i][0] == 'to_location_warehouse': | def process_args(args): i = 0 while i < len(args): if isinstance(args[i], list): process_args(args[i]) if isinstance(args[i], tuple) \ and args[i][0] == 'to_location_warehouse': location_id = False if args[i][2]: location = location_obj.browse(cursor, user, args[i][2], context=context) if location.type == 'warehouse': location_id = location.input_location.id args[i] = ('to_location', args[i][1], location_id) i += 1 | f72ac0a5390d01e66521ff9ac84af17da73f0bf5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9298/f72ac0a5390d01e66521ff9ac84af17da73f0bf5/move.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
1968,
12,
1968,
4672,
277,
273,
374,
1323,
277,
411,
562,
12,
1968,
4672,
225,
309,
261,
291,
1336,
12,
1968,
63,
77,
6487,
3193,
13,
578,
521,
261,
291,
1336,
12,
1968,
63... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1968,
12,
1968,
4672,
277,
273,
374,
1323,
277,
411,
562,
12,
1968,
4672,
225,
309,
261,
291,
1336,
12,
1968,
63,
77,
6487,
3193,
13,
578,
521,
261,
291,
1336,
12,
1968,
63... |
def DoEncrypt(input, key, iv, method, output): if (method == 'ISMA-IAEC'): | def DoDcfEncrypt(input, key, iv, method, output): lmethod = {'OMA-DCF-CBC':'CBC', 'OMA-DCF-CTR':'CTR'}[method] cmd = BIN_ROOT+'/mp4dcfpackager --method '+lmethod+' --content-type video/mp4 --content-id cid:bla@foo.bar --rights-issuer http://bla.com/1234 --key '+key+':'+iv+iv+' '+input+' '+output print cmd os.system(cmd) def DoDcfDecrypt(input, key, output): cmd = BIN_ROOT+"/mp4decrypt --key 1:"+key+' '+input+' '+output+'.tmp' print cmd os.system(cmd) cmd = BIN_ROOT+'/mp4extract --payload-only odrm/odda '+output+'.tmp '+output+'.odda' print cmd os.system(cmd) f1 = open(output+'.odda', 'rb') f2 = open(output, 'wb+') f2.truncate() payload = f1.read() f2.write(payload[8:]) f1.close() f2.close() os.unlink(output+'.tmp') os.unlink(output+'.odda') def DoMp4Encrypt(input, key, iv, method, output): if method == 'ISMA-IAEC': | def DoEncrypt(input, key, iv, method, output): if (method == 'ISMA-IAEC'): options = ' --kms-uri http:foo.bar ' else: options = '' cmd = "mp4encrypt --method "+method+options+" --key 1:"+key+":"+iv+" --key 2:"+key+":"+iv+' "'+input+'" "'+output+'"' print cmd os.system(cmd) | ccb0fe62ee9273ea776dcfb81b0a3950de89563f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5710/ccb0fe62ee9273ea776dcfb81b0a3950de89563f/Bento4CryptoTester.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2256,
40,
8522,
13129,
12,
2630,
16,
498,
16,
4674,
16,
707,
16,
876,
4672,
328,
2039,
273,
13666,
1872,
37,
17,
5528,
42,
17,
21813,
11,
2497,
21813,
2187,
296,
1872,
37,
17,
5528,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2256,
40,
8522,
13129,
12,
2630,
16,
498,
16,
4674,
16,
707,
16,
876,
4672,
328,
2039,
273,
13666,
1872,
37,
17,
5528,
42,
17,
21813,
11,
2497,
21813,
2187,
296,
1872,
37,
17,
5528,
... |
print "Send all messages... check wireshark for the last response" | print "Sent all messages... check wireshark for the last response" | def send_and_receive(packet): socket.sendto(packet, ("127.0.0.1", port)) try: data, addr = socket.recvfrom(4096) except socket.error, e: print "ERROR", e import sys sys.exit(0) return data | 1641b18c59a095e6b3c88f0a6660de6286e17278 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10100/1641b18c59a095e6b3c88f0a6660de6286e17278/gb-proxy-unblock-bug.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
464,
67,
18149,
12,
11482,
4672,
2987,
18,
4661,
869,
12,
11482,
16,
7566,
14260,
18,
20,
18,
20,
18,
21,
3113,
1756,
3719,
225,
775,
30,
501,
16,
3091,
273,
2987,
18,
1833... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
464,
67,
18149,
12,
11482,
4672,
2987,
18,
4661,
869,
12,
11482,
16,
7566,
14260,
18,
20,
18,
20,
18,
21,
3113,
1756,
3719,
225,
775,
30,
501,
16,
3091,
273,
2987,
18,
1833... |
this = apply(_quickfix.new_PositionLimit, args) | this = _quickfix.new_PositionLimit(*args) | def __init__(self, *args): this = apply(_quickfix.new_PositionLimit, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
2555,
3039,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
2555,
3039,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
365,
1... |
print "cmdCondor \n" print cmdCondor print "Condor submit file \n" print clist print "\n" print "Submitting Condor job ... \n"; | self.logger.log(Log.DEBUG, "cmdCondor = "+ cmdCondor) for item in clist: self.logger.log(Log.DEBUG, "Condor submit file line> "+ item) self.logger.log(Log.INFO, "Submitting Condor job ... ") | def launchPipeline(self): | 7c06e23fce83865fbdfe0d0f9e37b70137eebee0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6549/7c06e23fce83865fbdfe0d0f9e37b70137eebee0/AbePipelineManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8037,
8798,
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,
0,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8037,
8798,
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,
-100,
-... |
s,o=exec_command('echo "$BBB"',BBB='Hey') | s,o=exec_command('echo "$BBB"',BBB='Hey',**kws) | def test_posix(): s,o=exec_command("echo Hello") assert s==0 and o=='Hello',(s,o) s,o=exec_command('echo $AAA') assert s==0 and o=='',(s,o) s,o=exec_command('echo "$AAA"',AAA='Tere') assert s==0 and o=='Tere',(s,o) s,o=exec_command('echo "$AAA"') assert s==0 and o=='',(s,o) os.environ['BBB'] = 'Hi' s,o=exec_command('echo "$BBB"') assert s==0 and o=='Hi',(s,o) s,o=exec_command('echo "$BBB"',BBB='Hey') assert s==0 and o=='Hey',(s,o) s,o=exec_command('echo "$BBB"') assert s==0 and o=='Hi',(s,o) s,o=exec_command('this_is_not_a_command') assert s!=0 and o!='',(s,o) s,o=exec_command('echo path=$PATH') assert s==0 and o!='',(s,o) s,o=exec_command('python -c "import sys,os;sys.stderr.write(os.name)"') assert s==0 and o=='posix',(s,o) s,o=exec_command('python -c "raise \'Ignore me.\'"') assert s==1 and o,(s,o) s,o=exec_command('python -c "import sys;sys.stderr.write(\'0\');sys.stderr.write(\'1\');sys.stderr.write(\'2\')"') assert s==0 and o=='012',(s,o) s,o=exec_command('python -c "import sys;sys.exit(15)"') assert s==15 and o=='',(s,o) s,o=exec_command('python -c "print \'Heipa\'"') assert s==0 and o=='Heipa',(s,o) print 'ok' | 59c6f7c8809104ffcc97e2083529ae4111b41755 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/59c6f7c8809104ffcc97e2083529ae4111b41755/exec_command.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
24463,
13332,
272,
16,
83,
33,
4177,
67,
3076,
2932,
12946,
20889,
7923,
1815,
272,
631,
20,
471,
320,
18920,
18601,
2187,
12,
87,
16,
83,
13,
225,
272,
16,
83,
33,
4177,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
24463,
13332,
272,
16,
83,
33,
4177,
67,
3076,
2932,
12946,
20889,
7923,
1815,
272,
631,
20,
471,
320,
18920,
18601,
2187,
12,
87,
16,
83,
13,
225,
272,
16,
83,
33,
4177,
6... |
print '***', _get_language | def _get_language(self, cr, uid, context): print '***', _get_language lang_obj = self.pool.get('res.lang') lang_ids = lang_obj.search(cr, uid, [('translatable', '=', True)], context=context) langs = lang_obj.browse(cr, uid, lang_ids, context=context) res = [(lang.code, lang.name) for lang in langs] for lang_dict in tools.scan_languages(): if lang_dict not in res: res.append(lang_dict) return res | 66b98b50689a4bc7bae8c02ffea771683b216b76 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/66b98b50689a4bc7bae8c02ffea771683b216b76/ir_translation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
4923,
12,
2890,
16,
4422,
16,
4555,
16,
819,
4672,
3303,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
455,
18,
4936,
6134,
3303,
67,
2232,
273,
3303,
67,
2603,
18,
3072... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4923,
12,
2890,
16,
4422,
16,
4555,
16,
819,
4672,
3303,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
455,
18,
4936,
6134,
3303,
67,
2232,
273,
3303,
67,
2603,
18,
3072... | |
yield() | Yield() | def check_exception(self): "Checking exception handling" f = gui_thread.register(TestFrame) a = f(None) p = weakref.ref(a) self.assertRaises(TypeError, a.Close, 1, 2, 3) a.Close() del a yield() # this checks for memory leaks self.assertEqual(is_alive(p), 0) | 243de5d394f54b6172aeb50925b882a9dcdb8125 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/243de5d394f54b6172aeb50925b882a9dcdb8125/test_gui_thread.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
4064,
12,
2890,
4672,
315,
14294,
1520,
5057,
6,
284,
273,
13238,
67,
5930,
18,
4861,
12,
4709,
3219,
13,
279,
273,
284,
12,
7036,
13,
293,
273,
16046,
1734,
18,
1734,
12,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
4064,
12,
2890,
4672,
315,
14294,
1520,
5057,
6,
284,
273,
13238,
67,
5930,
18,
4861,
12,
4709,
3219,
13,
279,
273,
284,
12,
7036,
13,
293,
273,
16046,
1734,
18,
1734,
12,
6... |
if not BiskitTest.DEBUG: | if not self.DEBUG: | def tearDown( self ): | ff2ab258ca4a458190cfd1a423d9208455671bfe /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/482/ff2ab258ca4a458190cfd1a423d9208455671bfe/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
365,
262,
30,
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,
268,
2091,
4164,
12,
365,
262,
30,
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,
... |
cpus=None, root=None, | cpus=None, root=None, disk=None, | def new_container(self): self.construct_job(True) | f36707fda46ce58c7272cf54c7e9528ea432652d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/f36707fda46ce58c7272cf54c7e9528ea432652d/job_unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
3782,
12,
2890,
4672,
365,
18,
10062,
67,
4688,
12,
5510,
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,
394,
67,
3782,
12,
2890,
4672,
365,
18,
10062,
67,
4688,
12,
5510,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
@transform(sam_to_bam, regex(r'^(.*)/bam/(.*).bam$'), r'\1/namesorted_bam/\2.bam') | @transform(sam_to_bam, regex(r'^(.*)/bam/(.*).bam$'), r'\1/namesorted_bam/\2.namesorted.bam') | def sam_to_bam(input_file, output_file): '''Convert SAM files to BAM files.''' cmd_dict = cdict.copy() finfo = unpaired_re.search(input_file).groupdict() cmd_dict['infile'] = input_file cmd_dict['ofile'] = output_file pmsg('SAM to BAM', cmd_dict['infile'], cmd_dict['ofile']) samcmd = '%(samtools)s import %(ref)s.fai %(infile)s %(ofile)s' % cmd_dict call(samcmd) | 1bf6373d8053b0e19ba48a3be15088c626927c89 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14572/1bf6373d8053b0e19ba48a3be15088c626927c89/prep_sequence.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16260,
67,
869,
67,
11477,
12,
2630,
67,
768,
16,
876,
67,
768,
4672,
9163,
2723,
30712,
1390,
358,
605,
2192,
1390,
1093,
6309,
1797,
67,
1576,
273,
276,
1576,
18,
3530,
1435,
15190,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16260,
67,
869,
67,
11477,
12,
2630,
67,
768,
16,
876,
67,
768,
4672,
9163,
2723,
30712,
1390,
358,
605,
2192,
1390,
1093,
6309,
1797,
67,
1576,
273,
276,
1576,
18,
3530,
1435,
15190,
... |
bt.clicked = (my_anchorblock_bt, ab) | bt.callback_clicked_add(my_anchorblock_bt, ab) | def my_anchorblock_anchor(obj, ei, ab, *args, **kwargs): if ei: bt = elementary.Button(obj) bt.label_set(ei.name) ei.hover.content_set("middle", bt) bt.show() if (ei.hover_top): bx = elementary.Box(obj) bt = elementary.Button(obj) bt.label_set("Top 1") bx.pack_end(bt) bt.clicked = (my_anchorblock_bt, ab) bt.show() bt = elementary.Button(obj) bt.label_set("Top 2") bx.pack_end(bt) bt.clicked = (my_anchorblock_bt, ab) bt.show() bt = elementary.Button(obj) bt.label_set("Top 3") bx.pack_end(bt) bt.clicked = (my_anchorblock_bt, ab) bt.show() ei.hover.content_set("top", bx) bx.show() if (ei.hover_bottom): bt = elementary.Button(obj) bt.label_set("Bot") ei.hover.content_set("bottom", bt) bt.clicked = (my_anchorblock_bt, ab) bt.show() if (ei.hover_left): bt = elementary.Button(obj) bt.label_set("Left") ei.hover.content_set("left", bt) bt.clicked = (my_anchorblock_bt, ab) bt.show() if (ei.hover_right): bt = elementary.Button(obj) bt.label_set("Right") ei.hover.content_set("right", bt) bt.clicked = (my_anchorblock_bt, ab) bt.show() | ef127faaba8fc06ebbb7bd48a4185405cdfc6a4e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12343/ef127faaba8fc06ebbb7bd48a4185405cdfc6a4e/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3399,
67,
16215,
2629,
67,
16215,
12,
2603,
16,
13247,
16,
1223,
16,
380,
1968,
16,
2826,
4333,
4672,
309,
13247,
30,
10921,
273,
930,
814,
18,
3616,
12,
2603,
13,
10921,
18,
1925,
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,
3399,
67,
16215,
2629,
67,
16215,
12,
2603,
16,
13247,
16,
1223,
16,
380,
1968,
16,
2826,
4333,
4672,
309,
13247,
30,
10921,
273,
930,
814,
18,
3616,
12,
2603,
13,
10921,
18,
1925,
67,... |
m2.bio_free(self.sslbio) m2.bio_free(self.sockbio) | m2.bio_free_all(self.sslbio) | def close(self): m2.ssl_shutdown(self.ssl) try: m2.bio_free(self.sslbio) m2.bio_free(self.sockbio) except AttributeError: pass self.socket.close() | 7150c8556fec3a699bba0c60a6559070cea164ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8055/7150c8556fec3a699bba0c60a6559070cea164ac/Connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
312,
22,
18,
8157,
67,
15132,
12,
2890,
18,
8157,
13,
775,
30,
312,
22,
18,
21010,
67,
9156,
67,
454,
12,
2890,
18,
8157,
21010,
13,
225,
1335,
6394,
30,
1342,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1746,
12,
2890,
4672,
312,
22,
18,
8157,
67,
15132,
12,
2890,
18,
8157,
13,
775,
30,
312,
22,
18,
21010,
67,
9156,
67,
454,
12,
2890,
18,
8157,
21010,
13,
225,
1335,
6394,
30,
1342,
... |
self.capabilities = tuple(string.split(self.untagged_responses[cap][-1])) | self.capabilities = tuple(string.split(string.upper(self.untagged_responses[cap][-1]))) | def __init__(self, host = '', port = IMAP4_PORT): self.host = host self.port = port self.debug = Debug self.state = 'LOGOUT' self.literal = None # A literal argument to a command self.tagged_commands = {} # Tagged commands awaiting response self.untagged_responses = {} # {typ: [data, ...], ...} self.continuation_response = '' # Last continuation response self.tagnum = 0 | 00d6baa42b31dade08e2057e960ebabe6a5b509c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/00d6baa42b31dade08e2057e960ebabe6a5b509c/imaplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
273,
10226,
1756,
273,
6246,
2203,
24,
67,
6354,
4672,
365,
18,
2564,
273,
1479,
365,
18,
655,
273,
1756,
365,
18,
4148,
273,
4015,
365,
18,
2019,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1479,
273,
10226,
1756,
273,
6246,
2203,
24,
67,
6354,
4672,
365,
18,
2564,
273,
1479,
365,
18,
655,
273,
1756,
365,
18,
4148,
273,
4015,
365,
18,
2019,
... |
'Indexes' : { 'valueindex' : [ 'value' ] }, | 'UniqueIndexes' : { 'valueindex' : [ 'value' ] }, | def registerType( self, name, definitionKeyFields, definitionAccountingFields, bucketsLength ): """ Register a new type """ keyFieldsList = [] valueFieldsList = [] for t in definitionKeyFields: keyFieldsList.append( t[0] ) for t in definitionAccountingFields: valueFieldsList.append( t[0] ) for field in definitionKeyFields: if field in valueFieldsList: return S_ERROR( "Key field %s is also in the list of value fields" % field ) for field in definitionAccountingFields: if field in keyFieldsList: return S_ERROR( "Value field %s is also in the list of key fields" % field ) for bucket in bucketsLength: if type( bucket ) != types.TupleType: return S_ERROR( "Length of buckets should be a list of tuples" ) if len( bucket ) != 2: return S_ERROR( "Length of buckets should have 2d tuples" ) if name in self.dbCatalog: gLogger.error( "Type %s is already registered" % name ) return S_ERROR( "Type %s already exists in db" % name ) tables = {} for key in definitionKeyFields: gLogger.info( "Table for key %s has to be created" % key[0] ) tables[ self.__getTableName( "key", name, key[0] ) ] = { 'Fields' : { 'id' : 'INTEGER NOT NULL AUTO_INCREMENT', 'value' : '%s UNIQUE' % key[1] }, 'Indexes' : { 'valueindex' : [ 'value' ] }, 'PrimaryKey' : 'id' } #Registering type fieldsDict = {} bucketFieldsDict = {} indexesDict = {} for field in definitionKeyFields: indexesDict[ "%sIndex" % field[0] ] = [ field[0] ] fieldsDict[ field[0] ] = "INTEGER" bucketFieldsDict[ field[0] ] = "INTEGER" for field in definitionAccountingFields: fieldsDict[ field[0] ] = field[1] bucketFieldsDict[ field[0] ] = "FLOAT" fieldsDict[ 'startTime' ] = "INT UNSIGNED" fieldsDict[ 'endTime' ] = "INT UNSIGNED" bucketFieldsDict[ 'entriesInBucket' ] = "FLOAT" bucketFieldsDict[ 'startTime' ] = "INT UNSIGNED" bucketFieldsDict[ 'bucketLength' ] = "MEDIUMINT UNSIGNED" tables[ self.__getTableName( "bucket", name ) ] = { 'Fields' : bucketFieldsDict, 'Indexes' : indexesDict, } tables[ self.__getTableName( "type", name ) ] = { 'Fields' : fieldsDict, 'Indexes' : indexesDict, } retVal = self._createTables( tables ) | 13b41032681fed093279f250f41a8f53aa4fff7b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/13b41032681fed093279f250f41a8f53aa4fff7b/AccountingDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1744,
559,
12,
365,
16,
508,
16,
2379,
653,
2314,
16,
2379,
3032,
310,
2314,
16,
9169,
1782,
262,
30,
3536,
5433,
279,
394,
618,
3536,
498,
2314,
682,
273,
5378,
460,
2314,
682,
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,
1744,
559,
12,
365,
16,
508,
16,
2379,
653,
2314,
16,
2379,
3032,
310,
2314,
16,
9169,
1782,
262,
30,
3536,
5433,
279,
394,
618,
3536,
498,
2314,
682,
273,
5378,
460,
2314,
682,
273,
... |
import Martel uses_tags = tuple(builder.uses_tags()) exp = Martel.select_names(exp, uses_tags + ("record", "dataset")) iterator = exp.make_iterator("record", debug_level = debug_level) return FormatIOIterator(iterator.iterateFile(infile, builder)) | select_names = tuple(builder.uses_tags()) else: select_names = None if format.multirecord == 1: iterator = format.make_iterator("record", select_names = select_names, debug_level = debug_level) return FormatIOIterator(iterator.iterateFile(infile, builder)) elif format.multirecord == 0: t1 = time.clock() parser = format.make_parser(select_names = select_names, debug_level = debug_level) t2 = time.clock() print "Parser made", t2-t1 parser.setContentHandler(builder) t1 = time.clock() parser.parseFile(infile) t2 = time.clock() print "document created", t2-t1 return builder.document else: raise AssertionError(format.multirecord) | def readFile(self, infile, format = None, builder = None, debug_level = 0): if format is None: format = self.default_input_format format = self.registery.normalize(format) | bc44f143f3116fc1fabe2b3114bc7866d5e84f8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/bc44f143f3116fc1fabe2b3114bc7866d5e84f8f/FormatIO.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10413,
12,
2890,
16,
14568,
16,
740,
273,
599,
16,
2089,
273,
599,
16,
1198,
67,
2815,
273,
374,
4672,
309,
740,
353,
599,
30,
740,
273,
365,
18,
1886,
67,
2630,
67,
2139,
740,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10413,
12,
2890,
16,
14568,
16,
740,
273,
599,
16,
2089,
273,
599,
16,
1198,
67,
2815,
273,
374,
4672,
309,
740,
353,
599,
30,
740,
273,
365,
18,
1886,
67,
2630,
67,
2139,
740,
273,
... |
if alert_device not in engine.output_devices: if 'default' in engine.output_devices: alert_device = 'default' else: alert_device = None | if alert_device not in (None, 'default') and alert_device not in engine.output_devices: alert_device = 'default' | def start(self, config_backend=None): if self.state is not None: raise RuntimeError("SIPApplication cannot be started from '%s' state" % self.state) self.state = 'starting' account_manager = AccountManager() configuration_manager = ConfigurationManager() notification_center = NotificationCenter() session_manager = SessionManager() | fcec6e7bd84a6f0a2009bcfea5bc3733db18d487 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5703/fcec6e7bd84a6f0a2009bcfea5bc3733db18d487/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
16,
642,
67,
9993,
33,
7036,
4672,
309,
365,
18,
2019,
353,
486,
599,
30,
1002,
7265,
2932,
17739,
3208,
2780,
506,
5746,
628,
1995,
87,
11,
919,
6,
738,
365,
18,
2019... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
642,
67,
9993,
33,
7036,
4672,
309,
365,
18,
2019,
353,
486,
599,
30,
1002,
7265,
2932,
17739,
3208,
2780,
506,
5746,
628,
1995,
87,
11,
919,
6,
738,
365,
18,
2019... |
words = string.splitfields(url, ';') | words = url.split(';') | def splitattr(url): """splitattr('/path;attr1=value1;attr2=value2;...') -> '/path', ['attr1=value1', 'attr2=value2', ...].""" words = string.splitfields(url, ';') return words[0], words[1:] | 2aa671823938e593ea9dedd33b3cc4194fde8a0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/2aa671823938e593ea9dedd33b3cc4194fde8a0a/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
1747,
12,
718,
4672,
3536,
4939,
1747,
2668,
19,
803,
31,
1747,
21,
33,
1132,
21,
31,
1747,
22,
33,
1132,
22,
31,
7821,
13,
317,
1173,
803,
2187,
10228,
1747,
21,
33,
1132,
21,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1747,
12,
718,
4672,
3536,
4939,
1747,
2668,
19,
803,
31,
1747,
21,
33,
1132,
21,
31,
1747,
22,
33,
1132,
22,
31,
7821,
13,
317,
1173,
803,
2187,
10228,
1747,
21,
33,
1132,
21,... |
and self._is_tracking_a_remote_branch(current_branch): | and self.is_tracking_a_remote_branch(current_branch): | def _get_branch_switch_destination(self): current_branch = self._get_current_branch() wanted_branch = self.branch or 'master' | f3dca446ec51b04ec85ec73c7ed97895744dff87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4596/f3dca446ec51b04ec85ec73c7ed97895744dff87/git.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
7500,
67,
9610,
67,
10590,
12,
2890,
4672,
783,
67,
7500,
273,
365,
6315,
588,
67,
2972,
67,
7500,
1435,
15504,
67,
7500,
273,
365,
18,
7500,
578,
296,
7525,
11,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
588,
67,
7500,
67,
9610,
67,
10590,
12,
2890,
4672,
783,
67,
7500,
273,
365,
6315,
588,
67,
2972,
67,
7500,
1435,
15504,
67,
7500,
273,
365,
18,
7500,
578,
296,
7525,
11,
2,
-10... |
if not isinstance(inString, unicode): inString = inString.decode('utf-8') if not isinstance(outString, unicode): try: outString = outString.decode('utf-8') except UnicodeDecodeError: import traceback traceback.print_exc() print "The following string is invalid and caused the above error:", outString outString = outString.decode('utf-8', 'replace') | inString = safeDecode(inString) outString = safeDecode(outString) | def stringsMatch(inS, outS): """ Compares a regular expression to a string """ # The old way just checked equality ... #matched = inString == outString | ac37a68d77cdae125fe9dfdf908bf525d1b943c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10139/ac37a68d77cdae125fe9dfdf908bf525d1b943c9/i18n.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2064,
2060,
12,
267,
55,
16,
596,
55,
4672,
3536,
5427,
4807,
279,
6736,
2652,
358,
279,
533,
3536,
468,
1021,
1592,
4031,
2537,
5950,
14958,
1372,
468,
11073,
273,
316,
780,
422,
596,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2064,
2060,
12,
267,
55,
16,
596,
55,
4672,
3536,
5427,
4807,
279,
6736,
2652,
358,
279,
533,
3536,
468,
1021,
1592,
4031,
2537,
5950,
14958,
1372,
468,
11073,
273,
316,
780,
422,
596,
... |
response=urllib2.urlopen(request) text=response.read() | response = urllib2.urlopen(request) text = response.read() | def pageText(url): request=urllib2.Request(url) user_agent='Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7' print url request.add_header("User-Agent", user_agent) response=urllib2.urlopen(request) text=response.read() response.close() return text | dcc2ff24e2f997a7bd09888682822e754b7d38e6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/dcc2ff24e2f997a7bd09888682822e754b7d38e6/welcome.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1363,
1528,
12,
718,
4672,
590,
33,
718,
2941,
22,
18,
691,
12,
718,
13,
729,
67,
5629,
2218,
49,
11142,
10745,
19,
25,
18,
20,
261,
10399,
31,
587,
31,
8202,
20064,
1381,
18,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1363,
1528,
12,
718,
4672,
590,
33,
718,
2941,
22,
18,
691,
12,
718,
13,
729,
67,
5629,
2218,
49,
11142,
10745,
19,
25,
18,
20,
261,
10399,
31,
587,
31,
8202,
20064,
1381,
18,
21,
... |
key = keys.ReadKey(self.metadata.type, | key = keys.ReadKey(self.metadata.type, | def __init__(self, reader): self.metadata = keydata.KeyMetadata.Read(reader.GetMetadata()) self._keys = {} # maps both KeyVersions and hash ids to keys self.primary_version = None # default if no primary key self.default_size = self.metadata.type.default_size if not self.IsAcceptablePurpose(self.metadata.purpose): raise errors.KeyczarError("Unacceptable purpose: %s" % self.metadata.purpose) if self.metadata.encrypted and not isinstance(reader, readers.EncryptedReader): raise errors.KeyczarError("Need encrypted reader.") for version in self.metadata.versions: if version.status == keyinfo.PRIMARY: if self.primary_version is not None: raise errors.KeyczarError( "Key sets may only have a single primary version") self.primary_version = version key = keys.ReadKey(self.metadata.type, reader.GetKey(version.version_number)) self._keys[version] = key self._keys[key.hash] = key | 2ea8447951163e6a62b115b5c1068033e2eb4f4a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12014/2ea8447951163e6a62b115b5c1068033e2eb4f4a/keyczar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2949,
4672,
365,
18,
4165,
273,
498,
892,
18,
653,
2277,
18,
1994,
12,
10530,
18,
967,
2277,
10756,
365,
6315,
2452,
273,
2618,
225,
468,
7565,
3937,
192... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2949,
4672,
365,
18,
4165,
273,
498,
892,
18,
653,
2277,
18,
1994,
12,
10530,
18,
967,
2277,
10756,
365,
6315,
2452,
273,
2618,
225,
468,
7565,
3937,
192... |
if self.cp.has_option('main', 'cert_file'): | if self.cp.has_option('main', 'cacert'): | def setup(self, config_file = 'conf/p2ipc.ini'): # Load configuration file self.cp = ConfigParser.ConfigParser() self.cp.read(config_file) self.logger = logging.getLogger() | 7f21c1bc51f6f9e035094d0f83243fd5bbc415d5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5988/7f21c1bc51f6f9e035094d0f83243fd5bbc415d5/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
16,
642,
67,
768,
273,
296,
3923,
19,
84,
22,
625,
71,
18,
8767,
11,
4672,
468,
4444,
1664,
585,
365,
18,
4057,
273,
25076,
18,
809,
2678,
1435,
365,
18,
4057,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
16,
642,
67,
768,
273,
296,
3923,
19,
84,
22,
625,
71,
18,
8767,
11,
4672,
468,
4444,
1664,
585,
365,
18,
4057,
273,
25076,
18,
809,
2678,
1435,
365,
18,
4057,
18,
... |
else: self.TunerNextChannel() | def EventHandler(self,event): print '%s: %s app got %s event' % (time.time(), self.mode, event) if (event == remote.MENU or event == remote.STOP or event == remote.EXIT or event == remote.SELECT or event == remote.PLAY_END): self.Play('stop') remote.app = tv.eventhandler tv.refresh() return TRUE elif event == remote.CHUP or event == remote.CHDOWN: if event == remote.CHUP: self.TunerPrevChannel() else: self.TunerNextChannel() new_channel = self.TunerGetChannel() self.mplayerthread.app.write('pause\n') #os.spawnlp(os.P_WAIT, 'v4lctl', '--device=%s'%self.encoderthread.capturedev, 'setchannel', new_channel) os.spawnlp(os.P_WAIT, 'chchan','%s %s %s' % (new_channel, self.cf_norm, self.cf_clist)) self.encoderthread.app.write('reset\n') self.mplayerthread.app.write('seek 0 type=2\n') return TRUE elif event == remote.LEFT: self.StartEncoder() return TRUE elif event == remote.RIGHT: self.StopEncoder() return TRUE elif event == remote.PAUSE or event == remote.PLAY: self.mplayerthread.app.write('pause\n') # TODO: Check whether timeshifter has an overrun, in that case unpause return TRUE elif event == remote.FFWD: self.mplayerthread.app.write('seek 10\n') return TRUE elif event == remote.REW: self.mplayerthread.app.write('seek -10\n') return TRUE return TRUE | 2977e6ab7a0f3b6f80c9d8f5023c4065f4d68000 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/2977e6ab7a0f3b6f80c9d8f5023c4065f4d68000/timeshift.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26012,
12,
2890,
16,
2575,
4672,
1172,
1995,
87,
30,
738,
87,
595,
2363,
738,
87,
871,
11,
738,
261,
957,
18,
957,
9334,
365,
18,
3188,
16,
871,
13,
309,
261,
2575,
422,
2632,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26012,
12,
2890,
16,
2575,
4672,
1172,
1995,
87,
30,
738,
87,
595,
2363,
738,
87,
871,
11,
738,
261,
957,
18,
957,
9334,
365,
18,
3188,
16,
871,
13,
309,
261,
2575,
422,
2632,
18,
... | |
"""Given a model object as ``model` and a string or tuple | """Given a model object as ``model`` and a string or tuple | def traverse(model, path): """Given a model object as ``model` and a string or tuple representing a path as ``path`` (such as the return value of ``repoze.bfg.traversal.model_path`` or ``repoze.bfg.traversal.model_path_tuple`` or the value of ``request.environ['PATH_INFO']``), return a dictionary with the keys ``context``, ``root``, ``view_name``, ``subpath``, ``traversed``, ``virtual_root``, and ``virtual_root_path``. A definition of each value in the returned dictionary: - ``context``: The context (a 'model' object) found via traversal or url dispatch. If the ``path`` passed in is the empty string, the value of the ``model`` argument passed to this function is returned. - ``root``: The root model object found via traversal or url dispatch. If the ``model`` passed in was found via url dispatch, the value of the ``model`` argument passed to this function is returned. - ``view_name``: The 'view name' found during traversal or url dispatch; if the ``model`` was found via traversal, this is usually a representation of the path segment which directly follows the path to the ``context`` in the ``path``. The ``view_name`` will be a Unicode object or the empty string. The ``view_name`` will be the empty string if there is no element which follows the ``context`` path. An example: if the path passed is ``/foo/bar``, and a context object is found at ``/foo`` (but not at ``/foo/bar``), the 'view name' will be ``u'bar'``. If the ``model`` was found via urldispatch, the view_name will be the name the route found was registered with. - ``subpath``: For a ``model`` found via traversal, this is a sequence of path segments found in the ``path`` that follow the ``view_name`` (if any). Each of these items is a Unicode object. If no path segments follow the ``view_name``, the subpath will be the empty list. An example: if the path passed is ``/foo/bar/baz/buz``, and a context object is found at ``/foo`` (but not ``/foo/bar``), the 'view name' will be ``u'bar'`` and the subpath will be ``[u'baz', u'buz']``. For a ``model`` found via url dispatch, the subpath will be a sequence of values discerned from ``*subpath`` in the route pattern matched or the empty sequence. - ``traversed``: The sequence of path elements traversed to find the ``context`` object. Each of these items is a Unicode object. If no path segments were traversed to find the ``context`` object (e.g. if the ``path`` provided is the empty string), the ``traversed`` value will be the empty list. If the ``model`` is a model found via urldispatch, traversed will be None. - ``virtual_root``: A model object representing the 'virtual' root of the object graph being traversed. See :ref:`vhosting_chapter` for a definition of the virtual root object. If no virtual hosting is in effect or if the ``model`` passed in was found via URL dispatch, the ``virtual_root`` will always be the physical root of the object graph (the object at which traversal begins). - ``virtual_root_path`` -- If traversal was used to find the ``model``, this will be the sequence of path elements traversed to find the ``virtual_root`` object. Each of these items is a Unicode object. If no path segments were traversed to find the ``virtual_root`` object (e.g. if virtual hosting is not in effect), the ``traversed`` value will be the empty list. If url dispatch was used to find the ``model``, this will be None. If the path cannot be resolved, a KeyError will be raised. Rules for passing a *string* as the ``path`` argument: if the first character in the path string is the with the ``/`` character, the path will considered absolute and the graph traversal will start at the root object. If the first character of the path string is *not* the ``/`` character, the path is considered relative and graph traversal will begin at the model object supplied to the function as the ``model`` argument. If an empty string is passed as ``path``, the ``model`` passed in will be returned. Model path strings must be escaped in the following manner: each Unicode path segment must be encoded as UTF-8 and as each path segment must escaped via Python's ``urllib.quote``. For example, ``/path/to%20the/La%20Pe%C3%B1a`` (absolute) or ``to%20the/La%20Pe%C3%B1a`` (relative). The ``model_path`` function generates strings which follow these rules (albeit only absolute ones). Rules for passing a *tuple* as the ``path`` argument: if the first element in the path tuple is the empty string (for example ``('', 'a', 'b', 'c')``, the path is considered absolute and the graph traversal will start at the graph root object. If the first element in the path tuple is not the empty string (for example ``('a', 'b', 'c')``), the path is considered relative and graph traversal will begin at the model object supplied to the function as the ``model`` argument. If an empty sequence is passed as ``path``, the ``model`` passed in itself will be returned. No URL-quoting or UTF-8-encoding of individual path segments within the tuple is required (each segment may be any string or unicode object representing a model name). Model path tuples generated by ``model_path_tuple`` can always be resolved by ``find_model``. Explanation of the conversion of ``path`` segment values to Unicode during traversal: Each segment is URL-unquoted, and decoded into Unicode. Each segment is assumed to be encoded using the UTF-8 encoding (or a subset, such as ASCII); a TypeError is raised if a segment cannot be decoded. If a segment name is empty or if it is ``.``, it is ignored. If a segment name is ``..``, the previous segment is deleted, and the ``..`` is ignored. As a result of this process, the return values ``view_name``, each element in the ``subpath``, each element in ``traversed``, and each element in the ``virtual_root_path`` will be Unicode as opposed to a string, and will be URL-decoded. """ if hasattr(path, '__iter__'): # it's a tuple or some other iterable # the traverser factory expects PATH_INFO to be a string, not # unicode and it expects path segments to be utf-8 and # urlencoded (it's the same traverser which accepts PATH_INFO # from user agents; user agents always send strings). path = [quote_path_segment(name) for name in path] if path: path = '/'.join(path) or '/' else: path = '' if path and path[0] == '/': model = find_root(model) return _traverse(model, {'PATH_INFO':path}) | bdbd2e0b2e9bae8067de73f51e465c338da369ce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14321/bdbd2e0b2e9bae8067de73f51e465c338da369ce/traversal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10080,
12,
2284,
16,
589,
4672,
3536,
6083,
279,
938,
733,
487,
12176,
2284,
10335,
471,
279,
533,
578,
3193,
5123,
279,
589,
487,
12176,
803,
10335,
261,
87,
2648,
487,
326,
327,
460,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10080,
12,
2284,
16,
589,
4672,
3536,
6083,
279,
938,
733,
487,
12176,
2284,
10335,
471,
279,
533,
578,
3193,
5123,
279,
589,
487,
12176,
803,
10335,
261,
87,
2648,
487,
326,
327,
460,
... |
item.set_properties(pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin(self.tools[self.current_tool][1]))) | item.set_properties(pixbuf = gcompris.utils.load_pixmap(self.tools[self.current_tool][1])) | def assign_tool(self, newtool): # Deactivate old button item = self.tools[self.current_tool][4] item.set_properties(pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin(self.tools[self.current_tool][1]))) | ffbf41ce128e755c623406bf084ff75486e406ae /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11306/ffbf41ce128e755c623406bf084ff75486e406ae/electric.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2683,
67,
6738,
12,
2890,
16,
394,
6738,
4672,
468,
1505,
10014,
1592,
3568,
761,
273,
365,
18,
6642,
63,
2890,
18,
2972,
67,
6738,
6362,
24,
65,
761,
18,
542,
67,
4738,
12,
14861,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2683,
67,
6738,
12,
2890,
16,
394,
6738,
4672,
468,
1505,
10014,
1592,
3568,
761,
273,
365,
18,
6642,
63,
2890,
18,
2972,
67,
6738,
6362,
24,
65,
761,
18,
542,
67,
4738,
12,
14861,
4... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.