rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
str = string.join(items, '; ') + ';' return str | return '; '.join(items) + ';' | def _formatStyle(self, include=''): str = '' include = string.split(include) keys = self.style.keys() if include: #2.1-safe version of the line below follows: #keys = filter(lambda k: k in include, keys) tmp = [] for word in keys: if word in include: tmp.append(word) keys = tmp | 37afe6db14252697b2c6f0bd32cd0cbf4e4ebe03 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3878/37afe6db14252697b2c6f0bd32cd0cbf4e4ebe03/renderSVG.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2139,
2885,
12,
2890,
16,
2341,
2218,
11,
4672,
609,
273,
875,
2341,
273,
533,
18,
4939,
12,
6702,
13,
1311,
273,
365,
18,
4060,
18,
2452,
1435,
309,
2341,
30,
468,
22,
18,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2139,
2885,
12,
2890,
16,
2341,
2218,
11,
4672,
609,
273,
875,
2341,
273,
533,
18,
4939,
12,
6702,
13,
1311,
273,
365,
18,
4060,
18,
2452,
1435,
309,
2341,
30,
468,
22,
18,
21,
... |
True) | True, {}) | def tagInputIfNeeded(inputFile): inputTagName = os.path.basename(inputFile) if not tagExists('local', inputTagName): debugPrint(lambda : 'Tagging input file: ' + inputFile) taskName = tagData('localhost', 'local', inputTagName, os.path.dirname(inputFile), [inputFile], False, False, False, True) blockOnTaskAndFail('local', taskName, 'Tagging input failed') else: debugPrint(lambda : 'Input tag exists') | 11df4ec1976153b8ced832d1265c02b3ed772421 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5741/11df4ec1976153b8ced832d1265c02b3ed772421/clovr_blastall.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1047,
1210,
18299,
12,
2630,
812,
4672,
810,
8520,
273,
1140,
18,
803,
18,
13909,
12,
2630,
812,
13,
309,
486,
1047,
4002,
2668,
3729,
2187,
810,
8520,
4672,
1198,
5108,
12,
14661,
294,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1047,
1210,
18299,
12,
2630,
812,
4672,
810,
8520,
273,
1140,
18,
803,
18,
13909,
12,
2630,
812,
13,
309,
486,
1047,
4002,
2668,
3729,
2187,
810,
8520,
4672,
1198,
5108,
12,
14661,
294,
... |
_do_under(0, t_off, tx) | _do_under(0, t_off+leftIndent, tx) | def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite.""" | 6c7e147d9130dacadd2fe093bd3e271add7cebe3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/6c7e147d9130dacadd2fe093bd3e271add7cebe3/paragraph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
23529,
12,
2890,
16,
4148,
33,
20,
4672,
3536,
25113,
279,
10190,
4888,
358,
326,
864,
2154,
18,
2860,
326,
727,
677,
1754,
622,
326,
5469,
18,
2288,
4183,
364,
24552,
2887,
7292,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3724,
23529,
12,
2890,
16,
4148,
33,
20,
4672,
3536,
25113,
279,
10190,
4888,
358,
326,
864,
2154,
18,
2860,
326,
727,
677,
1754,
622,
326,
5469,
18,
2288,
4183,
364,
24552,
2887,
7292,
... |
os.system('tar xzf ../data/pulse2-image-sample.tar.gz -C /var/lib/pulse2/imaging/masters/' + self.IMAGE_UUID) result = SERVER.imageDone('00:11:22:33:44:ff', self.IMAGE_UUID) | os.system('tar xzf ../data/pulse2-image-sample.tar.gz -C /var/lib/pulse2/imaging/masters/' + IMAGE_UUID) result = SERVER.imageDone('00:11:22:33:44:ff', IMAGE_UUID) | def test_08imageDone(self): """ Tell that the image is done """ # Put a sample image os.system('tar xzf ../data/pulse2-image-sample.tar.gz -C /var/lib/pulse2/imaging/masters/' + self.IMAGE_UUID) result = SERVER.imageDone('00:11:22:33:44:ff', self.IMAGE_UUID) self.assertTrue(result) | 5e412cde7890a3771c1d8c828ef609be4080f173 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5988/5e412cde7890a3771c1d8c828ef609be4080f173/pserver-imaging.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
6840,
2730,
7387,
12,
2890,
4672,
3536,
29860,
716,
326,
1316,
353,
2731,
3536,
468,
4399,
279,
3296,
1316,
1140,
18,
4299,
2668,
11718,
31850,
74,
6116,
19,
892,
19,
84,
24667... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6840,
2730,
7387,
12,
2890,
4672,
3536,
29860,
716,
326,
1316,
353,
2731,
3536,
468,
4399,
279,
3296,
1316,
1140,
18,
4299,
2668,
11718,
31850,
74,
6116,
19,
892,
19,
84,
24667... |
This is an IIntegration. | This is an ``IIntegration``. | def createWorkItem(participant, process_definition_identifier, application): """Create a work for the given participant | 112a3d53b65c13be2d65524c017987be931dc35b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9066/112a3d53b65c13be2d65524c017987be931dc35b/interfaces.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
25553,
12,
2680,
14265,
16,
1207,
67,
6907,
67,
5644,
16,
2521,
4672,
3536,
1684,
279,
1440,
364,
326,
864,
14188,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
25553,
12,
2680,
14265,
16,
1207,
67,
6907,
67,
5644,
16,
2521,
4672,
3536,
1684,
279,
1440,
364,
326,
864,
14188,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
info['browser_href.old'] = self.env.href.browser(base_path, base_rev) | info['browser_href.old'] = self.env.href.browser(base_path, rev=base_rev) | def render_html(self, req, repos, chgset, diff_options): """HTML version""" | 8433a395827d5216e9ecfb77e66bd1e6bfb87305 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8433a395827d5216e9ecfb77e66bd1e6bfb87305/Changeset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
2620,
12,
2890,
16,
1111,
16,
13686,
16,
462,
75,
542,
16,
3122,
67,
2116,
4672,
3536,
4870,
1177,
8395,
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,
1743,
67,
2620,
12,
2890,
16,
1111,
16,
13686,
16,
462,
75,
542,
16,
3122,
67,
2116,
4672,
3536,
4870,
1177,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.assertRaises(UnknownFileError, cmd.run) | self.assertRaises((UnknownFileError, CompileError), cmd.run) | def test_optional_extension(self): | c5a67d7cee057744164422a806e5164894647072 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/c5a67d7cee057744164422a806e5164894647072/test_build_ext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
10444,
67,
6447,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
10444,
67,
6447,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ValueError, "BCH codes does not exist with the given input." | raise ValueError, "BCH codes does not exist with the given input." | def BCHCode(n,delta,F,b=0): r""" A 'Bose-Chaudhuri-Hockenghem code' (or BCH code for short) is the largest possible cyclic code of length n over field F=GF(q), whose generator polynomial has zeros (which contain the set) $Z = \{a^{b},a^{b+1}, ..., a^{b+delta-2}\}$, where a is a primitive $n^{th}$ root of unity in the splitting field $GF(q^m)$, b is an integer $0\leq b\leq n-delta+1$ and m is the multiplicative order of q modulo n. (The integers $b,...,b+delta-2$ typically lie in the range $1,...,n-1$.) The integer $delta \geq 1$ is called the "designed distance". The length n of the code and the size q of the base field must be relatively prime. The generator polynomial is equal to the least common multiple of the minimal polynomials of the elements of the set $Z$ above. Special cases are b=1 (resulting codes are called 'narrow-sense' BCH codes), and $n=q^m-1$ (known as 'primitive' BCH codes). It may happen that several values of delta give rise to the same BCH code. Thlargest one is called the Bose distance of the code. The true minimum distance, d, of the code is greater than or equal to the Bose distance, so $d\geq delta$. EXAMPLES: sage: FF.<a> = GF(3^2,"a") sage: x = PolynomialRing(FF,"x").gen() sage: L = [b.minpoly() for b in [a,a^2,a^3]]; g = LCM(L) sage: f = x^(8)-1 sage: g.divides(f) True sage: C = CyclicCode(8,g); C Linear code of length 8, dimension 4 over Finite Field of size 3 sage: C.minimum_distance() 4 sage: C = BCHCode(8,3,GF(3),1); C Linear code of length 8, dimension 4 over Finite Field of size 3 sage: C.minimum_distance() 4 sage: C = BCHCode(8,3,GF(3)); C Linear code of length 8, dimension 3 over Finite Field of size 3 sage: C.minimum_distance() 5 REFERENCES: [HP] W. C. Huffman, V. Pless, Fundamentals of Error-Correcting Codes, Cambridge Univ. Press, 2003. """ q = F.order() R = IntegerModRing(n) m = R(q).multiplicative_order() FF = GF(q**m,"a"); a = FF.gen() x = PolynomialRing(FF,"x").gen() L0 = [a**i for i in range(b,b+delta)] L1 = [b.minpoly() for b in L0] g = LCM(L1) if not(g.divides(x**n-1)): ValueError, "BCH codes does not exist with the given input." return CyclicCodeFromGeneratingPolynomial(n,g) | 20170ed427652eca5f638c9a08553fce978a471e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/20170ed427652eca5f638c9a08553fce978a471e/code_constructions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
605,
1792,
1085,
12,
82,
16,
9878,
16,
42,
16,
70,
33,
20,
4672,
436,
8395,
432,
296,
38,
2584,
17,
782,
24901,
76,
1650,
17,
44,
975,
275,
17680,
351,
981,
11,
261,
280,
605,
1792... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
605,
1792,
1085,
12,
82,
16,
9878,
16,
42,
16,
70,
33,
20,
4672,
436,
8395,
432,
296,
38,
2584,
17,
782,
24901,
76,
1650,
17,
44,
975,
275,
17680,
351,
981,
11,
261,
280,
605,
1792... |
self.defaultFont = QFont(self.font()) | self.defaultFont = QFont(self.font()) | def __init__(self, parent = None, name = None): | c25263540add024396d4bcf7631292f1fd2d50bb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/c25263540add024396d4bcf7631292f1fd2d50bb/MWsemantics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
273,
599,
16,
508,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
273,
599,
16,
508,
273,
599,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
return img | return img | def getImageAsFile(self, img=None, scale=None): """Get the img as file like object """ if img is None: f = self.getField('image') img = f.getScale(self, scale) # img.data contains the image as string or Pdata chain data = None if isinstance(img, OFSImage): data = str(img.data) elif isinstance(img, Pdata): data = str(img) elif isinstance(img, str): data = img elif isinstance(img, file) or (hasattr(img, 'read') and hasattr(img, 'seek')): img.seek(0) return img if data: return StringIO(data) else: return None | 05e7fbc058dbe4e597e6e6bb6e6334458d5dfd81 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11956/05e7fbc058dbe4e597e6e6bb6e6334458d5dfd81/imagetransform.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10567,
1463,
812,
12,
2890,
16,
3774,
33,
7036,
16,
3159,
33,
7036,
4672,
3536,
967,
326,
3774,
487,
585,
3007,
733,
3536,
309,
3774,
353,
599,
30,
284,
273,
365,
18,
588,
974,
2668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10567,
1463,
812,
12,
2890,
16,
3774,
33,
7036,
16,
3159,
33,
7036,
4672,
3536,
967,
326,
3774,
487,
585,
3007,
733,
3536,
309,
3774,
353,
599,
30,
284,
273,
365,
18,
588,
974,
2668,
... |
print query, print 'report=' in query print not report_id in query | def _render_view(self, req, db, id): """Retrieve the report results and pre-process them for rendering.""" | 5e383cb0ab6d4dd98fc23585a40fa627c708c4b7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9317/5e383cb0ab6d4dd98fc23585a40fa627c708c4b7/report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
1945,
12,
2890,
16,
1111,
16,
1319,
16,
612,
4672,
3536,
5767,
326,
2605,
1686,
471,
675,
17,
2567,
2182,
364,
9782,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
1945,
12,
2890,
16,
1111,
16,
1319,
16,
612,
4672,
3536,
5767,
326,
2605,
1686,
471,
675,
17,
2567,
2182,
364,
9782,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
sage: number_of_partitions(5, algorithm='bobber') | sage: number_of_partitions(5, algorithm='bober') | def number_of_partitions(n,k=None, algorithm='gap'): r""" Returns the size of partitions_list(n,k). INPUT: n -- an integer k -- (default: None); if specified, instead returns the cardinality of the set of all (unordered) partitions of the positive integer n into sums with k summands. algorithm -- (default: 'gap') 'gap' -- use GAP (VERY *slow*) 'bobber' -- use Jonathon Bobber's implementation (*very* fast, but new and not well tested yet). 'pari' -- use PARI. Speed seems the same as GAP until $n$ is in the thousands, in which case PARI is faster. *But* PARI has a bug, e.g., on 64-bit Linux PARI-2.3.2 outputs numbpart(147007)%1000 as 536, but it should be 533!. So do not use this option. IMPLEMENTATION: Wraps GAP's NrPartitions or PARI's numbpart function. Use the function \code{partitions(n)} to return a generator over all partitions of $n$. It is possible to associate with every partition of the integer n a conjugacy class of permutations in the symmetric group on n points and vice versa. Therefore p(n) = NrPartitions(n) is the number of conjugacy classes of the symmetric group on n points. EXAMPLES: sage: v = list(partitions(5)); v [(1, 1, 1, 1, 1), (1, 1, 1, 2), (1, 2, 2), (1, 1, 3), (2, 3), (1, 4), (5,)] sage: len(v) 7 sage: number_of_partitions(5) 7 sage: number_of_partitions(5, algorithm='pari') 7 sage: number_of_partitions(5, algorithm='bobber') 7 The input must be a nonnegative integer or a ValueError is raised. sage: number_of_partitions(-5) Traceback (most recent call last): ... ValueError: n (=-5) must be a nonnegative integer sage: number_of_partitions(10,2) 5 sage: number_of_partitions(10) 42 sage: number_of_partitions(3) 3 sage: number_of_partitions(10) 42 sage: number_of_partitions(3, algorithm='pari') 3 sage: number_of_partitions(10, algorithm='pari') 42 sage: number_of_partitions(40) 37338 sage: number_of_partitions(100) 190569292 A generating function for p(n) is given by the reciprocal of Euler's function: \[ \sum_{n=0}^\infty p(n)x^n = \prod_{k=1}^\infty \left(\frac {1}{1-x^k} \right). \] We use SAGE to verify that the first several coefficients do instead agree: sage: q = PowerSeriesRing(QQ, 'q', default_prec=9).gen() sage: prod([(1-q^k)^(-1) for k in range(1,9)]) ## partial product of 1 + q + 2*q^2 + 3*q^3 + 5*q^4 + 7*q^5 + 11*q^6 + 15*q^7 + 22*q^8 + O(q^9) sage: [number_of_partitions(k) for k in range(2,10)] [2, 3, 5, 7, 11, 15, 22, 30] REFERENCES: http://en.wikipedia.org/wiki/Partition_%28number_theory%29 """ n = ZZ(n) if n < 0: raise ValueError, "n (=%s) must be a nonnegative integer"%n elif n == 0: return ZZ(1) if algorithm == 'gap': if k==None: ans=gap.eval("NrPartitions(%s)"%(ZZ(n))) else: ans=gap.eval("NrPartitions(%s,%s)"%(ZZ(n),ZZ(k))) return ZZ(ans) elif algorithm == 'bobber': return partitions_ext.number_of_partitions(n) elif algorithm == 'pari': if not k is None: raise ValueError, "cannot specify second argument k if the algorithm is PARI" return ZZ(pari(ZZ(n)).numbpart()) raise ValueError, "unknown algorithm '%s'"%algorithm | c3468fcccefd299591e4d20bc48f143396a05974 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/c3468fcccefd299591e4d20bc48f143396a05974/combinat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
67,
792,
67,
21275,
12,
82,
16,
79,
33,
7036,
16,
4886,
2218,
14048,
11,
4672,
436,
8395,
2860,
326,
963,
434,
10060,
67,
1098,
12,
82,
16,
79,
2934,
225,
12943,
30,
290,
1493,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1300,
67,
792,
67,
21275,
12,
82,
16,
79,
33,
7036,
16,
4886,
2218,
14048,
11,
4672,
436,
8395,
2860,
326,
963,
434,
10060,
67,
1098,
12,
82,
16,
79,
2934,
225,
12943,
30,
290,
1493,... |
write("%d = "%index) | write("%d = " % (index + start_index)) | def handle_array(entry): length = entry[1] element = entry[2] newItems = [] write("[\n") indent() value = read_value(length) for index in xrange(value): write("%d = "%index) value = handle_element(element) write("\n") newItems.append(value) dedent() write("]") return newItems | 78d4d7fefc14a1bc325a3ad295f03e21dfda170f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11986/78d4d7fefc14a1bc325a3ad295f03e21dfda170f/coff-dump.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1126,
12,
4099,
4672,
769,
273,
1241,
63,
21,
65,
930,
273,
1241,
63,
22,
65,
225,
394,
3126,
273,
5378,
225,
1045,
2932,
7438,
82,
7923,
3504,
1435,
225,
460,
273,
855,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1126,
12,
4099,
4672,
769,
273,
1241,
63,
21,
65,
930,
273,
1241,
63,
22,
65,
225,
394,
3126,
273,
5378,
225,
1045,
2932,
7438,
82,
7923,
3504,
1435,
225,
460,
273,
855,
67... |
"the standard `logging` module instead") | "the standard `logging` module instead", PendingDeprecationWarning, stacklevel=2) | def notifyChannel(self, name, level, msg): warnings.warn("notifyChannel API shouldn't be used anymore, please use " "the standard `logging` module instead") from service.web_services import common | d373cb4f4fca2ff7a84c5da2f5d0a0d871bf8240 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/d373cb4f4fca2ff7a84c5da2f5d0a0d871bf8240/netsvc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
2909,
12,
2890,
16,
508,
16,
1801,
16,
1234,
4672,
5599,
18,
8935,
2932,
12336,
2909,
1491,
12044,
1404,
506,
1399,
16828,
16,
9582,
999,
315,
315,
5787,
4529,
1375,
11167,
68,
160... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5066,
2909,
12,
2890,
16,
508,
16,
1801,
16,
1234,
4672,
5599,
18,
8935,
2932,
12336,
2909,
1491,
12044,
1404,
506,
1399,
16828,
16,
9582,
999,
315,
315,
5787,
4529,
1375,
11167,
68,
160... |
self.assertEqual(STRING_RGX.sub('', "'yo\\'yo\\"), '') | self.assertEqual(STRING_RGX.sub('', r"'yo\'yo\''"), '') | def test_known_values_8(self): self.assertEqual(STRING_RGX.sub('', "'yo\\'yo\\"), '') | 037076855b9415e022bb196d33edeb4310a31884 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/928/037076855b9415e022bb196d33edeb4310a31884/test_format.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2994,
67,
2372,
67,
28,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
5804,
67,
19380,
60,
18,
1717,
2668,
2187,
436,
5187,
93,
83,
3730,
93,
83,
3730,
4970,
3631,
28707,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2994,
67,
2372,
67,
28,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
5804,
67,
19380,
60,
18,
1717,
2668,
2187,
436,
5187,
93,
83,
3730,
93,
83,
3730,
4970,
3631,
28707,
225,
... |
self.__Token = self.__CurrentLine[StartPos, self.CurrentOffsetWithinLine] | self.__Token = self.__CurrentLine()[StartPos : self.CurrentOffsetWithinLine] | def __GetNextToken(self): self.__SkipWhiteSpace() if self.__EndOfFile(): return False | 2f743f829e2c9e634d3e62f83c6af106a22f6583 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/914/2f743f829e2c9e634d3e62f83c6af106a22f6583/FdfParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
967,
9399,
12,
2890,
4672,
365,
16186,
6368,
23108,
1435,
309,
365,
16186,
23358,
812,
13332,
327,
1083,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
967,
9399,
12,
2890,
4672,
365,
16186,
6368,
23108,
1435,
309,
365,
16186,
23358,
812,
13332,
327,
1083,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
add_db_options('component', cursor, 'SELECT name FROM component ORDER BY name', constraints, 'query.options.') add_db_options('milestone', cursor, 'SELECT name FROM milestone ORDER BY name', constraints, 'query.options.') add_db_options('version', cursor, 'SELECT name FROM version ORDER BY name', constraints, 'query.options.') add_db_options('priority', cursor, 'SELECT name FROM enum WHERE type=\'priority\'', constraints, 'query.options.') add_db_options('severity', cursor, 'SELECT name FROM enum WHERE type=\'severity\'', constraints, 'query.options.') | add_db_options('component', constraints, 'query.options.', cursor, 'SELECT name FROM component ORDER BY name', ) add_db_options('milestone', constraints, 'query.options.', cursor, 'SELECT name FROM milestone ORDER BY name') add_db_options('version', constraints, 'query.options.', cursor, 'SELECT name FROM version ORDER BY name') add_db_options('priority', constraints, 'query.options.', cursor, 'SELECT name FROM enum WHERE type=\'priority\'') add_db_options('severity', constraints, 'query.options.', cursor, 'SELECT name FROM enum WHERE type=\'severity\'') | def add_db_options(field, db, sql, constraints, prefix): cursor.execute(sql) options = [] while 1: row = cursor.fetchone() if not row: break if row[0]: options.append({'name': row[0]}) add_options(field, options, constraints, prefix) | 880aa9ff4e6fbb362a2b26298b12a57c57c572dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/880aa9ff4e6fbb362a2b26298b12a57c57c572dd/Query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
1966,
67,
2116,
12,
1518,
16,
1319,
16,
1847,
16,
6237,
16,
1633,
4672,
3347,
18,
8837,
12,
4669,
13,
702,
273,
5378,
1323,
404,
30,
1027,
273,
3347,
18,
5754,
476,
1435,
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,
527,
67,
1966,
67,
2116,
12,
1518,
16,
1319,
16,
1847,
16,
6237,
16,
1633,
4672,
3347,
18,
8837,
12,
4669,
13,
702,
273,
5378,
1323,
404,
30,
1027,
273,
3347,
18,
5754,
476,
1435,
30... |
migrate_tags = get_vistrails_configuration().check("migrateTags") | should_migrate_tags = get_vistrails_configuration().check("migrateTags") | def flush_delayed_actions(self): start_version = self.current_version desc_key = Action.ANNOTATION_DESCRIPTION added_upgrade = False migrate_tags = get_vistrails_configuration().check("migrateTags") for action in self._delayed_actions: self.vistrail.add_action(action, start_version, self.current_session) # HACK to populate upgrade information if (action.has_annotation_with_key(desc_key) and action.get_annotation_by_key(desc_key).value == 'Upgrade'): self.vistrail.set_upgrade(start_version, str(action.id)) if migrate_tags: tag = self.vistrail.get_tag(start_version) if tag: self.vistrail.set_tag(start_version, "") self.vistrail.set_tag(action.id, tag) notes = self.vistrail.get_notes(start_version) if notes: self.vistrail.set_notes(start_version, "") self.vistrail.set_notes(action.id, notes) self.current_version = action.id start_version = action.id added_upgrade = True | 9c49285269ca706c8d38d0119e48b4cba5aa5d75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/9c49285269ca706c8d38d0119e48b4cba5aa5d75/controller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3663,
67,
10790,
329,
67,
4905,
12,
2890,
4672,
787,
67,
1589,
273,
365,
18,
2972,
67,
1589,
3044,
67,
856,
273,
4382,
18,
24922,
67,
15911,
3096,
67,
15097,
273,
1083,
1410,
67,
22083... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3663,
67,
10790,
329,
67,
4905,
12,
2890,
4672,
787,
67,
1589,
273,
365,
18,
2972,
67,
1589,
3044,
67,
856,
273,
4382,
18,
24922,
67,
15911,
3096,
67,
15097,
273,
1083,
1410,
67,
22083... |
def seek(self): raise IOError, 'Random access not allowed in gzip files' def tell(self): raise IOError, 'I won\'t tell() you for gzip files' | def flush(self): self.fileobj.flush() | 98d14dd84f6e46c405af5aec627ad23d1da115cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/98d14dd84f6e46c405af5aec627ad23d1da115cb/gzip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3663,
12,
2890,
4672,
365,
18,
768,
2603,
18,
11330,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3663,
12,
2890,
4672,
365,
18,
768,
2603,
18,
11330,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
"""Fragment objects are a basic unit for organizing small groups of Atoms. Amino acid residues are fragments, as well as nucleic acids and other small molecules. In terms of a PDB file, they are all the atoms from a unique residue in a chain. Fragments have the following attributes: | """Fragment objects are a basic unit for organizing small groups of Atoms. Amino acid residues are fragments, as well as nucleic acids and other small molecules. In terms of a PDB file, they are all the atoms from a unique residue in a chain. Fragments have the following attributes: | def set_chain_id(self, chain_id): """Sets a new ID for the Chain, updating the chain_id for all objects in the Structure hierarchy. """ ## check for conflicting chain_id in the structure if self.model is not None: chk_chain = self.model.get_chain(chain_id) if chk_chain is not None or chk_chain != self: raise ChainOverwrite() | a181eacbeb3c68b8f7caba918a821d3f3e6c50f6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10674/a181eacbeb3c68b8f7caba918a821d3f3e6c50f6/Structure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
5639,
67,
350,
12,
2890,
16,
2687,
67,
350,
4672,
3536,
2785,
279,
394,
1599,
364,
326,
7824,
16,
9702,
326,
2687,
67,
350,
364,
777,
2184,
316,
326,
13348,
9360,
18,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5639,
67,
350,
12,
2890,
16,
2687,
67,
350,
4672,
3536,
2785,
279,
394,
1599,
364,
326,
7824,
16,
9702,
326,
2687,
67,
350,
364,
777,
2184,
316,
326,
13348,
9360,
18,
3536,
... |
ai("a = (") | ai("if 1:") ai("if 1:\n") ai("if 1:\n pass\n if 1:\n pass\n else:") ai("if 1:\n pass\n if 1:\n pass\n else:\n") ai("if 1:\n pass\n if 1:\n pass\n else:\n pass") ai("def x():") ai("def x():\n") ai("def x():\n\n") ai("def x():\n pass") ai("def x():\n pass\n ") ai("def x():\n pass\n ") ai("\n\ndef x():\n pass") | ai("def x():\n") | de9a0d3158df0278d83754740f33276f780cef90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/de9a0d3158df0278d83754740f33276f780cef90/test_codeop.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
14679,
2932,
536,
619,
1435,
5581,
82,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
14679,
2932,
536,
619,
1435,
5581,
82,
7923,
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,
-1... |
if good.has(name, oid): if not data: | if data: if deleted.has(name, oid): | def gc(conf, days=1, conf2=None): db = ZODB.config.databaseFromFile(open(conf)) if conf2 is None: db2 = db else: logger.info("Using secondary configuration, %s, for analysis", conf2) db2 = ZODB.config.databaseFromFile(open(conf2)) if set(db.databases) != set(db2.databases): raise ValueError("primary and secondary databases don't match.") databases = db2.databases storages = dict((name, d.storage) for (name, d) in databases.items()) ptid = repr( ZODB.TimeStamp.TimeStamp(*time.gmtime(time.time() - 86400*days)[:6]) ) # Pre-populate good with roots and recently-written objects good = oidset(databases) bad = oidset(databases) baddir = tempfile.mkdtemp() for name in storages: os.mkdir(os.path.join(baddir, name)) for name, storage in storages.iteritems(): # Make sure we can get the roots _ = storage.load(z64, '') good.insert(name, z64) # All new records are good for trans in storage.iterator(ptid): for record in trans: good.insert(name, record.oid) # and anything they reference for ref in getrefs(record.data, name): good.insert(*ref) # Now iterate over older records for trans in storage.iterator(None, ptid): for record in trans: oid = record.oid data = record.data if good.has(name, oid): if not data: continue for ref in getrefs(data, name): if good.insert(*ref) and bad.has(*ref): bad_to_good(baddir, bad, good, *ref) else: bad.insert(name, oid) if not data: continue refs = tuple(ref for ref in getrefs(data, name) if not good.has(*ref)) if not refs: continue # leaves are common f = open(os.path.join(baddir, name, base64.urlsafe_b64encode(oid)), 'ab') marshal.dump(refs, f) f.close() # Now, we have the garbage in bad. Remove it. for name, db in db.databases.iteritems(): storage = db.storage t = transaction.begin() storage.tpc_begin(t) nd = 0 for oid in bad.iterator(name): p, s = storage.load(oid, '') storage.deleteObject(oid, s, t) nd += 1 logger.info("Removed %s objects from %s", nd, name) if nd: storage.tpc_vote(t) storage.tpc_finish(t) transaction.commit() else: storage.tpc_abort(t) transaction.abort() db.close() shutil.rmtree(baddir) return bad | 710f636d20110b254b274c75d4a5a9d62854e89a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5364/710f636d20110b254b274c75d4a5a9d62854e89a/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8859,
12,
3923,
16,
4681,
33,
21,
16,
2195,
22,
33,
7036,
4672,
1319,
273,
2285,
19786,
18,
1425,
18,
6231,
13087,
12,
3190,
12,
3923,
3719,
309,
2195,
22,
353,
599,
30,
1319,
22,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8859,
12,
3923,
16,
4681,
33,
21,
16,
2195,
22,
33,
7036,
4672,
1319,
273,
2285,
19786,
18,
1425,
18,
6231,
13087,
12,
3190,
12,
3923,
3719,
309,
2195,
22,
353,
599,
30,
1319,
22,
27... |
return eligible, preferred_versions | return eligible | def _filterProviders(providers, item, cfgData, dataCache): """ Take a list of providers and filter/reorder according to the environment variables and previous build results """ eligible = [] preferred_versions = {} # The order of providers depends on the order of the files on the disk # up to here. Sort pkg_pn to make dependency issues reproducible rather # than effectively random. providers.sort() # Collate providers by PN pkg_pn = {} for p in providers: pn = dataCache.pkg_fn[p] if pn not in pkg_pn: pkg_pn[pn] = [] pkg_pn[pn].append(p) bb.msg.debug(1, bb.msg.domain.Provider, "providers for %s are: %s" % (item, pkg_pn.keys())) for pn in pkg_pn.keys(): preferred_versions[pn] = bb.providers.findBestProvider(pn, cfgData, dataCache, pkg_pn, item)[2:4] eligible.append(preferred_versions[pn][1]) if len(eligible) == 0: bb.msg.error(bb.msg.domain.Provider, "no eligible providers for %s" % item) return 0 # If pn == item, give it a slight default preference # This means PREFERRED_PROVIDER_foobar defaults to foobar if available for p in providers: pn = dataCache.pkg_fn[p] if pn != item: continue (newvers, fn) = preferred_versions[pn] if not fn in eligible: continue eligible.remove(fn) eligible = [fn] + eligible # look to see if one of them is already staged, or marked as preferred. # if so, bump it to the head of the queue for p in providers: pn = dataCache.pkg_fn[p] pe, pv, pr = dataCache.pkg_pepvpr[p] stamp = '%s.do_populate_staging' % dataCache.stamp[p] if os.path.exists(stamp): (newvers, fn) = preferred_versions[pn] if not fn in eligible: # package was made ineligible by already-failed check continue oldver = "%s-%s" % (pv, pr) if pe > 0: oldver = "%s:%s" % (pe, oldver) newver = "%s-%s" % (newvers[1], newvers[2]) if newvers[0] > 0: newver = "%s:%s" % (newvers[0], newver) if (newver != oldver): extra_chat = "%s (%s) already staged but upgrading to %s to satisfy %s" % (pn, oldver, newver, item) else: extra_chat = "Selecting already-staged %s (%s) to satisfy %s" % (pn, oldver, item) bb.msg.note(2, bb.msg.domain.Provider, "%s" % extra_chat) eligible.remove(fn) eligible = [fn] + eligible break return eligible, preferred_versions | 3d2fa443ab7237256a2f59947e4536e4200a2cec /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2672/3d2fa443ab7237256a2f59947e4536e4200a2cec/providers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2188,
10672,
12,
17520,
16,
761,
16,
2776,
751,
16,
501,
1649,
4672,
3536,
17129,
279,
666,
434,
9165,
471,
1034,
19,
266,
1019,
4888,
358,
326,
3330,
3152,
471,
2416,
1361,
1686,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2188,
10672,
12,
17520,
16,
761,
16,
2776,
751,
16,
501,
1649,
4672,
3536,
17129,
279,
666,
434,
9165,
471,
1034,
19,
266,
1019,
4888,
358,
326,
3330,
3152,
471,
2416,
1361,
1686,
... |
else: return self.default | if not self.default: default_adapter = component.queryAdapter(instance, IFieldDefaultProvider, name=self.__name__) if default_adapter is not None: return default_adapter() return self.default | def getDefault(self, instance): """Return the default value to be used for initializing this field""" dm = self.default_method if dm: if type(dm) is StringType and shasattr(instance, dm): method = getattr(instance, dm) return method() elif callable(dm): return dm() else: raise ValueError('%s.default_method is neither a method of %s' ' nor a callable' % (self.getName(), instance.__class__)) else: return self.default | 6bf0b4d803f7a6c42f16af81053d806d99f67096 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12165/6bf0b4d803f7a6c42f16af81053d806d99f67096/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4829,
12,
2890,
16,
791,
4672,
3536,
990,
326,
805,
460,
358,
506,
1399,
364,
22584,
333,
652,
8395,
9113,
273,
365,
18,
1886,
67,
2039,
309,
9113,
30,
309,
618,
12,
10956,
13,
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,
4829,
12,
2890,
16,
791,
4672,
3536,
990,
326,
805,
460,
358,
506,
1399,
364,
22584,
333,
652,
8395,
9113,
273,
365,
18,
1886,
67,
2039,
309,
9113,
30,
309,
618,
12,
10956,
13,
353,
... |
its leg. | its leg. The optional boolean parameter flat provides the option of returning a flat list. | def leg_lengths(self, flat=False): """ Returns a tableau of shape p with each box filled in with its leg. | d2bea0c9898d10512ce54569c87e5b09be4cdba6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/d2bea0c9898d10512ce54569c87e5b09be4cdba6/partition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4553,
67,
14907,
12,
2890,
16,
3569,
33,
8381,
4672,
3536,
2860,
279,
1014,
8377,
434,
2179,
293,
598,
1517,
3919,
6300,
316,
598,
2097,
4553,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4553,
67,
14907,
12,
2890,
16,
3569,
33,
8381,
4672,
3536,
2860,
279,
1014,
8377,
434,
2179,
293,
598,
1517,
3919,
6300,
316,
598,
2097,
4553,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def copyFileIfExists(source, target): if os.path.exists(source): copyFile(source, target) | import svn | def copyFileIfExists(source, target): if os.path.exists(source): copyFile(source, target) | eae32ce680b5f9da9be171e86f095dfbb0f933ac /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7101/eae32ce680b5f9da9be171e86f095dfbb0f933ac/install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1930,
5893,
82,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1930,
5893,
82,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
sage: latex(r(2)) | sage: latex(r(2)) | def _latex_(self): r""" Return LaTeX representation of this R object. | f1cd5773fe3e88b0bf0433c53477cfdf6c99bd08 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/f1cd5773fe3e88b0bf0433c53477cfdf6c99bd08/r.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
26264,
67,
12,
2890,
4672,
436,
8395,
2000,
21072,
21575,
60,
4335,
434,
333,
534,
733,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
26264,
67,
12,
2890,
4672,
436,
8395,
2000,
21072,
21575,
60,
4335,
434,
333,
534,
733,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
tests = [Signed_TestCase, Unsigned_TestCase, Tuple_TestCase] | tests = [Signed_TestCase, Unsigned_TestCase, Tuple_TestCase, Keywords_TestCase] | def test_main(): tests = [Signed_TestCase, Unsigned_TestCase, Tuple_TestCase] try: from _testcapi import getargs_L, getargs_K except ImportError: pass # PY_LONG_LONG not available else: tests.append(LongLong_TestCase) test_support.run_unittest(*tests) | ea837931cf393aa0373ccfa1849b2a3d6e3cc6ea /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/ea837931cf393aa0373ccfa1849b2a3d6e3cc6ea/test_getargs2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
13332,
7434,
273,
306,
12294,
67,
4709,
2449,
16,
1351,
5679,
67,
4709,
2449,
16,
7257,
67,
4709,
2449,
16,
1929,
3753,
67,
4709,
2449,
65,
775,
30,
628,
389,
3813,
71,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
13332,
7434,
273,
306,
12294,
67,
4709,
2449,
16,
1351,
5679,
67,
4709,
2449,
16,
7257,
67,
4709,
2449,
16,
1929,
3753,
67,
4709,
2449,
65,
775,
30,
628,
389,
3813,
71,... |
blocknum = blocknum + 1 | read += len(block) blocknum += 1 | def retrieve(self, url, filename=None, reporthook=None, data=None): """retrieve(url) returns (filename, headers) for a local object or (tempfilename, headers) for a remote object.""" url = unwrap(toBytes(url)) if self.tempcache and url in self.tempcache: return self.tempcache[url] type, url1 = splittype(url) if filename is None and (not type or type == 'file'): try: fp = self.open_local_file(url1) hdrs = fp.info() del fp return url2pathname(splithost(url1)[1]), hdrs except IOError, msg: pass fp = self.open(url, data) headers = fp.info() if filename: tfp = open(filename, 'wb') else: import tempfile garbage, path = splittype(url) garbage, path = splithost(path or "") path, garbage = splitquery(path or "") path, garbage = splitattr(path or "") suffix = os.path.splitext(path)[1] (fd, filename) = tempfile.mkstemp(suffix) self.__tempfiles.append(filename) tfp = os.fdopen(fd, 'wb') result = filename, headers if self.tempcache is not None: self.tempcache[url] = result bs = 1024*8 size = -1 blocknum = 1 if reporthook: if "content-length" in headers: size = int(headers["Content-Length"]) reporthook(0, bs, size) block = fp.read(bs) if reporthook: reporthook(1, bs, size) while block: tfp.write(block) block = fp.read(bs) blocknum = blocknum + 1 if reporthook: reporthook(blocknum, bs, size) fp.close() tfp.close() del fp del tfp return result | 570d41356d45636be271cf9c77fce8d837f6f5b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/570d41356d45636be271cf9c77fce8d837f6f5b6/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4614,
12,
2890,
16,
880,
16,
1544,
33,
7036,
16,
2071,
7825,
1184,
33,
7036,
16,
501,
33,
7036,
4672,
3536,
17466,
12,
718,
13,
1135,
261,
3459,
16,
1607,
13,
364,
279,
1191,
733,
57... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4614,
12,
2890,
16,
880,
16,
1544,
33,
7036,
16,
2071,
7825,
1184,
33,
7036,
16,
501,
33,
7036,
4672,
3536,
17466,
12,
718,
13,
1135,
261,
3459,
16,
1607,
13,
364,
279,
1191,
733,
57... |
finally: | def main(settingsBot): # Taking the messages inside the function namespace. global netext; global summary; global logbook; global summary2; global report_page; global project_inserted global comment; global bad_pag; global report_text; global random_sign; global whitelist_pg """ 0 1 2 3 4 5 6 7 8 9 10 11 Returned tuple: (None, ask, filename, fileOption, fileSignName, filter_wp, limit, log_variable, number, numberlog, offset_variable, random, (mainSettings()) 12 13 14 15 recursive, savedata, sign, time_variable) """ # Loading the option of the mainSettings() ask = settingsBot[1]; filename = settingsBot[2]; fileOption = settingsBot[3]; fileSignName = settingsBot[4]; filter_wp = settingsBot[5] limit = settingsBot[6]; log_variable = settingsBot[7]; number = settingsBot[8]; numberlog = settingsBot[9]; offset_variable = settingsBot[10] random = settingsBot[11]; recursive = settingsBot[12]; savedata = settingsBot[13]; sign = settingsBot[14]; time_variable = settingsBot[15] # The site wsite = wikipedia.getSite() # A little block-statement to ensure that the bot won't start with en-parameters. if wsite.lang not in project_inserted: raise NoProjectFound(u'Your project is not supported by the framework. You have to edit the script and add it!') # The follow lines translate the language's parameters. welcomer = wikipedia.translate(wsite, netext) summ = wikipedia.translate(wsite, summary) logg = wikipedia.translate(wsite, logbook) summ2 = wikipedia.translate(wsite, summary2) rep_page = wikipedia.translate(wsite, report_page) com = wikipedia.translate(wsite, comment) bad_page = wikipedia.translate(wsite, bad_pag) rep_text = wikipedia.translate(wsite, report_text) signPageTitle = wikipedia.translate(wsite, random_sign) wtlpg = wikipedia.translate(wsite, whitelist_pg) usernam = wsite.namespace(2) contrib = string.capitalize(wsite.mediawiki_message('contribslink')) # The talk_page's variable gives "Talk page". talk_page = wsite.namespace(3) talk = urlname(talk_page, wsite) + ':' # Some project of the same language, have different settings. (this is the place to add them). if wsite.family.name == "wikinews" and wsite.lang == "it": welcomer = u'{{subst:benvenuto|%s}}' sign = 'Tooby' elif wsite.family.name == "wiktionary" and wsite.lang == "it": welcomer = u'{{subst:Utente:Filnik/Benve|nome={{subst:PAGENAME}}}} %s' elif wsite.family.name == "wikiversity" and wsite.lang == "it": welcomer = u'{{subst:Benvenuto}} %s' welcomed_users = list() if savedata == True and os.path.exists(wikipedia.datafilepath(filename)): f = file(filename) number_user = cPickle.load(f) yield number_user else: number_user = 0 yield number_user # Here there is the main loop. while True: if filter_wp == True: # A standard list of bad username components (you can change/delate it in your project...). # [ I divided the list into three to make it smaller...] elencoaf = [' ano', ' anus', 'anal ', 'babies', 'baldracca', 'balle', 'bastardo', 'bestiali', 'bestiale', 'bastarda', 'b.i.t.c.h.', 'bitch', 'boobie', 'bordello', 'breast', 'cacata', 'cacca', 'cachapera', 'cagata', 'cane', 'cazz', 'cazzo', 'cazzata', 'chiavare', 'chiavata', 'chick', 'christ ', 'cristo', 'clitoride', 'coione', 'cojdioonear', 'cojones', 'cojo', 'coglione', 'coglioni', 'cornuto', 'cula', 'culatone', 'culattone', 'culo', 'deficiente', 'deficente', 'dio', 'die ', 'died ', 'ditalino', 'ejackulate', 'enculer', 'eroticunt', 'fanculo', 'fellatio', 'fica ', 'ficken', 'figa', 'sfiga', 'fottere', 'fotter', 'fottuto', 'fuck', 'f.u.c.k.', "funkyass"] elencogz = ['gay', 'hentai.com', 'horne', 'horney', 'virgin', 'hotties', 'idiot', '@alice.it', 'incest', 'jesus', 'gesu', 'gesù', 'kazzo', 'kill', 'leccaculo', 'lesbian', 'lesbica', 'lesbo', 'masturbazione', 'masturbare', 'masturbo', 'merda', 'merdata', 'merdoso', 'mignotta', 'minchia', 'minkia', 'minchione', 'mona', 'nudo', 'nuda', 'nudi', 'oral', 'sex', 'orgasmso', 'porc', 'pompa', 'pompino', 'porno', 'puttana', 'puzza', 'puzzone', "racchia", 'sborone', 'sborrone', 'sborata', 'sborolata', 'sboro', 'scopata', 'scopare', 'scroto', 'scrotum', 'sega', 'sesso', 'shit', 'shiz', 's.h.i.t.', 'sadomaso', 'sodomist', 'stronzata', 'stronzo', 'succhiamelo', 'succhiacazzi', 'testicol', 'troia', 'universetoday.net', 'vaffanculo', 'vagina', 'vibrator', "vacca", 'yiddiot', "zoccola"] elenco_others = ['@', ".com", ".sex", ".org", ".uk", ".en", ".it", "admin", "administrator", "amministratore", '@yahoo.com', '@alice.com', "amministratrice", "burocrate", "checkuser", "developer", "http://", "jimbo", "mediawiki", "on wheals", "on wheal", "on wheel", "planante", "razinger", "sysop", "troll", "vandal", " v.f. ", "v. fighter", "vandal f.", "vandal fighter", 'wales jimmy', "wheels", "wales", "www."] badword_page = wikipedia.Page(wsite, bad_page) if badword_page.exists(): wikipedia.output(u'\nLoading the bad words list from %s...' % wsite.hostname() ) text_bad = badword_page.get() list_loaded = load_word_function(wsite,text_bad) else: wikipedia.output(u'\t\t>>>WARNING: The bad word page doesn\'t exist!<<<') list_loaded = list() # Joining the "other things" with the loaded... elencovarie = elenco_others + list_loaded elif filter_wp == False: elencoaf = list() elencogz = list() elencovarie = list() # Joining the three lists.. elenco = elencoaf + elencogz + elencovarie if filter_wp == True: # That is the default whitelist (it contains few name because it has been improved in the latest days..). whitelist_default = ['emiliano'] whitelist_page = wikipedia.Page(wsite, wtlpg) if whitelist_page.exists(): wikipedia.output(u'\nLoading the whitelist from %s...' % wsite.hostname() ) text_white = whitelist_page.get() list_white = load_word_function(wsite,text_white) else: wikipedia.output(u"\t\t>>>WARNING: The whitelist's page doesn't exist!<<<") list_white = list() else: list_white = list() whitelist_default = list() # Joined the whitelist words. whitelist = list_white + whitelist_default # List of words that the bot understands when it asks the operator for input. block = ("B", "b", "Blocco", "blocco", "block", "bloc", "Block", "Bloc", 'Report', 'report') say_hi = ("S", "s", "Saluto", "saluto", "Welcome", "welcome", 'w', 'W', 'say hi', 'Say hi', 'Hi', 'hi', 'h', 'hello', 'Hello') # The URL for new users is the same in every project. It should not be changed. URL = "/w/index.php?title=Special:Log&type=newusers&limit=%d&offset=%d" % (limit, offset_variable) log = wsite.getUrl(URL) wikipedia.output(u'Loading latest ' + str(limit) + u' new users from ' + (wsite.hostname()) + u'...\n') # Determine which signature to use if random == True: try: wikipedia.output(u'Loading random signatures...') signList = defineSign(wsite, signPageTitle, fileSignName, fileOption) except wikipedia.NoPage: wikipedia.output(u'The list with signatures is not available... Using default signature...') random = False for found_result in parselog(wsite, log, talk, number): if found_result == None: continue # Compiling the signature to be used. if random == True: if number_user + 1> len(signList): number_user = 0 yield number_user welcom = welcomer % signList[number_user] + ' {{subst:LOCALTIME}}, {{subst:CURRENTDAY}} {{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}} (UTC).' else: welcom = welcomer % sign username = str(found_result[0]) usertalkpage = wikipedia.Page(wsite, talk + username) baduser = False # Check if the username is composed by only numbers. try: int(username) baduser = True except ValueError: # OK, no problem pass # Check if the user has been already blocked. ki = blocked(wsite,username) if ki == True: wikipedia.output(u'%s has been blocked! Skipping...' % username) continue # Understand if the user has a bad-username. for word in elenco: username = str(username).encode(config.console_encoding) if word.lower() in username.lower(): baduser = True if wsite.lang == 'it': final_rep = rep_text + word + '}}' break else: final_rep = rep_text # Checking in the whitelist... for xy in whitelist: if xy.lower() in username.lower(): username.replace(xy, '') for word in elenco: if word.lower() in username.lower(): baduser = True else: baduser = False # He has a badusername, trying to report him... if baduser == True: while 1: if ask == True: wikipedia.output(u'%s may have an unwanted username, what shall i do?' % username ) answer = wikipedia.input(u'[B]lock or [W]elcome?') for w in block: if w in answer: if not usertalkpage.exists(): # Check if the user has been already blocked (second check). ki = blocked(wsite, username) if ki == True: wikipedia.output(u'%s has been blocked! Skipping him...' % username) continue report(wsite, rep_page, username, com, final_rep) break else: wikipedia.output(u'The discussion page of the bad-user already exist...') running = False for w in say_hi: if w in answer: baduser = False break elif ask == False: wikipedia.output(u'%s is possibly an unwanted username. He will be reported.' % username) if not usertalkpage.exists(): report(wsite, rep_page, username, com, final_rep) break else: wikipedia.output(u'The discussion page of the bad-user already exist...') break # He has a good username, welcome! elif baduser == False: if not usertalkpage.exists(): # Tring to put the welcome... try: # make non-minor edit to trigger new talk page message. usertalkpage.put(welcom, summ, minorEdit = False) welcomed_users.append(found_result) if random == True: number_user += 1 yield number_user except wikipedia.EditConflict: wikipedia.output(u'An edit conflict has occured, skipping this user.') continue else: wikipedia.output(u'%s has been already welcomed when i was loading all the users... skipping' % username) continue # That's the log if log_variable == True and logg: if len(welcomed_users) == 1: wikipedia.output(u'One user has been welcomed.') elif len(welcomed_users) == 0: wikipedia.output(u'No users have been welcomed.') else: wikipedia.output(u'%s users have been welcomed.' % str(len(welcomed_users)) ) if len(welcomed_users) < numberlog: continue # Update the welcome log each fifth welcome message. elif len(welcomed_users) >= numberlog: logresult = logmaker(wsite, welcomed_users, logg, summ2, usernam, contrib) welcomed_users = list() if logresult == False: continue # If we haven't to report, do nothing. elif log_variable == False: pass if log_variable == True and logg and len(welcomed_users) != 0: if len(welcomed_users) == 1: wikipedia.output(u'Putting the log of the latest user...') else: wikipedia.output(u'Putting the log of the latest %d users...' % len(welcomed_users)) logresult2 = logmaker(wsite, welcomed_users, logg, summ2, usernam, contrib) welcomed_users = list() if logresult2 == False: continue # If recursive, don't exit, repeat after one hour. if recursive == True: waitstr = unicode(time_variable) if locale.getlocale()[1]: strfstr = unicode(time.strftime(u"%d %b %Y %H:%M:%S (UTC)", time.gmtime()), locale.getlocale()[1]) else: strfstr = unicode(time.strftime(u"%d %b %Y %H:%M:%S (UTC)", time.gmtime())) wikipedia.output(u'Sleeping %s seconds before rerun. %s' % (waitstr, strfstr)) time.sleep(time_variable) # If not recursive, break. elif recursive == False: yield [number_user, 'STOP'] | fe702a33925267aa9a210fa3eabf12799ac83373 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/fe702a33925267aa9a210fa3eabf12799ac83373/welcome.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
4272,
6522,
4672,
468,
399,
6159,
326,
2743,
4832,
326,
445,
1981,
18,
2552,
2901,
408,
31,
2552,
4916,
31,
2552,
613,
3618,
31,
2552,
4916,
22,
31,
2552,
2605,
67,
2433,
31,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
4272,
6522,
4672,
468,
399,
6159,
326,
2743,
4832,
326,
445,
1981,
18,
2552,
2901,
408,
31,
2552,
4916,
31,
2552,
613,
3618,
31,
2552,
4916,
22,
31,
2552,
2605,
67,
2433,
31,... | |
print ev.kwargs | def test_remote_collect_skip(self, slave): p = slave.testdir.makepyfile(""" import py py.test.skip("hello") """) slave.setup() ev = slave.popevent("collectionstart") assert not ev.kwargs ev = slave.popevent() assert ev.name == "collectreport" rep = unserialize_report(ev.name, ev.kwargs['data']) assert rep.skipped ev = slave.popevent("collectionfinish") print ev.kwargs assert not ev.kwargs['ids'] | 51815940c27a7e1f5b40d716ab3f97b39aaa2fc5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1924/51815940c27a7e1f5b40d716ab3f97b39aaa2fc5/test_remote.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
7222,
67,
14676,
67,
7457,
12,
2890,
16,
11735,
4672,
293,
273,
11735,
18,
3813,
1214,
18,
81,
581,
881,
93,
768,
2932,
3660,
1930,
2395,
2395,
18,
3813,
18,
7457,
2932,
2371... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7222,
67,
14676,
67,
7457,
12,
2890,
16,
11735,
4672,
293,
273,
11735,
18,
3813,
1214,
18,
81,
581,
881,
93,
768,
2932,
3660,
1930,
2395,
2395,
18,
3813,
18,
7457,
2932,
2371... | |
self.CheckEditableBlock("EditCalendarStartTime", "start time", dict[field]) | self.CheckEditableBlock("EditCalendarStartTime", "start time", value) | def Check_DetailView(self, dict): """ Check expected values by comparation to the data diplayed in the detail view @type dict : dictionary @param dict : dictionary with expected item attributes values for checking {"attributeName":"expected value",...} """ if self.logger: self.logger.SetChecked(True) self.SelectItem() # call the check methods for field in dict.keys(): if field == "displayName": # display name checking self.CheckEditableBlock("HeadlineBlock", "display name", dict[field]) elif field == "startDate": # start date checking self.CheckEditableBlock("EditCalendarStartDate", "start date", self.formatDate(dict[field])) elif field == "startTime": # start time checking self.CheckEditableBlock("EditCalendarStartTime", "start time", dict[field]) elif field == "endDate": # end date checking self.CheckEditableBlock("EditCalendarEndDate", "end date", self.formatDate(dict[field])) elif field == "endTime": # end time checking self.CheckEditableBlock("EditCalendarEndTime", "end time", dict[field]) elif field == "location": # location checking self.CheckEditableBlock("CalendarLocation", "location", dict[field]) elif field == "body": # body checking self.CheckEditableBlock("NotesBlock", "body", dict[field]) elif field == "fromAddress": # from address checking self.CheckEditableBlock("EditMailFrom", "from address", dict[field]) elif field == "toAddress": # to address checking self.CheckEditableBlock("EditMailTo", "to address", dict[field]) elif field == "ccAddress": # cc address checking self.CheckEditableBlock("EditMailCc", "cc address", dict[field]) elif field == "bccAddress": # bcc address checking self.CheckEditableBlock("EditMailBcc", "bcc address", dict[field]) elif field == "status": # status checking self.CheckMenuBlock("EditTransparency", "status", dict[field]) elif field == "timeZone": # time zone checking self.CheckMenuBlock("EditTimeZone", "time-zone", dict[field]) elif field == "recurrence": # recurrence checking self.CheckMenuBlock("EditRecurrence", "recurrence", dict[field]) elif field == "recurrenceEnd": # recurrence end date checking self.CheckEditableBlock("EditRecurrenceEnd", "recurrence end", self.formatDate(dict[field])) elif field == "alarm": # status checking self.CheckMenuBlock("EditReminder", "alarm", dict[field]) elif field == "allDay": # status checking self.CheckEditableBlock("EditAllDay", "all-day", dict[field]) elif field == "stampMail": # Mail stamp checking self.CheckButton("MailMessageButton", "mail stamp", dict[field]) elif field == "stampTask": # Task stamp checking self.CheckButton("TaskStamp", "task stamp", dict[field]) elif field == "stampEvent": # Event stamp checking self.CheckButton("CalendarStamp", "calendar stamp", dict[field]) else: # Wrong check => set the report state to unchecked if self.logger: self.logger.SetChecked(False) #report the checkings if self.logger: self.logger.Report("Detail View") | 5c6ba404b99947f3210082287c79a9b81a402c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/5c6ba404b99947f3210082287c79a9b81a402c26/QAUITestAppLib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2073,
67,
6109,
1767,
12,
2890,
16,
2065,
4672,
3536,
2073,
2665,
924,
635,
532,
20961,
358,
326,
501,
4314,
1601,
329,
316,
326,
7664,
1476,
632,
723,
2065,
294,
3880,
632,
891,
2065,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2073,
67,
6109,
1767,
12,
2890,
16,
2065,
4672,
3536,
2073,
2665,
924,
635,
532,
20961,
358,
326,
501,
4314,
1601,
329,
316,
326,
7664,
1476,
632,
723,
2065,
294,
3880,
632,
891,
2065,
... |
printError(pkg, "dbus-unauthorized-service", f) | printError(pkg, "suse-dbus-unauthorized-service", f) | def check(self, pkg): global _services_whitelist global _dbus_system_paths | 11cfb60d8f0f6f24e0d3fd2ac4b9e4115128ff39 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10341/11cfb60d8f0f6f24e0d3fd2ac4b9e4115128ff39/CheckDBUSServices.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
3475,
4672,
2552,
389,
8387,
67,
20409,
2552,
389,
1966,
407,
67,
4299,
67,
4481,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
3475,
4672,
2552,
389,
8387,
67,
20409,
2552,
389,
1966,
407,
67,
4299,
67,
4481,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.body_prefix = ['\n%%% Body\n'] | self.body_prefix = ['\n%%% Body\n\\begin{document}\n'] | def __init__(self, document): nodes.NodeVisitor.__init__(self, document) self.settings = settings = document.settings self.latex_encoding = self.to_latex_encoding(settings.output_encoding) self.use_latex_toc = settings.use_latex_toc self.use_latex_docinfo = settings.use_latex_docinfo self.use_latex_footnotes = settings.use_latex_footnotes self._use_latex_citations = settings.use_latex_citations self.embed_stylesheet = settings.embed_stylesheet self._reference_label = settings.reference_label self.hyperlink_color = settings.hyperlink_color self.compound_enumerators = settings.compound_enumerators self.font_encoding = settings.font_encoding self.section_prefix_for_enumerators = ( settings.section_prefix_for_enumerators) self.section_enumerator_separator = ( settings.section_enumerator_separator.replace('_', '\\_')) if self.hyperlink_color == '0': self.hyperlink_color = 'black' self.colorlinks = 'false' else: self.colorlinks = 'true' if self.settings.literal_block_env != '': self.settings.use_verbatim_when_possible = True if self.settings.use_bibtex: self.bibtex = self.settings.use_bibtex.split(',',1) # TODO avoid errors on not declared citations. else: self.bibtex = None # language: labels, bibliographic_fields, and author_separators. # to allow writing labes for specific languages. self.language = languages.get_language(settings.language_code) self.babel = Babel(settings.language_code) self.author_separator = self.language.author_separators[0] self.d_options = self.settings.documentoptions if self.babel.get_language(): self.d_options += ',%s' % self.babel.get_language() self.latex_equivalents[u'\u00A0'] = self.babel.nobr | 46a0c8dd14843f2383711724a77c799cd55db324 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1278/46a0c8dd14843f2383711724a77c799cd55db324/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1668,
4672,
2199,
18,
907,
7413,
16186,
2738,
972,
12,
2890,
16,
1668,
13,
365,
18,
4272,
273,
1947,
273,
1668,
18,
4272,
365,
18,
26264,
67,
5999,
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,
1001,
2738,
972,
12,
2890,
16,
1668,
4672,
2199,
18,
907,
7413,
16186,
2738,
972,
12,
2890,
16,
1668,
13,
365,
18,
4272,
273,
1947,
273,
1668,
18,
4272,
365,
18,
26264,
67,
5999,
273,
... |
""" | """ | def valid_uri(self, uri): """ Check whether or not it's a good idea to have RabbitVCS do its magic for this URI. Some examples of URI schemes: x-nautilus-desktop:/// # e.g. mounted devices on the desktop """ if not uri.startswith("file://"): return False return True | 6268447808016e08552fea26797a7dc725fdd8d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5119/6268447808016e08552fea26797a7dc725fdd8d3/RabbitVCS.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
923,
67,
1650,
12,
2890,
16,
2003,
4672,
3536,
2073,
2856,
578,
486,
518,
1807,
279,
7494,
21463,
358,
1240,
31967,
58,
4596,
741,
2097,
8146,
364,
333,
3699,
18,
10548,
10991,
434,
3699... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
923,
67,
1650,
12,
2890,
16,
2003,
4672,
3536,
2073,
2856,
578,
486,
518,
1807,
279,
7494,
21463,
358,
1240,
31967,
58,
4596,
741,
2097,
8146,
364,
333,
3699,
18,
10548,
10991,
434,
3699... |
if type(cmd) in (type(''),type(u'')): oldcmd = DamnUnicode(cmd) while cmd: if cmd[0] == '"': arg = cmd[1:cmd.find('"', 1)] cmd = cmd[2 + len(arg):].strip() else: if cmd.find(' ') != -1: arg = cmd[0:cmd.find(' ')] else: arg = cmd cmd = cmd[len(arg):].strip() finalcmd.append(arg) | if type(cmd) in (type(''), type(u'')): cmd = DamnUnicode(cmd) if DV.os == 'nt': if type(cmd) in (type([]), type(())): tempcmd = [] for i in cmd: tempcmd.append(DamnUnicode(i).encode('windows-1252')) Damnlog('Spawning subprocess on NT:', tempcmd) return subprocess.Popen(tempcmd, shell=shell, creationflags=win32process.CREATE_NO_WINDOW, stderr=subprocess.PIPE, stdout=subprocess.PIPE, stdin=subprocess.PIPE, cwd=cwd.encode('windows-1252'), executable=None, bufsize=128) else: Damnlog('Spawning subprocess on NT:', cmd) return subprocess.Popen(cmd.encode('windows-1252'), shell=shell, creationflags=win32process.CREATE_NO_WINDOW, stderr=subprocess.PIPE, stdout=subprocess.PIPE, stdin=subprocess.PIPE, cwd=cwd.encode('windows-1252'), executable=None, bufsize=128) | def DamnSpawner(cmd, shell=False, stderr=None, stdout=None, stdin=None, cwd=None): finalcmd = [] if cwd is None: cwd = DV.curdir cwd = DamnUnicode(cwd) if type(cmd) in (type(''),type(u'')): oldcmd = DamnUnicode(cmd) while cmd: if cmd[0] == '"': arg = cmd[1:cmd.find('"', 1)] cmd = cmd[2 + len(arg):].strip() else: if cmd.find(' ') != -1: arg = cmd[0:cmd.find(' ')] else: arg = cmd cmd = cmd[len(arg):].strip() finalcmd.append(arg) else: finalcmd = cmd if DV.os == 'nt': Damnlog('Spawning subprocess', oldcmd) return subprocess.Popen(oldcmd.encode('windows-1252'), shell=shell, creationflags=win32process.CREATE_NO_WINDOW, stderr=subprocess.PIPE, stdout=subprocess.PIPE, stdin=subprocess.PIPE, cwd=cwd.encode('windows-1252'), executable=None, bufsize=128) # Yes, ALL std's must be PIPEd, otherwise it doesn't work on win32 (see http://www.py2exe.org/index.cgi/Py2ExeSubprocessInteractions) else: Damnlog('Spawning subprocess', finalcmd) return subprocess.Popen(finalcmd, shell=shell, stderr=stderr, stdout=stdout, stdin=stdin, cwd=cwd, executable=None, bufsize=128) # Must specify bufsize, or it might be too big to actually get any data (happened to me on Ubuntu) | 2e4d33b2a8b84c7e2a1d15176545dae986a39d07 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11142/2e4d33b2a8b84c7e2a1d15176545dae986a39d07/DamnVid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
463,
301,
82,
3389,
2219,
1224,
12,
4172,
16,
5972,
33,
8381,
16,
4514,
33,
7036,
16,
3909,
33,
7036,
16,
8801,
33,
7036,
16,
7239,
33,
7036,
4672,
727,
4172,
273,
5378,
309,
7239,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
463,
301,
82,
3389,
2219,
1224,
12,
4172,
16,
5972,
33,
8381,
16,
4514,
33,
7036,
16,
3909,
33,
7036,
16,
8801,
33,
7036,
16,
7239,
33,
7036,
4672,
727,
4172,
273,
5378,
309,
7239,
3... |
while 1: new_basename = os.path.splitext(basename)[0] if basename == new_basename: break else: basename = new_basename return basename | return os.path.splitext(basename)[0] | def ExtractModuleName(infile_path): """Infers the module name from the input file path. The input filename is supposed to be in the form "ModuleName.sigs". This function splits the filename from the extention on that basename of the path and returns that as the module name. Args: infile_path: String holding the path to the input file. Returns: The module name as a string. """ basename = os.path.basename(infile_path) # This loop continously removes suffixes of the filename separated by a "." # character. while 1: new_basename = os.path.splitext(basename)[0] if basename == new_basename: break else: basename = new_basename return basename | d2fbcbd334df5bbb1727220522d6d9ba744cb77c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/d2fbcbd334df5bbb1727220522d6d9ba744cb77c/generate_stubs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8152,
22542,
12,
267,
768,
67,
803,
4672,
3536,
13149,
414,
326,
1605,
508,
628,
326,
810,
585,
589,
18,
225,
1021,
810,
1544,
353,
18405,
358,
506,
316,
326,
646,
315,
22542,
18,
7340... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8152,
22542,
12,
267,
768,
67,
803,
4672,
3536,
13149,
414,
326,
1605,
508,
628,
326,
810,
585,
589,
18,
225,
1021,
810,
1544,
353,
18405,
358,
506,
316,
326,
646,
315,
22542,
18,
7340... |
self.auth = dom.getElementsByTagName("auth")[0].childNodes[0].data | self.auth = dom.getElementsByTagName("auth")[0].childNodes[0].data | def authenticate(self): """ Attempt to authenticate to Ampache. Returns True if successful and False if not. This will retry AUTH_MAX_RETRY(=3) times. """ # check for the necessary information if not self.has_credentials(): return False # generate the necessary information for the authentication timestamp = int(time.time()) password = hashlib.sha256(self.password).hexdigest() authkey = hashlib.sha256(str(timestamp) + password).hexdigest() values = {'action' : 'handshake', 'auth' : authkey, 'timestamp' : timestamp, 'user' : self.username, 'version' : '350001', } data = urllib.urlencode(values) | 6e5d7cb6fac763a180b0b3ccfee051ad464902e3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11350/6e5d7cb6fac763a180b0b3ccfee051ad464902e3/AmpacheSession.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8929,
12,
2890,
4672,
3536,
12864,
358,
8929,
358,
432,
1291,
807,
18,
225,
2860,
1053,
309,
6873,
471,
1083,
309,
486,
18,
1220,
903,
3300,
12790,
67,
6694,
67,
24240,
12,
33,
23,
13,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8929,
12,
2890,
4672,
3536,
12864,
358,
8929,
358,
432,
1291,
807,
18,
225,
2860,
1053,
309,
6873,
471,
1083,
309,
486,
18,
1220,
903,
3300,
12790,
67,
6694,
67,
24240,
12,
33,
23,
13,... |
self.waited = 1 | self.waited = "True" | def jsScriptSrc (self, url, language): assert self.state=='parse' ver = 0.0 if language: mo = re.search(r'(?i)javascript(?P<num>\d\.\d)', language) if mo: ver = float(mo.group('num')) debug(HURT_ME_PLENTY, "JS: self.url", self.url) debug(HURT_ME_PLENTY, "JS: url", url) url = urlparse.urljoin(self.url, url) debug(HURT_ME_PLENTY, "JS: jsScriptSrc", url, ver) self.state = 'wait' client = HttpProxyClient(self.jsScriptData, (url, ver)) ClientServerMatchmaker(client, "GET %s HTTP/1.1" % url, #request {}, #headers '', #content {'nofilter': None}, 'identity', # compress ) self.waited = 1 | 89b79386924e75b2a16ac8ce4c732a86c3d9ed2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/89b79386924e75b2a16ac8ce4c732a86c3d9ed2d/Rewriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3828,
3651,
7740,
261,
2890,
16,
880,
16,
2653,
4672,
1815,
365,
18,
2019,
18920,
2670,
11,
1924,
273,
374,
18,
20,
309,
2653,
30,
7344,
273,
283,
18,
3072,
12,
86,
11,
3680,
77,
13,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3828,
3651,
7740,
261,
2890,
16,
880,
16,
2653,
4672,
1815,
365,
18,
2019,
18920,
2670,
11,
1924,
273,
374,
18,
20,
309,
2653,
30,
7344,
273,
283,
18,
3072,
12,
86,
11,
3680,
77,
13,... |
else | else: | def __init__(data = None) if data == None: quickfix.CharField.__init__(self, 4) else quickfix.CharField.__init__(self, 4, 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,
2156,
974,
16186,
2738,
972,
12,
2890,
16,
1059,
13,
469,
30,
9549,
904,
18,
2156,
974,
16186,
2738,
97... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
2156,
974,
16186,
2738,
972,
12,
2890,
16,
1059,
13,
469,
30,
9549,
904,
18,
2156,
974,
16186,
2738,
97... |
version = '0.1.14', | version = '0.2', | def all_files(dir, lstrip): """ Return list of all filenames in the given directory, with lstrip stripped from the left of the filenames. """ X = [] for F in os.listdir(dir): ab = dir+'/'+F if os.path.isfile(ab): X.append((ab).lstrip(lstrip)) elif os.path.isdir(ab): X.extend(all_files(ab, lstrip)) return X | cd74104f5af4ab8417b014f065919b9095980761 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11792/cd74104f5af4ab8417b014f065919b9095980761/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
777,
67,
2354,
12,
1214,
16,
14730,
4672,
3536,
2000,
666,
434,
777,
9066,
316,
326,
864,
1867,
16,
598,
14730,
13300,
628,
326,
2002,
434,
326,
9066,
18,
3536,
1139,
273,
5378,
364,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
777,
67,
2354,
12,
1214,
16,
14730,
4672,
3536,
2000,
666,
434,
777,
9066,
316,
326,
864,
1867,
16,
598,
14730,
13300,
628,
326,
2002,
434,
326,
9066,
18,
3536,
1139,
273,
5378,
364,
4... |
if flags & select.POLLPRI: obj.handle_expt_event() | except socket.error, e: if e.args[0] not in (EBADF, ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED): obj.handle_error() else: obj.handle_close() | def readwrite(obj, flags): try: if flags & select.POLLIN: obj.handle_read_event() if flags & select.POLLOUT: obj.handle_write_event() if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL): obj.handle_close() if flags & select.POLLPRI: obj.handle_expt_event() except _reraised_exceptions: raise except: obj.handle_error() | 30389241ef0f00a44bebe43ec4516987694988e7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/30389241ef0f00a44bebe43ec4516987694988e7/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
2626,
12,
2603,
16,
2943,
4672,
775,
30,
309,
2943,
473,
2027,
18,
14232,
20663,
30,
1081,
18,
4110,
67,
896,
67,
2575,
1435,
309,
2943,
473,
2027,
18,
14232,
1502,
1693,
30,
1081... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2626,
12,
2603,
16,
2943,
4672,
775,
30,
309,
2943,
473,
2027,
18,
14232,
20663,
30,
1081,
18,
4110,
67,
896,
67,
2575,
1435,
309,
2943,
473,
2027,
18,
14232,
1502,
1693,
30,
1081... |
self.pack_off(self.path) | self.pack_off(self.size) | def make(self): return self.pack_uint(self.code) + \ self.pack_string(self.user) + \ self.pack_string(self.path) + \ self.pack_off(self.path) | 6f814f34f8781c6020dff7f64202d5d5c99cefaf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8737/6f814f34f8781c6020dff7f64202d5d5c99cefaf/messages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
12,
2890,
4672,
327,
365,
18,
2920,
67,
11890,
12,
2890,
18,
710,
13,
397,
521,
365,
18,
2920,
67,
1080,
12,
2890,
18,
1355,
13,
397,
521,
365,
18,
2920,
67,
1080,
12,
2890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1221,
12,
2890,
4672,
327,
365,
18,
2920,
67,
11890,
12,
2890,
18,
710,
13,
397,
521,
365,
18,
2920,
67,
1080,
12,
2890,
18,
1355,
13,
397,
521,
365,
18,
2920,
67,
1080,
12,
2890,
... |
def spawn_link_exception(cls, function, *args, **kwargs): g = cls.spawn(function, *args, **kwargs) | def spawn_link_exception(cls, *args, **kwargs): g = cls.spawn(*args, **kwargs) | def spawn_link_exception(cls, function, *args, **kwargs): g = cls.spawn(function, *args, **kwargs) g.link_exception() return g | e371f455f40e5d9f39dd79a6d3c3b8a42ded92bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10423/e371f455f40e5d9f39dd79a6d3c3b8a42ded92bb/greenlet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12560,
67,
1232,
67,
4064,
12,
6429,
16,
380,
1968,
16,
2826,
4333,
4672,
314,
273,
2028,
18,
1752,
9533,
30857,
1968,
16,
2826,
4333,
13,
314,
18,
1232,
67,
4064,
1435,
327,
314,
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,
12560,
67,
1232,
67,
4064,
12,
6429,
16,
380,
1968,
16,
2826,
4333,
4672,
314,
273,
2028,
18,
1752,
9533,
30857,
1968,
16,
2826,
4333,
13,
314,
18,
1232,
67,
4064,
1435,
327,
314,
2,
... |
raise ExtractError, "special devices not supported by system" | raise ExtractError("special devices not supported by system") | def makedev(self, tarinfo, targetpath): """Make a character or block device called targetpath. """ if not hasattr(os, "mknod") or not hasattr(os, "makedev"): raise ExtractError, "special devices not supported by system" | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
5206,
12,
2890,
16,
8232,
1376,
16,
1018,
803,
4672,
3536,
6464,
279,
3351,
578,
1203,
2346,
2566,
1018,
803,
18,
3536,
309,
486,
3859,
12,
538,
16,
315,
24816,
19888,
7923,
578,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
5206,
12,
2890,
16,
8232,
1376,
16,
1018,
803,
4672,
3536,
6464,
279,
3351,
578,
1203,
2346,
2566,
1018,
803,
18,
3536,
309,
486,
3859,
12,
538,
16,
315,
24816,
19888,
7923,
578,
... |
target[p] = source[i] | res.ll_setitem_fast(p, l.ll_getitem_fast(i)) | def ll_inplace_mul(l, factor): length = l.ll_length() if factor < 0: factor = 0 resultlen = length * factor res = l _ll_list_resize(res, resultlen) j = length source = l.ll_items() target = res.ll_items() while j < resultlen: i = 0 while i < length: p = j + i target[p] = source[i] i += 1 j += length return res | afabe8603c579750f81fa9c16896184dfa4a53b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/afabe8603c579750f81fa9c16896184dfa4a53b8/rlist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6579,
67,
267,
964,
67,
16411,
12,
80,
16,
5578,
4672,
769,
273,
328,
18,
2906,
67,
2469,
1435,
309,
5578,
411,
374,
30,
5578,
273,
374,
563,
1897,
273,
769,
380,
5578,
400,
273,
328... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6579,
67,
267,
964,
67,
16411,
12,
80,
16,
5578,
4672,
769,
273,
328,
18,
2906,
67,
2469,
1435,
309,
5578,
411,
374,
30,
5578,
273,
374,
563,
1897,
273,
769,
380,
5578,
400,
273,
328... |
self._context.setLocal(self.name, self.item) | context = self._context_ref() if context is not None: context.setLocal(self.name, self.item) | def next(self): if ZTUtils.Iterator.next(self): self._context.setLocal(self.name, self.item) return 1 return 0 | a6cfcc00aeae1e7b7c82981e3652ea62df0b90f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a6cfcc00aeae1e7b7c82981e3652ea62df0b90f9/TALES.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
12,
2890,
4672,
309,
2285,
56,
1989,
18,
3198,
18,
4285,
12,
2890,
4672,
819,
273,
365,
6315,
2472,
67,
1734,
1435,
309,
819,
353,
486,
599,
30,
819,
18,
542,
2042,
12,
2890,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
12,
2890,
4672,
309,
2285,
56,
1989,
18,
3198,
18,
4285,
12,
2890,
4672,
819,
273,
365,
6315,
2472,
67,
1734,
1435,
309,
819,
353,
486,
599,
30,
819,
18,
542,
2042,
12,
2890,
1... |
result = diracAdmin.getJobPilotOutput(job) | result = diracAdmin.getJobPilotOutput( job ) | def usage(): print 'Usage: %s <JobID> [<JobID>]' %(Script.scriptName) DIRAC.exit(2) | b88356c8571ab409f104405a01e9407cfe8f8ed6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/b88356c8571ab409f104405a01e9407cfe8f8ed6/dirac-admin-get-job-pilot-output.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
2278,
734,
34,
306,
32,
2278,
734,
34,
3864,
8975,
3651,
18,
4263,
461,
13,
18544,
2226,
18,
8593,
12,
22,
13,
225,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
2278,
734,
34,
306,
32,
2278,
734,
34,
3864,
8975,
3651,
18,
4263,
461,
13,
18544,
2226,
18,
8593,
12,
22,
13,
225,
2,
-100,
-100,
-10... |
if "</noinclude>" in s2[firstafter:]: | if "</noinclude>" in s2[firstafter:] and firstafter < 0: | def replaceCategoryLinks(oldtext, new, site = None): """Replace the category links given in the wikitext given in oldtext by the new links given in new. 'new' should be a list of Category objects. """ if site is None: site = getSite() if site == Site('de', 'wikipedia'): raise Error('The PyWikipediaBot is no longer allowed to touch categories on the German Wikipedia. See de.wikipedia.org/wiki/Wikipedia_Diskussion:Personendaten#Position') s = categoryFormat(new, insite = site) s2 = removeCategoryLinks(oldtext, site = site) if s: if site.language() in site.family.category_attop: newtext = s + site.family.category_text_separator + s2 else: # calculate what was after the categories links on the page firstafter = 0 try: while s2[firstafter-1] == oldtext[firstafter-1]: firstafter -= 1 except IndexError: pass # Is there any text in the 'after' part that means we should keep it after? if "</noinclude>" in s2[firstafter:]: newtext = s2[:firstafter+1] + s + s2[firstafter+1:] elif site.language() in site.family.categories_last: newtext = s2 + site.family.category_text_separator + s else: interwiki = getLanguageLinks(s2) s2 = removeLanguageLinks(s2, site) + site.family.category_text_separator + s newtext = replaceLanguageLinks(s2, interwiki, site) else: return s2 return newtext | 2478b18daa9c17ef1eec4a64ae0eb094462ef106 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/2478b18daa9c17ef1eec4a64ae0eb094462ef106/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
4457,
7100,
12,
1673,
955,
16,
394,
16,
2834,
273,
599,
4672,
3536,
5729,
326,
3150,
4716,
864,
316,
326,
341,
1766,
305,
408,
864,
316,
1592,
955,
635,
326,
394,
4716,
864,
316,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
4457,
7100,
12,
1673,
955,
16,
394,
16,
2834,
273,
599,
4672,
3536,
5729,
326,
3150,
4716,
864,
316,
326,
341,
1766,
305,
408,
864,
316,
1592,
955,
635,
326,
394,
4716,
864,
316,... |
action.skills[skill] = [minimum, maximum] | try: penalty = hex2dec(subchild.getattribute('penalty','0')) except: console.log(LOG_ERROR, "%s element with invalid max value in menu %s.\n" % (subchild.name, menu.id)) action.skills[skill] = [minimum, maximum, penalty] | itemdef = child.getattribute('definition') | 2fed29196e764f322a3e1d3a6ba446c5f0a6a9a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/2fed29196e764f322a3e1d3a6ba446c5f0a6a9a8/blacksmithing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
761,
536,
273,
1151,
18,
588,
4589,
2668,
6907,
6134,
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... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
761,
536,
273,
1151,
18,
588,
4589,
2668,
6907,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
regex_string = r'\b((?<=find)|(?<=and)|(?<=or)|(?<=not))\s*' + old_keyword | regex_string = r'\b(?P<operator>(find|and|or|not)\b[\s\(]*)' + \ old_keyword + r'(?P<end>[\s\(]+|$)' | def _replace_keyword(self, query, old_keyword, new_keyword): """Replaces old keyword in the query with a new keyword""" | 9ac6f199aca80bde5350b014ceb25041ee84876b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2139/9ac6f199aca80bde5350b014ceb25041ee84876b/search_engine_query_parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2079,
67,
11041,
12,
2890,
16,
843,
16,
1592,
67,
11041,
16,
394,
67,
11041,
4672,
3536,
15189,
1592,
4932,
316,
326,
843,
598,
279,
394,
4932,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
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,
2079,
67,
11041,
12,
2890,
16,
843,
16,
1592,
67,
11041,
16,
394,
67,
11041,
4672,
3536,
15189,
1592,
4932,
316,
326,
843,
598,
279,
394,
4932,
8395,
2,
-100,
-100,
-100,
-100,
-1... |
self.attr = m.eval('attributeQuery -ln -n %s %s'%(self.obj,self.attr)) | self.attr = cmd.attributeQuery(self.attr,longName=True,node=self.obj) | def __init__( self, attrpath, keyTime=None, keyIdx=None ): #if the attrpath doesn't exist, then just create an empty key instance if not m.eval('objExists "%s";'%(attrpath,)): self.obj = None self.attr = None self.time = None self.value = None self.iw = None self.ow = None self.itt = None self.ott = None self.time = None return | 8781a673d03469676f09284ae55510ab6d71bde7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1810/8781a673d03469676f09284ae55510ab6d71bde7/keyUtils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
1604,
803,
16,
498,
950,
33,
7036,
16,
498,
4223,
33,
7036,
262,
30,
468,
430,
326,
1604,
803,
3302,
1404,
1005,
16,
1508,
2537,
752,
392,
1008,
498,
79... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
365,
16,
1604,
803,
16,
498,
950,
33,
7036,
16,
498,
4223,
33,
7036,
262,
30,
468,
430,
326,
1604,
803,
3302,
1404,
1005,
16,
1508,
2537,
752,
392,
1008,
498,
79... |
return HttpResponse(json.encode(resp), mimetype = 'text/plain') | return HttpResponse(str(resp), mimetype = 'text/plain') | def task_filter(request): try: owner = request.POST['Owner'] status = request.POST['Status'] kindid = request.POST['Kind'] filterText = request.POST['FilterText'].strip().lower() # Max results per page maxPerPage = int(request.POST['Limit']) # page # to return targetPage = int(request.POST['Page']) except KeyError, e: raise HttpResponseServerError('Bad parameters') lenAllTasks = Processing_task.objects.count() anyStatus = False if status == 'successful': success = 1 elif status == 'failed': success = 0 else: anyStatus = True if owner == 'all': if anyStatus: tasks, filtered = read_proxy(request, Processing_task.objects.filter(kind__name = kindid).order_by('-end_date')) else: tasks, filtered = read_proxy(request, Processing_task.objects.filter(success = success, kind__name = kindid).order_by('-end_date')) elif owner == 'my': if anyStatus: tasks, filtered = read_proxy(request, Processing_task.objects.filter(user = request.user, kind__name = kindid).order_by('-end_date')) else: tasks, filtered = read_proxy(request, Processing_task.objects.filter(user = request.user, success = success, kind__name = kindid).order_by('-end_date')) elif owner == 'others': if anyStatus: tasks, filtered = read_proxy(request, Processing_task.objects.exclude(user = request.user).filter(kind__name = kindid).order_by('-end_date')) else: tasks, filtered = read_proxy(request, Processing_task.objects.exclude(user = request.user).filter(success = success, kind__name = kindid).order_by('-end_date')) else: tasks, filtered = read_proxy(request, Processing_task.objects.all().order_by('-end_date')) tasksIds = [{'id': t.id} for t in tasks] res = [] nb_suc = nb_failed = 0 if filterText: keepIds = [] for t in tasksIds: | 08e77067dd177b699676d0d1381eb2114a5bf235 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11651/08e77067dd177b699676d0d1381eb2114a5bf235/condor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1562,
67,
2188,
12,
2293,
4672,
775,
30,
3410,
273,
590,
18,
3798,
3292,
5541,
3546,
1267,
273,
590,
18,
3798,
3292,
1482,
3546,
3846,
350,
273,
590,
18,
3798,
3292,
5677,
3546,
1034,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1562,
67,
2188,
12,
2293,
4672,
775,
30,
3410,
273,
590,
18,
3798,
3292,
5541,
3546,
1267,
273,
590,
18,
3798,
3292,
1482,
3546,
3846,
350,
273,
590,
18,
3798,
3292,
5677,
3546,
1034,
... |
self.watcherThread.start() | self.watcherThread.CreateThread() | def __init__(self, template): self.bAutoReload = GetEditorOption("Auto Reload", 1) self.bDeclinedReload = 0 # Has the user declined to reload. self.fileStat = None self.bReportedFileNotFound = 0 | 002f429e05cfb7084f2a7e09f56f9520dbbe7649 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/002f429e05cfb7084f2a7e09f56f9520dbbe7649/document.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1542,
4672,
365,
18,
70,
4965,
13013,
273,
968,
6946,
1895,
2932,
4965,
23086,
3113,
404,
13,
365,
18,
70,
3456,
1920,
13013,
273,
374,
468,
4393,
326,
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,
1001,
2738,
972,
12,
2890,
16,
1542,
4672,
365,
18,
70,
4965,
13013,
273,
968,
6946,
1895,
2932,
4965,
23086,
3113,
404,
13,
365,
18,
70,
3456,
1920,
13013,
273,
374,
468,
4393,
326,
7... |
if worker.thread_id in self.worker_tracker: time_started, info = self.worker_tracker[worker.thread_id] | time_started, info = self.worker_tracker.get(worker.thread_id, (None, None)) if time_started is not None: | def add_task(self, task): """ Add a task to the queue """ self.logger.debug('Added task (%i tasks queued)', self.queue.qsize()) if self.hung_check_period: self.requests_since_last_hung_check += 1 if self.requests_since_last_hung_check > self.hung_check_period: self.requests_since_last_hung_check = 0 self.kill_hung_threads() if not self.idle_workers and self.spawn_if_under: # spawn_if_under can come into effect... busy = 0 now = time.time() self.logger.debug('No idle workers for task; checking if we need to make more workers') for worker in self.workers: if not hasattr(worker, 'thread_id'): # Not initialized continue if worker.thread_id in self.worker_tracker: time_started, info = self.worker_tracker[worker.thread_id] if now - time_started < self.hung_thread_limit: busy += 1 if busy < self.spawn_if_under: self.logger.info( 'No idle tasks, and only %s busy tasks; adding %s more ' 'workers', busy, self.spawn_if_under-busy) self._last_added_new_idle_workers = time.time() for i in range(self.spawn_if_under - busy): self.add_worker_thread(message='Response to lack of idle workers') else: self.logger.debug( 'No extra workers needed (%s busy workers)', busy) if (len(self.workers) > self.nworkers and len(self.idle_workers) > 3 and time.time()-self._last_added_new_idle_workers > self.hung_thread_limit): # We've spawned worers in the past, but they aren't needed # anymore; kill off some self.logger.info( 'Culling %s extra workers (%s idle workers present)', len(self.workers)-self.nworkers, len(self.idle_workers)) self.logger.debug( 'Idle workers: %s', self.idle_workers) for i in range(len(self.workers) - self.nworkers): self.queue.put(self.SHUTDOWN) self.queue.put(task) | 8f95e1273c6ac1ca254627ffb5b4cf2ae3a0bdb1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11400/8f95e1273c6ac1ca254627ffb5b4cf2ae3a0bdb1/httpserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
4146,
12,
2890,
16,
1562,
4672,
3536,
1436,
279,
1562,
358,
326,
2389,
3536,
365,
18,
4901,
18,
4148,
2668,
8602,
1562,
6142,
77,
4592,
12234,
13,
2187,
365,
18,
4000,
18,
85,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
4146,
12,
2890,
16,
1562,
4672,
3536,
1436,
279,
1562,
358,
326,
2389,
3536,
365,
18,
4901,
18,
4148,
2668,
8602,
1562,
6142,
77,
4592,
12234,
13,
2187,
365,
18,
4000,
18,
85,... |
msg_string = msg.as_string(options.mbox) return msg_string.strip('\n') | return msg | def __build_cover(tmpl, total_nr, msg_id, options): """Build the cover message (series description) to be sent via SMTP """ sender = __get_sender() if options.version: version_str = ' %s' % options.version else: version_str = '' if options.prefix: prefix_str = options.prefix + ' ' else: prefix_str = '' total_nr_str = str(total_nr) patch_nr_str = '0'.zfill(len(total_nr_str)) if total_nr > 1: number_str = ' %s/%s' % (patch_nr_str, total_nr_str) else: number_str = '' tmpl_dict = {'sender': sender, # for backward template compatibility 'maintainer': sender, # for backward template compatibility 'endofheaders': '', # for backward template compatibility 'date': '', 'version': version_str, 'prefix': prefix_str, 'patchnr': patch_nr_str, 'totalnr': total_nr_str, 'number': number_str} try: msg_string = tmpl % tmpl_dict except KeyError, err: raise CmdException, 'Unknown patch template variable: %s' \ % err except TypeError: raise CmdException, 'Only "%(name)s" variables are ' \ 'supported in the patch template' if options.edit_cover: msg_string = __edit_message(msg_string) # The Python email message try: msg = email.message_from_string(msg_string) except Exception, ex: raise CmdException, 'template parsing error: %s' % str(ex) __build_address_headers(msg, options) __build_extra_headers(msg, msg_id, options.refid) __encode_message(msg) msg_string = msg.as_string(options.mbox) return msg_string.strip('\n') | d650d6ed4c969d0d5127544e5236f83e21608ca5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12366/d650d6ed4c969d0d5127544e5236f83e21608ca5/mail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3510,
67,
3165,
12,
24717,
16,
2078,
67,
11611,
16,
1234,
67,
350,
16,
702,
4672,
3536,
3116,
326,
5590,
883,
261,
10222,
2477,
13,
358,
506,
3271,
3970,
18102,
3536,
5793,
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,
1001,
3510,
67,
3165,
12,
24717,
16,
2078,
67,
11611,
16,
1234,
67,
350,
16,
702,
4672,
3536,
3116,
326,
5590,
883,
261,
10222,
2477,
13,
358,
506,
3271,
3970,
18102,
3536,
5793,
273,
... |
typ, data = self._imap.uid('STORE', msg_list, '+FLAGS', flag_list) else: typ, data = self.store(msg_list, cmd, flag_list) | typ, data = self._imap.uid('STORE', msg_list, cmd, flag_list) else: typ, data = self._imap.store(msg_list, cmd, flag_list) | def _store(self, cmd, messages, flags): '''Worker functions for flag manipulation functions | 85410ed715e4d58f7449b28c7d003bfab4608e73 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9352/85410ed715e4d58f7449b28c7d003bfab4608e73/imapclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2233,
12,
2890,
16,
1797,
16,
2743,
16,
2943,
4672,
9163,
6671,
4186,
364,
2982,
27029,
4186,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2233,
12,
2890,
16,
1797,
16,
2743,
16,
2943,
4672,
9163,
6671,
4186,
364,
2982,
27029,
4186,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if self.getOption('PinyinApostropheFunction')(self, precedingEntity, entity): | if apostropheFunction(precedingEntity, entity): | def compose(self, readingEntities): """ Composes the given list of basic entities to a string. Applies an apostrophe between syllables if needed using default implementation L{aeoApostropheRule()}. | 0032d8af16679bbf2cea1b7da283239b9cde0068 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11128/0032d8af16679bbf2cea1b7da283239b9cde0068/operator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11458,
12,
2890,
16,
6453,
8108,
4672,
3536,
1286,
10522,
326,
864,
666,
434,
5337,
5140,
358,
279,
533,
18,
1716,
5259,
392,
513,
669,
1764,
580,
3086,
18832,
1538,
309,
3577,
1450,
805... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11458,
12,
2890,
16,
6453,
8108,
4672,
3536,
1286,
10522,
326,
864,
666,
434,
5337,
5140,
358,
279,
533,
18,
1716,
5259,
392,
513,
669,
1764,
580,
3086,
18832,
1538,
309,
3577,
1450,
805... |
name = re.sub('(.)', r'\1\-', var.name()) str += name.replace('_', r'\_') + ' & ' | str += self._text_to_latex(var.name(), 1, 1) + ' & ' if var.descr() or var.has_value(): str += '\\raggedright ' if var.has_value(): str += '\\textbf{Value:} \n' if var.descr(): str += self._pprint_var_value(var, 40) else: str += self._pprint_var_value(var, 90) if var.descr(): str += '\n\n' | def _var_list(self, variables, heading='Variables', seclevel=1): variables = self._filtersort_vars(variables) if len(variables) == 0: return '' str = self._start_of(heading) str += ' '+self._section(heading, seclevel) | 718e913e37bd564ee3425ab6734ad7a7748f8a8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/718e913e37bd564ee3425ab6734ad7a7748f8a8a/latex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1401,
67,
1098,
12,
2890,
16,
3152,
16,
11053,
2218,
6158,
2187,
1428,
2815,
33,
21,
4672,
3152,
273,
365,
6315,
2188,
3804,
67,
4699,
12,
7528,
13,
309,
562,
12,
7528,
13,
422,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1401,
67,
1098,
12,
2890,
16,
3152,
16,
11053,
2218,
6158,
2187,
1428,
2815,
33,
21,
4672,
3152,
273,
365,
6315,
2188,
3804,
67,
4699,
12,
7528,
13,
309,
562,
12,
7528,
13,
422,
... |
screen.fill((120, 50, 50), pygame.Rect(0, 0, player1.hitpoints * 2, 10)) screen.fill((120, 50, 50), pygame.Rect(1000 - player2.hitpoints * 2, 0, player2.hitpoints * 2, 10)) | screen.fill((120, 50, 50), pygame.Rect(0, 10, player1.hitpoints * 2, 10)) screen.fill((120, 50, 50), pygame.Rect(1000 - player2.hitpoints * 2, 10, player2.hitpoints * 2, 10)) | def main(): clock = events.dispatcher('Clock') keyboard = events.dispatcher('Keyboard') pygame.init() screen = pygame.display.set_mode((1000, 600)) tick_event = pygame.event.Event(TICK) datadir = find_datadir() player1 = create_viking(datadir, clock, keyboard, K_a, K_d, K_w, K_j) player2 = create_viking(datadir, clock, keyboard, K_LEFT, K_RIGHT, K_UP, K_RETURN) player2.location[0] = 900 entities = [player1, player2] scream = pygame.mixer.Sound(os.path.join(datadir, 'wilhelm.wav')) background = pygame.image.load(os.path.join(datadir, 'background.png')).convert() debug_draw = False while True: start = time.clock() clock.dispatch(tick_event) for event in pygame.event.get(): if event.type == QUIT: return 0 elif event.type == KEYDOWN or event.type == KEYUP: keyboard.dispatch(event) if event.type == KEYDOWN: if event.key == K_F2: debug_draw = not debug_draw elif event.key == K_F3: entities.append(create_sheep(datadir, clock)) elif event.key == K_F4: entities.append(create_drake(datadir, clock)) for thing1, thing2 in itertools.product(entities, entities): if thing1 is thing2: continue if any(thing1.hitbox_active.size <= 0): continue if collision_check(thing1.hitbox_active.point + thing1.location, thing1.hitbox_active.size, thing2.hitbox_passive.point + thing2.location, thing2.hitbox_passive.size): thing2.hitpoints -= 1 for thing1, thing2 in itertools.product(entities, entities): if thing1 is thing2: continue p1 = thing1.hitbox_passive.point + thing1.location p2 = thing2.hitbox_passive.point + thing2.location if collision_check(p1, thing1.hitbox_passive.size, p2, thing2.hitbox_passive.size): if thing1.location[0] < thing2.location[0]: diff = (p2[0] - p1[0] - thing1.hitbox_passive.size[0]) / 2 else: diff = -(p1[0] - p2[0] - thing2.hitbox_passive.size[0]) / 2 thing1.location[0] += diff thing2.location[0] -= diff dead = [] screen.blit(background, (0, 0)) for thing in entities: if thing.hitpoints <= 0: dead.append(thing) continue screen.blit(thing.graphics.sprite, map(math.trunc, thing.location + thing.graphics.anchor)) if debug_draw: screen.fill((227, 227, 227), pygame.Rect(thing.location + thing.hitbox_passive.point, thing.hitbox_passive.size)) screen.fill((255, 100, 100), pygame.Rect(thing.location + thing.hitbox_active.point, thing.hitbox_active.size)) screen.fill((100, 255, 255), pygame.Rect(thing.location[0] - 3, thing.location[1] - 3, 6, 6)) screen.fill((100, 100, 255), pygame.Rect(thing.location, (1, 1))) for thing in dead: scream.play() if thing.name == 'Player': thing.hitpoints = 100 thing.location[:] = (500, -10) if thing.physics is not None: thing.physics.last_position[:] = thing.location else: entities.remove(thing) screen.fill((120, 50, 50), pygame.Rect(0, 0, player1.hitpoints * 2, 10)) screen.fill((120, 50, 50), pygame.Rect(1000 - player2.hitpoints * 2, 0, player2.hitpoints * 2, 10)) pygame.display.flip() delta = time.clock() - start if delta < FRAME: time.sleep(FRAME - delta) | 908436b7a4b343bf9640611d4cf7a63b56f6f6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13911/908436b7a4b343bf9640611d4cf7a63b56f6f6a4/project_viking.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
7268,
273,
2641,
18,
18495,
2668,
14027,
6134,
16263,
273,
2641,
18,
18495,
2668,
17872,
6134,
2395,
13957,
18,
2738,
1435,
5518,
273,
2395,
13957,
18,
5417,
18,
542,
67,
3188... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7268,
273,
2641,
18,
18495,
2668,
14027,
6134,
16263,
273,
2641,
18,
18495,
2668,
17872,
6134,
2395,
13957,
18,
2738,
1435,
5518,
273,
2395,
13957,
18,
5417,
18,
542,
67,
3188... |
labelSaveTitle=Label(frameSave,text='Autosave Preference') | def CreatePageGeneral(self): #tkVars self.winWidth=StringVar(self) self.winHeight=StringVar(self) self.paraWidth=StringVar(self) self.startupEdit=IntVar(self) self.autoSave=IntVar(self) self.encoding=StringVar(self) self.userHelpBrowser=BooleanVar(self) self.helpBrowser=StringVar(self) #widget creation #body frame=self.tabPages.pages['General']['page'] #body section frames frameRun=Frame(frame,borderwidth=2,relief=GROOVE) frameSave=Frame(frame,borderwidth=2,relief=GROOVE) frameWinSize=Frame(frame,borderwidth=2,relief=GROOVE) frameParaSize=Frame(frame,borderwidth=2,relief=GROOVE) frameEncoding=Frame(frame,borderwidth=2,relief=GROOVE) frameHelp=Frame(frame,borderwidth=2,relief=GROOVE) #frameRun labelRunTitle=Label(frameRun,text='Startup Preferences') labelRunChoiceTitle=Label(frameRun,text='At Startup') radioStartupEdit=Radiobutton(frameRun,variable=self.startupEdit, value=1,command=self.SetKeysType,text="Open Edit Window") radioStartupShell=Radiobutton(frameRun,variable=self.startupEdit, value=0,command=self.SetKeysType,text='Open Shell Window') #frameSave labelSaveTitle=Label(frameSave,text='Autosave Preference') labelRunSaveTitle=Label(frameSave,text='At Start of Run (F5) ') radioSaveAsk=Radiobutton(frameSave,variable=self.autoSave, value=0,command=self.SetKeysType,text="Prompt to Save") radioSaveAuto=Radiobutton(frameSave,variable=self.autoSave, value=1,command=self.SetKeysType,text='No Prompt') #frameWinSize labelWinSizeTitle=Label(frameWinSize,text='Initial Window Size'+ ' (in characters)') labelWinWidthTitle=Label(frameWinSize,text='Width') entryWinWidth=Entry(frameWinSize,textvariable=self.winWidth, width=3) labelWinHeightTitle=Label(frameWinSize,text='Height') entryWinHeight=Entry(frameWinSize,textvariable=self.winHeight, width=3) #paragraphFormatWidth labelParaWidthTitle=Label(frameParaSize,text='Paragraph reformat'+ ' width (in characters)') entryParaWidth=Entry(frameParaSize,textvariable=self.paraWidth, width=3) #frameEncoding labelEncodingTitle=Label(frameEncoding,text="Default Source Encoding") radioEncLocale=Radiobutton(frameEncoding,variable=self.encoding, value="locale",text="Locale-defined") radioEncUTF8=Radiobutton(frameEncoding,variable=self.encoding, value="utf-8",text="UTF-8") radioEncNone=Radiobutton(frameEncoding,variable=self.encoding, value="none",text="None") #frameHelp frameHelpList=Frame(frameHelp) frameHelpListButtons=Frame(frameHelpList) labelHelpListTitle=Label(frameHelpList,text='Additional Help Sources:') scrollHelpList=Scrollbar(frameHelpList) self.listHelp=Listbox(frameHelpList,height=5,takefocus=FALSE, exportselection=FALSE) scrollHelpList.config(command=self.listHelp.yview) self.listHelp.config(yscrollcommand=scrollHelpList.set) self.listHelp.bind('<ButtonRelease-1>',self.HelpSourceSelected) self.buttonHelpListEdit=Button(frameHelpListButtons,text='Edit', state=DISABLED,width=8,command=self.HelpListItemEdit) self.buttonHelpListAdd=Button(frameHelpListButtons,text='Add', width=8,command=self.HelpListItemAdd) self.buttonHelpListRemove=Button(frameHelpListButtons,text='Remove', state=DISABLED,width=8,command=self.HelpListItemRemove) #widget packing #body frameRun.pack(side=TOP,padx=5,pady=5,fill=X) frameSave.pack(side=TOP,padx=5,pady=5,fill=X) frameWinSize.pack(side=TOP,padx=5,pady=5,fill=X) frameParaSize.pack(side=TOP,padx=5,pady=5,fill=X) frameEncoding.pack(side=TOP,padx=5,pady=5,fill=X) frameHelp.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH) #frameRun labelRunTitle.pack(side=TOP,anchor=W,padx=5,pady=5) labelRunChoiceTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) radioStartupShell.pack(side=RIGHT,anchor=W,padx=5,pady=5) radioStartupEdit.pack(side=RIGHT,anchor=W,padx=5,pady=5) #frameSave labelSaveTitle.pack(side=TOP,anchor=W,padx=5,pady=5) labelRunSaveTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) radioSaveAuto.pack(side=RIGHT,anchor=W,padx=5,pady=5) radioSaveAsk.pack(side=RIGHT,anchor=W,padx=5,pady=5) #frameWinSize labelWinSizeTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) entryWinHeight.pack(side=RIGHT,anchor=E,padx=10,pady=5) labelWinHeightTitle.pack(side=RIGHT,anchor=E,pady=5) entryWinWidth.pack(side=RIGHT,anchor=E,padx=10,pady=5) labelWinWidthTitle.pack(side=RIGHT,anchor=E,pady=5) #paragraphFormatWidth labelParaWidthTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) entryParaWidth.pack(side=RIGHT,anchor=E,padx=10,pady=5) #frameEncoding labelEncodingTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) radioEncNone.pack(side=RIGHT,anchor=E,pady=5) radioEncUTF8.pack(side=RIGHT,anchor=E,pady=5) radioEncLocale.pack(side=RIGHT,anchor=E,pady=5) #frameHelp frameHelpListButtons.pack(side=RIGHT,padx=5,pady=5,fill=Y) frameHelpList.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH) labelHelpListTitle.pack(side=TOP,anchor=W) scrollHelpList.pack(side=RIGHT,anchor=W,fill=Y) self.listHelp.pack(side=LEFT,anchor=E,expand=TRUE,fill=BOTH) self.buttonHelpListEdit.pack(side=TOP,anchor=W,pady=5) self.buttonHelpListAdd.pack(side=TOP,anchor=W) self.buttonHelpListRemove.pack(side=TOP,anchor=W,pady=5) return frame | ed15565253c2cb817c68ed89e22c7a6c7707ab66 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/ed15565253c2cb817c68ed89e22c7a6c7707ab66/configDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
1964,
12580,
12,
2890,
4672,
468,
16099,
5555,
365,
18,
8082,
2384,
33,
780,
1537,
12,
2890,
13,
365,
18,
8082,
2686,
33,
780,
1537,
12,
2890,
13,
365,
18,
25072,
2384,
33,
780,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
1964,
12580,
12,
2890,
4672,
468,
16099,
5555,
365,
18,
8082,
2384,
33,
780,
1537,
12,
2890,
13,
365,
18,
8082,
2686,
33,
780,
1537,
12,
2890,
13,
365,
18,
25072,
2384,
33,
780,
... | |
self.ready = True | def _parse_request(self): # HTTP/1.1 connections are persistent by default. If a client # requests a page, then idles (leaves the connection open), # then rfile.readline() will raise socket.error("timed out"). # Note that it does this based on the value given to settimeout(), # and doesn't need the client to request or acknowledge the close # (although your TCP stack might suffer for it: cf Apache's history # with FIN_WAIT_2). request_line = self.rfile.readline() # Set started_request to True so communicate() knows to send 408 # from here on out. self.started_request = True if not request_line: # Force self.ready = False so the connection will close. self.ready = False return if request_line == CRLF: # RFC 2616 sec 4.1: "...if the server is reading the protocol # stream at the beginning of a message and receives a CRLF # first, it should ignore the CRLF." # But only ignore one leading line! else we enable a DoS. request_line = self.rfile.readline() if not request_line: self.ready = False return if not request_line.endswith(CRLF): self.simple_response(400, "HTTP requires CRLF terminators") return try: method, uri, req_protocol = request_line.strip().split(" ", 2) except ValueError: self.simple_response(400, "Malformed Request-Line") return self.uri = uri self.method = method # uri may be an abs_path (including "http://host.domain.tld"); scheme, authority, path = self.parse_request_uri(uri) if '#' in path: self.simple_response("400 Bad Request", "Illegal #fragment in Request-URI.") return if scheme: self.scheme = scheme qs = '' if '?' in path: path, qs = path.split('?', 1) # Unquote the path+params (e.g. "/this%20path" -> "/this path"). # http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2 # # But note that "...a URI must be separated into its components # before the escaped characters within those components can be # safely decoded." http://www.ietf.org/rfc/rfc2396.txt, sec 2.4.2 # Therefore, "/this%2Fpath" becomes "/this%2Fpath", not "/this/path". try: atoms = [unquote(x) for x in quoted_slash.split(path)] except ValueError, ex: self.simple_response("400 Bad Request", ex.args[0]) return path = "%2F".join(atoms) self.path = path # Note that, like wsgiref and most other HTTP servers, # we "% HEX HEX"-unquote the path but not the query string. self.qs = qs # Compare request and server HTTP protocol versions, in case our # server does not support the requested protocol. Limit our output # to min(req, server). We want the following output: # request server actual written supported response # protocol protocol response protocol feature set # a 1.0 1.0 1.0 1.0 # b 1.0 1.1 1.1 1.0 # c 1.1 1.0 1.0 1.0 # d 1.1 1.1 1.1 1.1 # Notice that, in (b), the response will be "HTTP/1.1" even though # the client only understands 1.0. RFC 2616 10.5.6 says we should # only return 505 if the _major_ version is different. rp = int(req_protocol[5]), int(req_protocol[7]) sp = int(self.server.protocol[5]), int(self.server.protocol[7]) if sp[0] != rp[0]: self.simple_response("505 HTTP Version Not Supported") return self.request_protocol = req_protocol self.response_protocol = "HTTP/%s.%s" % min(rp, sp) # then all the http headers try: read_headers(self.rfile, self.inheaders) except ValueError, ex: self.simple_response("400 Bad Request", ex.args[0]) return mrbs = self.server.max_request_body_size if mrbs and int(self.inheaders.get("Content-Length", 0)) > mrbs: self.simple_response("413 Request Entity Too Large", "The entity sent with the request exceeds the maximum " "allowed bytes.") return # Persistent connection support if self.response_protocol == "HTTP/1.1": # Both server and client are HTTP/1.1 if self.inheaders.get("Connection", "") == "close": self.close_connection = True else: # Either the server or client (or both) are HTTP/1.0 if self.inheaders.get("Connection", "") != "Keep-Alive": self.close_connection = True # Transfer-Encoding support te = None if self.response_protocol == "HTTP/1.1": te = self.inheaders.get("Transfer-Encoding") if te: te = [x.strip().lower() for x in te.split(",") if x.strip()] self.chunked_read = False if te: for enc in te: if enc == "chunked": self.chunked_read = True else: # Note that, even if we see "chunked", we must reject # if there is an extension we don't recognize. self.simple_response("501 Unimplemented") self.close_connection = True return # From PEP 333: # "Servers and gateways that implement HTTP 1.1 must provide # transparent support for HTTP 1.1's "expect/continue" mechanism. # This may be done in any of several ways: # 1. Respond to requests containing an Expect: 100-continue request # with an immediate "100 Continue" response, and proceed normally. # 2. Proceed with the request normally, but provide the application # with a wsgi.input stream that will send the "100 Continue" # response if/when the application first attempts to read from # the input stream. The read request must then remain blocked # until the client responds. # 3. Wait until the client decides that the server does not support # expect/continue, and sends the request body on its own. # (This is suboptimal, and is not recommended.) # # We used to do 3, but are now doing 1. Maybe we'll do 2 someday, # but it seems like it would be a big slowdown for such a rare case. if self.inheaders.get("Expect", "") == "100-continue": # Don't use simple_response here, because it emits headers # we don't want. See http://www.cherrypy.org/ticket/951 msg = self.server.protocol + " 100 Continue\r\n\r\n" try: self.conn.wfile.sendall(msg) except socket.error, x: if x.args[0] not in socket_errors_to_ignore: raise self.ready = True | 6612fe4c4515164198f5cd35a07324ae0faa722b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/82/6612fe4c4515164198f5cd35a07324ae0faa722b/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
2293,
12,
2890,
4672,
468,
2239,
19,
21,
18,
21,
5921,
854,
9195,
635,
805,
18,
971,
279,
1004,
468,
3285,
279,
1363,
16,
1508,
612,
1040,
261,
298,
6606,
326,
1459,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2670,
67,
2293,
12,
2890,
4672,
468,
2239,
19,
21,
18,
21,
5921,
854,
9195,
635,
805,
18,
971,
279,
1004,
468,
3285,
279,
1363,
16,
1508,
612,
1040,
261,
298,
6606,
326,
1459,
1... | |
this = apply(_quickfix.new_CustOrderCapacity, args) | this = _quickfix.new_CustOrderCapacity(*args) | def __init__(self, *args): this = apply(_quickfix.new_CustOrderCapacity, 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,
39,
641,
2448,
7437,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
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,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
39,
641,
2448,
7437,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
3... |
qBgNode = stfu_pipe.fuQscanNode(dag,qscanBgJob,cp,opts,time,ifo,p_nodes=[dHoftNode],"ht","bg") | qBgNode = stfu_pipe.fuQscanNode(dag,qscanBgJob,cp,opts,time,ifo,p_nodes=[dHoftNode],type="ht",variety="bg") | def get_times(): # determine the start time : 00:00:00 UTC from the day before # and the end time, 00:00:00 UTC the current day gps = xlal.date.LIGOTimeGPS(gpstime.GpsSecondsFromPyUTC(time.time())) end_gps = int(date.utc_midnight(gps)) start_gps = end_gps - 86400 print "Start time : "+str(start_gps)+" End Time : "+str(end_gps) return str(start_gps)+","+str(end_gps) | 18d35550cfa2994a670eec5d6aa1b970066bbd31 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/18d35550cfa2994a670eec5d6aa1b970066bbd31/wscan_background.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
8293,
13332,
225,
468,
4199,
326,
787,
813,
294,
9631,
30,
713,
30,
713,
9951,
628,
326,
2548,
1865,
468,
471,
326,
679,
813,
16,
9631,
30,
713,
30,
713,
9951,
326,
783,
254... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8293,
13332,
225,
468,
4199,
326,
787,
813,
294,
9631,
30,
713,
30,
713,
9951,
628,
326,
2548,
1865,
468,
471,
326,
679,
813,
16,
9631,
30,
713,
30,
713,
9951,
326,
783,
254... |
return self._untagged_response(typ, name) | return self._untagged_response(typ, dat, name) | def fetch(self, message_set, message_parts): """Fetch (parts of) messages. | 30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
12,
2890,
16,
883,
67,
542,
16,
883,
67,
6019,
4672,
3536,
5005,
261,
6019,
434,
13,
2743,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
12,
2890,
16,
883,
67,
542,
16,
883,
67,
6019,
4672,
3536,
5005,
261,
6019,
434,
13,
2743,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
classes = ['xref', domain, '%s-%s' % (domain, role)] | classes = ['xref', domain, '%s-%s' % (domain, role)] | def __call__(self, typ, rawtext, text, lineno, inliner, options={}, content=[]): env = inliner.document.settings.env if not typ: typ = env.config.default_role else: typ = typ.lower() if ':' not in typ: domain, role = '', typ else: domain, role = typ.split(':', 1) classes = ['xref', domain, '%s-%s' % (domain, role)] text = utils.unescape(text) # if the first character is a bang, don't cross-reference at all if text[0:1] == '!': if self.fix_parens: text, tgt = self._fix_parens(env, False, text[1:], "") innernode = self.innernodeclass(rawtext, text, classes=classes) return self.result_nodes(inliner.document, env, innernode, is_ref=False) # split title and target in role content has_explicit_title, title, target = split_explicit_title(text) # fix-up title and target if self.lowercase: target = target.lower() if self.fix_parens: title, target = self._fix_parens( env, has_explicit_title, title, target) # create the reference node refnode = self.nodeclass(rawtext, reftype=role, refdomain=domain, refexplicit=has_explicit_title) # we may need the line number for warnings refnode.line = lineno title, target = self.process_link( env, refnode, has_explicit_title, title, target) # now that the target and title are finally determined, set them refnode['reftarget'] = target refnode += self.innernodeclass(rawtext, title, classes=classes) # we also need the source document refnode['refdoc'] = env.docname # result_nodes allow further modification of return values return self.result_nodes(inliner.document, env, refnode, is_ref=True) | 6661d7214ccd0a68299c32518c9cd9dd1727d76a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5532/6661d7214ccd0a68299c32518c9cd9dd1727d76a/roles.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
3815,
16,
1831,
955,
16,
977,
16,
7586,
16,
316,
7511,
264,
16,
702,
28793,
913,
33,
8526,
4672,
1550,
273,
316,
7511,
264,
18,
5457,
18,
4272,
18,
307... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
3815,
16,
1831,
955,
16,
977,
16,
7586,
16,
316,
7511,
264,
16,
702,
28793,
913,
33,
8526,
4672,
1550,
273,
316,
7511,
264,
18,
5457,
18,
4272,
18,
307... |
TEST_F(GLES2DecoderTest, %(name)sInvalidArgs) { | TEST_F(%(test_name)s, %(name)sInvalidArgs) { | def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | 0cf346be2eee13b0349e5b4ec789c5a56c28b09c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0cf346be2eee13b0349e5b4ec789c5a56c28b09c/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
22651,
1179,
2802,
4709,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
923,
67,
3813,
273,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
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,
2598,
22651,
1179,
2802,
4709,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
923,
67,
3813,
273,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
etree.SubElement(root, 'manifest:file-entry', attrib={ | SubElement(root, 'manifest:file-entry', attrib={ | def create_manifest(self): root = etree.Element('manifest:manifest', attrib=MANIFEST_NAMESPACE_DICT) doc = etree.ElementTree(root) etree.SubElement(root, 'manifest:file-entry', attrib={ 'manifest:media-type': 'application/vnd.oasis.opendocument.text', 'manifest:full-path': '/', }) etree.SubElement(root, 'manifest:file-entry', attrib={ 'manifest:media-type': 'text/xml', 'manifest:full-path': 'content.xml', }) etree.SubElement(root, 'manifest:file-entry', attrib={ 'manifest:media-type': 'text/xml', 'manifest:full-path': 'styles.xml', }) etree.SubElement(root, 'manifest:file-entry', attrib={ 'manifest:media-type': 'text/xml', 'manifest:full-path': 'meta.xml', }) s1 = etree.tostring(doc) doc = minidom.parseString(s1) s1 = doc.toprettyxml(' ') return s1 | 277ba1af817dc725b8179dbbf649a815fdff5939 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/277ba1af817dc725b8179dbbf649a815fdff5939/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
14357,
12,
2890,
4672,
1365,
273,
12031,
18,
1046,
2668,
14357,
30,
14357,
2187,
5885,
33,
9560,
30050,
67,
11368,
67,
31456,
13,
997,
273,
12031,
18,
1046,
2471,
12,
3085,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
14357,
12,
2890,
4672,
1365,
273,
12031,
18,
1046,
2668,
14357,
30,
14357,
2187,
5885,
33,
9560,
30050,
67,
11368,
67,
31456,
13,
997,
273,
12031,
18,
1046,
2471,
12,
3085,
13,
... |
return BASIC16[color] elif 16 <= color <= 232: | return BASIC16[xcolor] elif 16 <= xcolor <= 231: | def xterm_to_rgb(color): if color < 16: # basic colors return BASIC16[color] elif 16 <= color <= 232: # color cube color -= 16 return (CUBE_STEPS[(color / 36) % 6], CUBE_STEPS[(color / 6) % 6], CUBE_STEPS[color % 6]) elif 233 <= color <= 253: # gray tone c = 8 + (color - 232) * 0x0A return (c, c, c) else: assert False | 202adc9d5049d9aec692ff214e5f3e6e2075be94 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10366/202adc9d5049d9aec692ff214e5f3e6e2075be94/xterm256.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
6408,
67,
869,
67,
10948,
12,
3266,
4672,
309,
2036,
411,
2872,
30,
468,
5337,
5740,
327,
28143,
18118,
2313,
63,
92,
3266,
65,
1327,
2872,
1648,
619,
3266,
1648,
576,
6938,
30,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
6408,
67,
869,
67,
10948,
12,
3266,
4672,
309,
2036,
411,
2872,
30,
468,
5337,
5740,
327,
28143,
18118,
2313,
63,
92,
3266,
65,
1327,
2872,
1648,
619,
3266,
1648,
576,
6938,
30,
4... |
class TestLuSolve(NumpyTestCase): | class TestLUSolve(NumpyTestCase): | def __init__(self, *args, **kw): test_lu.__init__(self, *args, **kw) | ed190d870bbfc8f800477027b23dcafc112a646e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/ed190d870bbfc8f800477027b23dcafc112a646e/test_decomp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
9987,
4672,
1842,
67,
28832,
16186,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
9987,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
9987,
4672,
1842,
67,
28832,
16186,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
9987,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
short_sample = "Hello world\n" sample = short_sample + "x"*(20 - len(short_sample)) | short_sample = b"Hello world\n" sample = short_sample + b"x"*(20 - len(short_sample)) | def test_buffer_api(self): short_sample = "Hello world\n" sample = short_sample + "x"*(20 - len(short_sample)) tfn = tempfile.mktemp() try: # Prepare with open(tfn, "wb") as f: f.write(short_sample) # Test readinto with open(tfn, "rb") as f: b = bytes([ord('x')]*20) n = f.readinto(b) self.assertEqual(n, len(short_sample)) self.assertEqual(list(b), map(ord, sample)) # Test writing in binary mode with open(tfn, "wb") as f: f.write(b) with open(tfn, "rb") as f: self.assertEqual(f.read(), sample) # Text mode is ambiguous; don't test finally: try: os.remove(tfn) except os.error: pass | 3bb742e8b97d906669efa32295fe18fc3aa1b32a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/3bb742e8b97d906669efa32295fe18fc3aa1b32a/test_bytes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4106,
67,
2425,
12,
2890,
4672,
3025,
67,
6358,
273,
324,
6,
18601,
9117,
64,
82,
6,
3296,
273,
3025,
67,
6358,
397,
324,
6,
92,
6,
21556,
3462,
300,
562,
12,
6620,
67,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4106,
67,
2425,
12,
2890,
4672,
3025,
67,
6358,
273,
324,
6,
18601,
9117,
64,
82,
6,
3296,
273,
3025,
67,
6358,
397,
324,
6,
92,
6,
21556,
3462,
300,
562,
12,
6620,
67,
6... |
if self._config.os == numericOutputType: | if self._config.outputScalarType == numericOutputType: | def configToView(self): self._viewFrame.lowerThresholdText.SetValue("%.2f" % (self._config.lt)) self._viewFrame.upperThresholdText.SetValue("%.2f" % (self._config.ut)) self._viewFrame.replaceInCheckBox.SetValue(self._config.ri) self._viewFrame.replaceInText.SetValue(str(self._config.iv)) self._viewFrame.replaceOutCheckBox.SetValue(self._config.ro) self._viewFrame.replaceOutText.SetValue(str(self._config.ov)) | 1c5dbe5f37c7026fceadab4a3eafdb2cdb2eb9a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4494/1c5dbe5f37c7026fceadab4a3eafdb2cdb2eb9a9/doubleThreshold.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
642,
774,
1767,
12,
2890,
4672,
365,
6315,
1945,
3219,
18,
8167,
7614,
1528,
18,
694,
620,
27188,
18,
22,
74,
6,
738,
261,
2890,
6315,
1425,
18,
5618,
3719,
365,
6315,
1945,
3219,
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,
642,
774,
1767,
12,
2890,
4672,
365,
6315,
1945,
3219,
18,
8167,
7614,
1528,
18,
694,
620,
27188,
18,
22,
74,
6,
738,
261,
2890,
6315,
1425,
18,
5618,
3719,
365,
6315,
1945,
3219,
18,
... |
res.update({'output':self.output}) | def __getstate__(self): res = super(logger, self).__getstate__() res.update({'output':self.output}) return res | cfa976a8fbf48ffd321a95a26233801052bfa28a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/cfa976a8fbf48ffd321a95a26233801052bfa28a/logger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
2019,
972,
12,
2890,
4672,
400,
273,
2240,
12,
4901,
16,
365,
2934,
972,
588,
2019,
972,
1435,
327,
400,
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,
1001,
588,
2019,
972,
12,
2890,
4672,
400,
273,
2240,
12,
4901,
16,
365,
2934,
972,
588,
2019,
972,
1435,
327,
400,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
else: return db.cacheExtremeDetail() | def cache_extreme_detail(self, REQUEST=None): """ Returns information about each object in the cache. """ db=self._p_jar.db() detail = db.cacheExtremeDetail() if REQUEST is not None: lst = map(lambda dict: ((dict['conn_no'], dict['oid']), dict), detail) lst.sort() res = [ ' 'and class.', ' for sortkey, dict in lst: id = dict.get('id', None) if id: idinfo = ' (%s)' % id else: idinfo = '' s = dict['state'] if s == 0: state = 'L' elif s == 1: state = 'C' else: state = 'G' res.append('%d %-34s %6d %s %s%s' % ( dict['conn_no'], `dict['oid']`, dict['rc'], state, dict['klass'], idinfo)) REQUEST.RESPONSE.setHeader('Content-Type', 'text/plain') return string.join(res, '\n') else: return detail | def cache_extreme_detail(self): try: db=self._p_jar.db() except: # BoboPOS2 detail=[] rc=sys.getrefcount db=Globals.Bobobase._jar.db for oid, ob in Globals.Bobobase._jar.cache.items(): id=oid | dcd0edcaa04205b5837e8b007af641aa19cf23d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dcd0edcaa04205b5837e8b007af641aa19cf23d8/CacheManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1247,
67,
408,
2764,
73,
67,
8992,
12,
2890,
4672,
775,
30,
1319,
33,
2890,
6315,
84,
67,
11930,
18,
1966,
1435,
1335,
30,
468,
605,
947,
83,
7057,
22,
7664,
33,
8526,
4519,
33,
9499... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1247,
67,
408,
2764,
73,
67,
8992,
12,
2890,
4672,
775,
30,
1319,
33,
2890,
6315,
84,
67,
11930,
18,
1966,
1435,
1335,
30,
468,
605,
947,
83,
7057,
22,
7664,
33,
8526,
4519,
33,
9499... |
def _handle_MSRPChatGotMessage(self, msrp_chat, data): | def _NH_MSRPChatGotMessage(self, msrp_chat, data): | def _handle_MSRPChatGotMessage(self, msrp_chat, data): session = self.msrp_chat_mapping.get(msrp_chat, None) if session is not None: self.notification_center.post_notification("SCSessionGotMessage", session, data) | 1aa02bcc4900f818907c52a21768d4b2368788e2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3449/1aa02bcc4900f818907c52a21768d4b2368788e2/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
50,
44,
67,
3537,
54,
52,
14163,
15617,
1079,
12,
2890,
16,
4086,
13832,
67,
10880,
16,
501,
4672,
1339,
273,
365,
18,
959,
13832,
67,
10880,
67,
6770,
18,
588,
12,
959,
13832,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
50,
44,
67,
3537,
54,
52,
14163,
15617,
1079,
12,
2890,
16,
4086,
13832,
67,
10880,
16,
501,
4672,
1339,
273,
365,
18,
959,
13832,
67,
10880,
67,
6770,
18,
588,
12,
959,
13832,
... |
if not when: when = int(time.time()) | when = int(when or time.time()) | def save_changes(self, author, comment, when=0, db=None): """ Store ticket changes in the database. The ticket must already exist in the database. """ assert self.exists, 'Cannot update a new ticket' | f60a0c925fe330ec1fa91f1ff4e558274af57c15 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f60a0c925fe330ec1fa91f1ff4e558274af57c15/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
6329,
12,
2890,
16,
2869,
16,
2879,
16,
1347,
33,
20,
16,
1319,
33,
7036,
4672,
3536,
4994,
9322,
3478,
316,
326,
2063,
18,
1021,
9322,
1297,
1818,
1005,
316,
326,
2063,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
6329,
12,
2890,
16,
2869,
16,
2879,
16,
1347,
33,
20,
16,
1319,
33,
7036,
4672,
3536,
4994,
9322,
3478,
316,
326,
2063,
18,
1021,
9322,
1297,
1818,
1005,
316,
326,
2063,
18,
... |
def create_header_files(output_dir, suffix, applications, includes, init_functions): | def create_header_files(output_dir, suffix, applications, includes, init_functions, enabled_modules): | def create_header_files(output_dir, suffix, applications, includes, init_functions): if False == os.path.isdir(output_dir): os.mkdir(output_dir) for current_app in applications.keys(): hdr_file_path = os.path.join(output_dir, current_app + suffix) try: hdr_file = open(hdr_file_path, 'w') try: app_string = 'HIP_' + current_app.upper() + '_MODULES_H' hdr_file.write('#ifndef ' + app_string + '\n') hdr_file.write('#define ' + app_string + '\n') if includes.has_key(current_app) and init_functions.has_key(current_app): num_modules = str(len(init_functions[current_app])); for current in includes[current_app]: hdr_file.write('\n#include \"' + current + '\"') hdr_file.write('\n\ntypedef int (*pt2Function)(void);\n') hdr_file.write('\nconst int num_modules_' + current_app + ' = ') hdr_file.write(num_modules + ';') hdr_file.write('\n\nstatic const pt2Function ' + current_app) hdr_file.write('_init_functions[' + num_modules + '] = {') first_loop = True for function in init_functions[current_app]: if first_loop != True: hdr_file.write(', ') hdr_file.write('&' + function) first_loop = False hdr_file.write('};') else: hdr_file.write('\n\ntypedef int (*pt2Function)(void);\n') hdr_file.write('\nconst int num_modules_' + current_app + ' = 0;') hdr_file.write('\n\nstatic const pt2Function ' + current_app) hdr_file.write('_init_functions[0] = {};') hdr_file.write('\n\n#endif /* ' + app_string + ' */') print '| created file: ' + hdr_file_path finally: hdr_file.close() except IOError: sys.exit('Error on creating header files') | 4342107590df52002402fe29e27a49dcc0211e4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6933/4342107590df52002402fe29e27a49dcc0211e4d/process_modules.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3374,
67,
2354,
12,
2844,
67,
1214,
16,
3758,
16,
12165,
16,
6104,
16,
1208,
67,
10722,
16,
3696,
67,
6400,
4672,
225,
309,
1083,
422,
1140,
18,
803,
18,
291,
1214,
12,
2844... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3374,
67,
2354,
12,
2844,
67,
1214,
16,
3758,
16,
12165,
16,
6104,
16,
1208,
67,
10722,
16,
3696,
67,
6400,
4672,
225,
309,
1083,
422,
1140,
18,
803,
18,
291,
1214,
12,
2844... |
while lines and not lines[0]: lines.pop(0) return string.join(lines, '\n') | return '\n'.join(lines) | def unindent_docstring(docstring): # [xx] copied from inspect. if docstring == '': return '' lines = docstring.expandtabs().split('\n') # Find minimum indentation of any non-blank lines after first line. margin = sys.maxint for line in lines[1:]: content = len(string.lstrip(line)) if content: indent = len(line) - content margin = min(margin, indent) # Remove indentation. if lines: lines[0] = lines[0].lstrip() if margin < sys.maxint: for i in range(1, len(lines)): lines[i] = lines[i][margin:] # Remove any trailing or leading blank lines. while lines and not lines[-1]: lines.pop() while lines and not lines[0]: lines.pop(0) return string.join(lines, '\n') | 4a85b1c34e0c700cc571072eb493b033af23aa85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/4a85b1c34e0c700cc571072eb493b033af23aa85/docstringparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
9355,
67,
24675,
12,
24675,
4672,
468,
306,
5279,
65,
9268,
628,
5334,
18,
225,
309,
14525,
422,
875,
30,
327,
875,
2362,
273,
14525,
18,
12320,
16056,
7675,
4939,
2668,
64,
82,
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,
640,
9355,
67,
24675,
12,
24675,
4672,
468,
306,
5279,
65,
9268,
628,
5334,
18,
225,
309,
14525,
422,
875,
30,
327,
875,
2362,
273,
14525,
18,
12320,
16056,
7675,
4939,
2668,
64,
82,
6... |
def fixTwistedNames(): import twisted.names.dns import socket f1 = twisted.names.dns.DNSDatagramProtocol.writeMessage def writeMessage(*args): try: f1(*args) except socket.error: pass twisted.names.dns.DNSDatagramProtocol.writeMessage = writeMessage from twisted.internet.error import CannotListenError f2 = twisted.names.dns.DNSDatagramProtocol.startListening def startListening(*args): for i in range(10): try: return f2(*args) except CannotListenError: pass raise AssertionError("DNS isn't happy :-(") twisted.names.dns.DNSDatagramProtocol.startListening = startListening try: import twisted.names except ImportError: pass else: if twisted.names.__version__ == '0.4.0': fixTwistedNames() | def noop(): reactor.callLater(55.0, noop) | 20bf9eba7684658dbea89887eb0acfe74ad07926 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12372/20bf9eba7684658dbea89887eb0acfe74ad07926/fix_twisted.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17065,
13332,
19178,
18,
1991,
20607,
12,
2539,
18,
20,
16,
17065,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
17065,
13332,
19178,
18,
1991,
20607,
12,
2539,
18,
20,
16,
17065,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
if not re.search('\*',i): if not os.path.isdir(i): resolvedIS.append(i) | if not re.search( '\*', i ): if not os.path.isdir( i ): resolvedIS.append( i ) | def _resolveInputSandbox(self, inputSandbox): """ Internal function. | 50b3322668816ba92ea3f9b253d993dc34c53a21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/50b3322668816ba92ea3f9b253d993dc34c53a21/Job.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10828,
1210,
17881,
12,
2890,
16,
810,
17881,
4672,
3536,
3186,
445,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10828,
1210,
17881,
12,
2890,
16,
810,
17881,
4672,
3536,
3186,
445,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
def test(): """ test method""" | def googlemaps_key(self): """ returns google maps api key for a website""" | def test(): """ test method""" | 3e53d56508efdd392bbac99f647608c300a2e5b0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6024/3e53d56508efdd392bbac99f647608c300a2e5b0/projectmap_configview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13332,
3536,
1842,
707,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13332,
3536,
1842,
707,
8395,
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.steady_state = [] | def _set_steady_state(self, data): errmsg = 'Soil carbon components should contain: \n'\ ' mass, mass std, acid, acid std, water, water std,\n'\ ' ethanol, ethanol std, non soluble, non soluble std,'\ '\n humus, humus std, size class' self.steady_state = [] for vals in data: ok, obj = self._load_litter_object(vals, errmsg) if not ok: break self.steady_state.append(obj) | bbfcbae9af76ce263b65221ec9ef39d20dbc2975 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1832/bbfcbae9af76ce263b65221ec9ef39d20dbc2975/yasso.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
334,
684,
93,
67,
2019,
12,
2890,
16,
501,
4672,
17460,
273,
296,
10225,
330,
28755,
4085,
1410,
912,
30,
521,
82,
8314,
296,
8039,
16,
8039,
2044,
16,
1721,
350,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
334,
684,
93,
67,
2019,
12,
2890,
16,
501,
4672,
17460,
273,
296,
10225,
330,
28755,
4085,
1410,
912,
30,
521,
82,
8314,
296,
8039,
16,
8039,
2044,
16,
1721,
350,
16,
1... | |
os.remove(pdf) | def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml." | 884a06ea0bd2021bfc298a93495433a28a717a3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/884a06ea0bd2021bfc298a93495433a28a717a3e/test_tools_pythonpoint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
20,
12,
2890,
4672,
315,
4709,
309,
5790,
1153,
18,
7699,
848,
506,
2522,
628,
5790,
1153,
18,
2902,
1199,
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,
1842,
20,
12,
2890,
4672,
315,
4709,
309,
5790,
1153,
18,
7699,
848,
506,
2522,
628,
5790,
1153,
18,
2902,
1199,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
self.fail() | r = Rect(10, 10, 30, 30) r2 = Rect(30, 30, 15, 10) f = r.fit(r2) self.assertTrue(r2.contains(f)) f2 = r2.fit(r) self.assertTrue(r.contains(f2)) | def todo_test_fit(self): | b02b7673750224983acbd2ede1a25a7caa904368 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1298/b02b7673750224983acbd2ede1a25a7caa904368/rect_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10621,
67,
3813,
67,
7216,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10621,
67,
3813,
67,
7216,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if(mode=='velocity' and nchan==-1): vmin=self.convertvf(str(freqlist[-1])+'Hz',frame,field,restf) vmax=self.convertvf(str(freqlist[0])+'Hz',frame,field,restf) if(width==''): vwidth=qa.sub(qa.quantity(vmax),qa.quantity(self.convertvf(str(freqlist[1])+'Hz',frame,field,restf))) else: vwidth=qa.convert(width,'m/s') vrange=qa.sub(qa.quantity(vmax),qa.quantity(vmin)) retnchan=min(int(math.ceil(qa.div(vrange,qa.abs(qa.quantity(vwidth)))['value']))+1,retnchan) | def setChannelization(self,mode,spw,field,nchan,start,width,frame,veltype,restf): """ determine appropriate values for channelization parameters when default values are used for mode='velocity' or 'frequency' or 'channel' """ #pdb.set_trace() #if (mode!='frequency' and mode!='velocity') or (nchan!=-1 and start!='' and width!=''): instartunit='' inwidthunit='' if(mode=='channel'): ###for mode channel ignore the frame to use the data frame #if(frame != ''): # self._casalog.post('Note: in channel mode, the outframe parameter is ignored.', 'WARN') #frame='' if(type(start)!=int): raise TypeError, "Wrong type for start parameter. Int is expected for the channel mode." if(type(width)!=int): raise TypeError, "Wrong type for width parameter. Int is expected for the channel mode." elif(mode=='frequency' or mode=='velocity'): if(type(start)!=str or type(width)!=str): if type(start)==int: if start==0: #assume the default is not properly set start='' if type(width)==int: if width==1: # assume the default is not properly set width='' else: raise TypeError, "Start and width parameters must be given in strings, for mode=%s" % mode #raise TypeError, "Start and width parameters must be given in strings, for mode=%s" % mode | 93b23fce9d48a029a398a23df73f95174e378bb5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2098/93b23fce9d48a029a398a23df73f95174e378bb5/cleanhelper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2909,
1588,
12,
2890,
16,
3188,
16,
1752,
91,
16,
1518,
16,
82,
7472,
16,
1937,
16,
2819,
16,
3789,
16,
941,
723,
16,
8792,
74,
4672,
3536,
4199,
5505,
924,
364,
1904,
1588,
147... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2909,
1588,
12,
2890,
16,
3188,
16,
1752,
91,
16,
1518,
16,
82,
7472,
16,
1937,
16,
2819,
16,
3789,
16,
941,
723,
16,
8792,
74,
4672,
3536,
4199,
5505,
924,
364,
1904,
1588,
147... | |
self.compiler = new_compiler ( compiler="msvc", | self.compiler = new_compiler (compiler=self.compiler, | def run (self): | bfb7065feea05a3113807ea1be8804f279407a94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/bfb7065feea05a3113807ea1be8804f279407a94/build_ext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
category, combining, bidirectional, mirrored, eastasianwidth | category, combining, bidirectional, mirrored, eastasianwidth, normalizationquickcheck | def makeunicodedata(unicode, trace): dummy = (0, 0, 0, 0, 0) table = [dummy] cache = {0: dummy} index = [0] * len(unicode.chars) FILE = "Modules/unicodedata_db.h" print "--- Preparing", FILE, "..." # 1) database properties for char in unicode.chars: record = unicode.table[char] if record: # extract database properties category = CATEGORY_NAMES.index(record[2]) combining = int(record[3]) bidirectional = BIDIRECTIONAL_NAMES.index(record[4]) mirrored = record[9] == "Y" eastasianwidth = EASTASIANWIDTH_NAMES.index(record[15]) item = ( category, combining, bidirectional, mirrored, eastasianwidth ) # add entry to index and item tables i = cache.get(item) if i is None: cache[item] = i = len(table) table.append(item) index[char] = i # 2) decomposition data decomp_data = [0] decomp_prefix = [""] decomp_index = [0] * len(unicode.chars) decomp_size = 0 comp_pairs = [] comp_first = [None] * len(unicode.chars) comp_last = [None] * len(unicode.chars) for char in unicode.chars: record = unicode.table[char] if record: if record[5]: decomp = record[5].split() if len(decomp) > 19: raise Exception, "character %x has a decomposition too large for nfd_nfkd" % char # prefix if decomp[0][0] == "<": prefix = decomp.pop(0) else: prefix = "" try: i = decomp_prefix.index(prefix) except ValueError: i = len(decomp_prefix) decomp_prefix.append(prefix) prefix = i assert prefix < 256 # content decomp = [prefix + (len(decomp)<<8)] +\ map(lambda s: int(s, 16), decomp) # Collect NFC pairs if not prefix and len(decomp) == 3 and \ char not in unicode.exclusions and \ unicode.table[decomp[1]][3] == "0": p, l, r = decomp comp_first[l] = 1 comp_last[r] = 1 comp_pairs.append((l,r,char)) try: i = decomp_data.index(decomp) except ValueError: i = len(decomp_data) decomp_data.extend(decomp) decomp_size = decomp_size + len(decomp) * 2 else: i = 0 decomp_index[char] = i f = l = 0 comp_first_ranges = [] comp_last_ranges = [] prev_f = prev_l = None for i in unicode.chars: if comp_first[i] is not None: comp_first[i] = f f += 1 if prev_f is None: prev_f = (i,i) elif prev_f[1]+1 == i: prev_f = prev_f[0],i else: comp_first_ranges.append(prev_f) prev_f = (i,i) if comp_last[i] is not None: comp_last[i] = l l += 1 if prev_l is None: prev_l = (i,i) elif prev_l[1]+1 == i: prev_l = prev_l[0],i else: comp_last_ranges.append(prev_l) prev_l = (i,i) comp_first_ranges.append(prev_f) comp_last_ranges.append(prev_l) total_first = f total_last = l comp_data = [0]*(total_first*total_last) for f,l,char in comp_pairs: f = comp_first[f] l = comp_last[l] comp_data[f*total_last+l] = char print len(table), "unique properties" print len(decomp_prefix), "unique decomposition prefixes" print len(decomp_data), "unique decomposition entries:", print decomp_size, "bytes" print total_first, "first characters in NFC" print total_last, "last characters in NFC" print len(comp_pairs), "NFC pairs" print "--- Writing", FILE, "..." fp = open(FILE, "w") print >>fp, "/* this file was generated by %s %s */" % (SCRIPT, VERSION) print >>fp print >>fp, '#define UNIDATA_VERSION "%s"' % UNIDATA_VERSION print >>fp, "/* a list of unique database records */" print >>fp, \ "const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {" for item in table: print >>fp, " {%d, %d, %d, %d, %d}," % item print >>fp, "};" print >>fp print >>fp, "/* Reindexing of NFC first characters. */" print >>fp, "#define TOTAL_FIRST",total_first print >>fp, "#define TOTAL_LAST",total_last print >>fp, "struct reindex{int start;short count,index;};" print >>fp, "static struct reindex nfc_first[] = {" for start,end in comp_first_ranges: print >>fp," { %d, %d, %d}," % (start,end-start,comp_first[start]) print >>fp," {0,0,0}" print >>fp,"};\n" print >>fp, "static struct reindex nfc_last[] = {" for start,end in comp_last_ranges: print >>fp," { %d, %d, %d}," % (start,end-start,comp_last[start]) print >>fp," {0,0,0}" print >>fp,"};\n" # FIXME: <fl> the following tables could be made static, and # the support code moved into unicodedatabase.c print >>fp, "/* string literals */" print >>fp, "const char *_PyUnicode_CategoryNames[] = {" for name in CATEGORY_NAMES: print >>fp, " \"%s\"," % name print >>fp, " NULL" print >>fp, "};" print >>fp, "const char *_PyUnicode_BidirectionalNames[] = {" for name in BIDIRECTIONAL_NAMES: print >>fp, " \"%s\"," % name print >>fp, " NULL" print >>fp, "};" print >>fp, "const char *_PyUnicode_EastAsianWidthNames[] = {" for name in EASTASIANWIDTH_NAMES: print >>fp, " \"%s\"," % name print >>fp, " NULL" print >>fp, "};" print >>fp, "static const char *decomp_prefix[] = {" for name in decomp_prefix: print >>fp, " \"%s\"," % name print >>fp, " NULL" print >>fp, "};" # split record index table index1, index2, shift = splitbins(index, trace) print >>fp, "/* index tables for the database records */" print >>fp, "#define SHIFT", shift Array("index1", index1).dump(fp, trace) Array("index2", index2).dump(fp, trace) # split decomposition index table index1, index2, shift = splitbins(decomp_index, trace) print >>fp, "/* decomposition data */" Array("decomp_data", decomp_data).dump(fp, trace) print >>fp, "/* index tables for the decomposition data */" print >>fp, "#define DECOMP_SHIFT", shift Array("decomp_index1", index1).dump(fp, trace) Array("decomp_index2", index2).dump(fp, trace) index, index2, shift = splitbins(comp_data, trace) print >>fp, "/* NFC pairs */" print >>fp, "#define COMP_SHIFT", shift Array("comp_index", index).dump(fp, trace) Array("comp_data", index2).dump(fp, trace) # Generate delta tables for old versions for version, table, normalization in unicode.changed: cversion = version.replace(".","_") records = [table[0]] cache = {table[0]:0} index = [0] * len(table) for i, record in enumerate(table): try: index[i] = cache[record] except KeyError: index[i] = cache[record] = len(records) records.append(record) index1, index2, shift = splitbins(index, trace) print >>fp, "static const change_record change_records_%s[] = {" % cversion for record in records: print >>fp, "\t{ %s }," % ", ".join(map(str,record)) print >>fp, "};" Array("changes_%s_index" % cversion, index1).dump(fp, trace) Array("changes_%s_data" % cversion, index2).dump(fp, trace) print >>fp, "static const change_record* get_change_%s(Py_UCS4 n)" % cversion print >>fp, "{" print >>fp, "\tint index;" print >>fp, "\tif (n >= 0x110000) index = 0;" print >>fp, "\telse {" print >>fp, "\t\tindex = changes_%s_index[n>>%d];" % (cversion, shift) print >>fp, "\t\tindex = changes_%s_data[(index<<%d)+(n & %d)];" % \ (cversion, shift, ((1<<shift)-1)) print >>fp, "\t}" print >>fp, "\treturn change_records_%s+index;" % cversion print >>fp, "}\n" print >>fp, "static Py_UCS4 normalization_%s(Py_UCS4 n)" % cversion print >>fp, "{" print >>fp, "\tswitch(n) {" for k, v in normalization: print >>fp, "\tcase %s: return 0x%s;" % (hex(k), v) print >>fp, "\tdefault: return 0;" print >>fp, "\t}\n}\n" fp.close() | e988e286b2831382deb7c69b26c74ed185f51696 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/e988e286b2831382deb7c69b26c74ed185f51696/makeunicodedata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
9124,
892,
12,
9124,
16,
2606,
4672,
225,
9609,
273,
261,
20,
16,
374,
16,
374,
16,
374,
16,
374,
13,
1014,
273,
306,
21050,
65,
1247,
273,
288,
20,
30,
9609,
97,
770,
273,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
9124,
892,
12,
9124,
16,
2606,
4672,
225,
9609,
273,
261,
20,
16,
374,
16,
374,
16,
374,
16,
374,
13,
1014,
273,
306,
21050,
65,
1247,
273,
288,
20,
30,
9609,
97,
770,
273,
3... |
previous_start = format_date(fromdate - timedelta(days=daysback), | previous_start = format_date(fromdate - timedelta(days=daysback+1), | def process_request(self, req): req.perm.assert_permission('TIMELINE_VIEW') data = {} | 428480218ca9901dbe3bc812b2eca3de32d5fbf7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9317/428480218ca9901dbe3bc812b2eca3de32d5fbf7/web_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2293,
12,
2890,
16,
1111,
4672,
1111,
18,
12160,
18,
11231,
67,
9827,
2668,
4684,
5997,
67,
12145,
6134,
501,
273,
2618,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2293,
12,
2890,
16,
1111,
4672,
1111,
18,
12160,
18,
11231,
67,
9827,
2668,
4684,
5997,
67,
12145,
6134,
501,
273,
2618,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
pass | print "aIB on %s" % self self.mb.addElementBefore(xml, id) print "back" @deferUntilAfterLoad | def addItemBefore(self, xml, id): pass | fbd444af0fb24176d164815bf82a5f27bbb4c126 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12354/fbd444af0fb24176d164815bf82a5f27bbb4c126/HTMLDisplay.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15009,
4649,
12,
2890,
16,
2025,
16,
612,
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,
... | [
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,
15009,
4649,
12,
2890,
16,
2025,
16,
612,
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,... |
source_path = os.path.join(tmpdir_sources, package.name, source_filename) | def submit(request): if request.method == 'POST': form = PackageSubmitForm(request.POST, request.FILES) if not form.is_valid(): return render_to_response('aur/submit.html', { 'user': request.user, 'form': form}) import tempfile directory = tempfile.mkdtemp() filename = os.path.join(directory, form.cleaned_data['file'].filename) # Save the uploaded file to disk fp = open(filename, "wb") fp.write(form.cleaned_data['file'].content) fp.close() try: pkg = PKGBUILD.Package(filename) except: # TODO: Add error to form return render_to_response('aur/submit.html', { 'user': request.user, 'form': form, 'errors': sys.exc_info()[1]}) pkg.validate() if not pkg.is_valid() or pkg.has_warnings(): return render_to_response('aur/submit.html', { 'user': request.user, 'form': form, 'errors': pkg.get_errors(), 'warnings': pkg.get_warnings()}) # TODO: Check if we are updating an existing package or creating one package = Package(name=pkg['name'], version=pkg['version'], release=pkg['release'], description=pkg['description'], url=pkg['url']) package.repository=Repository.objects.get(name__exact="Unsupported") package.category=Category.objects.get(name__iexact=form.cleaned_data['category']) # Save the package so we can reference it package.save() # Check for, and add dependencies for dependency in pkg['depends']: # This would be nice, but we don't have access to the official # repositories #if Package.objects.filter(name=dependency).count() == 0: # TODO: Display an error #return render_to_response("aur/submit.html") try: dep = Package.objects.get(name__exact=dependency) except Package.DoesNotExist: # Fail silently pass else: package.depends.add(dep) package.maintainers.add(request.user) for license in pkg['licenses']: object, created = License.objects.get_or_create(name=license) package.licenses.add(object) for arch in pkg['arch']: try: object = Architecture.objects.get(name=arch) except Architecture.DoesNotExist: # TODO: Add an error return render_to_response('aur/submit.html', { 'user': request.user, 'form': form, 'errors': ['architecture %s does not exist' % arch,], }) else: package.architectures.add(object) # Check if the uploaded file is a tar file or just a PKGBUILD try: tar = tarfile.open(filename, "r") except tarfile.ReadError: # It's not a tar file, so if must be a PKGBUILD since it validated pkgbuild = filename pass else: tmpdir_sources = os.path.join(directory, 'sources') tar.extractall(tmpdir_sources) pkgbuild = os.path.join(tmpdir_sources, package.name, 'PKGBUILD') # Hash and save PKGBUILD fp = open(pkgbuild, "r") pkgbuild_contents = ''.join(fp.readlines()) fp.close() source = PackageFile(package=package) source.save_filename_file('%s/sources/PKGBUILD' % package.name, pkgbuild_contents) source.save() md5hash = hashlib.md5(pkgbuild_contents) hash = PackageHash(hash=md5hash.hexdigest(), file=source, type='md5') hash.save() del pkgbuild_contents # Save tarball # TODO: Tar the saved sources instead of using the uploaded one, for # security fp = open(filename, "rb") package.save_tarball_file('%s/%s' % (package.name, os.path.basename(filename)), ''.join(fp.readlines())) fp.close() for index in range(len(pkg['source'])): source_filename = pkg['source'][index] source = PackageFile(package=package) source_path = os.path.join(tmpdir_sources, package.name, source_filename) # If it's a local file, save to disk, otherwise record as url if os.path.exists(source_path): fp = open(source_path, "r") source.save_filename_file('%s/sources/%s' % (package.name, source_filename), ''.join(fp.readlines())) fp.close() else: # TODO: Check that it _is_ a url, otherwise report an error # that files are missing source.url = source_filename source.save() # Check for, and save, any hashes this file may have for hash_type in ('md5', 'sha1', 'sha256', 'sha384', 'sha512'): if pkg[hash_type + 'sums']: PackageHash(hash=pkg[hash_type + 'sums'][index], file=source, type=hash_type).save() comment = Comment(package=package, user=request.user, message=form.cleaned_data['comment'], ip=request.META['REMOTE_ADDR'], commit=True,) comment.save() return HttpResponseRedirect( reverse('aur-package_detail', args=[package.name,])) else: form = PackageSubmitForm() return render_to_response('aur/submit.html', { 'user': request.user, 'form': form, }) | a942de6da427c5e3db17c3635da3df5a02bc011c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3268/a942de6da427c5e3db17c3635da3df5a02bc011c/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4879,
12,
2293,
4672,
309,
590,
18,
2039,
422,
296,
3798,
4278,
646,
273,
7508,
11620,
1204,
12,
2293,
18,
3798,
16,
590,
18,
12669,
13,
309,
486,
646,
18,
291,
67,
877,
13332,
327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4879,
12,
2293,
4672,
309,
590,
18,
2039,
422,
296,
3798,
4278,
646,
273,
7508,
11620,
1204,
12,
2293,
18,
3798,
16,
590,
18,
12669,
13,
309,
486,
646,
18,
291,
67,
877,
13332,
327,
... | |
""" builds a set containing all classes with an explicit superclass """ inhFilename = glob.glob(DUMPDIR + "/*.inheritance")[0] inhFile = open(inhFilename) inhs = set() for inh in inhFile: inhs.add(inh.split(" ")[3].split(".")[0].replace("/",".")) inhFile.close() return inhs | """ builds a set containing all classes with an explicit superclass """ inhFilename = glob.glob(DUMPDIR + "/*.inheritance")[0] inhFile = open(inhFilename) inhs = set() for inh in inhFile: inhs.add(inh.split(" ")[3]) inhFile.close() return inhs | def readInheritances(): """ builds a set containing all classes with an explicit superclass """ inhFilename = glob.glob(DUMPDIR + "/*.inheritance")[0] inhFile = open(inhFilename) inhs = set() for inh in inhFile: inhs.add(inh.split(" ")[3].split(".")[0].replace("/",".")) inhFile.close() return inhs | fdaf036527e7325360dfcf5cae6f68f166b4b064 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1052/fdaf036527e7325360dfcf5cae6f68f166b4b064/fixObjectInheritance.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
14216,
6872,
13332,
3536,
10736,
279,
444,
4191,
777,
3318,
598,
392,
5515,
12098,
3536,
316,
76,
5359,
273,
4715,
18,
10581,
12,
40,
23942,
4537,
397,
2206,
11146,
6018,
1359,
7923,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14216,
6872,
13332,
3536,
10736,
279,
444,
4191,
777,
3318,
598,
392,
5515,
12098,
3536,
316,
76,
5359,
273,
4715,
18,
10581,
12,
40,
23942,
4537,
397,
2206,
11146,
6018,
1359,
7923,
... |
n_cut = partial_line(line, allowed_line_lenght) print >> log, line[:n_cut] line = help_offset+line[n_cut:] | n_cut = partial_line(line, allowed_line_lenght, line_to_appear) if(len(line[:n_cut].strip())==0): print >> log, line[:allowed_line_lenght] line = help_offset+line[allowed_line_lenght:] else: print >> log, line[:n_cut] line = help_offset+line[n_cut:] | def format_string(object, ind, log, scope=False, allowed_line_lenght=80): name = str(object.name).strip() help = str(object.help).strip() if(scope): if(len(" "*ind+name) >= allowed_line_lenght): raise Sorry( "Cannot create doc file: scope is too deep or its name is too long.") fmt = "%s<b>%s</b> <b><FONT color=blue>%s</FONT></b>" elements = (" "*ind, name, help) line = fmt % elements line_to_appear = "%s%s %s"%elements if(len(line_to_appear) <= allowed_line_lenght): print >> log, line else: help_start = len(" "*ind+name)+1 help_offset = " "*help_start n_cut = partial_line(line, allowed_line_lenght) print >> log, line[:n_cut] line = help_offset+line[n_cut:] while True: if(n_cut is None): break n_cut = partial_line(line, allowed_line_lenght) print >> log, line[:n_cut] line = help_offset+line[n_cut:] else: values = (" ".join([str(i) for i in object.words])).strip() if(len(" "*ind+name) >= allowed_line_lenght): raise Sorry( "Cannot create doc file: scope is too deep or its name is too long.") elements = (" "*ind, name, values, help) fmt = "%s%s= <FONT color=CC0000>%s</FONT> <FONT color=blue>%s</FONT>" line = fmt % elements line_length = len(" "*ind+str(object.name)+str(object.help)+values) line_to_appear = "%s%s %s %s"%elements if(len(line_to_appear) <= allowed_line_lenght): print >> log, line else: help_start = len(" "*ind+name)+2 help_offset = " "*help_start n_cut = partial_line(line, allowed_line_lenght) print >> log, line[:n_cut] line = help_offset+line[n_cut:] while True: if(n_cut is None): break n_cut = partial_line(line, allowed_line_lenght) print >> log, line[:n_cut] line = help_offset+line[n_cut:] | fe5344ca05b9020a2b9a31e2e21730727a2a37ab /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/696/fe5344ca05b9020a2b9a31e2e21730727a2a37ab/as_html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
1080,
12,
1612,
16,
1547,
16,
613,
16,
2146,
33,
8381,
16,
2935,
67,
1369,
67,
1897,
75,
647,
33,
3672,
4672,
508,
273,
609,
12,
1612,
18,
529,
2934,
6406,
1435,
2809,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
1080,
12,
1612,
16,
1547,
16,
613,
16,
2146,
33,
8381,
16,
2935,
67,
1369,
67,
1897,
75,
647,
33,
3672,
4672,
508,
273,
609,
12,
1612,
18,
529,
2934,
6406,
1435,
2809,
273,
... |
attrs['last_mod_date'] = time.ctime(os.stat(path)[stat.ST_MTIME]) | try: attrs['last_mod_date'] = time.ctime(os.stat(path)[stat.ST_MTIME]) except OSError: continue | def perform_request_format_templates_management(ln=cdslang, checking=0): """ Returns the main management console for format templates @param ln language @param checking the level of checking (0: basic, 1:extensive (time consuming) ) @return the main page for format templates management """ # Reload in case a format was changed bibformat_engine.clear_caches() # Get formats lists of attributes formats = bibformat_engine.get_format_templates(with_attributes=True) formats_attrs = [] for filename in formats: attrs = formats[filename]['attrs'] attrs['filename'] = filename if filename.endswith('.xsl'): attrs['name'] += ' (XSL)' attrs['editable'] = can_write_format_template(filename) path = CFG_BIBFORMAT_TEMPLATES_PATH + os.sep + filename attrs['last_mod_date'] = time.ctime(os.stat(path)[stat.ST_MTIME]) status = check_format_template(filename, checking) if len(status) > 1 or (len(status)==1 and status[0][0] != 'ERR_BIBFORMAT_CANNOT_READ_TEMPLATE_FILE'): status = ''' <a style="color: rgb(255, 0, 0);" href="%(weburl)s/admin/bibformat/bibformatadmin.py/validate_format?ln=%(ln)s&bft=%(bft)s">Not OK</a> ''' % {'weburl':weburl, 'ln':ln, 'bft':filename} else: status = '<span style="color: rgb(0, 255, 0);">OK</span>' attrs['status'] = status formats_attrs.append(attrs) def sort_by_attr(seq): """ Sort 'seq' by attribute name. @param seq a list of dictionaries, containing each one key named 'name' """ intermed = [ (x['name'].lower(), i, x) for i, x in enumerate(seq)] intermed.sort() return [x[-1] for x in intermed] sorted_format_templates = sort_by_attr(formats_attrs) return bibformat_templates.tmpl_admin_format_templates_management(ln, sorted_format_templates) | e0e4bd772153b97f2bdc8423e07b37cc3a52940d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2763/e0e4bd772153b97f2bdc8423e07b37cc3a52940d/bibformatadminlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
2139,
67,
8502,
67,
17381,
12,
2370,
33,
4315,
2069,
539,
16,
6728,
33,
20,
4672,
3536,
2860,
326,
2774,
11803,
2983,
364,
740,
5539,
225,
632,
891,
7211,
2653,
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,
3073,
67,
2293,
67,
2139,
67,
8502,
67,
17381,
12,
2370,
33,
4315,
2069,
539,
16,
6728,
33,
20,
4672,
3536,
2860,
326,
2774,
11803,
2983,
364,
740,
5539,
225,
632,
891,
7211,
2653,
632... |
self.saved_dbc_key = c.current(0,0,0)[0] | try: self.saved_dbc_key = c.current(0,0,0)[0] except db.DBError: pass | def _closeCursors(self, save=1): if self.dbc: c = self.dbc self.dbc = None if save: self.saved_dbc_key = c.current(0,0,0)[0] c.close() del c for cref in self._cursor_refs.values(): c = cref() if c is not None: c.close() | a223d2cb29a27ea25632cfe695401a4ced96ca06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a223d2cb29a27ea25632cfe695401a4ced96ca06/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4412,
2408,
87,
1383,
12,
2890,
16,
1923,
33,
21,
4672,
309,
365,
18,
9137,
30,
276,
273,
365,
18,
9137,
365,
18,
9137,
273,
599,
309,
1923,
30,
775,
30,
365,
18,
14077,
67,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4412,
2408,
87,
1383,
12,
2890,
16,
1923,
33,
21,
4672,
309,
365,
18,
9137,
30,
276,
273,
365,
18,
9137,
365,
18,
9137,
273,
599,
309,
1923,
30,
775,
30,
365,
18,
14077,
67,
9... |
filename = frame.f_globals.get("__file__", None) if filename is None: filename = frame.f_code.co_filename | (filename, lineno, funcname, context, lineindex,) = inspect.getframeinfo(frame) bname = self.pathtobasename.get(filename) if bname is None: bname = self.pathtobasename.setdefault(filename, os.path.basename(filename)) | def trace(self, frame, why, arg): if why == 'line': # something is fishy about getting the file name filename = frame.f_globals.get("__file__", None) if filename is None: filename = frame.f_code.co_filename try: modulename = frame.f_globals["__name__"] except KeyError: # PyRun_String() for example # XXX what to do? modulename = None | dc6ad8d207ed136b6b1c7c8a4e6aa0c126e7bc61 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/dc6ad8d207ed136b6b1c7c8a4e6aa0c126e7bc61/trace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2606,
12,
2890,
16,
2623,
16,
11598,
16,
1501,
4672,
309,
11598,
422,
296,
1369,
4278,
468,
5943,
353,
284,
1468,
93,
2973,
8742,
326,
585,
508,
282,
261,
3459,
16,
7586,
16,
1326,
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,
2606,
12,
2890,
16,
2623,
16,
11598,
16,
1501,
4672,
309,
11598,
422,
296,
1369,
4278,
468,
5943,
353,
284,
1468,
93,
2973,
8742,
326,
585,
508,
282,
261,
3459,
16,
7586,
16,
1326,
529... |
assert V <= VERSION | assert V <= VERSION, "File is version %d but I don't know about anything beyond %d" % ( V, VERSION ) | def __init__( self, f, cache=32): # If cache=None, then everything is allowed to stay in memory, # this is the default behavior. self.f = f M, V, max_size, bin_size, nbins = read_packed( f, ">5I" ) assert M == MAGIC # assert less than assert V <= VERSION self.max_size = max_size self.bin_size = bin_size self.nbins = nbins self.bins = LRUCache(size=cache) # Read typecode if V >= 1: self.typecode = unpack( 'c', f.read(1) )[0] else: self.typecode = 'f' s = f.read( calcsize( self.typecode ) ) a = fromstring( s, self.typecode ) if LittleEndian: a = a.byteswapped() self.default = a[0] # Read bin sizes and offsets self.bin_pos = [] self.bin_sizes = [] for i in range( nbins ): pos, size = read_packed( f, ">2I" ) self.bin_pos.append( pos ) self.bin_sizes.append( size ) | 769d2a2bf8f7645a185cb04c263da8e3061ef85c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2104/769d2a2bf8f7645a185cb04c263da8e3061ef85c/binned_array.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
284,
16,
1247,
33,
1578,
4672,
468,
971,
1247,
33,
7036,
16,
1508,
7756,
353,
2935,
358,
23449,
316,
3778,
16,
468,
333,
353,
326,
805,
6885,
18,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
284,
16,
1247,
33,
1578,
4672,
468,
971,
1247,
33,
7036,
16,
1508,
7756,
353,
2935,
358,
23449,
316,
3778,
16,
468,
333,
353,
326,
805,
6885,
18,
365,
1... |
if isinstance(fp, file): | if isfile(fp): | def read_array(fp): """ Read an array from an NPY file. Parameters ---------- fp : filelike object If this is not a real file object, then this may take extra memory and time. Returns ------- array : numpy.ndarray The array from the data on disk. Raises ------ ValueError If the data is invalid. """ version = read_magic(fp) if version != (1, 0): msg = "only support version (1,0) of file format, not %r" raise ValueError(msg % (version,)) shape, fortran_order, dtype = read_array_header_1_0(fp) if len(shape) == 0: count = 1 else: count = numpy.multiply.reduce(shape) # Now read the actual data. if dtype.hasobject: # The array contained Python objects. We need to unpickle the data. array = cPickle.load(fp) else: if isinstance(fp, file): # We can use the fast fromfile() function. array = numpy.fromfile(fp, dtype=dtype, count=count) else: # This is not a real file. We have to read it the memory-intensive # way. # XXX: we can probably chunk this to avoid the memory hit. data = fp.read(count * dtype.itemsize) array = numpy.fromstring(data, dtype=dtype, count=count) if fortran_order: array.shape = shape[::-1] array = array.transpose() else: array.shape = shape return array | 906d21e1b3ef6e6cd68847c427c185137a151314 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/906d21e1b3ef6e6cd68847c427c185137a151314/format.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
1126,
12,
7944,
4672,
3536,
2720,
392,
526,
628,
392,
423,
16235,
585,
18,
225,
7012,
12181,
4253,
294,
661,
292,
2547,
733,
971,
333,
353,
486,
279,
2863,
585,
733,
16,
1508,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1126,
12,
7944,
4672,
3536,
2720,
392,
526,
628,
392,
423,
16235,
585,
18,
225,
7012,
12181,
4253,
294,
661,
292,
2547,
733,
971,
333,
353,
486,
279,
2863,
585,
733,
16,
1508,... |
def as_field(self): """Returns a field object for this form.""" field = self._converter.clone() field.__class__ = FormAsField field.form = self return field | def as_field(self): """Returns a field object for this form.""" field = self._converter.clone() field.__class__ = FormAsField field.form = self return field | f95105a4e0c240821e86d7b5d2305e9c23ac1b4d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12815/f95105a4e0c240821e86d7b5d2305e9c23ac1b4d/forms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
487,
67,
1518,
12,
2890,
4672,
3536,
1356,
279,
652,
733,
364,
333,
646,
12123,
652,
273,
365,
6315,
15747,
18,
14056,
1435,
652,
16186,
1106,
972,
273,
2748,
1463,
974,
652,
18,
687,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
487,
67,
1518,
12,
2890,
4672,
3536,
1356,
279,
652,
733,
364,
333,
646,
12123,
652,
273,
365,
6315,
15747,
18,
14056,
1435,
652,
16186,
1106,
972,
273,
2748,
1463,
974,
652,
18,
687,
... | |
if self.priv["tasklist"].has_key("sort_column") and \ self.priv["tasklist"].has_key("sort_order"): if self.priv["tasklist"]["sort_column"] is not None and \ self.priv["tasklist"]["sort_order"] is not None: self.sort_tasklist_rows(self.priv["tasklist"]["sort_column"], \ self.priv["tasklist"]["sort_order"]) | if (self.priv["tasklist"].has_key("sort_column") and self.priv["tasklist"].has_key("sort_order")): if (self.priv["tasklist"]["sort_column"] is not None and self.priv["tasklist"]["sort_order"] is not None): self.sort_tasklist_rows( self.priv["tasklist"]["sort_column"], self.priv["tasklist"]["sort_order"]) | def refresh_list(self, a=None, toselect=None): #pylint: disable-msg=W0613 | 451ea29e3924785bc6c6b8648aa6459b292a0db4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7036/451ea29e3924785bc6c6b8648aa6459b292a0db4/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
67,
1098,
12,
2890,
16,
279,
33,
7036,
16,
358,
4025,
33,
7036,
4672,
468,
2074,
5671,
30,
4056,
17,
3576,
33,
59,
7677,
3437,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
67,
1098,
12,
2890,
16,
279,
33,
7036,
16,
358,
4025,
33,
7036,
4672,
468,
2074,
5671,
30,
4056,
17,
3576,
33,
59,
7677,
3437,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if not content_array[0].startswith('svn: File not found:'): continue | if (content_array[0].startswith('svn: File not found:') or content_array[0].endswith('path not found')): break | def GetCachedFile(filename, max_age=60*60*24*3, use_root=False): """Retrieves a file from the repository and caches it in GetCacheDir() for max_age seconds. use_root: If False, look up the arborescence for the first match, otherwise go directory to the root repository. Note: The cache will be inconsistent if the same file is retrieved with both use_root=True and use_root=False. Don't be stupid. """ if filename not in FILES_CACHE: # Don't try to look up twice. FILES_CACHE[filename] = None # First we check if we have a cached version. try: cached_file = os.path.join(GetCacheDir(), filename) except gclient_utils.Error: return None if (not os.path.exists(cached_file) or (time.time() - os.stat(cached_file).st_mtime) > max_age): dir_info = SVN.CaptureInfo('.') repo_root = dir_info['Repository Root'] if use_root: url_path = repo_root else: url_path = dir_info['URL'] while True: # Look in the repository at the current level for the file. for _ in range(5): content = None try: # Take advantage of the fact that svn won't output to stderr in case # of success but will do in case of failure so don't mind putting # stderr into content_array. content_array = [] svn_path = url_path + '/' + filename args = ['svn', 'cat', svn_path] if sys.platform != 'darwin': # MacOSX 10.5.2 has a bug with svn 1.4.4 that will trigger the # 'Can\'t get username or password' and can be fixed easily. # The fix doesn't work if the user upgraded to svn 1.6.x. Bleh. # I don't have time to fix their broken stuff. args.append('--non-interactive') gclient_utils.CheckCallAndFilter( args, cwd='.', filter_fn=content_array.append) # Exit the loop if the file was found. Override content. content = '\n'.join(content_array) break except gclient_utils.Error: if content_array[0].startswith( 'svn: Can\'t get username or password'): ErrorExit('Your svn credentials expired. Please run svn update ' 'to fix the cached credentials') if content_array[0].startswith('svn: Can\'t get password'): ErrorExit('If are using a Mac and svn --version shows 1.4.x, ' 'please hack gcl.py to remove --non-interactive usage, it\'s' 'a bug on your installed copy') if not content_array[0].startswith('svn: File not found:'): # Try again. continue if content: break if url_path == repo_root: # Reached the root. Abandoning search. break # Go up one level to try again. url_path = os.path.dirname(url_path) if content is not None or filename != CODEREVIEW_SETTINGS_FILE: # Write a cached version even if there isn't a file, so we don't try to # fetch it each time. codereview.settings must always be present so do # not cache negative. gclient_utils.FileWrite(cached_file, content or '') else: content = gclient_utils.FileRead(cached_file, 'r') # Keep the content cached in memory. FILES_CACHE[filename] = content return FILES_CACHE[filename] | 062a83f206757174b7e007170de76d54448d0367 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/062a83f206757174b7e007170de76d54448d0367/gcl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
9839,
812,
12,
3459,
16,
943,
67,
410,
33,
4848,
14,
4848,
14,
3247,
14,
23,
16,
999,
67,
3085,
33,
8381,
4672,
3536,
6960,
279,
585,
628,
326,
3352,
471,
12535,
518,
316,
968,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
9839,
812,
12,
3459,
16,
943,
67,
410,
33,
4848,
14,
4848,
14,
3247,
14,
23,
16,
999,
67,
3085,
33,
8381,
4672,
3536,
6960,
279,
585,
628,
326,
3352,
471,
12535,
518,
316,
968,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.