rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
ignore1, ignore2, ignore3, final_time_free = self._jmim.opt_get_optimization_interval() | ignore1, ignore2, ignore3, final_time_free = self._m.jmimodel.opt_get_optimization_interval() | def isFreeFinalTime(self): ignore1, ignore2, ignore3, final_time_free = self._jmim.opt_get_optimization_interval() return final_time_free == 1 | 733964346bd705d3e3fa78795693f8a99289c936 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7711/733964346bd705d3e3fa78795693f8a99289c936/shooting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
9194,
7951,
950,
12,
2890,
4672,
2305,
21,
16,
2305,
22,
16,
2305,
23,
16,
727,
67,
957,
67,
9156,
273,
365,
6315,
81,
18,
78,
81,
381,
1009,
18,
3838,
67,
588,
67,
16689,
158... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
9194,
7951,
950,
12,
2890,
4672,
2305,
21,
16,
2305,
22,
16,
2305,
23,
16,
727,
67,
957,
67,
9156,
273,
365,
6315,
81,
18,
78,
81,
381,
1009,
18,
3838,
67,
588,
67,
16689,
158... |
sqlQuery = sqlQuery + " WHERE tsvector_street_housenumber_city @@ to_tsquery('" + tsquery + "')" | sqlQuery = sqlQuery + " WHERE tsvector_street_housenumber_city @@ to_tsquery('english','" + tsquery + "')" | def fullTextSearch(self,request): # addresses/fullTextSearch?fields=street,city,housenumber&query=ch%20du%2028&tolerance=0.005&easting=6.62379551&northing=46.51687241&limit=20&distinct=true # Read request parameters fields = request.params['fields'] | b5802d22e5d41c8ddbbd831b4bcf601707da23a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/b5802d22e5d41c8ddbbd831b4bcf601707da23a8/addresses.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1983,
1528,
2979,
12,
2890,
16,
2293,
4672,
468,
225,
6138,
19,
2854,
1528,
2979,
35,
2821,
33,
22424,
16,
14240,
16,
76,
1481,
21998,
10,
2271,
33,
343,
9,
3462,
2544,
9,
18212,
28,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1983,
1528,
2979,
12,
2890,
16,
2293,
4672,
468,
225,
6138,
19,
2854,
1528,
2979,
35,
2821,
33,
22424,
16,
14240,
16,
76,
1481,
21998,
10,
2271,
33,
343,
9,
3462,
2544,
9,
18212,
28,
... |
p.set_objective( Sum( weight(l) * edge_used[(u,v)] for u,v,l in self.edges() ) ) | p.set_objective( Sum(weight(l) * edge_used[(u,v)] for u, v, l in self.edges())) | def longest_path(self, s = None, t = None, weighted = False, algorithm = "MILP", solver = None, verbose = 0): r""" Returns a longest path of ``self``. | fbdfc46fda1150428e37faef1f31cd5518ab4374 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/fbdfc46fda1150428e37faef1f31cd5518ab4374/generic_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12163,
67,
803,
12,
2890,
16,
272,
273,
599,
16,
268,
273,
599,
16,
13747,
273,
1083,
16,
4886,
273,
315,
49,
2627,
52,
3113,
12776,
273,
599,
16,
3988,
273,
374,
4672,
436,
8395,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12163,
67,
803,
12,
2890,
16,
272,
273,
599,
16,
268,
273,
599,
16,
13747,
273,
1083,
16,
4886,
273,
315,
49,
2627,
52,
3113,
12776,
273,
599,
16,
3988,
273,
374,
4672,
436,
8395,
28... |
simu = simulator(pop, randomMating(sexParam=0.3, sexMode=MATE_ProbOfMale)) | simu = simulator(pop, randomMating(sexMode=(ProbOfMale, 0.3))) | def testMateProbOfMale(self): '''Testing assigning offspring sex by probability''' pop = population(10000) simu = simulator(pop, randomMating(sexParam=0.3, sexMode=MATE_ProbOfMale)) simu.evolve( preOps = [initByFreq([0.5, 0.5])], ops = [ stat(numOfMale=True), # number of male should be variable, but not too much terminateIf('numOfMale < 2500 or numOfMale > 3500'), ], gen = 10 ) self.assertEqual(simu.gen(), 10) | dea4c91f42fa280e4e984c17ba3e6f321287e221 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/401/dea4c91f42fa280e4e984c17ba3e6f321287e221/test_05_matings.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
49,
340,
9152,
951,
49,
5349,
12,
2890,
4672,
9163,
22218,
28639,
21174,
11638,
19631,
635,
11331,
26418,
1843,
273,
11209,
12,
23899,
13,
3142,
89,
273,
3142,
11775,
12,
5120,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
49,
340,
9152,
951,
49,
5349,
12,
2890,
4672,
9163,
22218,
28639,
21174,
11638,
19631,
635,
11331,
26418,
1843,
273,
11209,
12,
23899,
13,
3142,
89,
273,
3142,
11775,
12,
5120,
16,
... |
ValueError: j values must be integer or half integer and fulfil the triangle relation | ValueError: j values must be integer or half integer and fulfill the triangle relation | def wigner_6j(j_1, j_2, j_3, j_4, j_5, j_6, prec=None): r""" Calculate the Wigner 6j symbol `Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6)`. INPUT: - ``j_1``, ..., ``j_6`` - integer or half integer - ``prec`` - precision, default: None. Providing a precision can drastically speed up the calculation. OUTPUT: rational number times the square root of a rational number (if prec=None), or real number if a precision is given EXAMPLES:: sage: wigner_6j(3,3,3,3,3,3) -1/14 sage: wigner_6j(5,5,5,5,5,5) 1/52 sage: wigner_6j(6,6,6,6,6,6) 309/10868 sage: wigner_6j(8,8,8,8,8,8) -12219/965770 sage: wigner_6j(30,30,30,30,30,30) 36082186869033479581/87954851694828981714124 sage: wigner_6j(0.5,0.5,1,0.5,0.5,1) 1/6 sage: wigner_6j(200,200,200,200,200,200, prec=1000)*1.0 0.000155903212413242 It is an error to have arguments that are not integer or half integer values or do not fulfil the triangle relation:: sage: wigner_6j(2.5,2.5,2.5,2.5,2.5,2.5) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfil the triangle relation sage: wigner_6j(0.5,0.5,1.1,0.5,0.5,1.1) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfil the triangle relation NOTES: The Wigner 6j symbol is related to the Racah symbol but exhibits more symmetries as detailed below. .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =(-1)^{j_1+j_2+j_4+j_5} W(j_1,j_2,j_5,j_4,j_3,j_6) The Wigner 6j symbol obeys the following symmetry rules: - Wigner $6j$ symbols are left invariant under any permutation of the columns: .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =Wigner6j(j_3,j_1,j_2,j_6,j_4,j_5) =Wigner6j(j_2,j_3,j_1,j_5,j_6,j_4) =Wigner6j(j_3,j_2,j_1,j_6,j_5,j_4) =Wigner6j(j_1,j_3,j_2,j_4,j_6,j_5) =Wigner6j(j_2,j_1,j_3,j_5,j_4,j_6) - They are invariant under the exchange of the upper and lower arguments in each of any two columns, i. e. .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =Wigner6j(j_1,j_5,j_6,j_4,j_2,j_3) =Wigner6j(j_4,j_2,j_6,j_1,j_5,j_3) =Wigner6j(j_4,j_5,j_3,j_1,j_2,j_6) - additional 6 symmetries [Regge59] giving rise to 144 symmetries in total - only non-zero if any triple of `j`'s fulfil a triangle relation ALGORITHM: This function uses the algorithm of [Edmonds74] to calculate the value of the 6j symbol exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [Rasch03]. REFERENCES: - [Regge59] 'Symmetry Properties of Racah Coefficients', T. Regge, Nuovo Cimento, Volume 11, pp. 116 (1959) - [Edmonds74] 'Angular Momentum in Quantum Mechanics', A. R. Edmonds, Princeton University Press (1974) - [Rasch03] 'Efficient Storage Scheme for Pre-calculated Wigner 3j, 6j and Gaunt Coefficients', J. Rasch and A. C. H. Yu, SIAM J. Sci. Comput. Volume 25, Issue 4, pp. 1416-1428 (2003) """ res = (-1) ** (int(j_1 + j_2 + j_4 + j_5)) * \ racah(j_1, j_2, j_5, j_4, j_3, j_6, prec) return res | 2aae1a34350173041dcaa920c230128b23fb8288 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/2aae1a34350173041dcaa920c230128b23fb8288/wigner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
724,
264,
67,
26,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
525,
67,
24,
16,
525,
67,
25,
16,
525,
67,
26,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
341,
724,
264,
67,
26,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
525,
67,
24,
16,
525,
67,
25,
16,
525,
67,
26,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... |
""" | """) | def unpack(pkgfilename): '''unpack a tar[.gz|.bz2] source distribution package.''' if pkgfilename.endswith('.bz2'): d = 'j' elif pkgfilename.endswith('.gz'): d = 'z' shellCommand('tar ' + d + 'xf ' + pkgfilename) return os.path.basename(os.path.splitext(os.path.splitext(pkgfilename)[0])) | b4796f12253039e6a154e7c6028fd2f4e9ade2a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1360/b4796f12253039e6a154e7c6028fd2f4e9ade2a2/dws.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6167,
12,
10657,
3459,
4672,
9163,
17309,
279,
8232,
63,
18,
9764,
96,
18,
25292,
22,
65,
1084,
7006,
2181,
1093,
6309,
309,
3475,
3459,
18,
5839,
1918,
2668,
18,
25292,
22,
11,
4672,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6167,
12,
10657,
3459,
4672,
9163,
17309,
279,
8232,
63,
18,
9764,
96,
18,
25292,
22,
65,
1084,
7006,
2181,
1093,
6309,
309,
3475,
3459,
18,
5839,
1918,
2668,
18,
25292,
22,
11,
4672,
... |
branch = [b.lstrip('* ') for b in gitlog.stdout.split('\n') | branch = [b[2:] for b in gitlog.stdout.split('\n') | def get_branch(self, all=False, remote_tracking=False): """ Show the branches. | f4473f88d1e49fccfb1a6654c241ae8886c53120 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12268/f4473f88d1e49fccfb1a6654c241ae8886c53120/git.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7500,
12,
2890,
16,
777,
33,
8381,
16,
2632,
67,
6440,
33,
8381,
4672,
3536,
9674,
326,
11483,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7500,
12,
2890,
16,
777,
33,
8381,
16,
2632,
67,
6440,
33,
8381,
4672,
3536,
9674,
326,
11483,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
def createMessage(self, dir): | def createMessage(self, dir, mbox=False): | def createMessage(self, dir): t = int(time.time() % 1000000) pid = self._counter self._counter += 1 filename = os.extsep.join((str(t), str(pid), "myhostname", "mydomain")) tmpname = os.path.join(self._dir, "tmp", filename) newname = os.path.join(self._dir, dir, filename) fp = open(tmpname, "w") self._msgfiles.append(tmpname) fp.write(DUMMY_MESSAGE) fp.close() if hasattr(os, "link"): os.link(tmpname, newname) else: fp = open(newname, "w") fp.write(DUMMY_MESSAGE) fp.close() self._msgfiles.append(newname) | b868ddd858e12547d94ee46a40b7cb52fd3de21b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/b868ddd858e12547d94ee46a40b7cb52fd3de21b/test_mailbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23836,
12,
2890,
16,
1577,
16,
312,
2147,
33,
8381,
4672,
268,
273,
509,
12,
957,
18,
957,
1435,
738,
15088,
13,
4231,
273,
365,
6315,
7476,
365,
6315,
7476,
1011,
404,
1544,
273,
1140... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
23836,
12,
2890,
16,
1577,
16,
312,
2147,
33,
8381,
4672,
268,
273,
509,
12,
957,
18,
957,
1435,
738,
15088,
13,
4231,
273,
365,
6315,
7476,
365,
6315,
7476,
1011,
404,
1544,
273,
1140... |
this = apply(_quickfix.new_EncodedHeadline, args) | this = _quickfix.new_EncodedHeadline(*args) | def __init__(self, *args): this = apply(_quickfix.new_EncodedHeadline, 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,
10397,
1414,
1369,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
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,
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,
10397,
1414,
1369,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
... |
'name': str(attach), | 'name': str(attach)[:64], | def msg_new(self, msg): message = self.msg_body_get(msg) data = { 'name': self._decode_header(msg['Subject']), 'section_id': self.section_id, 'email_from': self._decode_header(msg['From']), 'email_cc': self._decode_header(msg['Cc'] or ''), 'canal_id': self.canal_id, 'user_id': False, 'history_line': [(0, 0, {'description': message['body'], 'email': msg['From'] })], } try: data.update(self.partner_get(self._decode_header(msg['From']))) except Exception, e: print e #end try | 48ccd4e9897657b356f82c8cbff9b13e2ca2e8ba /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/48ccd4e9897657b356f82c8cbff9b13e2ca2e8ba/tinyerp-mailgate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1234,
67,
2704,
12,
2890,
16,
1234,
4672,
883,
273,
365,
18,
3576,
67,
3432,
67,
588,
12,
3576,
13,
501,
273,
288,
296,
529,
4278,
365,
6315,
3922,
67,
3374,
12,
3576,
3292,
6638,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1234,
67,
2704,
12,
2890,
16,
1234,
4672,
883,
273,
365,
18,
3576,
67,
3432,
67,
588,
12,
3576,
13,
501,
273,
288,
296,
529,
4278,
365,
6315,
3922,
67,
3374,
12,
3576,
3292,
6638,
35... |
print "Recieved a unknown command: ", netCommand | print "Recieved a unknown command: ", netCommand | def handle(self): # Read the incoming command. netCommand = self.rfile.read(4) # Skip the trailing NULL. self.rfile.read(1) | 460fd94d4754a7dd61469b9205b010a7263269fe /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13981/460fd94d4754a7dd61469b9205b010a7263269fe/wzmasterserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
12,
2890,
4672,
468,
2720,
326,
6935,
1296,
18,
2901,
2189,
273,
365,
18,
86,
768,
18,
896,
12,
24,
13,
225,
468,
6611,
326,
7341,
3206,
18,
365,
18,
86,
768,
18,
896,
12,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
12,
2890,
4672,
468,
2720,
326,
6935,
1296,
18,
2901,
2189,
273,
365,
18,
86,
768,
18,
896,
12,
24,
13,
225,
468,
6611,
326,
7341,
3206,
18,
365,
18,
86,
768,
18,
896,
12,
21... |
self.reset_view_pixbuf() | self.size_observer.notify_all() | def set_zoom(self, zoom_factor): self.zoom_factor = zoom_factor if abs(self.zoom_factor-round(self.zoom_factor))<0.01: self.zoom_factor = round(self.zoom_factor) self.reset_view_pixbuf() | 82c8e202dbf903ca748c1ef9293b6aee0f9fabf1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/704/82c8e202dbf903ca748c1ef9293b6aee0f9fabf1/goghview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
14932,
12,
2890,
16,
7182,
67,
6812,
4672,
365,
18,
14932,
67,
6812,
273,
7182,
67,
6812,
309,
2417,
12,
2890,
18,
14932,
67,
6812,
17,
2260,
12,
2890,
18,
14932,
67,
6812,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
14932,
12,
2890,
16,
7182,
67,
6812,
4672,
365,
18,
14932,
67,
6812,
273,
7182,
67,
6812,
309,
2417,
12,
2890,
18,
14932,
67,
6812,
17,
2260,
12,
2890,
18,
14932,
67,
6812,
... |
startX = columnStart | startX = columnStart + 1 | def DrawMonth(self, gc, dc, startDate, y, highlightDate, font, boldFont, clientWidth, clientHeight, transform): """ draw a single month return the updated value of y """ | 3bb7ec9ecbd5dca196c1156c6e4fdf5c9e39d32e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/3bb7ec9ecbd5dca196c1156c6e4fdf5c9e39d32e/minical.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
5445,
12,
2890,
16,
8859,
16,
6744,
16,
12572,
16,
677,
16,
8839,
1626,
16,
3512,
16,
13068,
5711,
16,
1004,
2384,
16,
1004,
2686,
16,
2510,
4672,
3536,
3724,
279,
2202,
3138,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
5445,
12,
2890,
16,
8859,
16,
6744,
16,
12572,
16,
677,
16,
8839,
1626,
16,
3512,
16,
13068,
5711,
16,
1004,
2384,
16,
1004,
2686,
16,
2510,
4672,
3536,
3724,
279,
2202,
3138,
3... |
for filename in find_files(dir, '*.pt'): | for filename in find_files(dir, '*.pt', exclude=tuple(exclude)): | def write(self, s): pass | 62c8758173e77db1c2eb56c52650f838fe49bbfc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9527/62c8758173e77db1c2eb56c52650f838fe49bbfc/extract.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
272,
4672,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
272,
4672,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.selected_rows.append(self._realpath(tup[0])) | self.selected_rows.append(self._realpath(tup)[0]) | def update_selection(self): selection = self.treeview.get_selection() (liststore, indexes) = selection.get_selected_rows() | 628e2c521b98e88744088c81a82b41663a7683bc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5119/628e2c521b98e88744088c81a82b41663a7683bc/widget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
10705,
12,
2890,
4672,
4421,
273,
365,
18,
3413,
1945,
18,
588,
67,
10705,
1435,
261,
1098,
2233,
16,
5596,
13,
273,
4421,
18,
588,
67,
8109,
67,
3870,
1435,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
10705,
12,
2890,
4672,
4421,
273,
365,
18,
3413,
1945,
18,
588,
67,
10705,
1435,
261,
1098,
2233,
16,
5596,
13,
273,
4421,
18,
588,
67,
8109,
67,
3870,
1435,
2,
-100,
-100,
... |
while n > 0 and line[n-1] in (' ', '\t'): | while n > 0 and line[n-1] in " \t\r": | def decode(input, output): """Read 'input', apply quoted-printable decoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods.""" new = '' while 1: line = input.readline() if not line: break i, n = 0, len(line) if n > 0 and line[n-1] == '\n': partial = 0; n = n-1 # Strip trailing whitespace while n > 0 and line[n-1] in (' ', '\t'): n = n-1 else: partial = 1 while i < n: c = line[i] if c != ESCAPE: new = new + c; i = i+1 elif i+1 == n and not partial: partial = 1; break elif i+1 < n and line[i+1] == ESCAPE: new = new + ESCAPE; i = i+2 elif i+2 < n and ishex(line[i+1]) and ishex(line[i+2]): new = new + chr(unhex(line[i+1:i+3])); i = i+3 else: # Bad escape sequence -- leave it in new = new + c; i = i+1 if not partial: output.write(new + '\n') new = '' if new: output.write(new) | 57a9d5cb91868f947cdaeff4900b6f918c440114 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/57a9d5cb91868f947cdaeff4900b6f918c440114/quopri.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2495,
12,
2630,
16,
876,
4672,
3536,
1994,
296,
2630,
2187,
2230,
9298,
17,
1188,
429,
13547,
16,
471,
1045,
358,
296,
2844,
10332,
225,
296,
2630,
11,
471,
296,
2844,
11,
854,
1390,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2495,
12,
2630,
16,
876,
4672,
3536,
1994,
296,
2630,
2187,
2230,
9298,
17,
1188,
429,
13547,
16,
471,
1045,
358,
296,
2844,
10332,
225,
296,
2630,
11,
471,
296,
2844,
11,
854,
1390,
5... |
self.store_changes(user, asset, changes, meta) | self.store_changes(user, asset, changes, meta, previous) | def apply_changes(self, user, asset, changes={}, meta=()): """Apply a dictionary of changes to an asset. If anything in fact changed, this will create a record of those changes and save the asset. | 8cd4ba9bf358476036b3b8b4dafd8dead6801f4e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9478/8cd4ba9bf358476036b3b8b4dafd8dead6801f4e/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
67,
6329,
12,
2890,
16,
729,
16,
3310,
16,
3478,
28793,
2191,
33,
1435,
4672,
3536,
7001,
279,
3880,
434,
3478,
358,
392,
3310,
18,
971,
6967,
316,
5410,
3550,
16,
333,
903,
752,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2230,
67,
6329,
12,
2890,
16,
729,
16,
3310,
16,
3478,
28793,
2191,
33,
1435,
4672,
3536,
7001,
279,
3880,
434,
3478,
358,
392,
3310,
18,
971,
6967,
316,
5410,
3550,
16,
333,
903,
752,... |
var = "do_" + func | if func[:3] != "do_": var = "do_" + func | text = "def %s(d):\n" % (funcname) + '\n'.join(__body__) | dbd66fc8080eacd6c20df9d6528a929b9070fe35 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8123/dbd66fc8080eacd6c20df9d6528a929b9070fe35/BBHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
977,
273,
315,
536,
738,
87,
12,
72,
4672,
64,
82,
6,
738,
261,
644,
529,
13,
397,
2337,
82,
10332,
5701,
12,
972,
3432,
972,
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,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
977,
273,
315,
536,
738,
87,
12,
72,
4672,
64,
82,
6,
738,
261,
644,
529,
13,
397,
2337,
82,
10332,
5701,
12,
972,
3432,
972,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return '''<script language="JavaScript"''' \ | return '''<script language="JavaScript" ''' \ | def create_html_mailto(email, subject=None, body=None, cc=None, bcc=None, link_label="%(email)s", linkattrd=None, escape_urlargd=True, escape_linkattrd=True, email_obfuscation_mode=CFG_WEBSTYLE_EMAIL_ADDRESSES_OBFUSCATION_MODE): """Creates a W3C compliant 'mailto' link. Encode/encrypt given email to reduce undesired automated email harvesting when embedded in a web page. NOTE: there is no ultimate solution to protect against email harvesting. All have drawbacks and can more or less be circumvented. There are other techniques to protect email adresses. We implement the less annoying one for users. @param email: the recipient of the email @param subject: a default subject for the email (must not contain line feeds) @param body: a default body for the email @param cc: the co-recipient(s) of the email @param bcc: the hidden co-recpient(s) of the email @param link_label: the label of this mailto link. String replacement is performed on key %(email)s with the email address if needed. @param linkattrd: dictionary of attributes (e.g. a={'class': 'img'}) @param escape_urlargd: boolean indicating if the function should escape arguments (e.g. < becomes < or " becomes ") @param escape_linkattrd: boolean indicating if the function should escape attributes (e.g. < becomes < or " becomes ") @param email_obfuscation_mode: the protection mode. See below: You can choose among several modes to protect emails. It is advised to keep the default CFG_MISCUTIL_EMAIL_HARVESTING_PROTECTION value, so that it is possible for an admin to change the policy globally. Available modes ([t] means "transparent" for the user): -1: hide all emails, excepted CFG_SITE_ADMIN_EMAIL and CFG_SITE_SUPPORT_EMAIL. [t] 0 : no protection, email returned as is. foo@example.com => foo@example.com 1 : basic email munging: replaces @ by [at] and . by [dot] foo@example.com => foo [at] example [dot] com [t] 2 : transparent name mangling: characters are replaced by equivalent HTML entities. foo@example.com => foo@example.com [t] 3 : javascript insertion. Requires Javascript enabled on client side. 4 : replaces @ and . characters by gif equivalents. foo@example.com => foo<img src="at.gif" alt=" [at] ">example<img src="dot.gif" alt=" [dot] ">com """ # TODO: implement other protection modes to encode/encript email: # ## [t] 5 : form submission. User is redirected to a form that he can ## fills in to send the email (??Use webmessage??). ## Depending on WebAccess, ask to answer a question. ## ## [t] 6 : if user can see (controlled by WebAccess), display. Else ## ask to login to see email. If user cannot see, display ## form submission. if linkattrd is None: linkattrd = {} parameters = {} if subject: parameters["subject"] = subject if body: parameters["body"] = body.replace('\r\n', '\n').replace('\n', '\r\n') if cc: parameters["cc"] = cc if bcc: parameters["bcc"] = bcc # Preprocessing values for some modes if email_obfuscation_mode == 1: # Basic Munging email = email.replace("@", " [at] ").replace(".", " [dot] ") elif email_obfuscation_mode == 2: # Transparent name mangling email = string_to_numeric_char_reference(email) if '%(email)s' in link_label: link_label = link_label % {'email': email} mailto_link = create_html_link('mailto:' + email, parameters, link_label, linkattrd, escape_urlargd, escape_linkattrd) if email_obfuscation_mode == 0: # Return "as is" return mailto_link elif email_obfuscation_mode == 1: # Basic Munging return mailto_link elif email_obfuscation_mode == 2: # Transparent name mangling return mailto_link elif email_obfuscation_mode == 3: # Javascript-based return '''<script language="JavaScript"''' \ '''type="text/javascript">''' \ '''document.write('%s'.split("").reverse().join(""))''' \ '''</script>''' % \ mailto_link[::-1].replace("'", "\\'") elif email_obfuscation_mode == 4: # GIFs-based email = email.replace('.', '<img src="%s/img/dot.gif" alt=" [dot] " ' 'style="vertical-align:bottom" />' % CFG_SITE_URL) email = email.replace('@', '<img src="%s/img/at.gif" alt=" [at] " ' 'style="vertical-align:baseline" />' % CFG_SITE_URL) return email # All other cases, including mode -1: return "" | c3c928bcb282b68d609fca00ed44669066be1566 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1780/c3c928bcb282b68d609fca00ed44669066be1566/urlutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2620,
67,
4408,
869,
12,
3652,
16,
3221,
33,
7036,
16,
1417,
33,
7036,
16,
4946,
33,
7036,
16,
16915,
33,
7036,
16,
1692,
67,
1925,
11613,
12,
3652,
13,
87,
3113,
1692,
1747... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
2620,
67,
4408,
869,
12,
3652,
16,
3221,
33,
7036,
16,
1417,
33,
7036,
16,
4946,
33,
7036,
16,
16915,
33,
7036,
16,
1692,
67,
1925,
11613,
12,
3652,
13,
87,
3113,
1692,
1747... |
user.permissions['global'].add('') | user.permissions['global'].add('repository.create') | def fill_perms(user): """ Fills user permission attribute with permissions taken from database @param user: """ sa = meta.Session user.permissions['repositories'] = {} user.permissions['global'] = set() #first fetch default permissions default_perms = sa.query(Repo2Perm, Repository, Permission)\ .join((Repository, Repo2Perm.repository_id == Repository.repo_id))\ .join((Permission, Repo2Perm.permission_id == Permission.permission_id))\ .filter(Repo2Perm.user_id == sa.query(User).filter(User.username == 'default').one().user_id).all() if user.is_admin: user.permissions['global'].add('hg.admin') #admin have all rights full for perm in default_perms: p = 'repository.admin' user.permissions['repositories'][perm.Repo2Perm.repository.repo_name] = p else: user.permissions['global'].add('') for perm in default_perms: if perm.Repository.private: #disable defaults for private repos, p = 'repository.none' elif perm.Repository.user_id == user.user_id: #set admin if owner p = 'repository.admin' else: p = perm.Permission.permission_name user.permissions['repositories'][perm.Repo2Perm.repository.repo_name] = p user_perms = sa.query(Repo2Perm, Permission, Repository)\ .join((Repository, Repo2Perm.repository_id == Repository.repo_id))\ .join((Permission, Repo2Perm.permission_id == Permission.permission_id))\ .filter(Repo2Perm.user_id == user.user_id).all() #overwrite userpermissions with defaults for perm in user_perms: #set write if owner if perm.Repository.user_id == user.user_id: p = 'repository.write' else: p = perm.Permission.permission_name user.permissions['repositories'][perm.Repo2Perm.repository.repo_name] = p meta.Session.remove() return user | 1922a6efe7f48829bb47a30b614fd128c4d93778 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4230/1922a6efe7f48829bb47a30b614fd128c4d93778/auth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
67,
15969,
12,
1355,
4672,
3536,
14192,
87,
729,
4132,
1566,
598,
4371,
9830,
628,
2063,
632,
891,
729,
30,
3536,
225,
7864,
273,
2191,
18,
2157,
729,
18,
9612,
3292,
26626,
3546,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3636,
67,
15969,
12,
1355,
4672,
3536,
14192,
87,
729,
4132,
1566,
598,
4371,
9830,
628,
2063,
632,
891,
729,
30,
3536,
225,
7864,
273,
2191,
18,
2157,
729,
18,
9612,
3292,
26626,
3546,
... |
pdbFiles = [ T.absfile( f ) for f in pdbFiles ] | def align_for_modeller_inp( self, pdbFiles=None, fasta_templates=None, fasta_sequences=None, fasta_target=None, f_fast_tree=None, f_sequence_tree=None ): """ Prepare alignment commands for homology modeling. | 06fb5a85071ba1d133175a7365d7f5e0eb313ad9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/482/06fb5a85071ba1d133175a7365d7f5e0eb313ad9/Aligner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5689,
67,
1884,
67,
2284,
749,
67,
31647,
12,
365,
16,
10892,
2697,
33,
7036,
16,
13104,
67,
8502,
33,
7036,
16,
13104,
67,
17190,
33,
7036,
16,
13104,
67,
3299,
33,
7036,
16,
284,
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,
5689,
67,
1884,
67,
2284,
749,
67,
31647,
12,
365,
16,
10892,
2697,
33,
7036,
16,
13104,
67,
8502,
33,
7036,
16,
13104,
67,
17190,
33,
7036,
16,
13104,
67,
3299,
33,
7036,
16,
284,
6... | |
Generate restructured text markup for a comment heading in a HTML page. | Generate HTML markup for a comment heading in a HTML page. | def makeCommentHeading(self, page, subject, username, time, message_id=None,in_reply_to=None): """ Generate restructured text markup for a comment heading in a HTML page. | b3ccf52bc2c59dc982bc480175553907b601dcec /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5225/b3ccf52bc2c59dc982bc480175553907b601dcec/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
4469,
21867,
12,
2890,
16,
1363,
16,
3221,
16,
2718,
16,
813,
16,
883,
67,
350,
33,
7036,
16,
267,
67,
10629,
67,
869,
33,
7036,
4672,
3536,
6654,
400,
8813,
2862,
977,
9813,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
4469,
21867,
12,
2890,
16,
1363,
16,
3221,
16,
2718,
16,
813,
16,
883,
67,
350,
33,
7036,
16,
267,
67,
10629,
67,
869,
33,
7036,
4672,
3536,
6654,
400,
8813,
2862,
977,
9813,
3... |
if note not in self.noteList: self.noteList.append(note) | def saveNote(self,note): if note not in self.noteList: self.noteList.append(note) | be5fd71a59f94863e7f54998815958259544afa6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2701/be5fd71a59f94863e7f54998815958259544afa6/notes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
8067,
12,
2890,
16,
7652,
4672,
309,
4721,
486,
316,
365,
18,
7652,
682,
30,
365,
18,
7652,
682,
18,
6923,
12,
7652,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
8067,
12,
2890,
16,
7652,
4672,
309,
4721,
486,
316,
365,
18,
7652,
682,
30,
365,
18,
7652,
682,
18,
6923,
12,
7652,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
result={} | result = {} | def dtp_last_modification_date(self, cr, uid, ids, field_name, arg, context={}): result={} for id in ids: sql = "select write_date,create_date from dm_offer where id = %d"%id cr.execute(sql) res = cr.fetchone() if res[0]: result[id]=res[0].split(' ')[0] else : result[id]=res[1].split(' ')[0] return result | 85a1e7b7da9518beac3cb0935570916534cd57ee /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/85a1e7b7da9518beac3cb0935570916534cd57ee/dm_offer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3681,
84,
67,
2722,
67,
31064,
67,
712,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
529,
16,
1501,
16,
819,
12938,
4672,
563,
273,
2618,
364,
612,
316,
3258,
30,
1847,
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,
3681,
84,
67,
2722,
67,
31064,
67,
712,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
529,
16,
1501,
16,
819,
12938,
4672,
563,
273,
2618,
364,
612,
316,
3258,
30,
1847,
273,
... |
"%s cannot be child of %s" % (repr(newChild), repr(self) ) | "%s cannot be child of %s" % (repr(newChild), repr(self)) | def replaceChild(self, newChild, oldChild): if newChild.nodeType not in self.childNodeTypes: raise HierarchyRequestErr, \ "%s cannot be child of %s" % (repr(newChild), repr(self) ) if newChild.parentNode is not None: newChild.parentNode.removeChild(newChild) if newChild is oldChild: return index = self.childNodes.index(oldChild) self.childNodes[index] = newChild if self._makeParentNodes: newChild.parentNode = self oldChild.parentNode = None newChild.nextSibling = oldChild.nextSibling newChild.previousSibling = oldChild.previousSibling oldChild.nextSibling = None oldChild.previousSibling = None if newChild.previousSibling: newChild.previousSibling.nextSibling = newChild if newChild.nextSibling: newChild.nextSibling.previousSibling = newChild return oldChild | ec5905c95815205aa328f8b75324f1465ff85290 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/ec5905c95815205aa328f8b75324f1465ff85290/minidom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
1763,
12,
2890,
16,
19783,
16,
1592,
1763,
4672,
309,
19783,
18,
2159,
559,
486,
316,
365,
18,
3624,
907,
2016,
30,
1002,
670,
6000,
691,
2524,
16,
521,
2213,
87,
2780,
506,
1151... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1453,
1763,
12,
2890,
16,
19783,
16,
1592,
1763,
4672,
309,
19783,
18,
2159,
559,
486,
316,
365,
18,
3624,
907,
2016,
30,
1002,
670,
6000,
691,
2524,
16,
521,
2213,
87,
2780,
506,
1151... |
h=hash(oid)%131 cache=self._miv_cache | h = hash(oid) % 131 cache = self._miv_cache | def modifiedInVersion(self, oid): h=hash(oid)%131 cache=self._miv_cache o=cache.get(h, None) if o and o[0]==oid: return o[1] v=self._storage.modifiedInVersion(oid) cache[h]=oid, v return v | 3f5dc8adcf31c234935a3c71325d44bf2f319df0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3f5dc8adcf31c234935a3c71325d44bf2f319df0/DB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4358,
382,
1444,
12,
2890,
16,
7764,
4672,
366,
273,
1651,
12,
839,
13,
738,
5958,
21,
1247,
273,
365,
6315,
81,
427,
67,
2493,
320,
33,
2493,
18,
588,
12,
76,
16,
599,
13,
309,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4358,
382,
1444,
12,
2890,
16,
7764,
4672,
366,
273,
1651,
12,
839,
13,
738,
5958,
21,
1247,
273,
365,
6315,
81,
427,
67,
2493,
320,
33,
2493,
18,
588,
12,
76,
16,
599,
13,
309,
32... |
res['id'] = fact.id | res['id'] = str(fact.id) | def _output_fact(self, fact): res = dict(zip(fact.keys(), fact.values())) res['id'] = fact.id return res | f3407c0c5c3b7b8c4dc2672f82f90b4a559669c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12941/f3407c0c5c3b7b8c4dc2672f82f90b4a559669c0/app.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2844,
67,
3493,
12,
2890,
16,
5410,
4672,
400,
273,
2065,
12,
4450,
12,
3493,
18,
2452,
9334,
5410,
18,
2372,
1435,
3719,
400,
3292,
350,
3546,
273,
609,
12,
3493,
18,
350,
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,
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,
2844,
67,
3493,
12,
2890,
16,
5410,
4672,
400,
273,
2065,
12,
4450,
12,
3493,
18,
2452,
9334,
5410,
18,
2372,
1435,
3719,
400,
3292,
350,
3546,
273,
609,
12,
3493,
18,
350,
13,
... |
exclude_coincs = None, include_only_coincs = None, sim_tag = 'ALLINJ'): | exclude_coincs = None, include_only_coincs = None, sim_tag = 'ALLINJ', verbose = False): | def create_filter( connection, tableName, param_name = None, param_ranges = None, exclude_coincs = None, include_only_coincs = None, sim_tag = 'ALLINJ'): """ Strings together param_name, param_ranges, exclude/include_only_coincs, and sim_tag options into a filter string that can be stuck in a sqlite WHERE clause. """ in_this_filter = '' # Get param and param-ranges if specified if param_name is not None: param_name = sqlutils.validate_option(param_name) param_filters = sqlutils.parse_param_ranges( tableName, param_name, param_ranges, verbose = verbose ).get_param_filters() # since want triggers that fall within all the parameters, concatenate # all param ranges param_filters = '\n\t\tOR '.join( param_filters ) in_this_filter = ''.join([ in_this_filter, '\n\tAND (\n\t\t', param_filters, '\n\t)' ]) # Get exclude_coincs list if specified if exclude_coincs is not None: exclude_coinc_filters = sqlutils.parse_coinc_options( exclude_coincs, verbose = verbose ).get_coinc_filters() # concatenate exclude_coinc_filters exclude_coinc_filters = '\n\t\tOR '.join( exclude_coinc_filters ) # add to in_this_filter in_this_filter = ''.join([ in_this_filter, '\n\tAND NOT (\n\t\t', exclude_coinc_filters, '\n\t)' ]) # Get include_only_coincs list if specified if include_only_coincs is not None: include_coinc_filters = sqlutils.parse_coinc_options( include_only_coincs, verbose = verbose ).get_coinc_filters() # concatenate include_coinc_filters include_coinc_filters = '\n\t\tOR '.join( include_coinc_filters ) # add to in_this_filter in_this_filter = ''.join([ in_this_filter, '\n\tAND (\n\t\t', include_coinc_filters, '\n\t)' ]) # if sim-tag specified add the sim-tag to the filter if sim_tag != 'ALLINJ': # create a map between sim_proc_id and sim-tag sim_map = sqlutils.sim_tag_proc_id_mapper( connection ) # check that sim_tag is in the the map sim_tag = sqlutils.validate_option(sim_tag, lower = False).upper() if sim_tag not in sim_map.tag_id_map.keys(): raise ValueError, "sim-tag %s not found in database" % sim_tag # create the filter connection.create_function( 'get_sim_tag', 1, sim_map.get_sim_tag ) sim_filter = ''.join(['get_sim_tag(experiment_summary.sim_proc_id) == "', sim_tag, '"' ]) # add to in_this_filter in_this_filter = ''.join([ in_this_filter, '\n\tAND ', sim_filter ]) return in_this_filter | e293574b9b8e058707476095932097d7b8a95a9e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/e293574b9b8e058707476095932097d7b8a95a9e/printutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2188,
12,
1459,
16,
4775,
16,
579,
67,
529,
273,
599,
16,
579,
67,
14530,
273,
599,
16,
4433,
67,
12645,
2143,
273,
599,
16,
2341,
67,
3700,
67,
12645,
2143,
273,
599,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2188,
12,
1459,
16,
4775,
16,
579,
67,
529,
273,
599,
16,
579,
67,
14530,
273,
599,
16,
4433,
67,
12645,
2143,
273,
599,
16,
2341,
67,
3700,
67,
12645,
2143,
273,
599,
16,
... |
m = re.search(restr, resp) | namelist_regex = '<meta name=description content="Google& m = re.search(namelist_regex, resp) | def update_languages(self): '''Naively try to determine if new languages are available by scraping http://translate.google.com''' restr = '<meta name="description" content="Google's free online language translation service instantly translates text and web pages. This translator supports: (.*?)">' resp = urllib2.urlopen(urllib2.Request('http://translate.google.com', None, {'User-Agent':'Traduisons/%s' % msg_VERSION})).read() m = re.search(restr, resp) d = {} if m: names = m.group(1).split(', ') for name in names: n = re.search('<option value="([^"]+)">%s[^<]*</option>' % name, resp) if n: d[name] = n.group(1) else: return False for k, v in [('Detect Language', 'auto'), ('Gaelic', 'ga'), ('Chinese (Traditional)', 'zh-TW'), ('Chinese (Simplified)', 'zh-CN')]: d[k] = v for k in self.dictLang: if not d.has_key(k): print k, ': Unavailable' self.dictLang = d else: print 'Unable to update_languages' return False | aa80d065d095c420e5ef14cb7c4c6f364c10ceea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9947/aa80d065d095c420e5ef14cb7c4c6f364c10ceea/traduisons.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
14045,
12,
2890,
4672,
9163,
24101,
4492,
775,
358,
4199,
309,
394,
8191,
854,
2319,
635,
888,
1266,
310,
1062,
2207,
13929,
18,
9536,
18,
832,
26418,
400,
313,
273,
2368,
3901... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
14045,
12,
2890,
4672,
9163,
24101,
4492,
775,
358,
4199,
309,
394,
8191,
854,
2319,
635,
888,
1266,
310,
1062,
2207,
13929,
18,
9536,
18,
832,
26418,
400,
313,
273,
2368,
3901... |
self.scfvalues[0] = [self.scfvalues[0][1]] self.scftargets = self.scftargets[0] | self.scftargets = [[self.scftargets[0][0]]] if hasattr(self,"scfvalues"): self.scfvalues[0] = [[x[0]] for x in self.scfvalues[0]] geoopt = True else: self.scftargets.append([5E-5]) | def parse(self,fupdate=0.05,cupdate=0.002): """Extract information from the logfile.""" inputfile = open(self.filename,"r") if self.progress: inputfile.seek(0,2) #go to end of file nstep=inputfile.tell() inputfile.seek(0) self.progress.initialize(nstep) oldstep=0 | c113725d0fc482613d55fa90683477ac0ce24f35 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8167/c113725d0fc482613d55fa90683477ac0ce24f35/jaguarparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
74,
2725,
33,
20,
18,
6260,
16,
71,
2725,
33,
20,
18,
24908,
4672,
3536,
4976,
1779,
628,
326,
15204,
12123,
810,
768,
273,
1696,
12,
2890,
18,
3459,
10837,
86,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
74,
2725,
33,
20,
18,
6260,
16,
71,
2725,
33,
20,
18,
24908,
4672,
3536,
4976,
1779,
628,
326,
15204,
12123,
810,
768,
273,
1696,
12,
2890,
18,
3459,
10837,
86,
7... |
@type date: (L{dt.date}|L{str}) | @type date: (date|str) | def __init__(self, date): """ @param date: The value of the object. @type date: (L{dt.date}|L{str}) @raise ValueError: When I{date} is invalid. """ if isinstance(date, dt.date): self.date = date return if isinstance(date, basestring): self.date = self.__parse(date) return raise ValueError, type(date) | 1296a8afdb34c7fe4f2c53ba1950416906dd20f2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5930/1296a8afdb34c7fe4f2c53ba1950416906dd20f2/date.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1509,
4672,
3536,
632,
891,
1509,
30,
1021,
460,
434,
326,
733,
18,
632,
723,
1509,
30,
261,
712,
96,
701,
13,
632,
11628,
2068,
30,
5203,
467,
95,
712... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1509,
4672,
3536,
632,
891,
1509,
30,
1021,
460,
434,
326,
733,
18,
632,
723,
1509,
30,
261,
712,
96,
701,
13,
632,
11628,
2068,
30,
5203,
467,
95,
712... |
f.close() | rv = f.close() | def _findLib_gcc(name): expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) fdout, ccout = tempfile.mkstemp() os.close(fdout) cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; else CC=cc; fi;' \ '$CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name try: f = os.popen(cmd) trace = f.read() f.close() finally: try: os.unlink(ccout) except OSError, e: if e.errno != errno.ENOENT: raise res = re.search(expr, trace) if not res: return None return res.group(0) | 35bea17f6fa03092ffe374ab4a07e28a86b588dc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/35bea17f6fa03092ffe374ab4a07e28a86b588dc/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
5664,
67,
75,
952,
12,
529,
4672,
3065,
273,
436,
11,
15441,
4713,
5153,
87,
5772,
2941,
9,
87,
5834,
15441,
4713,
5153,
87,
65,
4035,
738,
283,
18,
6939,
12,
529,
13,
519... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4720,
5664,
67,
75,
952,
12,
529,
4672,
3065,
273,
436,
11,
15441,
4713,
5153,
87,
5772,
2941,
9,
87,
5834,
15441,
4713,
5153,
87,
65,
4035,
738,
283,
18,
6939,
12,
529,
13,
519... |
self.count = 0 | def __init__(self, hdf, prefix='changeset.diff'): self.count = 0 self.block = [] self.ttype = None self.p_block = [] self.p_type = None self.hdf = hdf self.prefix = prefix self.changeno = 0 self.blockno = 0 | f61601fb44e716bee3966732212690b1eb07ed42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/f61601fb44e716bee3966732212690b1eb07ed42/Changeset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
24217,
16,
1633,
2218,
6329,
278,
18,
5413,
11,
4672,
365,
18,
2629,
273,
5378,
365,
18,
88,
723,
225,
273,
599,
365,
18,
84,
67,
2629,
273,
5378,
365,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
24217,
16,
1633,
2218,
6329,
278,
18,
5413,
11,
4672,
365,
18,
2629,
273,
5378,
365,
18,
88,
723,
225,
273,
599,
365,
18,
84,
67,
2629,
273,
5378,
365,... | |
colorbutton = gtk.ColorButton(self.bgcolor) colorbutton.connect('color-set', self.bgcolor_selected) | colorbutton = gtk.ColorButton(self.bgcolor) colorbutton.connect('color-set', self.bgcolor_selected) | def show_prefs(self, action): self.prefs_dialog = gtk.Dialog(title=_("Mirage Preferences"), parent=self.window) self.prefs_dialog.set_has_separator(False) self.prefs_dialog.set_resizable(False) # Add "Interface" prefs: | a4d6024d09d807bd2a142bf54daca1a7d1873c7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/a4d6024d09d807bd2a142bf54daca1a7d1873c7f/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
1484,
2556,
12,
2890,
16,
1301,
4672,
365,
18,
1484,
2556,
67,
12730,
273,
22718,
18,
6353,
12,
2649,
33,
67,
2932,
49,
481,
410,
28310,
6,
3631,
982,
33,
2890,
18,
5668,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2405,
67,
1484,
2556,
12,
2890,
16,
1301,
4672,
365,
18,
1484,
2556,
67,
12730,
273,
22718,
18,
6353,
12,
2649,
33,
67,
2932,
49,
481,
410,
28310,
6,
3631,
982,
33,
2890,
18,
5668,
1... |
assert "command" in res[0].name | assert "sum" in res[0].name | def test_search(): pkgman = PackageManager() pkgman.load_directory("./") assert 'Test' in pkgman res = pkgman.search_node("command") print res assert "command" in res[0].name # comment these 3 lines because system.command is not part # of any nodes anymore. #res = pkgman.search_node("system.command") #print res #assert "command" in res[0].name | 552a713eebb4891da3d3268f07664089b7eeb9fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11338/552a713eebb4891da3d3268f07664089b7eeb9fb/test_packagemanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3072,
13332,
225,
3475,
4728,
273,
7508,
1318,
1435,
3475,
4728,
18,
945,
67,
5149,
2932,
18,
4898,
13,
225,
1815,
296,
4709,
11,
316,
3475,
4728,
225,
400,
273,
3475,
4728,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3072,
13332,
225,
3475,
4728,
273,
7508,
1318,
1435,
3475,
4728,
18,
945,
67,
5149,
2932,
18,
4898,
13,
225,
1815,
296,
4709,
11,
316,
3475,
4728,
225,
400,
273,
3475,
4728,
... |
"Parses a compact ISO weekdate (*yyyyWwwd*), and returns a tuple with year, | Parses a compact ISO weekdate (*yyyyWwwd*), and returns a tuple with year, | def compactweekdate(cls, date): """ "Parses a compact ISO weekdate (*yyyyWwwd*), and returns a tuple with year, week, and weekday. """ | 5ecfcebcb1224336a96144a10eaa65b4462fb24b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4181/5ecfcebcb1224336a96144a10eaa65b4462fb24b/iso.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6739,
10741,
712,
12,
6429,
16,
1509,
4672,
3536,
2280,
2420,
279,
6739,
9351,
4860,
712,
261,
14,
17722,
59,
3107,
72,
14,
3631,
471,
1135,
279,
3193,
598,
3286,
16,
4860,
16,
471,
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,
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,
6739,
10741,
712,
12,
6429,
16,
1509,
4672,
3536,
2280,
2420,
279,
6739,
9351,
4860,
712,
261,
14,
17722,
59,
3107,
72,
14,
3631,
471,
1135,
279,
3193,
598,
3286,
16,
4860,
16,
471,
75... |
return gnucap | return [gnucap, ""] | def to_gnucap_res(self, gnucap_name, node_id1, node_id2, gnucap_value): # Ignore the component if there is some unconnected nodes. for i in (node_id1, node_id2): node = self.nodes[i] if not node.get_wires(): gnucap = "* %s: component ignored: not connected\n" %(gnucap_name) return gnucap | 13ee6c41f57e9506834260f5eae4b05b66b6faeb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11306/13ee6c41f57e9506834260f5eae4b05b66b6faeb/electric.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
1600,
5286,
438,
67,
455,
12,
2890,
16,
22908,
5286,
438,
67,
529,
16,
756,
67,
350,
21,
16,
756,
67,
350,
22,
16,
22908,
5286,
438,
67,
1132,
4672,
468,
8049,
326,
1794,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
1600,
5286,
438,
67,
455,
12,
2890,
16,
22908,
5286,
438,
67,
529,
16,
756,
67,
350,
21,
16,
756,
67,
350,
22,
16,
22908,
5286,
438,
67,
1132,
4672,
468,
8049,
326,
1794,
... |
if self.writeoperation(convop, inputrepr, outputrepr): self.mark_release(tmp) else: if self.writeoperation(convop, inputrepr, outputrepr): tmp = Variable() self.hltypes[tmp] = outputtype self.llreprs[tmp] = outputrepr self.mark_release(tmp) | self.writeoperation(convop, inputrepr, outputrepr) | def convert(self, inputtype, inputrepr, outputtype, outputrepr=None): convop = self.getconversion(inputtype, outputtype) if outputrepr is None: tmp = Variable() self.makevar(tmp, hltype=outputtype) outputrepr = self.llreprs[tmp] if self.writeoperation(convop, inputrepr, outputrepr): self.mark_release(tmp) else: if self.writeoperation(convop, inputrepr, outputrepr): tmp = Variable() self.hltypes[tmp] = outputtype self.llreprs[tmp] = outputrepr self.mark_release(tmp) return outputrepr | 842d71aa77f5a1dec4c16a6ec8790eb83ff69fa4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/842d71aa77f5a1dec4c16a6ec8790eb83ff69fa4/typer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
12,
2890,
16,
810,
723,
16,
810,
12715,
16,
876,
723,
16,
876,
12715,
33,
7036,
4672,
6292,
556,
273,
365,
18,
588,
20990,
12,
2630,
723,
16,
876,
723,
13,
309,
876,
12715,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1765,
12,
2890,
16,
810,
723,
16,
810,
12715,
16,
876,
723,
16,
876,
12715,
33,
7036,
4672,
6292,
556,
273,
365,
18,
588,
20990,
12,
2630,
723,
16,
876,
723,
13,
309,
876,
12715,
353... |
= self._read_embedded_args_and_regexp(handlerdata.name) | = self._read_embedded_args_and_regexp(keyword.name) | def __init__(self, handlerdata, libname): if handlerdata.args: raise TypeError('Cannot have normal arguments') self.embedded_args, self.name_regexp \ = self._read_embedded_args_and_regexp(handlerdata.name) if not self.embedded_args: raise TypeError('Must have embedded arguments') UserKeywordHandler.__init__(self, handlerdata, libname) | 525339e947a1628a32403e6e8c2f383ef8bbb6dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6988/525339e947a1628a32403e6e8c2f383ef8bbb6dc/userkeyword.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1838,
892,
16,
2561,
529,
4672,
309,
1838,
892,
18,
1968,
30,
1002,
3580,
2668,
4515,
1240,
2212,
1775,
6134,
365,
18,
20722,
67,
1968,
16,
365,
18,
529,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1838,
892,
16,
2561,
529,
4672,
309,
1838,
892,
18,
1968,
30,
1002,
3580,
2668,
4515,
1240,
2212,
1775,
6134,
365,
18,
20722,
67,
1968,
16,
365,
18,
529,... |
if value: element.attrib[utils.localname(name)] = css_to_xpath(value, prefix=prefix) | localname = utils.localname(name) if not value: element.attrib[localname] = "" continue if localname == 'content' and element.tag == '{%s}drop' % utils.namespaces['xdv']: prefix = '//' | def convert_css_selectors(rules, prefix='//'): """Convert css rules to xpath rules element tree in place """ #XXX: There is a :root pseudo-class - http://www.w3.org/TR/css3-selectors/#root-pseudo # We may wish to add support to lxml.cssselect for it some day. for element in rules.xpath("//@*[namespace-uri()='%s']/.." % utils.namespaces['css']): for name, value in element.attrib.items(): if name.startswith('{%s}' % utils.namespaces['css']): if value: element.attrib[utils.localname(name)] = css_to_xpath(value, prefix=prefix) else: element.attrib[utils.fullname(element.nsmap[element.prefix], utils.localname(name))] = "" return rules | 35d9d586daf60d4e13a4bc23636938f5b9874bd3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12188/35d9d586daf60d4e13a4bc23636938f5b9874bd3/cssrules.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
5212,
67,
29829,
12,
7482,
16,
1633,
2218,
759,
11,
4672,
3536,
2723,
3747,
2931,
358,
6748,
2931,
930,
2151,
316,
3166,
3536,
468,
15639,
30,
6149,
353,
279,
294,
3085,
12454,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1765,
67,
5212,
67,
29829,
12,
7482,
16,
1633,
2218,
759,
11,
4672,
3536,
2723,
3747,
2931,
358,
6748,
2931,
930,
2151,
316,
3166,
3536,
468,
15639,
30,
6149,
353,
279,
294,
3085,
12454,... |
warning("Interface %s: unkown address family (%i)"%(iff, addrfamily)) continue | addrfamily = struct.unpack("h",ifreq[16:18])[0] if addrfamily == socket.AF_INET: ifaddr = inet_ntoa(ifreq[20:24]) else: warning("Interface %s: unkown address family (%i)"%(iff, addrfamily)) continue | def read_routes(): f=open("/proc/net/route","r") routes = [] s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ifreq = ioctl(s, SIOCGIFADDR,struct.pack("16s16x","lo")) addrfamily = struct.unpack("h",ifreq[16:18])[0] if addrfamily == socket.AF_INET: ifreq2 = ioctl(s, SIOCGIFNETMASK,struct.pack("16s16x","lo")) msk = struct.unpack("I",ifreq2[20:24])[0] dst = struct.unpack("I",ifreq[20:24])[0] & msk ifaddr = inet_ntoa(ifreq[20:24]) routes.append((dst, msk, "0.0.0.0", "lo", ifaddr)) else: warning("Interface lo: unkown address family (%i)"% addrfamily) for l in f.readlines()[1:]: iff,dst,gw,flags,x,x,x,msk,x,x,x = l.split() flags = int(flags,16) if flags & RTF_UP == 0: continue if flags & RTF_REJECT: continue ifreq = ioctl(s, SIOCGIFADDR,struct.pack("16s16x",iff)) addrfamily = struct.unpack("h",ifreq[16:18])[0] if addrfamily == socket.AF_INET: ifaddr = inet_ntoa(ifreq[20:24]) else: warning("Interface %s: unkown address family (%i)"%(iff, addrfamily)) continue routes.append((long(dst,16), long(msk,16), inet_ntoa(struct.pack("I",long(gw,16))), iff, ifaddr)) f.close() return routes | 2affa8eef1ef85219745fd668c0d88ddf689804c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7311/2affa8eef1ef85219745fd668c0d88ddf689804c/scapy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
10854,
13332,
284,
33,
3190,
2932,
19,
9381,
19,
2758,
19,
5547,
15937,
86,
7923,
4912,
273,
5378,
272,
33,
7814,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
16,
2987,
18,
3584,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
10854,
13332,
284,
33,
3190,
2932,
19,
9381,
19,
2758,
19,
5547,
15937,
86,
7923,
4912,
273,
5378,
272,
33,
7814,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
16,
2987,
18,
3584,
... |
'''shouldn't normally be called directly''' | '''Perform actions required at beginning of page. shouldn't normally be called directly''' | def handle_pageBegin(self): '''shouldn't normally be called directly''' self.page = self.page + 1 self.pageTemplate.drawPage(self.canv,self) self.pageTemplate.onPage(self.canv,self) if hasattr(self,'_nextFrameIndex'): del self._nextFrameIndex self.frame = self.pageTemplate.frames[0] self.handle_frameBegin() | 2308046a6bba89b2245e9e88a7b7491f6ed0d2d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2308046a6bba89b2245e9e88a7b7491f6ed0d2d7/doctemplate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
2433,
8149,
12,
2890,
4672,
9163,
4990,
4209,
1931,
622,
8435,
434,
1363,
18,
12044,
1404,
15849,
506,
2566,
5122,
26418,
365,
18,
2433,
273,
365,
18,
2433,
397,
404,
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,
1640,
67,
2433,
8149,
12,
2890,
4672,
9163,
4990,
4209,
1931,
622,
8435,
434,
1363,
18,
12044,
1404,
15849,
506,
2566,
5122,
26418,
365,
18,
2433,
273,
365,
18,
2433,
397,
404,
365,
18,
... |
pass | b, a = bilinear(b, a, fs=fs) | def butter(N, Wn, bandtype='band', analog=0, output=''): """Butterworth digital and analog filter design. Description: Design an Nth order lowpass digital Butterworth filter and return the filter coefficients in (B,A) form. Inputs: """ #pre-warp frequencies for digital filter design if not analog: warped = 2*fs*tan(pi*Wn/fs) else: warped = Wn # convert to low-pass prototype # Get analog lowpass prototype # transform to lowpass, bandpass, highpass, or bandstop # Find discrete equivalent if necessary if not analog: pass # Transform to proper out type (pole-zero, state-space, numer-denom) pass | 52477d3d8b9098fa5178fb8886e5ea9d40db9bb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/52477d3d8b9098fa5178fb8886e5ea9d40db9bb3/filter_design.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1496,
387,
12,
50,
16,
678,
82,
16,
8937,
723,
2218,
12752,
2187,
25714,
33,
20,
16,
876,
2218,
11,
4672,
3536,
38,
18220,
91,
7825,
25615,
471,
25714,
1034,
8281,
18,
225,
6507,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1496,
387,
12,
50,
16,
678,
82,
16,
8937,
723,
2218,
12752,
2187,
25714,
33,
20,
16,
876,
2218,
11,
4672,
3536,
38,
18220,
91,
7825,
25615,
471,
25714,
1034,
8281,
18,
225,
6507,
30,
... |
self.assertRaises(TypeError, list, ifilter(isEven, N(s))) | self.assertRaises(TypeError, ifilter, isEven, N(s)) | def test_ifilter(self): for s in (range(10), range(0), range(1000), (7,11), xrange(2000,2200,5)): for g in (G, I, Ig, S, L, R): self.assertEqual(list(ifilter(isEven, g(s))), filter(isEven, g(s))) self.assertRaises(TypeError, ifilter, isEven, X(s)) self.assertRaises(TypeError, list, ifilter(isEven, N(s))) self.assertRaises(ZeroDivisionError, list, ifilter(isEven, E(s))) | 99670b07b3fb0f90717126730b9ee2d3f78261c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/99670b07b3fb0f90717126730b9ee2d3f78261c2/test_itertools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
430,
1088,
12,
2890,
4672,
364,
272,
316,
261,
3676,
12,
2163,
3631,
1048,
12,
20,
3631,
1048,
12,
18088,
3631,
261,
27,
16,
2499,
3631,
12314,
12,
17172,
16,
3787,
713,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
430,
1088,
12,
2890,
4672,
364,
272,
316,
261,
3676,
12,
2163,
3631,
1048,
12,
20,
3631,
1048,
12,
18088,
3631,
261,
27,
16,
2499,
3631,
12314,
12,
17172,
16,
3787,
713,
16,
... |
print "\nPARENT'S OFFSET = ",self.parent.xoffset,self.parent.yoffset | def paintOnDC(self, dc): """ Created: 06.10.2006, KP Description: Paint the annotations on a DC """ print "\nPARENT'S OFFSET = ",self.parent.xoffset,self.parent.yoffset self.parent.diagram.Redraw(dc) | 4f55a5dca9f9faeeb6611f04a3dc12710a42321e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2877/4f55a5dca9f9faeeb6611f04a3dc12710a42321e/InteractivePanel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12574,
1398,
5528,
12,
2890,
16,
6744,
4672,
3536,
12953,
30,
13026,
18,
2163,
18,
6976,
26,
16,
1475,
52,
6507,
30,
30001,
326,
5617,
603,
279,
21533,
3536,
225,
365,
18,
2938,
18,
12... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12574,
1398,
5528,
12,
2890,
16,
6744,
4672,
3536,
12953,
30,
13026,
18,
2163,
18,
6976,
26,
16,
1475,
52,
6507,
30,
30001,
326,
5617,
603,
279,
21533,
3536,
225,
365,
18,
2938,
18,
12... | |
out = BIO.openfile('p7.clear', 'w') | out = BIO.openfile('clear.p7', 'w') | def sign(): print 'test sign & save...', buf = makebuf() s = SMIME.SMIME() s.load_key('client.pem') p7 = s.sign(buf) out = BIO.openfile('p7.clear', 'w') out.write('To: ngps@post1.com\n') out.write('From: m2crypto@m2crypto.org\n') out.write('Subject: testing\n') buf = makebuf() # Recreate buf, because sign() has consumed it. s.write(out, p7, buf) out.close() buf = makebuf() p7 = s.sign(buf) out = BIO.openfile('p7.opaque', 'w') out.write('To: ngps@post1.com\n') out.write('From: m2crypto@m2crypto.org\n') out.write('Subject: testing\n') s.write(out, p7) out.close() print 'ok' | 40431475922500ae7929b2bc6c49d3d58098e5cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8055/40431475922500ae7929b2bc6c49d3d58098e5cc/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1573,
13332,
1172,
296,
3813,
1573,
473,
1923,
7821,
16,
1681,
273,
1221,
4385,
1435,
272,
273,
12014,
3114,
18,
7303,
3114,
1435,
272,
18,
945,
67,
856,
2668,
2625,
18,
20313,
6134,
293... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1573,
13332,
1172,
296,
3813,
1573,
473,
1923,
7821,
16,
1681,
273,
1221,
4385,
1435,
272,
273,
12014,
3114,
18,
7303,
3114,
1435,
272,
18,
945,
67,
856,
2668,
2625,
18,
20313,
6134,
293... |
if not(isinstance(range_info, LocationParser.Range)): | elif not(isinstance(range_info, LocationParser.Range)): | def _get_location(self, range_info): """Return a (possibly fuzzy) location from a Range object. | 1707d3b28d546c252f7d95b599cdf5b9993fba00 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7167/1707d3b28d546c252f7d95b599cdf5b9993fba00/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
3562,
12,
2890,
16,
1048,
67,
1376,
4672,
3536,
990,
279,
261,
917,
8781,
21315,
13,
2117,
628,
279,
8086,
733,
18,
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,
389,
588,
67,
3562,
12,
2890,
16,
1048,
67,
1376,
4672,
3536,
990,
279,
261,
917,
8781,
21315,
13,
2117,
628,
279,
8086,
733,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
"""Test wither one of the indexes belongs to the predefined set.""" | """Test wether one of the indexes belongs to the predefined set.""" | def __call__(self, *test_indexes): """Test wither one of the indexes belongs to the predefined set.""" if self.filter_atoms is None: return True return len(self.filter_atoms.intersection(test_indexes)) > 0 | c58b0e1dee304ebf71871e7a0ad0d130f2900bd7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11050/c58b0e1dee304ebf71871e7a0ad0d130f2900bd7/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
380,
3813,
67,
11265,
4672,
3536,
4709,
341,
2437,
1245,
434,
326,
5596,
11081,
358,
326,
19555,
444,
12123,
309,
365,
18,
2188,
67,
14937,
353,
599,
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
380,
3813,
67,
11265,
4672,
3536,
4709,
341,
2437,
1245,
434,
326,
5596,
11081,
358,
326,
19555,
444,
12123,
309,
365,
18,
2188,
67,
14937,
353,
599,
30,
... |
current_version=5 | current_version=6 | def check_dbversion(): cfg = Config.Config() current_version=5 try: dbversion=cfg.GetConfigItem("dbversion") except: print "WARNING: dbversion tag not found." print " : Check that your DB structure is up to date." return 0 dbversion=int(dbversion) if dbversion < current_version: print "WARNING: dbversion tag indicates your database is out of date. Updating..." update_dbversion() return 1 | 750b731c383a64a4ccc10cbdd682c7e77ea36207 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11694/750b731c383a64a4ccc10cbdd682c7e77ea36207/DBSync.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1966,
1589,
13332,
2776,
273,
1903,
18,
809,
1435,
783,
67,
1589,
33,
26,
225,
775,
30,
1319,
1589,
33,
7066,
18,
967,
809,
1180,
2932,
1966,
1589,
7923,
1335,
30,
1172,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1966,
1589,
13332,
2776,
273,
1903,
18,
809,
1435,
783,
67,
1589,
33,
26,
225,
775,
30,
1319,
1589,
33,
7066,
18,
967,
809,
1180,
2932,
1966,
1589,
7923,
1335,
30,
1172,
315,
... |
singleDayTuples = [(str(minPartitionDate + dt.timedelta(x))[:10], str(minPartitionDate + dt.timedelta(x + 1))[:10]) for x in range(6)] | singleDayTuples = [(str(minPartitionDate + dt.timedelta(x))[:10], str(minPartitionDate + dt.timedelta(x + 1))[:10]) for x in range(7)] | def wrapperIter(): for x in list(dateRangeIterator())[::-1][:4]: yield x | a75ad7a47ea9ac630af873ab6d62af5175d4d29c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12383/a75ad7a47ea9ac630af873ab6d62af5175d4d29c/migrate_3.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4053,
2360,
13332,
364,
619,
316,
666,
12,
712,
2655,
3198,
10756,
63,
2866,
17,
21,
6362,
30,
24,
14542,
2824,
619,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4053,
2360,
13332,
364,
619,
316,
666,
12,
712,
2655,
3198,
10756,
63,
2866,
17,
21,
6362,
30,
24,
14542,
2824,
619,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.channel.set_custom_title( self.entryTitle.get_text()) | self.channel.set_custom_title(self.entryTitle.get_text()) | def on_btnOK_clicked(self, widget, *args): entered_url = self.entryURL.get_text() channel_url = self.channel.url | 54386f67bc60d9a7695fad74a7d75be57c17a98d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12778/54386f67bc60d9a7695fad74a7d75be57c17a98d/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
11898,
3141,
67,
7475,
329,
12,
2890,
16,
3604,
16,
380,
1968,
4672,
16219,
67,
718,
273,
365,
18,
4099,
1785,
18,
588,
67,
955,
1435,
1904,
67,
718,
273,
365,
18,
4327,
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,
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,
603,
67,
11898,
3141,
67,
7475,
329,
12,
2890,
16,
3604,
16,
380,
1968,
4672,
16219,
67,
718,
273,
365,
18,
4099,
1785,
18,
588,
67,
955,
1435,
1904,
67,
718,
273,
365,
18,
4327,
18,... |
item.itsKind = davItem.itsKind | def syncFromServer(item, davItem): item.itsKind = davItem.itsKind kind = davItem.itsKind for (name, attr) in kind.iterAttributes(True): value = davItem.getAttribute(attr) if not value: continue log.info('Getting: %s (%s)' % (name, attr.type.itsName)) # see if its an ItemRef or not if isinstance(attr.type, Kind): # time for some xml parsing! yum! nodes = nodesFromXml(value) if len(nodes) == 0: continue if attr.cardinality == 'list': # replaced by mergeList + continue #setfunc = item.addValue mergeList(item, name, nodes, True) continue elif attr.cardinality == 'single': node = nodes[0] try: otherItem = Dav.DAV(node.content).get() item.setAttributeValue(name, otherItem) except Dav.NotFound: log.warning('Cant access %s' % (node.content)) elif attr.cardinality == 'dict': # XXX implement me log.info('NOTIMPLEMENTED Trying to share cardinality dict attribute' % (node.content)) else: raise Exception else: if attr.cardinality == 'list': nodes = nodesFromXml(value) # mergeList replaces this code #for node in nodes: # item.addValue(name, node.content) # log.info('Got.....: ', value) mergeList(item, name, nodes, False) elif attr.cardinality == 'single': log.info('Got.....: %s' % (value)) item.setAttributeValue(name, attr.type.makeValue(value)) # # XXX refactor this code # if item.isItemOf(item.itsView.findPath('//parcels/osaf/contentmodel/ItemCollection')): value = davItem._getAttribute('results', '//special/case') nodes = nodesFromXml(value) serverCollectionResults = [] for node in nodes: otherItem = Dav.DAV(node.content).get() serverCollectionResults.append(otherItem) log.debug('Merging itemCollection') # for now, just sync with whatever the server gave us for i in serverCollectionResults: if i not in item: item.add(i) log.debug('adding %s to collection %s' % (i, item)) # XXX this should work but has some issues.. fixme! # for i in item: # if i not in serverCollectionResults: # item.remove(i) # log.debug('removing %s from collection %s' % (i, item)) # # End refactor # item.etag = davItem.etag #item.lastModified = davItem.lastModified item.sharedVersion = item._version # XXX should we commit first? | 74eef4b9b8ed3dc891787afb7430831cfda48942 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/74eef4b9b8ed3dc891787afb7430831cfda48942/Sync.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3792,
1265,
2081,
12,
1726,
16,
302,
842,
1180,
4672,
3846,
273,
302,
842,
1180,
18,
1282,
5677,
225,
364,
261,
529,
16,
1604,
13,
316,
3846,
18,
2165,
2498,
12,
5510,
4672,
225,
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,
3792,
1265,
2081,
12,
1726,
16,
302,
842,
1180,
4672,
3846,
273,
302,
842,
1180,
18,
1282,
5677,
225,
364,
261,
529,
16,
1604,
13,
316,
3846,
18,
2165,
2498,
12,
5510,
4672,
225,
460,
... | |
cache_recid_data_dict_CERNBulletin(recid, issue_number, rule, order) | cache_recid_data_dict_CERNBulletin(recid, issue_number, rule, order) | def get_recid_from_order_CERNBulletin(order, rule, issue_number): """ same functionality as get_recid_from_order above, but extends it for the CERN Bulletin in a way so multiple entries for the first article are possible. parameters: order: the order at which the record appears in the journal as passed in the url rule: the defining rule of the journal record category issue_number: the issue number for which we are searching returns: recid: the recid of the ordered record """ # try to get it from cache recid_dict = {} recid_dict = get_cached_recid_data_dict_CERNBulletin(issue_number, rule) if recid_dict.has_key(order): recid = recid_dict[order] return recid alternative_issue_number = "00/0000" # get the id list if issue_number[0] == "0": alternative_issue_number = issue_number[1:] all_records = list(search_pattern(p="%s and 773__n:%s" % (rule, issue_number), f="&action_search=Search")) all_records += list(search_pattern(p="%s and 773__n:%s" % (rule, alternative_issue_number), f="&action_search=Search")) else: all_records = list(search_pattern(p="%s and 773__n:%s" % (rule, issue_number), f="&action_search=Search")) #raise repr(all_records) ordered_records = {} new_addition_records = [] for record in all_records: temp_rec = BibFormatObject(record) # todo: refactor with get_fieldValues from search_engine issue_numbers = temp_rec.fields('773__n') order_number = temp_rec.fields('773__c') #raise "%s:%s" % (repr(issue_numbers), repr(order_number)) # todo: fields for issue number and order number have to become generic n = 0 for temp_issue in issue_numbers: if temp_issue == issue_number or temp_issue == alternative_issue_number: try: order_number = int(order_number[n]) except: register_exception(stream="warning", suffix="There \ was an article in the journal that does not support \ a numbering scheme") order_number = -1000 n+=1 if order_number == -1000: ordered_records[max(ordered_records.keys()) + 1] = record elif order_number <= 1: new_addition_records.append(record) else: try: ordered_records[order_number] = record except: register_exception(stream='warning', suffix="There \ were double entries for an order in this journal.") # process the CERN Bulletin specific new additions if len(new_addition_records) > 1 and int(order) <= 1: # if we are dealing with a new addition (order number smaller 1) ordered_new_additions = {} for record in new_addition_records: #upload_date = run_sql("SELECT modification_date FROM bibrec WHERE id=%s", (record, ))[0][0] upload_date = run_sql("SELECT creation_date FROM bibrec WHERE id=%s", (record, ))[0][0] ordered_new_additions[int(time.mktime(upload_date.timetuple()))] = record i = 1 while len(ordered_new_additions) > 0: temp_key = pop_oldest_article_CERNBulletin(ordered_new_additions) record = ordered_new_additions.pop(int(temp_key)) ordered_records[i] = record i -=1 else: # if we have only one record on 1 just push it through ordered_records[1] = new_addition_records[0] try: recid = ordered_records[int(order)] except: register_exception() cache_recid_data_dict_CERNBulletin(recid, issue_number, rule, order) return recid | 95302ea88121546ed68c8b38bb6cd6cf4b324cd0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/95302ea88121546ed68c8b38bb6cd6cf4b324cd0/webjournal_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3927,
350,
67,
2080,
67,
1019,
67,
39,
654,
20626,
19994,
267,
12,
1019,
16,
1720,
16,
5672,
67,
2696,
4672,
3536,
1967,
14176,
487,
336,
67,
3927,
350,
67,
2080,
67,
1019,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3927,
350,
67,
2080,
67,
1019,
67,
39,
654,
20626,
19994,
267,
12,
1019,
16,
1720,
16,
5672,
67,
2696,
4672,
3536,
1967,
14176,
487,
336,
67,
3927,
350,
67,
2080,
67,
1019,
... |
contents = re.sub(r'goog.exportSymbol\([^\)]*\);\n', '', contents) | contents = re.sub(r'goog.exportSymbol\([^\)]*\);', '', contents) | def BuildCompiledO3DJS(o3djs_files, externs_path, o3d_externs_js_path, compiled_o3djs_outpath): Execute([ _java_exe, '-jar', MakePath('../../o3d-internal/jscomp/JSCompiler_deploy.jar'), '--property_renaming', 'OFF', '--variable_renaming', 'LOCAL', '--strict', '--externs=%s' % externs_path, ('--externs=%s' % o3d_externs_js_path), ('--js_output_file=%s' % compiled_o3djs_outpath)] + ['-js=%s' % (x, ) for x in o3djs_files]); # strip out goog.exportSymbol and move o3djs.require to end file = open(compiled_o3djs_outpath, 'r') contents = file.read() file.close() contents = re.sub(r'goog.exportSymbol\([^\)]*\);\n', '', contents) requires = set(re.findall(r'o3djs.require\([^\)]*\);', contents)) contents = re.sub(r'o3djs.require\([^\)]*\);', '', contents) file = open(compiled_o3djs_outpath, 'w') file.write(_js_copyright) file.write(contents) file.write('\n') file.write('\n'.join(requires)) file.close() | 9320f85bc4fcdb342288821697d0e988d4d670ed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/9320f85bc4fcdb342288821697d0e988d4d670ed/build_docs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3998,
20733,
51,
23,
40,
6479,
12,
83,
23,
72,
2924,
67,
2354,
16,
18885,
87,
67,
803,
16,
320,
23,
72,
67,
338,
798,
87,
67,
2924,
67,
803,
16,
7743,
67,
83,
23,
72,
2924,
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,
3998,
20733,
51,
23,
40,
6479,
12,
83,
23,
72,
2924,
67,
2354,
16,
18885,
87,
67,
803,
16,
320,
23,
72,
67,
338,
798,
87,
67,
2924,
67,
803,
16,
7743,
67,
83,
23,
72,
2924,
67,
... |
(options, args) = parser.parse_args() | image.disable_undo() gimp.context_push() | def main(): parser = OptionParser() defaultThemeDir = os.path.normpath(os.path.join(os.getcwd(), "..", "theme")) parser.add_option("--theme-directory", dest="themedir", default=defaultThemeDir) (options, args) = parser.parse_args() smallSave = os.path.join(options.themedir, "default", "images") wideSave = os.path.join(options.themedir, "default-wide", "images") try: checkdirs = [ options.themedir, smallSave, wideSave ] for dir in checkdirs: if not (os.path.exists(dir) and os.path.isdir(dir)): raise DirError(dir) except DirError, e: print(e.name) print("Error: missing theme directory \"%s\"" % (str(e),)) sys.exit(1) images = [ { "name" : ("MythVideo-SearchSelect", "mv_results_popup.png"), "Small" : (387, 400), "Wide" : (592, 400), }, { "name" : ("MythVideo-ItemDetailPopup", "mv_itemdetail_popup.png"), "Small" : (720, 540), # 800x600 - 10% "Wide" : (1152, 648), # 1280x720 - 10% }, ] savepath = { "Small" : smallSave, "Wide" : wideSave, } for image in images: for size in [ "Small", "Wide" ]: name = "%s-%s" % (image['name'][0], size) xcfname = os.path.join(os.getcwd(), name) pngname = os.path.join(savepath[size], image['name'][1]) GIMPCreateDialog(xcfname, pngname, image[size][0], image[size][1]) | e2c03d1fd04dc50dc4ad9ec4c41799301ff80998 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/e2c03d1fd04dc50dc4ad9ec4c41799301ff80998/mythvideofu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2082,
273,
18862,
1435,
805,
8335,
1621,
273,
1140,
18,
803,
18,
7959,
803,
12,
538,
18,
803,
18,
5701,
12,
538,
18,
588,
11089,
9334,
315,
838,
3113,
315,
7997,
6,
3719,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2082,
273,
18862,
1435,
805,
8335,
1621,
273,
1140,
18,
803,
18,
7959,
803,
12,
538,
18,
803,
18,
5701,
12,
538,
18,
588,
11089,
9334,
315,
838,
3113,
315,
7997,
6,
3719,
... |
nParts = self._readAndUnpack(self.__SIGNED_INT, fp.read(4)) nPoints = self._readAndUnpack(self.__SIGNED_INT, fp.read(4)) if self._readAndUnpack(self.__SIGNED_INT, fp.read(4)) != 0: raise ValueError('ERROR: First part offset must be 0') counts = [] prev = 0 for i in xrange(nParts - 1): nextItem = self._readAndUnpack(self.__SIGNED_INT, fp.read(4)) counts.append(nextItem - prev) prev = nextItem counts.append(nPoints - prev) | nParts = self._readAndUnpack(self.__LE_SINT, fp.read(4)) nPoints = self._readAndUnpack(self.__LE_SINT, fp.read(4)) offsetParts = [] prevRec = 0 for idx in xrange(nParts): offsetParts.append(self._readAndUnpack(self.__LE_SINT, fp.read(4))) size = len(offsetParts) for i in xrange(size): offset = offsetParts[i] if i < (size - 1): offsetParts[i] = offsetParts[i + 1] - offset nPoints -= offsetParts[i] else: offsetParts[i] = nPoints | def _readRecordPolyLine(self, fp): shape = {'bounds': self._readBounds(fp)} nParts = self._readAndUnpack(self.__SIGNED_INT, fp.read(4)) nPoints = self._readAndUnpack(self.__SIGNED_INT, fp.read(4)) | 2abd3eddcba3d6741d32d051c14cabc4c6006a50 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1821/2abd3eddcba3d6741d32d051c14cabc4c6006a50/shapefile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
2115,
12487,
1670,
12,
2890,
16,
4253,
4672,
2179,
273,
13666,
10576,
4278,
365,
6315,
896,
5694,
12,
7944,
16869,
290,
4305,
273,
365,
6315,
896,
1876,
23649,
12,
2890,
16186,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2115,
12487,
1670,
12,
2890,
16,
4253,
4672,
2179,
273,
13666,
10576,
4278,
365,
6315,
896,
5694,
12,
7944,
16869,
290,
4305,
273,
365,
6315,
896,
1876,
23649,
12,
2890,
16186,
... |
p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) divsig = p.system.methodSignature('div') self.assertEqual(divsig, 'signatures not supported') | try: p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) divsig = p.system.methodSignature('div') self.assertEqual(divsig, 'signatures not supported') except xmlrpclib.ProtocolError, e: self.fail("%s\n%s" % (e, e.headers)) | def test_introspection3(self): # the SimpleXMLRPCServer doesn't support signatures, but # at least check that we can try p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) divsig = p.system.methodSignature('div') self.assertEqual(divsig, 'signatures not supported') | 095843808f6940bbcdf850b6544a8efc02ed14d6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/095843808f6940bbcdf850b6544a8efc02ed14d6/test_xmlrpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
474,
26362,
23,
12,
2890,
4672,
468,
326,
4477,
4201,
8087,
2081,
3302,
1404,
2865,
14862,
16,
1496,
468,
622,
4520,
866,
716,
732,
848,
775,
293,
273,
2025,
13832,
830,
495,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26362,
23,
12,
2890,
4672,
468,
326,
4477,
4201,
8087,
2081,
3302,
1404,
2865,
14862,
16,
1496,
468,
622,
4520,
866,
716,
732,
848,
775,
293,
273,
2025,
13832,
830,
495,
... |
self.appendMessages(lines, keyedMessages[header], label) lines.append("""<tr><td></td><td></td><td align='center'> <br> | self.appendMessages(lines, keyedMessages[header], label, startAt, howMany) lines.append("""<tr><td></td><td></td><td align='center' colspan='4'> <br> | def onReview(self, params): """Present a list of message for (re)training.""" # Train/discard submitted messages. id = '' numTrained = 0 numDeferred = 0 for key, value in params.items(): if key.startswith('classify:'): id = key.split(':')[2] if value == 'spam': targetCorpus = state.spamCorpus elif value == 'ham': targetCorpus = state.hamCorpus elif value == 'discard': targetCorpus = None try: state.unknownCorpus.removeMessage(state.unknownCorpus[id]) except KeyError: pass # Must be a reload. else: # defer targetCorpus = None numDeferred += 1 if targetCorpus: try: targetCorpus.takeMessage(id, state.unknownCorpus) if numTrained == 0: self.push("<p><b>Training... ") self.push(" ") numTrained += 1 except KeyError: pass # Must be a reload. | d319917072174781f46b53caa571a8bdd023d80f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/d319917072174781f46b53caa571a8bdd023d80f/proxytrainer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
9159,
12,
2890,
16,
859,
4672,
3536,
6351,
279,
666,
434,
883,
364,
261,
266,
13,
17584,
12123,
468,
2197,
267,
19,
31992,
9638,
2743,
18,
612,
273,
875,
818,
1609,
1920,
273,
374... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
9159,
12,
2890,
16,
859,
4672,
3536,
6351,
279,
666,
434,
883,
364,
261,
266,
13,
17584,
12123,
468,
2197,
267,
19,
31992,
9638,
2743,
18,
612,
273,
875,
818,
1609,
1920,
273,
374... |
contextHandlers = getattr(self, "contextHandlers", {}) for contextHandler in contextHandlers.values(): contextHandler.mergeBack(self) settings[contextHandler.localContextName] = contextHandler.globalContexts settings[contextHandler.localContextName+"Version"] = (contextStructureVersion, contextHandler.contextDataVersion) | def saveSettings(self, file = None): settings = self.getSettings() | c073ee3c75c0e0884437921ffc37e0d94b41cb79 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/c073ee3c75c0e0884437921ffc37e0d94b41cb79/OWBaseWidget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
2628,
12,
2890,
16,
585,
273,
599,
4672,
1947,
273,
365,
18,
588,
2628,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
2628,
12,
2890,
16,
585,
273,
599,
4672,
1947,
273,
365,
18,
588,
2628,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
try: if isinstance(self.socket, ssl.SSLSocket): if self.socket._sslobj is not None: self.socket.unwrap() finally: super(SSLConnection, self).close() | if (isinstance(self.socket, ssl.SSLSocket) and self.socket._sslobj is not None): self._do_ssl_shutdown() | def close(self): try: if isinstance(self.socket, ssl.SSLSocket): if self.socket._sslobj is not None: self.socket.unwrap() finally: super(SSLConnection, self).close() | 1ad61af58377105e51758ab67f7315199e5d6064 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/1ad61af58377105e51758ab67f7315199e5d6064/test_ftplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
775,
30,
309,
1549,
12,
2890,
18,
7814,
16,
5832,
18,
1260,
25831,
4672,
309,
365,
18,
7814,
6315,
1049,
383,
441,
353,
486,
599,
30,
365,
18,
7814,
18,
318,
41... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
775,
30,
309,
1549,
12,
2890,
18,
7814,
16,
5832,
18,
1260,
25831,
4672,
309,
365,
18,
7814,
6315,
1049,
383,
441,
353,
486,
599,
30,
365,
18,
7814,
18,
318,
41... |
self.cache = [] | self.input_cache = [] self.output_cache = [] | def __init__(self, *args): pipeline.LigolwAddNode.__init__(self, *args) self.cache = [] | a6f51cd0e257501ea4f0864483cd73ad05576b37 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/a6f51cd0e257501ea4f0864483cd73ad05576b37/power.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
5873,
18,
48,
360,
355,
91,
986,
907,
16186,
2738,
972,
12,
2890,
16,
380,
1968,
13,
365,
18,
2493,
273,
5378,
2,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
5873,
18,
48,
360,
355,
91,
986,
907,
16186,
2738,
972,
12,
2890,
16,
380,
1968,
13,
365,
18,
2493,
273,
5378,
2,
-100,
-100,
-100,
-1... |
rfs.close() | rfs.close(ctx) | def close(self, current = None): | ef5c48ac90cceda2e205d0636e0cbe67a972e6fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/ef5c48ac90cceda2e205d0636e0cbe67a972e6fb/tables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
16,
783,
273,
599,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
16,
783,
273,
599,
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,
... |
return '<a href="%s"%s>%s</a>' % (url, css, label) | onclick = '' if ((isinstance(target, VariableDoc) and not target.is_public) or (isinstance(target, ValueDoc) and not isinstance(target, GenericValueDoc) and not self._val_is_public(target))): onclick = ' onclick="show_private();"' return '<a href="%s"%s%s>%s</a>' % (url, css, onclick, label) | def href(self, target, label=None, css_class=None, context=None): """ Return the HTML code for an HREF link to the given target (which can be a C{VariableDoc}, a C{ValueDoc}, or a C{DottedName}. If a C{NamespaceDoc} C{context} is specified, the target label is contextualized to it. """ assert isinstance(target, (APIDoc, DottedName)) | dffa60555a5bb4f2cca0528fb11658f3760be525 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3512/dffa60555a5bb4f2cca0528fb11658f3760be525/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3897,
12,
2890,
16,
1018,
16,
1433,
33,
7036,
16,
3747,
67,
1106,
33,
7036,
16,
819,
33,
7036,
4672,
3536,
2000,
326,
3982,
981,
364,
392,
670,
10771,
1692,
358,
326,
864,
1018,
261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3897,
12,
2890,
16,
1018,
16,
1433,
33,
7036,
16,
3747,
67,
1106,
33,
7036,
16,
819,
33,
7036,
4672,
3536,
2000,
326,
3982,
981,
364,
392,
670,
10771,
1692,
358,
326,
864,
1018,
261,
... |
def get_entry(self, id): """ Returns a single entry if it can identify a model from the regex dict url_parts. """ model = self.queryset.get(**{self.queryset.model._meta.pk.name : id}) | def get_entry(self, pk_value): """ Returns a single entry retrieved by filtering the collection queryset by primary key value. """ model = self.queryset.get(**{self.queryset.model._meta.pk.name : pk_value}) | def get_entry(self, id): """ Returns a single entry if it can identify a model from the regex dict url_parts. """ model = self.queryset.get(**{self.queryset.model._meta.pk.name : id}) entry = self.entry_class(self, model) return entry | fbb9a95bc9ec8149401056b76f5ffa5076eb7beb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12520/fbb9a95bc9ec8149401056b76f5ffa5076eb7beb/model_resource.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4099,
12,
2890,
16,
2365,
67,
1132,
4672,
3536,
2860,
279,
2202,
1241,
10295,
635,
11346,
326,
1849,
11892,
635,
3354,
498,
460,
18,
3536,
938,
273,
365,
18,
21729,
18,
588,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4099,
12,
2890,
16,
2365,
67,
1132,
4672,
3536,
2860,
279,
2202,
1241,
10295,
635,
11346,
326,
1849,
11892,
635,
3354,
498,
460,
18,
3536,
938,
273,
365,
18,
21729,
18,
588,
1... |
If at1 == at2, this is an error; print a warning and do nothing. | If a1 == a2, this is an error; print a warning and do nothing. | def bond_atoms_oldversion(at1,at2): #bruce 050502 renamed this from bond_atoms; it's called from the newer version of bond_atoms """Make a new bond between atoms at1 and at2 (and add it to their lists of bonds), if they are not already bonded; if they are already bonded do nothing. Return None. (The new bond object, if one is made, can't be found except by scanning the bonds of one of the atoms.) If at1 == at2, this is an error; print a warning and do nothing. This increases the number of bonds on each atom (when it makes a new bond) -- it never removes any singlets. Therefore it is mostly for low-level use. It could be called directly, but is usually called via the method molecule.bond, purely for historical reasons. """ # bruce 041109 split this out of molecule.bond. Since it's the only caller of # Bond.__init__, what it does to the atoms could (and probably should) be put # inside the constructor. However, it should not simply be replaced with calls # to the constructor, in case we someday want it to return the bond which it # either makes (as the constructor does) or doesn't make (when the atoms are # already bonded). The test for a prior bond makes more sense outside of the # Bond constructor. if at1 is at2: #bruce 041119, partial response to bug #203 print "BUG: bond_atoms was asked to bond %r to itself." % at1 print "Doing nothing (but further bugs may be caused by this)." print_compact_stack("stack when same-atom bond attempted: ") return b = Bond(at1,at2) # (this does all necessary invals) #bruce 041029 precautionary change -- I find in debugging that the bond # can be already in one but not the other of at1.bonds and at2.bonds, # as a result of prior bugs. To avoid worsening those bugs, we should # change this... but for now I'll just print a message about it. #bruce 041109: when this happens I'll now also remove the obsolete bond. if (b in at1.bonds) != (b in at2.bonds): print "fyi: debug: for new bond %r, (b in at1.bonds) != (b in at2.bonds); removing old bond" % b try: at1.bonds.remove(b) except: pass try: at2.bonds.remove(b) except: pass if not b in at2.bonds: at1.bonds += [b] at2.bonds += [b] else: # [bruce comment 041115: I don't know if this ever happens, # or if it's a good idea for it to be allowed, but it is allowed. # #e should it inval the old bond? I think so, but didn't add that. # later: it happens a lot when entering Extrude; guess: mol.copy copies # each internal bond twice (sounds right, but I did not verify this).] # # [addendum, bruce 051018: I added a message for when a new bond is equal to # an existing one, but entering Extrude does not print that, so either it's # been changed or mol.copy has or I misunderstand the above code (which # I predict would hit that message). Just to check, I'll print a debug message here (below); # that message is not happening either, so maybe this deprecated feature is no longer used at all. #k ####@@@@ # (Should also try reading a pdb file with the same bond listed twice... ###k) if platform.atom_debug: print "atom_debug: fyi (possible bug): bond_atoms_oldversion is a noop since an equal bond exists:", b pass return | 5b1c4a788181169d53459e035454c6285af3fb7c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/5b1c4a788181169d53459e035454c6285af3fb7c/bonds.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8427,
67,
14937,
67,
1673,
1589,
12,
270,
21,
16,
270,
22,
4672,
468,
2848,
3965,
374,
3361,
25,
3103,
17657,
333,
628,
8427,
67,
14937,
31,
518,
1807,
2566,
628,
326,
16069,
1177,
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,
8427,
67,
14937,
67,
1673,
1589,
12,
270,
21,
16,
270,
22,
4672,
468,
2848,
3965,
374,
3361,
25,
3103,
17657,
333,
628,
8427,
67,
14937,
31,
518,
1807,
2566,
628,
326,
16069,
1177,
434... |
if hasattr(self, 'pkgobjlist'): | if hasattr(self, 'pkgobjlist') and not self._pkgobjlist_dirty: | def __len__(self): # First check if everything is excluded all_excluded = True for (repo, cache) in self.primarydb.items(): if repo not in self._all_excludes: all_excluded = False break if all_excluded: return 0 exclude_num = 0 for repo in self.excludes: exclude_num += len(self.excludes[repo]) if hasattr(self, 'pkgobjlist'): return len(self.pkgobjlist) - exclude_num pkg_num = 0 sql = "SELECT count(pkgId) FROM packages" for repo in self.primarydb: pkg_num += self._sql_MD_pkg_num('primary', repo) return pkg_num - exclude_num | 434679afead379a530d209af2bf3439d6c5ed0ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5445/434679afead379a530d209af2bf3439d6c5ed0ac/sqlitesack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1897,
972,
12,
2890,
4672,
468,
5783,
866,
309,
7756,
353,
8845,
777,
67,
24602,
273,
1053,
364,
261,
7422,
16,
1247,
13,
316,
365,
18,
8258,
1966,
18,
3319,
13332,
309,
3538,
48... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1897,
972,
12,
2890,
4672,
468,
5783,
866,
309,
7756,
353,
8845,
777,
67,
24602,
273,
1053,
364,
261,
7422,
16,
1247,
13,
316,
365,
18,
8258,
1966,
18,
3319,
13332,
309,
3538,
48... |
lat_min=lat_min, lat_max=lat_max, lon_min=lon_max, lon_max=180., | lat_min=lat_min, lat_max=lat_max, lon_min=lon_min, lon_max=180., | def search_geo_clusters(self, meta_types=None, lat_min=None, lat_max=None, lon_min=None, lon_max=None, zoom_level=None, path='', geo_types=None, query='', approved=True, lat_center=None, lon_center=None, landscape_type=[], administrative_level=[], languages=None): """ Returns all the clusters that match the specified criteria. """ if zoom_level is None: zoom_level = 0 if lat_min is None or lat_min == '': lat_min = -90. if lat_max is None or lat_max == '': lat_max = 90. if lon_min is None or lon_min == '': lon_min = -180. if lon_max is None or lon_max == '': lon_max = 180. if lat_center is None or lat_center == '': lat_center = 0. if lon_center is None or lon_center == '': lon_center = 0. zoom_level = int(zoom_level) lat_min, lat_max = float(lat_min), float(lat_max) lon_min, lon_max = float(lon_min), float(lon_max) lat_center, lon_center = float(lat_center), float(lon_center) | 02aa5efb4054ae6ee0d7425f004d619f77e60f16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/02aa5efb4054ae6ee0d7425f004d619f77e60f16/GeoMapTool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
12376,
67,
16806,
12,
2890,
16,
2191,
67,
2352,
33,
7036,
16,
2516,
67,
1154,
33,
7036,
16,
2516,
67,
1896,
33,
7036,
16,
4281,
67,
1154,
33,
7036,
16,
4281,
67,
1896,
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,
1623,
67,
12376,
67,
16806,
12,
2890,
16,
2191,
67,
2352,
33,
7036,
16,
2516,
67,
1154,
33,
7036,
16,
2516,
67,
1896,
33,
7036,
16,
4281,
67,
1154,
33,
7036,
16,
4281,
67,
1896,
33,
... |
globals().update( locals() ) self.log.writeln('local namespace is pushed into global ') | globals().update( locals() ) self.log.writeln('local namespace is pushed into global ') | def remoteBlast( self, seqFile, db, method, e=0.01, **kw ): """ Perform a remote BLAST search using the QBLAST server at NCBI. Uses Bio.Blast.NCBIWWW.qblast (Biopython) for the search @param seqFile: file name with search sequence as FASTA @type seqFile: str @param db: database(s) to search in, e.g. ['swissprot', 'pdb'] @type db: [str] @param method: search method, e.g. 'blastp', 'fasta' @type method: str @param e: expectation value cutoff @type e: float @param kw: optional keywords:: program BLASTP, BLASTN, BLASTX, TBLASTN, or TBLASTX. database Which database to search against. sequence The sequence to search. ncbi_gi TRUE/FALSE whether to give 'gi' identifier. (default: FALSE) descriptions Number of descriptions to show. Def 500. alignments Number of alignments to show. Def 500. expect An expect value cutoff. Def 10.0. matrix Specify an alt. matrix (PAM30, PAM70, BLOSUM80, BLOSUM45). filter 'none' turns off filtering. Default uses 'seg' or 'dust'. format_type 'HTML', 'Text', 'ASN.1', or 'XML'. Def. 'HTML @type kw: any | 192f7ffa922aed1ead1fed83d7e0b2a4faaea9b9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/482/192f7ffa922aed1ead1fed83d7e0b2a4faaea9b9/SequenceSearcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2632,
38,
2722,
12,
365,
16,
3833,
812,
16,
1319,
16,
707,
16,
425,
33,
20,
18,
1611,
16,
2826,
9987,
262,
30,
3536,
11217,
279,
2632,
605,
14378,
1623,
1450,
326,
2238,
38,
14378,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2632,
38,
2722,
12,
365,
16,
3833,
812,
16,
1319,
16,
707,
16,
425,
33,
20,
18,
1611,
16,
2826,
9987,
262,
30,
3536,
11217,
279,
2632,
605,
14378,
1623,
1450,
326,
2238,
38,
14378,
1... |
"""Increase the xAstrom value in a Source object by frac. E.g | """Increase the yAstrom value in a Source object by frac. E.g | def linearYDistort(src, frac=.001): """Increase the xAstrom value in a Source object by frac. E.g src.xAstrom = 1000 --> 1001 if frac=.001 Input: src A Source object frac How much to change X by Output: A deep copy of src, with the value of xAstrom changed """ out = afwDet.Source(src) out.setYAstrom( out.getYAstrom()*(1+frac) ) return out | e3ff0ee33638a13c21dd9bf76a147b6d958a4776 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6522/e3ff0ee33638a13c21dd9bf76a147b6d958a4776/genDistortedImage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9103,
61,
5133,
499,
12,
4816,
16,
12445,
33,
18,
11664,
4672,
3536,
382,
11908,
326,
677,
21385,
520,
460,
316,
279,
4998,
733,
635,
12445,
18,
512,
18,
75,
1705,
18,
92,
21385,
520,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9103,
61,
5133,
499,
12,
4816,
16,
12445,
33,
18,
11664,
4672,
3536,
382,
11908,
326,
677,
21385,
520,
460,
316,
279,
4998,
733,
635,
12445,
18,
512,
18,
75,
1705,
18,
92,
21385,
520,
... |
author_list = '%s' % (single_list[0]) master_author_list=[(author_list, self.authors[0][1][0])] else: master_author_list = [] current_letter = self.authors[0][1][0].upper() current_author_list = [] for author in self.authors: if author[1][0] != current_letter: author_list = " • ".join(current_author_list) if len(current_author_list) == self.descriptionClip: author_list += " …" author_list = self.formatNCXText(author_list) master_author_list.append((author_list, current_letter)) current_letter = author[1][0].upper() current_author_list = [author[0]] else: if len(current_author_list) < self.descriptionClip: current_author_list.append(author[0]) author_list = " • ".join(current_author_list) if len(current_author_list) == self.descriptionClip: author_list += " …" author_list = self.formatNCXText(author_list) master_author_list.append((author_list, current_letter)) | if len(current_author_list) < self.descriptionClip: current_author_list.append(author[0]) author_list = " • ".join(current_author_list) if len(current_author_list) == self.descriptionClip: author_list += " …" author_list = self.formatNCXText(author_list) if self.verbose: print " adding '%s' to master_author_list" % current_letter master_author_list.append((author_list, current_letter)) | def generateNCXByAuthor(self, tocTitle, single_article_per_section=True): | 073710f405f291eedc7992694a78db2be7983d10 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/073710f405f291eedc7992694a78db2be7983d10/catalog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
10346,
60,
858,
3594,
12,
2890,
16,
17919,
4247,
16,
2202,
67,
11480,
67,
457,
67,
3464,
33,
5510,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
10346,
60,
858,
3594,
12,
2890,
16,
17919,
4247,
16,
2202,
67,
11480,
67,
457,
67,
3464,
33,
5510,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if EasyDialogs.AskYesNoCancel('Proceed with removing old aliases?') <= 0: sys.exit(0) LibFiles = [] allfiles = os.listdir(':') for f in allfiles: if f[-4:] == '.slb': finfo = macfs.FSSpec(f).GetFInfo() if finfo.Flags & 0x8000: os.unlink(f) else: LibFiles.append(f) | def main(): # Ask the user for the plugins directory dir, ok = macfs.GetDirectory() if not ok: sys.exit(0) os.chdir(dir.as_pathname()) # Remove old .slb aliases and collect a list of .slb files if EasyDialogs.AskYesNoCancel('Proceed with removing old aliases?') <= 0: sys.exit(0) LibFiles = [] allfiles = os.listdir(':') for f in allfiles: if f[-4:] == '.slb': finfo = macfs.FSSpec(f).GetFInfo() if finfo.Flags & 0x8000: os.unlink(f) else: LibFiles.append(f) print LibFiles # Create the new aliases. if EasyDialogs.AskYesNoCancel('Proceed with creating new ones?') <= 0: sys.exit(0) for dst, src in goals: if src in LibFiles: mkalias(src, dst) else: EasyDialogs.Message(dst+' not created: '+src+' not found') EasyDialogs.Message('All done!') | d8eb8a79456555385185782df350c39233104341 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d8eb8a79456555385185782df350c39233104341/fixfiletypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
25747,
326,
729,
364,
326,
4799,
1867,
1577,
16,
1529,
273,
5318,
2556,
18,
967,
2853,
1435,
309,
486,
1529,
30,
2589,
18,
8593,
12,
20,
13,
1140,
18,
343,
1214,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
25747,
326,
729,
364,
326,
4799,
1867,
1577,
16,
1529,
273,
5318,
2556,
18,
967,
2853,
1435,
309,
486,
1529,
30,
2589,
18,
8593,
12,
20,
13,
1140,
18,
343,
1214,
12,
... | |
if_modified_since = context.request.get_header('if-modified-since') if if_modified_since is None: return | def check_cache(cls, server, context): # Check for the request header If-Modified-Since if_modified_since = context.request.get_header('if-modified-since') if if_modified_since is None: return | 06dfa808e5c9a65280a7d5f29118e45e67ef8936 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/06dfa808e5c9a65280a7d5f29118e45e67ef8936/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
2493,
12,
6429,
16,
1438,
16,
819,
4672,
468,
2073,
364,
326,
590,
1446,
971,
17,
4575,
17,
9673,
309,
67,
7342,
67,
9256,
273,
819,
18,
2293,
18,
588,
67,
3374,
2668,
430,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
866,
67,
2493,
12,
6429,
16,
1438,
16,
819,
4672,
468,
2073,
364,
326,
590,
1446,
971,
17,
4575,
17,
9673,
309,
67,
7342,
67,
9256,
273,
819,
18,
2293,
18,
588,
67,
3374,
2668,
430,
... | |
self.obsolete = True | self.obsolete = True | def __init__(self, ontology, oboStanza = None, *args, **keywordArgs): object.__init__(self, *args, **keywordArgs) if not isinstance(ontology, Ontology.Ontology): raise ValueError, gettext('The first argument must be an Ontology instance') self.ontology = ontology self.oboStanza = oboStanza self.identifier = None self.name = None self.abbreviation = None self.partOf = None self.parts = [] self.obsolete = False if self.oboStanza is not None: self.identifier = self.oboStanza.id.value self.name = self.oboStanza.name.value # If this term has 'part-of' relationship then try to set the parent term. for relationship in self.oboStanza.relationship or []: if relationship.relationship == 'part_of': parentId = relationship.value if parentId in self.ontology: parentTerm = self.ontology[parentId] self.partOf = parentTerm parentTerm.parts.append(self) else: # The parent of this term has not been loaded yet. Store its ID and look it up later. self.partOf = parentId # Grab any abbreviation. for synonym in self.oboStanza.synonyms or []: if 'ABBREVIATION' in synonym.types: self.abbreviation = synonym.value # TODO: grab other synonyms? if self.oboStanza.definition is not None and self.oboStanza.definition.value == 'Obsolete.': self.obsolete = True | 1fa538ab787e2830a0a53f69de475b64a0426a2c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6368/1fa538ab787e2830a0a53f69de475b64a0426a2c/OntologyTerm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
21598,
16,
320,
1075,
510,
15214,
273,
599,
16,
380,
1968,
16,
2826,
11041,
2615,
4672,
733,
16186,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
11041,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
21598,
16,
320,
1075,
510,
15214,
273,
599,
16,
380,
1968,
16,
2826,
11041,
2615,
4672,
733,
16186,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
11041,
... |
pseudo_emission = asarray(pseudo_emission) | pseudo_emission = numpy.asarray(pseudo_emission) | def train_visible(states, alphabet, training_data, pseudo_initial=None, pseudo_transition=None, pseudo_emission=None): """train_visible(states, alphabet, training_data[, pseudo_initial] [, pseudo_transition][, pseudo_emission]) -> MarkovModel Train a visible MarkovModel using maximum likelihoood estimates for each of the parameters. states is a list of strings that describe the names of each state. alphabet is a list of objects that indicate the allowed outputs. training_data is a list of (outputs, observed states) where outputs is a list of the emission from the alphabet, and observed states is a list of states from states. pseudo_initial, pseudo_transition, and pseudo_emission are optional parameters that you can use to assign pseudo-counts to different matrices. They should be matrices of the appropriate size that contain numbers to add to each parameter matrix """ N, M = len(states), len(alphabet) if pseudo_initial!=None: pseudo_initial = asarray(pseudo_initial) if pseudo_initial.shape != (N,): raise ValueError("pseudo_initial not shape len(states)") if pseudo_transition!=None: pseudo_transition = asarray(pseudo_transition) if pseudo_transition.shape != (N,N): raise ValueError("pseudo_transition not shape " + \ "len(states) X len(states)") if pseudo_emission!=None: pseudo_emission = asarray(pseudo_emission) if pseudo_emission.shape != (N,M): raise ValueError("pseudo_emission not shape " + \ "len(states) X len(alphabet)") # Training data is given as a list of members of the alphabet. # Replace those with indexes into the alphabet list for easier # computation. training_states, training_outputs = [], [] states_indexes = itemindex(states) outputs_indexes = itemindex(alphabet) for toutputs, tstates in training_data: if len(tstates) != len(toutputs): raise ValueError("states and outputs not aligned") training_states.append([states_indexes[x] for x in tstates]) training_outputs.append([outputs_indexes[x] for x in toutputs]) x = _mle(N, M, training_outputs, training_states, pseudo_initial, pseudo_transition, pseudo_emission) p_initial, p_transition, p_emission = x return MarkovModel(states, alphabet, p_initial, p_transition, p_emission) | c89840cf25ab64ca2eb9e3818dfc5a7a4e94f6ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7167/c89840cf25ab64ca2eb9e3818dfc5a7a4e94f6ef/MarkovModel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4691,
67,
8613,
12,
7992,
16,
10877,
16,
8277,
67,
892,
16,
12454,
67,
6769,
33,
7036,
16,
12454,
67,
14936,
33,
7036,
16,
12454,
67,
351,
19710,
33,
7036,
4672,
3536,
9754,
67,
8613,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4691,
67,
8613,
12,
7992,
16,
10877,
16,
8277,
67,
892,
16,
12454,
67,
6769,
33,
7036,
16,
12454,
67,
14936,
33,
7036,
16,
12454,
67,
351,
19710,
33,
7036,
4672,
3536,
9754,
67,
8613,
... |
'to be a string or None, not %s'%repr(new_url) ) | 'to be a string or None, not %r' % new_url) | def change_response(status, headers, exc_info=None): status_code = status.split(' ') try: code = int(status_code[0]) except (ValueError, TypeError): raise Exception( 'StatusBasedForward middleware ' 'received an invalid status code %s'%repr(status_code[0]) ) message = ' '.join(status_code[1:]) new_url = self.mapper( code, message, environ, self.global_conf, **self.params ) if not (new_url == None or isinstance(new_url, str)): raise TypeError( 'Expected the url to internally ' 'redirect to in the StatusBasedForward mapper' 'to be a string or None, not %s'%repr(new_url) ) if new_url: url.append([new_url, status, headers]) else: return start_response(status, headers, exc_info) | be845c1a4de6aea43515c95e3095c238415e1607 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2097/be845c1a4de6aea43515c95e3095c238415e1607/errordocument.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
67,
2740,
12,
2327,
16,
1607,
16,
3533,
67,
1376,
33,
7036,
4672,
1267,
67,
710,
273,
1267,
18,
4939,
2668,
8624,
775,
30,
981,
273,
509,
12,
2327,
67,
710,
63,
20,
5717,
1335,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2549,
67,
2740,
12,
2327,
16,
1607,
16,
3533,
67,
1376,
33,
7036,
4672,
1267,
67,
710,
273,
1267,
18,
4939,
2668,
8624,
775,
30,
981,
273,
509,
12,
2327,
67,
710,
63,
20,
5717,
1335,... |
(mi.title, None, series_index, aus)) | (title, None, series_index, aus)) | def import_book(self, mi, formats, notify=True): series_index = 1 if mi.series_index is None else mi.series_index if not mi.authors: mi.authors = [_('Unknown')] aus = mi.author_sort if mi.author_sort else ', '.join(mi.authors) obj = self.conn.execute('INSERT INTO books(title, uri, series_index, author_sort) VALUES (?, ?, ?, ?)', (mi.title, None, series_index, aus)) id = obj.lastrowid self.data.books_added([id], self.conn) self.set_path(id, True) self.set_metadata(id, mi) for path in formats: ext = os.path.splitext(path)[1][1:].lower() if ext == 'opf': continue stream = open(path, 'rb') self.add_format(id, ext, stream, index_is_id=True) self.conn.commit() self.data.refresh_ids(self.conn, [id]) # Needed to update format list and size if notify: self.notify('add', [id]) | 2b4a4a31e362e03d5f6e1b1faafa349eb1792857 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/2b4a4a31e362e03d5f6e1b1faafa349eb1792857/database2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
3618,
12,
2890,
16,
12837,
16,
6449,
16,
5066,
33,
5510,
4672,
4166,
67,
1615,
273,
404,
309,
12837,
18,
10222,
67,
1615,
353,
599,
469,
12837,
18,
10222,
67,
1615,
309,
486,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3618,
12,
2890,
16,
12837,
16,
6449,
16,
5066,
33,
5510,
4672,
4166,
67,
1615,
273,
404,
309,
12837,
18,
10222,
67,
1615,
353,
599,
469,
12837,
18,
10222,
67,
1615,
309,
486,... |
h1 = Numeric.zeros(N[0],'d') h2 = Numeric.zeros(N[1],'d') | h1 = zeros(N[0],'d') h2 = zeros(N[1],'d') | def hilbert2(x,N=None): """Return the '2-D' hilbert transform of x of length N. """ x = asarray(x) x = asarray(x) if N is None: N = x.shape if len(N) < 2: if N <=0: raise ValueError, "N must be positive." N = (N,N) if numpy.iscomplexobj(x): print "Warning: imaginary part of x ignored." x = numpy.real(x) print N Xf = fft2(x,N,axes=(0,1)) h1 = Numeric.zeros(N[0],'d') h2 = Numeric.zeros(N[1],'d') for p in range(2): h = eval("h%d"%(p+1)) N1 = N[p] if N1 % 2 == 0: h[0] = h[N1/2] = 1 h[1:N1/2] = 2 else: h[0] = 1 h[1:(N1+1)/2] = 2 exec("h%d = h" % (p+1), globals(), locals()) h = h1[:,NewAxis] * h2[NewAxis,:] k = len(x.shape) while k > 2: h = h[:,Numeric.NewAxis] k -= 1 x = ifft2(Xf*h,axes=(0,1)) return x | 936da8591e6b92539aeda1c0c884ca93d37a2754 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/936da8591e6b92539aeda1c0c884ca93d37a2754/signaltools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
366,
330,
25925,
22,
12,
92,
16,
50,
33,
7036,
4672,
3536,
990,
326,
296,
22,
17,
40,
11,
366,
330,
25925,
2510,
434,
619,
434,
769,
423,
18,
3536,
619,
273,
10455,
12,
92,
13,
619... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
366,
330,
25925,
22,
12,
92,
16,
50,
33,
7036,
4672,
3536,
990,
326,
296,
22,
17,
40,
11,
366,
330,
25925,
2510,
434,
619,
434,
769,
423,
18,
3536,
619,
273,
10455,
12,
92,
13,
619... |
utils.eprint(procRM.getMessage()) | utils.eprint("%s\n\n" % procRM.getMessage()) | def dlfs_rm(path, msg): procRM = se_utils.se_rm(path) if procRM.wait() != 0: print "\t\tUnable to remove %s!" % msg utils.eprint(procRM.getMessage()) | 45e0a8366ef09ad2b9900eb80d335aaa03af6bdc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/45e0a8366ef09ad2b9900eb80d335aaa03af6bdc/downloadFromSE.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8910,
2556,
67,
8864,
12,
803,
16,
1234,
4672,
5418,
8717,
273,
695,
67,
5471,
18,
307,
67,
8864,
12,
803,
13,
309,
5418,
8717,
18,
7048,
1435,
480,
374,
30,
1172,
1548,
88,
64,
88,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8910,
2556,
67,
8864,
12,
803,
16,
1234,
4672,
5418,
8717,
273,
695,
67,
5471,
18,
307,
67,
8864,
12,
803,
13,
309,
5418,
8717,
18,
7048,
1435,
480,
374,
30,
1172,
1548,
88,
64,
88,
... |
r'(?P<option>[-\w_.*,(){}]+)' | r'(?P<option>[]\-[\w_.*,(){}]+)' | def remove_section(self, section): """Remove a file section.""" if self.__sections.has_key(section): del self.__sections[section] return 1 else: return 0 | bd3109add24d2e9ee3659bc3fa8c0c1329c8b9e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/bd3109add24d2e9ee3659bc3fa8c0c1329c8b9e3/ConfigParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
3464,
12,
2890,
16,
2442,
4672,
3536,
3288,
279,
585,
2442,
12123,
309,
365,
16186,
11657,
18,
5332,
67,
856,
12,
3464,
4672,
1464,
365,
16186,
11657,
63,
3464,
65,
327,
404,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
3464,
12,
2890,
16,
2442,
4672,
3536,
3288,
279,
585,
2442,
12123,
309,
365,
16186,
11657,
18,
5332,
67,
856,
12,
3464,
4672,
1464,
365,
16186,
11657,
63,
3464,
65,
327,
404,
... |
print " Function evaluations: %d" % _powell_funcalls | print " Function evaluations: %d" % fcalls[0] | def fmin_powell(func, x0, args=(), xtol=1e-4, ftol=1e-4, maxiter=None, maxfun=None, full_output=0, disp=1, retall=0): """Minimize a function using modified Powell's method. Description: Uses a modification of Powell's method to find the minimum of a function of N variables Inputs: func -- the Python function or method to be minimized. x0 -- the initial guess. args -- extra arguments for func. Outputs: (xopt, {fopt, xi, direc, iter, funcalls, warnflag}, {allvecs}) xopt -- minimizer of function fopt -- value of function at minimum: fopt = func(xopt) direc -- current direction set iter -- number of iterations funcalls -- number of function calls warnflag -- Integer warning flag: 1 : 'Maximum number of function evaluations.' 2 : 'Maximum number of iterations.' allvecs -- a list of solutions at each iteration Additional Inputs: xtol -- line-search error tolerance. ftol -- acceptable relative error in func(xopt) for convergence. maxiter -- the maximum number of iterations to perform. maxfun -- the maximum number of function evaluations. full_output -- non-zero if fval and warnflag outputs are desired. disp -- non-zero to print convergence messages. retall -- non-zero to return a list of the solution at each iteration """ global _powell_funcalls x = asarray(x0) if retall: allvecs = [x] N = len(x) rank = len(x.shape) if not -1 < rank < 2: raise ValueError, "Initial guess must be a scalar or rank-1 sequence." if maxiter is None: maxiter = N * 1000 if maxfun is None: maxfun = N * 1000 direc = eye(N,typecode='d') fval = squeeze(apply(func, (x,)+args)) _powell_funcalls = 1 x1 = x.copy() iter = 0; ilist = range(N) while 1: fx = fval bigind = 0 delta = 0.0 for i in ilist: direc1 = direc[i] fx2 = fval fval, x, direc1 = _linesearch_powell(func, x, direc1, args=args, tol=xtol*100) if (fx2 - fval) > delta: delta = fx2 - fval bigind = i iter += 1 if retall: allvecs.append(x) if (2.0*(fx - fval) <= ftol*(abs(fx)+abs(fval))+1e-20): break if _powell_funcalls >= maxfun: break if iter >= maxiter: break # Construct the extrapolated point direc1 = x - x1 x2 = 2*x - x1 x1 = x.copy() fx2 = squeeze(apply(func, (x2,)+args)) _powell_funcalls +=1 if (fx > fx2): t = 2.0*(fx+fx2-2.0*fval) temp = (fx-fval-delta) t *= temp*temp temp = fx-fx2 t -= delta*temp*temp if t < 0.0: fval, x, direc1 = _linesearch_powell(func, x, direc1, args=args, tol=xtol*100) direc[bigind] = direc[-1] direc[-1] = direc1 warnflag = 0 if _powell_funcalls >= maxfun: warnflag = 1 if disp: print "Warning: Maximum number of function evaluations has "\ "been exceeded." elif iter >= maxiter: warnflag = 2 if disp: print "Warning: Maximum number of iterations has been exceeded" else: if disp: print "Optimization terminated successfully." print " Current function value: %f" % fval print " Iterations: %d" % iter print " Function evaluations: %d" % _powell_funcalls x = squeeze(x) if full_output: retlist = x, fval, direc, iter, _powell_funcalls, warnflag if retall: retlist += (allvecs,) else: retlist = x if retall: retlist = (x, allvecs) return retlist | 926e615eebcd9f2ca3373b1887f74b532b10bda4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/926e615eebcd9f2ca3373b1887f74b532b10bda4/optimize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
1154,
67,
23509,
1165,
12,
644,
16,
619,
20,
16,
833,
33,
9334,
619,
3490,
33,
21,
73,
17,
24,
16,
284,
3490,
33,
21,
73,
17,
24,
16,
25743,
33,
7036,
16,
943,
12125,
33,
70... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
284,
1154,
67,
23509,
1165,
12,
644,
16,
619,
20,
16,
833,
33,
9334,
619,
3490,
33,
21,
73,
17,
24,
16,
284,
3490,
33,
21,
73,
17,
24,
16,
25743,
33,
7036,
16,
943,
12125,
33,
70... |
out = reduce(lambda x,y: audioop.add(x, y, 2), divsamples) | if divsamples: out = reduce(lambda x,y: audioop.add(x, y, 2), divsamples) else: out = '' | def mixAudio(self): import audioop self._audioOut = {} samples = self._audioIn.items() power = [ (audioop.rms(x[1],2),x[1], x[0]) for x in samples ] power.sort(); power.reverse() speakers = Set([x[2] for x in power[:self._maxSpeakers]]) # First we calculate the 'default' audio. Used for everyone who's # not a speaker in the room. samples = [ x[1] for x in power[:self._maxSpeakers] ] divsamples = [ audioop.mul(x, 2, len(samples)) for x in samples ] out = reduce(lambda x,y: audioop.add(x, y, 2), divsamples) self._audioOutDefault = out | df888c2bcc1eba4d7a46e8c2e8092107f6819ac6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1265/df888c2bcc1eba4d7a46e8c2e8092107f6819ac6/conferencing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6843,
12719,
12,
2890,
4672,
1930,
7447,
556,
365,
6315,
11509,
1182,
273,
2618,
5216,
273,
365,
6315,
11509,
382,
18,
3319,
1435,
7212,
273,
306,
261,
11509,
556,
18,
29716,
12,
92,
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,
6843,
12719,
12,
2890,
4672,
1930,
7447,
556,
365,
6315,
11509,
1182,
273,
2618,
5216,
273,
365,
6315,
11509,
382,
18,
3319,
1435,
7212,
273,
306,
261,
11509,
556,
18,
29716,
12,
92,
63,... |
self._checkme() | def peekvalue(self, index_from_top=0): index = self.valuestackdepth + ~index_from_top assert index >= 0, "peek past the bottom of the stack" return self.valuestack_w[index] self._checkme() | 8fc109cbc472f1192978cdd91012f9fc407c486b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/8fc109cbc472f1192978cdd91012f9fc407c486b/pyframe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8032,
1132,
12,
2890,
16,
770,
67,
2080,
67,
3669,
33,
20,
4672,
770,
273,
365,
18,
4531,
395,
484,
5979,
397,
4871,
1615,
67,
2080,
67,
3669,
1815,
770,
1545,
374,
16,
315,
347,
383... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8032,
1132,
12,
2890,
16,
770,
67,
2080,
67,
3669,
33,
20,
4672,
770,
273,
365,
18,
4531,
395,
484,
5979,
397,
4871,
1615,
67,
2080,
67,
3669,
1815,
770,
1545,
374,
16,
315,
347,
383... | |
for (i = ss.length-1; i >= 0; --i) { if (ss[i].label == label) | i = len(ss)-1 while i >= 0: if ss[i].label == label: | def Statement(tokenizer, compilerContext): """Parses a Statement.""" tokenType = tokenizer.get(True) builder = compilerContext.builder # Cases for statements ending in a right curly return early, avoiding the # common semicolon insertion magic after this switch. if tokenType == FUNCTION: # DECLARED_FORM extends funDecls of compilerContext, STATEMENT_FORM doesn'tokenizer. if compilerContext.stmtStack.length > 1: kind = STATEMENT_FORM else: kind = DECLARED_FORM return FunctionDefinition(tokenizer, compilerContext, True, kind) elif tokenType == LEFT_CURLY: node = Statements(tokenizer, compilerContext) tokenizer.mustMatch(RIGHT_CURLY) return node elif tokenType == IF: node = builder.IF__build(tokenizer) builder.IF__setCondition(node, ParenExpression(tokenizer, compilerContext)) compilerContext.stmtStack.push(node) builder.IF__setThenPart(node, Statement(tokenizer, compilerContext)) if tokenizer.match(ELSE): builder.IF__setElsePart(node, Statement(tokenizer, compilerContext)) compilerContext.stmtStack.pop() builder.IF__finish(node) return node elif tokenType == SWITCH: # This allows CASEs after a DEFAULT, which is in the standard. node = builder.SWITCH__build(tokenizer) builder.SWITCH__setDiscriminant(node, ParenExpression(tokenizer, compilerContext)) compilerContext.stmtStack.push(node) tokenizer.mustMatch(LEFT_CURLY) tokenType = tokenizer.get() while tokenType != RIGHT_CURLY: if tokenType == DEFAULT: if node.defaultIndex >= 0: raise SyntaxError("More than one switch default", tokenizer) childNode = builder.DEFAULT__build(tokenizer) builder.SWITCH__setDefaultIndex(node, node.cases.length) tokenizer.mustMatch(COLON) builder.DEFAULT__initializeStatements(childNode, tokenizer) while ((tokenType=tokenizer.peek(True)) != CASE and tokenType != DEFAULT and tokenType != RIGHT_CURLY) builder.DEFAULT__addStatement(childNode, Statement(tokenizer, compilerContext)) builder.DEFAULT__finish(childNode) break elif tokenType == CASE: childNode = builder.CASE__build(tokenizer) builder.CASE__setLabel(childNode, Expression(tokenizer, compilerContext, COLON)) tokenizer.mustMatch(COLON) builder.CASE__initializeStatements(childNode, tokenizer) while ((tokenType=tokenizer.peek(True)) != CASE and tokenType != DEFAULT and tokenType != RIGHT_CURLY) builder.CASE__addStatement(childNode, Statement(tokenizer, compilerContext)) builder.CASE__finish(childNode) break else: raise SyntaxError("Invalid switch case", tokenizer) builder.SWITCH__addCase(node, childNode) tokenType = tokenizer.get() compilerContext.stmtStack.pop() builder.SWITCH__finish(node) return node elif tokenType == FOR: node = builder.FOR__build(tokenizer) if tokenizer.match(IDENTIFIER) and tokenizer.token.value == "each": builder.FOR__rebuildForEach(node) tokenizer.mustMatch(LEFT_PAREN) tokenType = tokenizer.peek() if tokenType != SEMICOLON: compilerContext.inForLoopInit = True if tokenType == VAR or tokenType == CONST: tokenizer.get() childNode = Variables(tokenizer, compilerContext) elif tokenType == LET: tokenizer.get() if tokenizer.peek() == LEFT_PAREN: childNode = LetBlock(tokenizer, compilerContext, False) else: # Let in for head, we need to add an implicit block # around the rest of the for. forBlock = builder.BLOCK__build(tokenizer, compilerContext.blockId++) compilerContext.stmtStack.push(forBlock) childNode = Variables(tokenizer, compilerContext, forBlock) else: childNode = Expression(tokenizer, compilerContext) compilerContext.inForLoopInit = False if childNode and tokenizer.match(IN): builder.FOR__rebuildForIn(node) builder.FOR__setObject(node, Expression(tokenizer, compilerContext), forBlock) if childNode.type == VAR or childNode.type == LET: if len(childNode) != 1: raise SyntaxError("Invalid for..in left-hand side", tokenizer) builder.FOR__setIterator(node, childNode[0], childNode, forBlock) else: builder.FOR__setIterator(node, childNode, null, forBlock) else: builder.FOR__setSetup(node, childNode) tokenizer.mustMatch(SEMICOLON) if node.isEach: raise SyntaxError("Invalid for each..in loop") builder.FOR__setCondition(node, (tokenizer.peek() == SEMICOLON) ? null : Expression(tokenizer, compilerContext)) tokenizer.mustMatch(SEMICOLON) builder.FOR__setUpdate(node, (tokenizer.peek() == RIGHT_PAREN) ? null : Expression(tokenizer, compilerContext)) tokenizer.mustMatch(RIGHT_PAREN) builder.FOR__setBody(node, nest(tokenizer, compilerContext, node, Statement)) if forBlock: builder.BLOCK__finish(forBlock) compilerContext.stmtStack.pop() builder.FOR__finish(node) return node elif tokenType == WHILE: node = builder.WHILE__build(tokenizer) builder.WHILE__setCondition(node, ParenExpression(tokenizer, compilerContext)) builder.WHILE__setBody(node, nest(tokenizer, compilerContext, node, Statement)) builder.WHILE__finish(node) return node elif tokenType == DO: node = builder.DO__build(tokenizer) builder.DO__setBody(node, nest(tokenizer, compilerContext, node, Statement, WHILE)) builder.DO__setCondition(node, ParenExpression(tokenizer, compilerContext)) builder.DO__finish(node) if not compilerContext.ecmaStrictMode: # <script language="JavaScript"> (without version hints) may need # automatic semicolon insertion without a newline after do-while. # See http://bugzilla.mozilla.org/show_bug.cgi?id=238945. tokenizer.match(SEMICOLON) return node # NO RETURN elif tokenType == BREAK or tokenType == CONTINUE: if tokenType == BREAK: node = builder.BREAK__build(tokenizer) else: node = builder.CONTINUE__build(tokenizer) if tokenizer.peekOnSameLine() == IDENTIFIER: tokenizer.get() if tokenType == BREAK: builder.BREAK__setLabel(node, tokenizer.token.value) else: builder.CONTINUE__setLabel(node, tokenizer.token.value) ss = compilerContext.stmtStack i = ss.length label = node.label if label: while True: i -= 1 if i < 0: raise SyntaxError("Label not found", tokenizer) if ss[i].label == label: break # # Both break and continue to label need to be handled specially # within a labeled loop, so that they target that loop. If not in # a loop, then break targets its labeled statement. Labels can be # nested so we skip all labels immediately enclosing the nearest # non-label statement. # while i < ss.length - 1 and ss[i+1].type == LABEL: i++ if i < ss.length - 1 and ss[i+1].isLoop: i++ elif tokenType == CONTINUE: raise SyntaxError("Invalid continue", tokenizer) else: while True: i -= 1 if i < 0: raise SyntaxError("Invalid " + ((tokenType == BREAK) ? "break" : "continue")) if ss[i].isLoop or (tokenType == BREAK and ss[i].type == SWITCH): break if tokenType == BREAK: builder.BREAK__setTarget(node, ss[i]) builder.BREAK__finish(node) else: builder.CONTINUE__setTarget(node, ss[i]) builder.CONTINUE__finish(node) # NO RETURN elif tokenType == TRY: node = builder.TRY__build(tokenizer) builder.TRY__setTryBlock(node, Block(tokenizer, compilerContext)) while tokenizer.match(CATCH): childNode = builder.CATCH__build(tokenizer) tokenizer.mustMatch(LEFT_PAREN) nextTokenType = tokenizer.get() if nextTokenType == LEFT_BRACKET or nextTokenType == LEFT_CURLY: # Destructured catch identifiers. tokenizer.unget() builder.CATCH__setVarName(childNode, DestructuringExpression(tokenizer, compilerContext, True)) elif nextTokenType == IDENTIFIER: builder.CATCH__setVarName(childNode, tokenizer.token.value) else: raise SyntaxError("Missing identifier in catch", tokenizer) if tokenizer.match(IF): if compilerContext.ecma3OnlyMode: raise SyntaxError("Illegal catch guard", tokenizer) if node.catchClauses.length and not node.catchClauses.top().guard: raise SyntaxError("Guarded catch after unguarded", tokenizer) builder.CATCH__setGuard(childNode, Expression(tokenizer, compilerContext)) else: builder.CATCH__setGuard(childNode, null) tokenizer.mustMatch(RIGHT_PAREN) builder.CATCH__setBlock(childNode, Block(tokenizer, compilerContext)) builder.CATCH__finish(childNode) builder.TRY__addCatch(node, childNode) builder.TRY__finishCatches(node) if tokenizer.match(FINALLY): builder.TRY__setFinallyBlock(node, Block(tokenizer, compilerContext)) if not node.catchClauses.length and not node.finallyBlock: raise SyntaxError("Invalid try statement", tokenizer) builder.TRY__finish(node) return node elif tokenType == CATCH or tokenType == FINALLY: raise SyntaxError(tokens[tokenType] + " without preceding try") elif tokenType == THROW: node = builder.THROW__build(tokenizer) builder.THROW__setException(node, Expression(tokenizer, compilerContext)) builder.THROW__finish(node) # NO RETURN elif tokenType == RETURN: node = returnOrYield(tokenizer, compilerContext) # NO RETURN elif tokenType == WITH: node = builder.WITH__build(tokenizer) builder.WITH__setObject(node, ParenExpression(tokenizer, compilerContext)) builder.WITH__setBody(node, nest(tokenizer, compilerContext, node, Statement)) builder.WITH__finish(node) return node elif tokenType == VAR or tokenType == CONST: node = Variables(tokenizer, compilerContext) # NO RETURN elif tokenType == LET: if tokenizer.peek() == LEFT_PAREN: node = LetBlock(tokenizer, compilerContext, True) else node = Variables(tokenizer, compilerContext) # NO RETURN elif tokenType == DEBUGGER: node = builder.DEBUGGER__build(tokenizer) # NO RETURN elif tokenType == NEWLINE or tokenType == SEMICOLON: node = builder.SEMICOLON__build(tokenizer) builder.SEMICOLON__setExpression(node, null) builder.SEMICOLON__finish(tokenizer) return node else: if tokenType == IDENTIFIER: tokenType = tokenizer.peek() # Labeled statement. if tokenType == COLON: label = tokenizer.token.value ss = compilerContext.stmtStack for (i = ss.length-1; i >= 0; --i) { if (ss[i].label == label) raise SyntaxError("Duplicate label") } tokenizer.get() node = builder.LABEL__build(tokenizer) builder.LABEL__setLabel(node, label) builder.LABEL__setStatement(node, nest(tokenizer, compilerContext, node, Statement)) builder.LABEL__finish(node) return node # Expression statement. # We unget the current token to parse the expression as a whole. node = builder.SEMICOLON__build(tokenizer) tokenizer.unget() builder.SEMICOLON__setExpression(node, Expression(tokenizer, compilerContext)) node.end = node.expression.end builder.SEMICOLON__finish(node) # NO RETURN MagicalSemicolon(tokenizer) return node | e84674e67dd665fd11d61644e7a7afffaad25771 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/e84674e67dd665fd11d61644e7a7afffaad25771/Parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8056,
12,
2316,
1824,
16,
5274,
1042,
4672,
3536,
6656,
279,
8056,
12123,
225,
22302,
273,
10123,
18,
588,
12,
5510,
13,
2089,
273,
5274,
1042,
18,
9574,
225,
468,
385,
3304,
364,
6317,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8056,
12,
2316,
1824,
16,
5274,
1042,
4672,
3536,
6656,
279,
8056,
12123,
225,
22302,
273,
10123,
18,
588,
12,
5510,
13,
2089,
273,
5274,
1042,
18,
9574,
225,
468,
385,
3304,
364,
6317,
... |
callFromThread(self.buff.append,val) | callFromThread(self.buff.extend,val) | def process(self): ''' This is called in the 'source' thread, and just basically sucks the iterator, appending items back to the main thread. ''' from twisted.internet.reactor import callFromThread try: while 1: val = self.source.next() callFromThread(self.buff.append,val) except StopIteration: callFromThread(self.stop) | ba18f3b8e8bc43496892b7fe4507e1f8530cde36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ba18f3b8e8bc43496892b7fe4507e1f8530cde36/flow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12,
2890,
4672,
9163,
1220,
353,
2566,
316,
326,
296,
3168,
11,
2650,
16,
471,
2537,
23772,
1597,
363,
87,
326,
2775,
16,
19997,
1516,
1473,
358,
326,
2774,
2650,
18,
9163,
628,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12,
2890,
4672,
9163,
1220,
353,
2566,
316,
326,
296,
3168,
11,
2650,
16,
471,
2537,
23772,
1597,
363,
87,
326,
2775,
16,
19997,
1516,
1473,
358,
326,
2774,
2650,
18,
9163,
628,
... |
self.moviePlayerDashboard.setGeometry(QRect(0,19,1087,29)) | self.moviePlayerDashboard.setGeometry(QRect(0,19,1084,29)) | def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar() | e860bf4c1454394fa1c8688dfa1029ac4ad0a5f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/e860bf4c1454394fa1c8688dfa1029ac4ad0a5f8/MainWindowUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2938,
273,
599,
16,
529,
273,
599,
16,
2242,
273,
374,
4672,
2238,
6376,
3829,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
2242,
13,
365,
18,
23... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2938,
273,
599,
16,
529,
273,
599,
16,
2242,
273,
374,
4672,
2238,
6376,
3829,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
2242,
13,
365,
18,
23... |
mkdir -p $RPM_BUILD_ROOT/usr/lib/PYTHONV/lib-dynload mkdir -p $RPM_BUILD_ROOT/usr/lib/PYTHONV/site-packages | mkdir -p $RPM_BUILD_ROOT/usr/lib/$PYTHONV/lib-dynload mkdir -p $RPM_BUILD_ROOT/usr/lib/$PYTHONV/site-packages | def printUsage(): sys.exit("usage: maketarball [version]") | 436ae20d95e5984ad6e1c983024fc0d697d1fb0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/436ae20d95e5984ad6e1c983024fc0d697d1fb0b/maketarball.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
5357,
13332,
2589,
18,
8593,
2932,
9167,
30,
29796,
278,
23846,
306,
1589,
4279,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1172,
5357,
13332,
2589,
18,
8593,
2932,
9167,
30,
29796,
278,
23846,
306,
1589,
4279,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if not dotG.get_node(each_edge.get_destination()): | if not G.has_node(each_edge.get_destination()): | def read(string): """ Read a graph from a string in Dot language and return it. Nodes and edges specified in the input will be added to the current graph. @type string: string @param string: Input string in Dot format specifying a graph. @rtype: graph @return: Graph """ dotG = pydot.graph_from_dot_data(string) if (dotG.get_type() == "graph"): G = graph() elif (dotG.get_type() == "digraph"): G = digraph() elif (dotG.get_type() == "hypergraph"): return read_hypergraph(string) else: raise InvalidGraphType # Read nodes... # Note: If the nodes aren't explicitly listed, they need to be for each_node in dotG.get_nodes(): G.add_node(each_node.get_name()) for each_attr_key, each_attr_val in each_node.get_attributes().items(): G.add_node_attribute(each_node.get_name(), (each_attr_key, each_attr_val)) # Read edges... for each_edge in dotG.get_edges(): # Check if the nodes have been added if not dotG.get_node(each_edge.get_source()): G.add_node(each_edge.get_source()) if not dotG.get_node(each_edge.get_destination()): G.add_node(each_edge.get_destination()) # See if there's a weight if 'weight' in each_edge.get_attributes().keys(): _wt = each_edge.get_attributes()['weight'] else: _wt = 1 # See if there is a label if 'label' in each_edge.get_attributes().keys(): _label = each_edge.get_attributes()['label'] else: _label = '' G.add_edge((each_edge.get_source(), each_edge.get_destination()), wt = _wt, label = _label) for each_attr_key, each_attr_val in each_edge.get_attributes().items(): if not each_attr_key in ['weight', 'label']: G.add_edge_attribute((each_edge.get_source(), each_edge.get_destination()), \ (each_attr_key, each_attr_val)) return G | 8291004b970248038af24e4dfc5dfd1d52821d79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4687/8291004b970248038af24e4dfc5dfd1d52821d79/dot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
1080,
4672,
3536,
2720,
279,
2667,
628,
279,
533,
316,
17502,
2653,
471,
327,
518,
18,
14037,
471,
5231,
1269,
316,
326,
810,
903,
506,
3096,
358,
326,
783,
2667,
18,
225,
632... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
1080,
4672,
3536,
2720,
279,
2667,
628,
279,
533,
316,
17502,
2653,
471,
327,
518,
18,
14037,
471,
5231,
1269,
316,
326,
810,
903,
506,
3096,
358,
326,
783,
2667,
18,
225,
632... |
``level`` - (integer): the level. ``weight`` - (integer): the weight. | - ``level`` - (integer): the level. - ``weight`` - (integer): the weight. | def __repr__(self): """ String representation. | e265517a575a65b09b817a2b1feaf73c31f0ba93 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/e265517a575a65b09b817a2b1feaf73c31f0ba93/manin_symbols.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
3536,
514,
4335,
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,
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,
12715,
972,
12,
2890,
4672,
3536,
514,
4335,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
msg = "The combination %s is not unique in the frame cache file" % str(key) | msg = "The combination %s is not unique in the frame cache file" \ % str(key) | def parse(self): """ Each line of the frame cache file is like the following: | a7bd5749d7e3884dc25892a5f5265bab9a159fab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/a7bd5749d7e3884dc25892a5f5265bab9a159fab/pipeline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
4672,
3536,
8315,
980,
434,
326,
2623,
1247,
585,
353,
3007,
326,
3751,
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... | [
1,
1,
1,
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,
1109,
12,
2890,
4672,
3536,
8315,
980,
434,
326,
2623,
1247,
585,
353,
3007,
326,
3751,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self._active = active | self._active = (active < len(self._items) and [active] or [1])[0] | def _set_active(self, active): if active == self._active: return oldactive = self._active self._active = active self.emit("changed", oldactive) text, iconname = self._items[active] self.label.set_markup (self.markup[0] + text + self.markup[1]) if iconname != None: self.hbox.set_spacing(6) self.image.set_from_pixbuf(gtk.icon_theme_get_default().load_icon ( iconname, 12, gtk.ICON_LOOKUP_USE_BUILTIN)) else: self.hbox.set_spacing(0) self.image.clear() | a71c98b24e28db1cc4f2f8b451016507db2a40f1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5339/a71c98b24e28db1cc4f2f8b451016507db2a40f1/ToggleComboBox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
3535,
12,
2890,
16,
2695,
4672,
309,
2695,
422,
365,
6315,
3535,
30,
327,
1592,
3535,
273,
365,
6315,
3535,
225,
365,
6315,
3535,
273,
261,
3535,
411,
562,
12,
2890,
6315... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
3535,
12,
2890,
16,
2695,
4672,
309,
2695,
422,
365,
6315,
3535,
30,
327,
1592,
3535,
273,
365,
6315,
3535,
225,
365,
6315,
3535,
273,
261,
3535,
411,
562,
12,
2890,
6315... |
else | else: | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 914) else quickfix.StringField.__init__(self, 914, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
2468,
3461,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
2468,
3461,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738... |
'selection': ('selection', lambda s: [encode(e[1]) for e in (not callable(s) and s) or (callable(s) and s(None, cr, uid, {})) or [] ]), | 'selection': ('selection', lambda s: [encode(e[1]) for e in ((not callable(s)) and s or [])] ), | for state_name, state_def in obj2.states.iteritems(): if 'result' in state_def: result = state_def['result'] if result['type'] != 'form': continue name = "%s,%s" % (encode(obj.wiz_name), state_name) def_params = { 'string': ('wizard_field', lambda s: [encode(s)]), 'selection': ('selection', lambda s: [encode(e[1]) for e in | d9460e53c6365d15bfe8d508e8a55f4d1b27e15f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/d9460e53c6365d15bfe8d508e8a55f4d1b27e15f/translate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
364,
919,
67,
529,
16,
919,
67,
536,
316,
1081,
22,
18,
7992,
18,
2165,
3319,
13332,
309,
296,
2088,
11,
316,
919,
67,
536,
30,
563,
273,
919,
67,
536,
3292,
2088,
3546,
309,
563,
3292,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
364,
919,
67,
529,
16,
919,
67,
536,
316,
1081,
22,
18,
7992,
18,
2165,
3319,
13332,
309,
296,
2088,
11,
316,
919,
67,
536,
30,
563,
273,
919,
67,
536,
3292,
2088,
3546,
309,
563,
3292,
... |
flags = [] if _ignored_flags is None: _ignored_flags = [] if not isinstance(flags, dict): flags = dict([(s, int(s in flags)) for s in _signals]) del s if traps is not None and not isinstance(traps, dict): traps = dict([(s, int(s in traps)) for s in _signals]) del s for name, val in locals().items(): if val is None: setattr(self, name, _copy.copy(getattr(DefaultContext, name))) else: setattr(self, name, val) del self.self | self.flags = dict.fromkeys(_signals, 0) elif not isinstance(flags, dict): self.flags = dict((s, int(s in flags)) for s in _signals) else: self.flags = flags | def __init__(self, prec=None, rounding=None, traps=None, flags=None, Emin=None, Emax=None, capitals=None, _clamp=0, _ignored_flags=None): if flags is None: flags = [] if _ignored_flags is None: _ignored_flags = [] if not isinstance(flags, dict): flags = dict([(s, int(s in flags)) for s in _signals]) del s if traps is not None and not isinstance(traps, dict): traps = dict([(s, int(s in traps)) for s in _signals]) del s for name, val in locals().items(): if val is None: setattr(self, name, _copy.copy(getattr(DefaultContext, name))) else: setattr(self, name, val) del self.self | 221364a82189c9c29de01bb6c571858154f431af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/221364a82189c9c29de01bb6c571858154f431af/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
13382,
33,
7036,
16,
13885,
33,
7036,
16,
1284,
1121,
33,
7036,
16,
2943,
33,
7036,
16,
512,
1154,
33,
7036,
16,
512,
1896,
33,
7036,
16,
3523,
305,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
13382,
33,
7036,
16,
13885,
33,
7036,
16,
1284,
1121,
33,
7036,
16,
2943,
33,
7036,
16,
512,
1154,
33,
7036,
16,
512,
1896,
33,
7036,
16,
3523,
305,
10... |
self.assertEquals("\x00\x00\x00\x00\x00\x11\x11\x00", ex.object) | self.assertEquals(b"\x00\x00\x00\x00\x00\x11\x11\x00", ex.object) | def test_decode_error_attributes(self): if sys.maxunicode > 0xffff: try: "\x00\x00\x00\x00\x00\x11\x11\x00".decode("unicode_internal") except UnicodeDecodeError as ex: self.assertEquals("unicode_internal", ex.encoding) self.assertEquals("\x00\x00\x00\x00\x00\x11\x11\x00", ex.object) self.assertEquals(4, ex.start) self.assertEquals(8, ex.end) else: self.fail() | 092a225a4de9b168e541e3c57b1bee075f6382a8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/092a225a4de9b168e541e3c57b1bee075f6382a8/test_codecs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3922,
67,
1636,
67,
4350,
12,
2890,
4672,
309,
2589,
18,
1896,
9124,
405,
374,
20431,
30,
775,
30,
1548,
92,
713,
64,
92,
713,
64,
92,
713,
64,
92,
713,
64,
92,
713,
64,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3922,
67,
1636,
67,
4350,
12,
2890,
4672,
309,
2589,
18,
1896,
9124,
405,
374,
20431,
30,
775,
30,
1548,
92,
713,
64,
92,
713,
64,
92,
713,
64,
92,
713,
64,
92,
713,
64,
... |
company_vat = obj_cmpny.partner_id.vat | company_vat = obj_cmpny.partner_id.vat | def _create_xml(self, cr, uid, data, context): datas=[] # now wizard will use user->company instead of directly company from res.company | ae21cdb0eeaa8df585a2f1316935223d84ff3fe5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/ae21cdb0eeaa8df585a2f1316935223d84ff3fe5/partner_vat_listing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
2902,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
5386,
33,
8526,
468,
2037,
24204,
903,
999,
729,
2122,
16840,
3560,
434,
5122,
9395,
628,
400,
18,
16840,
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,
1652,
389,
2640,
67,
2902,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
5386,
33,
8526,
468,
2037,
24204,
903,
999,
729,
2122,
16840,
3560,
434,
5122,
9395,
628,
400,
18,
16840,
2,
... |
@echo | def make_atomic_category(atom): return AtomicCategory(atom) | ba3220a2c6b52f045b539ed94d094a73aa2cc2b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8383/ba3220a2c6b52f045b539ed94d094a73aa2cc2b9/catlab.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
27718,
67,
4743,
12,
7466,
4672,
327,
11553,
4457,
12,
7466,
13,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
27718,
67,
4743,
12,
7466,
4672,
327,
11553,
4457,
12,
7466,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
pass | ncvar2.assignValue(ncvar.getValue()) | def delete_ncattdimvar(self,ncf,ncattrs=[],ncdims=[],ncvars=[]): ''' helper function to delete attributes, dimensions and variables in a netcdffile | 24090606542c2371b096582dbd2f096326c13961 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1380/24090606542c2371b096582dbd2f096326c13961/jacapo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
82,
2574,
88,
3509,
1401,
12,
2890,
16,
82,
8522,
16,
14202,
7039,
22850,
6487,
14202,
8550,
22850,
6487,
14202,
4699,
33,
8526,
4672,
9163,
4222,
445,
358,
1430,
1677,
16,
576... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1430,
67,
82,
2574,
88,
3509,
1401,
12,
2890,
16,
82,
8522,
16,
14202,
7039,
22850,
6487,
14202,
8550,
22850,
6487,
14202,
4699,
33,
8526,
4672,
9163,
4222,
445,
358,
1430,
1677,
16,
576... |
... sage: print "Test finished !" Test finished ! | def longest_path(self, s = None, t = None, weighted = False, algorithm = "MILP", solver = None, verbose = 0): r""" Returns a longest path of ``self``. | fbdfc46fda1150428e37faef1f31cd5518ab4374 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/fbdfc46fda1150428e37faef1f31cd5518ab4374/generic_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12163,
67,
803,
12,
2890,
16,
272,
273,
599,
16,
268,
273,
599,
16,
13747,
273,
1083,
16,
4886,
273,
315,
49,
2627,
52,
3113,
12776,
273,
599,
16,
3988,
273,
374,
4672,
436,
8395,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12163,
67,
803,
12,
2890,
16,
272,
273,
599,
16,
268,
273,
599,
16,
13747,
273,
1083,
16,
4886,
273,
315,
49,
2627,
52,
3113,
12776,
273,
599,
16,
3988,
273,
374,
4672,
436,
8395,
28... | |
message = "I payed " + tr.toUser.nickname() + " $" + str(tr.amount) | message = "you payed " + tr.toUser.nickname() + " $" + str(tr.amount) | def get(self): # Get user, group and me user = users.get_current_user() group = Group.get(self.request.get("group")) goToHistoryTab = self.request.get("goToHistoryTab") me = Membership.gql("WHERE group = :1 AND user = :2", group, user)[0] # Calculate how much I owe or they owe me if me.balance != 0: if me.balance > 0: members = Membership.gql("WHERE group = :1 AND balance < 0 ORDER BY balance", group) sign = 1 else: members = Membership.gql("WHERE group = :1 AND balance > 0 ORDER BY balance DESC", group) sign = -1 balance = me.balance * sign result = [] for member in members: if balance <= 0: break result.append({'user': member.user, 'amount': min(balance, member.balance * -sign)}) balance -= member.balance * -sign else: sign = 0 result = [] # Get transaction history # TODO filtrar por grupo y por mi! try: transactionCount = int(self.request.get('transactionCount', default_value=10)) transactions_query_from = Transaction.gql("WHERE group = :1 AND fromUser = :2 ORDER BY date DESC", group, user) transactions_from = transactions_query_from.fetch(transactionCount) transactions_query_to = Transaction.gql("WHERE group = :1 AND toUser = :2 ORDER BY date DESC", group, user) transactions_to = transactions_query_to.fetch(transactionCount) transactions = transactions_from + transactions_to transactions.sort(cmp = compareTransactionsByDate) transactions = transactions[0:transactionCount] messages = [] for tr in transactions: if (tr.type == "debt"): if (tr.fromUser == user): message = "I owed " + tr.toUser.nickname() + " $" + str(tr.amount) else: message = tr.fromUser.nickname() + " owed me $" + str(tr.amount) if (tr.type == "payment"): if (tr.fromUser == user): message = "I payed " + tr.toUser.nickname() + " $" + str(tr.amount) else: message = tr.fromUser.nickname() + " payed me $" + str(tr.amount) if (tr.type == "rejectedDebt"): if (tr.fromUser == user): message = "I rejected from " + tr.toUser.nickname() + " a debt of $" + str(tr.amount) else: message = tr.fromUser.nickname() + " rejected you a debt of $" + str(tr.amount) if (tr.type == "rejectedPayment"): if (tr.fromUser == user): message = "I rejected from " + tr.toUser.nickname() + " a payment of $" + str(tr.amount) else: message = tr.fromUser.nickname() + " rejected you a payment of $" + str(tr.amount) if ( len(tr.reason) > 0 ): message = message + " due to " + tr.reason message = niceDate(tr.date) + " " + message messages.append(message) transactions = messages validationError = False validationMessage = '' except BaseException, e: transactionCount = 0 transactions = [] validationError = True validationMessage = '(This should be a number)' # Get all members members = Membership.gql("WHERE user != :1 AND group = :2", user, group) members = members.fetch(100000) hasMembers = len(members) > 0 template_values = { 'balance': me.balance * sign, 'balancePositive': sign > 0, 'balanceIsZero': sign == 0, 'result': result, 'currentUser': user, 'members': members, 'hasMembers': hasMembers, 'group': group, 'hasTransactions': len(transactions) > 0, 'transactionCount': transactionCount, 'transactions': transactions, 'validationError': validationError, 'validationMessage': validationMessage, 'groups': self.getGroups(user), 'message': self.request.get("msg"), 'goToHistoryTab': goToHistoryTab, 'signout_url': users.create_logout_url("/"), 'hasMoreThanOneItem': len(result) > 1 } path = os.path.join(os.path.dirname(__file__), 'group.html') self.response.out.write(template.render(path, template_values)) | d0b6870ff1f7c3afd9b6c96525cfdbf2d1795c20 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3133/d0b6870ff1f7c3afd9b6c96525cfdbf2d1795c20/groupHandlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
468,
968,
729,
16,
1041,
471,
1791,
729,
273,
3677,
18,
588,
67,
2972,
67,
1355,
1435,
1041,
273,
3756,
18,
588,
12,
2890,
18,
2293,
18,
588,
2932,
1655,
6,
3719... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
4672,
468,
968,
729,
16,
1041,
471,
1791,
729,
273,
3677,
18,
588,
67,
2972,
67,
1355,
1435,
1041,
273,
3756,
18,
588,
12,
2890,
18,
2293,
18,
588,
2932,
1655,
6,
3719... |
else: | elif type==2: | def getText(self,type=0,addparentheses=True): assert type>=0 and type<=2, 'Argument "type" must be 0 (identifier), 1 (short name) or 2 (long name).' if type==0 or type==1: # Return the short name of the object (optionally with slice specification). if type==0 and self.name!=None: res = self.name else: res = self.args[0].getName() if self.slice!=None: res += LazyExpression.slices2string(self.slice) return res else: # Return the long name of the object (optionally with slice specification). res = self.args[0].getLongName() if self.slice!=None: res += LazyExpression.slices2prettystring(self.slice,self.args[0].getDimensions()) return res | fd79e95faa47d373922744d73eedbf0df1db28c3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/381/fd79e95faa47d373922744d73eedbf0df1db28c3/expressions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6701,
12,
2890,
16,
723,
33,
20,
16,
1289,
13012,
7915,
281,
33,
5510,
4672,
1815,
618,
34,
33,
20,
471,
618,
32,
33,
22,
16,
296,
1379,
315,
723,
6,
1297,
506,
374,
261,
5644,
363... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6701,
12,
2890,
16,
723,
33,
20,
16,
1289,
13012,
7915,
281,
33,
5510,
4672,
1815,
618,
34,
33,
20,
471,
618,
32,
33,
22,
16,
296,
1379,
315,
723,
6,
1297,
506,
374,
261,
5644,
363... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.