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 |
|---|---|---|---|---|---|---|
n2 = _strxfrm(buf, rffi.str2charp(s), n1) + 1 | s_c = rffi.str2charp(s) try: n2 = _strxfrm(buf, s_c, n1) + 1 finally: rffi.free_charp(s_c) | def strxfrm(space, s): "string -> string. Returns a string that behaves for cmp locale-aware." n1 = len(s) + 1 buf = lltype.malloc(rffi.CCHARP.TO, n1, flavor="raw", zero=True) n2 = _strxfrm(buf, rffi.str2charp(s), n1) + 1 if n2 > n1: # more space needed lltype.free(buf, flavor="raw") buf = lltype.malloc(rffi.CCHARP.TO, intmask(n2), flavor="raw", zero=True) _strxfrm(buf, rffi.str2charp(s), n2) val = rffi.charp2str(buf) lltype.free(buf, flavor="raw") return space.wrap(val) | 65aa0aa2e21be5f7ed865c24d133771e4c44ff1f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/65aa0aa2e21be5f7ed865c24d133771e4c44ff1f/interp_locale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
92,
4840,
81,
12,
2981,
16,
272,
4672,
315,
1080,
317,
533,
18,
2860,
279,
533,
716,
12433,
6606,
364,
9411,
2573,
17,
30799,
1199,
290,
21,
273,
562,
12,
87,
13,
397,
404,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
92,
4840,
81,
12,
2981,
16,
272,
4672,
315,
1080,
317,
533,
18,
2860,
279,
533,
716,
12433,
6606,
364,
9411,
2573,
17,
30799,
1199,
290,
21,
273,
562,
12,
87,
13,
397,
404,
225,... |
def _signal_client(self, host, command): | def _signal_client(self, host, autodir, command): | def _signal_client(self, host, command): """ Signal to a client that it should execute profilers.command by writing a byte into AUTODIR/profilers.command. """ autodir = host.get_autodir() path = os.path.join(autodir, "profiler.%s" % command) host.run("echo A > %s" % path) | d16ba8fddbf6985a577ca31bfe9030c19678bb78 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/d16ba8fddbf6985a577ca31bfe9030c19678bb78/profiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10420,
67,
2625,
12,
2890,
16,
1479,
16,
2059,
369,
481,
16,
1296,
4672,
3536,
12032,
358,
279,
1004,
716,
518,
1410,
1836,
450,
7540,
414,
18,
3076,
635,
7410,
279,
1160,
1368,
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,
389,
10420,
67,
2625,
12,
2890,
16,
1479,
16,
2059,
369,
481,
16,
1296,
4672,
3536,
12032,
358,
279,
1004,
716,
518,
1410,
1836,
450,
7540,
414,
18,
3076,
635,
7410,
279,
1160,
1368,
4... |
for headername in ["subject", "to"]: for disp in (self.ham, self.spam, self.unsure): header = self.msg[headername] self.assert_(disp not in header) options["Headers", "notate_%s" % (headername,)] = \ (self.ham, self.unsure, self.spam) prob = {self.ham:self.g_prob, self.spam:self.s_prob, self.unsure:self.u_prob}[disp] self.msg.addSBHeaders(prob, self.clues) self.assert_(disp in self.msg[headername]) header2 = self.msg[headername] self.msg.addSBHeaders(prob, self.clues) self.assert_(disp in self.msg[headername].replace(disp, "", 1)) self.msg.delNotations() self.assertEqual(self.msg[headername], header2) self.msg.replace_header(headername, header) | for disp in (self.ham, self.spam, self.unsure): header = self.msg[headername] self.assertEqual(header.find(disp), -1) options["Headers", "notate_%s" % (headername,)] = \ (self.ham, self.unsure, self.spam) prob = {self.ham:self.g_prob, self.spam:self.s_prob, self.unsure:self.u_prob}[disp] self.msg.addSBHeaders(prob, self.clues) self.assertNotEqual(self.msg[headername].find(disp), -1) header2 = self.msg[headername] self.msg.addSBHeaders(prob, self.clues) self.assertNotEqual(self.msg[headername].\ replace(disp, "", 1).find(disp), -1) self.msg.delNotations() self.assertEqual(self.msg[headername], header2) self.msg.replace_header(headername, header) | def test_delNotations_only_once(self): # Check that only one disposition is removed, even if more than # one is present. for headername in ["subject", "to"]: for disp in (self.ham, self.spam, self.unsure): # Add a notation to the header header = self.msg[headername] self.assert_(disp not in header) options["Headers", "notate_%s" % (headername,)] = \ (self.ham, self.unsure, self.spam) prob = {self.ham:self.g_prob, self.spam:self.s_prob, self.unsure:self.u_prob}[disp] self.msg.addSBHeaders(prob, self.clues) self.assert_(disp in self.msg[headername]) header2 = self.msg[headername] # Add a second notation self.msg.addSBHeaders(prob, self.clues) self.assert_(disp in self.msg[headername].replace(disp, "", 1)) # Remove it self.msg.delNotations() self.assertEqual(self.msg[headername], header2) # Restore for next time round the loop self.msg.replace_header(headername, header) | 274fd041277b8777bd1567b84a52d889f51c6bcc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/274fd041277b8777bd1567b84a52d889f51c6bcc/test_message.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3771,
1248,
1012,
67,
3700,
67,
8243,
12,
2890,
4672,
468,
2073,
716,
1338,
1245,
23913,
353,
3723,
16,
5456,
309,
1898,
2353,
468,
1245,
353,
3430,
18,
364,
1446,
529,
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,
1842,
67,
3771,
1248,
1012,
67,
3700,
67,
8243,
12,
2890,
4672,
468,
2073,
716,
1338,
1245,
23913,
353,
3723,
16,
5456,
309,
1898,
2353,
468,
1245,
353,
3430,
18,
364,
1446,
529,
316,
... |
print 'Added ID %d to list' % cls.id | def catalog_cached(self, program, ts=None, force_all=False, initial_queryset=None): """ Return a queryset of classes for view in the catalog. | 0e203a1b7bc0363239878326aa80af78f4d99087 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12041/0e203a1b7bc0363239878326aa80af78f4d99087/class_.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6222,
67,
7097,
12,
2890,
16,
5402,
16,
3742,
33,
7036,
16,
2944,
67,
454,
33,
8381,
16,
2172,
67,
21729,
33,
7036,
4672,
3536,
2000,
279,
11892,
434,
3318,
364,
1476,
316,
326,
6222,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6222,
67,
7097,
12,
2890,
16,
5402,
16,
3742,
33,
7036,
16,
2944,
67,
454,
33,
8381,
16,
2172,
67,
21729,
33,
7036,
4672,
3536,
2000,
279,
11892,
434,
3318,
364,
1476,
316,
326,
6222,
... | |
bb.build.del_stamp('do_%s' % self.configuration.cmd, self.status, fn) | bb.build.del_stamp('do_%s' % self.configuration.cmd, self.configuration.data) | def buildFile(self, buildfile): """ Build the file matching regexp buildfile """ | 771c75a811aa55ed5ec788603698c0087924253c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2672/771c75a811aa55ed5ec788603698c0087924253c/cooker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
812,
12,
2890,
16,
1361,
768,
4672,
3536,
3998,
326,
585,
3607,
7195,
1361,
768,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
812,
12,
2890,
16,
1361,
768,
4672,
3536,
3998,
326,
585,
3607,
7195,
1361,
768,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
s.save_views() | def run(app, s): try: app.start() except KeyboardInterrupt: pass # save the option database s.save_views() | e5c8bfb6eb67598fa27053f07362c5d996821b47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/e5c8bfb6eb67598fa27053f07362c5d996821b47/Main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2910,
16,
272,
4672,
775,
30,
595,
18,
1937,
1435,
1335,
19424,
30,
1342,
468,
1923,
326,
1456,
2063,
282,
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,
1086,
12,
2910,
16,
272,
4672,
775,
30,
595,
18,
1937,
1435,
1335,
19424,
30,
1342,
468,
1923,
326,
1456,
2063,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
ufl_assert(isinstance(f, (Terminal, x._uflclass)), "Expecting expand_derivatives to have been applied.") | ufl_assert(isinstance(f, (Terminal, x._uflclass, ListTensor, ComponentTensor)), "Expecting expand_derivatives to have been applied.") | def spatial_derivative(self, x): f, ii = x.operands() ufl_assert(isinstance(f, (Terminal, x._uflclass)), "Expecting expand_derivatives to have been applied.") # Taking component if necessary f = self.visit(f) #ii = self.visit(ii) # mapping to constant if necessary | d64e7217cf78c7c13a822e3459ab4c924822acb5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/624/d64e7217cf78c7c13a822e3459ab4c924822acb5/transformations.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15010,
67,
20615,
1535,
12,
2890,
16,
619,
4672,
284,
16,
6072,
273,
619,
18,
4063,
5708,
1435,
582,
2242,
67,
11231,
12,
291,
1336,
12,
74,
16,
261,
11336,
16,
619,
6315,
696,
80,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15010,
67,
20615,
1535,
12,
2890,
16,
619,
4672,
284,
16,
6072,
273,
619,
18,
4063,
5708,
1435,
582,
2242,
67,
11231,
12,
291,
1336,
12,
74,
16,
261,
11336,
16,
619,
6315,
696,
80,
1... |
- ``proof`` - a boolean (default ``False``), requres height_bound to be set | - ``proof`` - a boolean (default: ``False``), requires height_bound to be set | def algdep(z, degree, known_bits=None, use_bits=None, known_digits=None, use_digits=None, height_bound=None, proof=False): """ Returns a polynomial of degree at most `degree` which is approximately satisfied by the number `z`. Note that the returned polynomial need not be irreducible, and indeed usually won't be if `z` is a good approximation to an algebraic number of degree less than `degree`. You can specify the number of known bits or digits with ``known_bits=k`` or ``known_digits=k``; Pari is then told to compute the result using `0.8k` of these bits/digits. (The Pari documentation recommends using a factor between .6 and .9, but internally defaults to .8.) Or, you can specify the precision to use directly with ``use_bits=k`` or ``use_digits=k``. If none of these are specified, then the precision is taken from the input value. A height bound may specified to indicate the maximum coefficient size of the returned polynomial; if a sufficiently small polyomial is not found then ``None`` wil be returned. If ``proof=True`` then the result is returned only if it can be proved correct (i.e. the only possible minimal polynomial satisfying the height bound, or no such polynomial exists). Otherwise a ``ValueError`` is raised indicating that higher precision is required. ALGORITHM: Uses LLL for real/complex inputs, PARI C-library algdep command otherwise. Note that ``algebraic_dependency`` is a synonym for ``algdep``. INPUT: - ``z`` - real, complex, or `p`-adic number - ``degree`` - an integer - ``height_bound`` - an integer (default ``None``) specifying the maximum coefficient size for the returned polynomial - ``proof`` - a boolean (default ``False``), requres height_bound to be set EXAMPLES:: sage: algdep(1.888888888888888, 1) 9*x - 17 sage: algdep(0.12121212121212,1) 33*x - 4 sage: algdep(sqrt(2),2) x^2 - 2 This example involves a complex number. :: sage: z = (1/2)*(1 + RDF(sqrt(3)) *CC.0); z 0.500000000000000 + 0.866025403784439*I sage: p = algdep(z, 6); p x^3 + 1 sage: p.factor() (x + 1) * (x^2 - x + 1) sage: z^2 - z + 1 0 This example involves a `p`-adic number. :: sage: K = Qp(3, print_mode = 'series') sage: a = K(7/19); a 1 + 2*3 + 3^2 + 3^3 + 2*3^4 + 2*3^5 + 3^8 + 2*3^9 + 3^11 + 3^12 + 2*3^15 + 2*3^16 + 3^17 + 2*3^19 + O(3^20) sage: algdep(a, 1) 19*x - 7 These examples show the importance of proper precision control. We compute a 200-bit approximation to sqrt(2) which is wrong in the 33'rd bit. :: sage: z = sqrt(RealField(200)(2)) + (1/2)^33 sage: p = algdep(z, 4); p 227004321085*x^4 - 216947902586*x^3 - 99411220986*x^2 + 82234881648*x - 211871195088 sage: factor(p) 227004321085*x^4 - 216947902586*x^3 - 99411220986*x^2 + 82234881648*x - 211871195088 sage: algdep(z, 4, known_bits=32) x^2 - 2 sage: algdep(z, 4, known_digits=10) x^2 - 2 sage: algdep(z, 4, use_bits=25) x^2 - 2 sage: algdep(z, 4, use_digits=8) x^2 - 2 Using the ``height_bound`` and ``proof`` parameters, we can see that `pi` is not the root of an integer polynomial of degree at most 5 and coefficients bounded above by 10. :: sage: algdep(pi.n(), 5, height_bound=10, proof=True) is None True For stronger results, we need more precicion. :: sage: algdep(pi.n(), 5, height_bound=100, proof=True) is None Traceback (most recent call last): ... ValueError: insufficient precision for non-existence proof sage: algdep(pi.n(200), 5, height_bound=100, proof=True) is None True sage: algdep(pi.n(), 10, height_bound=10, proof=True) is None Traceback (most recent call last): ... ValueError: insufficient precision for non-existence proof sage: algdep(pi.n(200), 10, height_bound=10, proof=True) is None True We can also use ``proof=True`` to get positive results. :: sage: a = sqrt(2) + sqrt(3) + sqrt(5) sage: algdep(a.n(), 8, height_bound=1000, proof=True) Traceback (most recent call last): ... ValueError: insufficient precision for uniqueness proof sage: f = algdep(a.n(1000), 8, height_bound=1000, proof=True); f x^8 - 40*x^6 + 352*x^4 - 960*x^2 + 576 sage: f(a).expand() 0 """ if proof and not height_bound: raise ValueError, "height_bound must be given for proof=True" x = ZZ['x'].gen() if isinstance(z, (int, long, integer.Integer)): if height_bound and abs(z) >= height_bound: return None return x - ZZ(z) degree = ZZ(degree) if isinstance(z, (sage.rings.rational.Rational)): if height_bound and max(abs(z.denominator()), abs(z.numerator())) >= height_bound: return None return z.denominator()*x - z.numerator() if isinstance(z, float): z = sage.rings.real_mpfr.RR(z) elif isinstance(z, complex): z = sage.rings.complex_field.CC(z) if isinstance(z, (sage.rings.real_mpfr.RealNumber, sage.rings.complex_number.ComplexNumber)): log2_10 = 3.32192809488736 prec = z.prec() - 6 if known_digits is not None: known_bits = known_digits * log2_10 if known_bits is not None: use_bits = known_bits * 0.8 if use_digits is not None: use_bits = use_digits * log2_10 if use_bits is not None: prec = int(use_bits) is_complex = isinstance(z, sage.rings.complex_number.ComplexNumber) n = degree+1 from sage.matrix.all import matrix M = matrix(ZZ, n, n+1+int(is_complex)) r = ZZ(1) << prec M[0, 0] = 1 M[0,-1] = r for k in range(1, degree+1): M[k,k] = 1 r *= z if is_complex: M[k, -1] = r.real().round() M[k, -2] = r.imag().round() else: M[k, -1] = r.round() LLL = M.LLL(delta=.75) coeffs = LLL[0][:n] if height_bound: def norm(v): # norm on an integer vector invokes Integer.sqrt() which tries to factor... from sage.rings.real_mpfi import RIF return v.change_ring(RIF).norm() if max(abs(a) for a in coeffs) > height_bound: if proof: # Given an LLL reduced basis $b_1, ..., b_n$, we only # know that $|b_1| <= 2^((n-1)/2) |x|$ for non-zero $x \in L$. if norm(LLL[0]) <= 2**((n-1)/2) * n.sqrt() * height_bound: raise ValueError, "insufficient precision for non-existence proof" return None elif proof and norm(LLL[1]) < 2**((n-1)/2) * max(norm(LLL[0]), n.sqrt()*height_bound): raise ValueError, "insufficient precision for uniqueness proof" if coeffs[degree] < 0: coeffs = -coeffs f = list(coeffs) elif proof or height_bound: raise NotImplementedError, "proof and height bound only implemented for real and complex numbers" else: y = pari(z) f = y.algdep(degree) return x.parent()(f) | 2a5f9f192675580f8a03d5205bd9793259ee204a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2a5f9f192675580f8a03d5205bd9793259ee204a/arith.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11989,
15037,
12,
94,
16,
10782,
16,
4846,
67,
6789,
33,
7036,
16,
999,
67,
6789,
33,
7036,
16,
4846,
67,
16649,
33,
7036,
16,
999,
67,
16649,
33,
7036,
16,
2072,
67,
3653,
33,
7036,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11989,
15037,
12,
94,
16,
10782,
16,
4846,
67,
6789,
33,
7036,
16,
999,
67,
6789,
33,
7036,
16,
4846,
67,
16649,
33,
7036,
16,
999,
67,
16649,
33,
7036,
16,
2072,
67,
3653,
33,
7036,... |
'\\documentclass{article}\\usepackage{fullpage}\\usepackage{amsmath}\n\\usepackage{amssymb}\n\\usepackage{amsfonts}\\usepackage{graphicx}\\usepackage{pstricks}\\pagestyle{empty}\n\n\n\\begin{document}\n\\begin{center}{\\Large\\bf The number three}\\end{center}\n\\thispagestyle{empty}\n \\small \\vfill\\thispagestyle{empty}\\pagestyle{empty}\n\n \\[ 3 \\]\n\n\\vfill \\end{document}' | '\\documentclass{article}\\usepackage{fullpage}\\usepackage{amsmath}\n\\usepackage{amssymb}\n\\usepackage{amsfonts}\\usepackage{graphicx}\\usepackage{pstricks}\\pagestyle{empty}\n\n\\begin{document}\n\\begin{center}{\\Large\\bf The number three}\\end{center}\n\\vspace{40mm}\\[3\\]\n\\end{document}' sage: _latex_file_([7, 8, 9], title="Why was six afraid of seven?", sep='\\vfill\\hrule\\vfill') '\\documentclass{article}\\usepackage{fullpage}\\usepackage{amsmath}\n\\usepackage{amssymb}\n\\usepackage{amsfonts}\\usepackage{graphicx}\\usepackage{pstricks}\\pagestyle{empty}\n\n\\begin{document}\n\\begin{center}{\\Large\\bf Why was six afraid of seven?}\\end{center}\n\\vspace{40mm}\\[7\\]\n\n\\vfill\\hrule\\vfill\n\n\\[8\\]\n\n\\vfill\\hrule\\vfill\n\n\\[9\\]\n\\end{document}' | def _latex_file_(objects, title='SAGE', expert=True, debug=False, \ sep='', tiny=False, math_left='\\[', math_right='\\]', extra_preamble=''): """ Compute a latex file that defines a representation of each object in objects. INPUT: - ``objects`` - list (or object) - ``title`` - string (default: 'Sage'): title for the document - ``expert`` - bool (default: True): mode passed on to xdvi - ``debug`` - bool (default: False): print verbose output - ``sep`` - string (default: ''): separator between math objects - ``tiny`` - bool (default: False): use 'tiny' font. - ``extra_preamble`` - string (default: ''): extra LaTeX commands, inserted before "\\begin{document}" EXAMPLES:: sage: from sage.misc.latex import _latex_file_ sage: _latex_file_(3, title="The number three") '\\documentclass{article}\\usepackage{fullpage}\\usepackage{amsmath}\n\\usepackage{amssymb}\n\\usepackage{amsfonts}\\usepackage{graphicx}\\usepackage{pstricks}\\pagestyle{empty}\n\n\n\\begin{document}\n\\begin{center}{\\Large\\bf The number three}\\end{center}\n\\thispagestyle{empty}\n \\small \\vfill\\thispagestyle{empty}\\pagestyle{empty}\n\n \\[ 3 \\]\n\n\\vfill \\end{document}' """ process = True if hasattr(objects, '_latex_'): objects = [objects] if hasattr(objects, '__doc__') and hasattr(objects, 'func_name'): process = False title = "\\begin{verbatim}%s\\end{verbatim}"%objects.func_name objects = [objects.__doc__] if not isinstance(objects, list): objects = [objects] if expert: expert='-expert' else: expert='' if tiny: size='tiny' else: size='small' s = LATEX_HEADER s += '\n%s\n\\begin{document}\n\\begin{center}{\\Large\\bf %s}\\end{center}\n\\thispagestyle{empty}\n \\%s '%( extra_preamble, title, size) #s += "(If something is missing it may be on the next page or there may be errors in the latex. Use view with {\\tt debug=True}.)\\vfill" s += '\\vfill' if process: for i in range(len(objects)): x = objects[i] L = latex(x) if not '\\begin{verbatim}' in L: s += '\\thispagestyle{empty}\\pagestyle{empty}\n\n %s %s %s'%(math_left, latex(x), math_right) else: s += '\\thispagestyle{empty}\\pagestyle{empty}\n\n %s'%latex(x) if i < len(objects)-1: s += '\n\n%s\n\n'%sep else: s += "\n\n".join([str(x) for x in objects]) s += '\n\n\\vfill \\end{document}' if debug: print s return s | 41e685a664d91787b4b32852193aeddf3e79118c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/41e685a664d91787b4b32852193aeddf3e79118c/latex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
26264,
67,
768,
67,
12,
6911,
16,
2077,
2218,
55,
2833,
2187,
431,
672,
33,
5510,
16,
1198,
33,
8381,
16,
521,
5478,
2218,
2187,
24405,
33,
8381,
16,
4233,
67,
4482,
2218,
1695,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26264,
67,
768,
67,
12,
6911,
16,
2077,
2218,
55,
2833,
2187,
431,
672,
33,
5510,
16,
1198,
33,
8381,
16,
521,
5478,
2218,
2187,
24405,
33,
8381,
16,
4233,
67,
4482,
2218,
1695,
... |
(vers[key].encode('utf-8'),)) | (vers[key],)) | def setVersionList(self, v, key): """Remove all versions, set them to `v`""" self.assertNoTickets() | dcac9900ef68be5a1bfa423276a595d98b1050eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/dcac9900ef68be5a1bfa423276a595d98b1050eb/bugzilla2trac.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16770,
682,
12,
2890,
16,
331,
16,
498,
4672,
3536,
3288,
777,
5244,
16,
444,
2182,
358,
1375,
90,
68,
8395,
365,
18,
11231,
2279,
6264,
2413,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16770,
682,
12,
2890,
16,
331,
16,
498,
4672,
3536,
3288,
777,
5244,
16,
444,
2182,
358,
1375,
90,
68,
8395,
365,
18,
11231,
2279,
6264,
2413,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-1... |
def depsToJsonFile(classDepsIter, logConf): | def depsToJsonFile(classDepsIter, depsLogConf): | def depsToJsonFile(classDepsIter, logConf): data = {} for (packageId, classId, depId, loadOrRun) in classDepsIter: if classId not in data: data[classId] = {} data[classId]["load"] = [] data[classId]["run"] = [] | c18752e3a6a20f73f8cace28d0b3ee01558d13f0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/c18752e3a6a20f73f8cace28d0b3ee01558d13f0/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8740,
774,
3185,
812,
12,
1106,
14430,
2360,
16,
8740,
1343,
3976,
4672,
501,
273,
2618,
364,
261,
5610,
548,
16,
31181,
16,
5993,
548,
16,
1262,
1162,
1997,
13,
316,
667,
14430,
2360,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8740,
774,
3185,
812,
12,
1106,
14430,
2360,
16,
8740,
1343,
3976,
4672,
501,
273,
2618,
364,
261,
5610,
548,
16,
31181,
16,
5993,
548,
16,
1262,
1162,
1997,
13,
316,
667,
14430,
2360,
... |
return space.newbool(0) for w_k, hash, cell in w_left.data: | return space.w_False for w_key, cell in w_left.non_empties(): | def eq__Dict_Dict(space, w_left, w_right): if len(w_left.data) != len(w_right.data): return space.newbool(0) for w_k, hash, cell in w_left.data: try: w_v = space.getitem(w_right, w_k) except OperationError: return space.newbool(0) r = space.is_true(space.eq(cell.w_value, w_v)) if not r: return space.newbool(r) return space.newbool(1) | 6866ac46dd6908f6d7aabea61e4b536cbf9023a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/6866ac46dd6908f6d7aabea61e4b536cbf9023a7/dictobject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7555,
972,
5014,
67,
5014,
12,
2981,
16,
341,
67,
4482,
16,
341,
67,
4083,
4672,
309,
562,
12,
91,
67,
4482,
18,
892,
13,
480,
562,
12,
91,
67,
4083,
18,
892,
4672,
327,
3476,
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,
7555,
972,
5014,
67,
5014,
12,
2981,
16,
341,
67,
4482,
16,
341,
67,
4083,
4672,
309,
562,
12,
91,
67,
4482,
18,
892,
13,
480,
562,
12,
91,
67,
4083,
18,
892,
4672,
327,
3476,
18,
... |
if name in self.room_handlers: | if name not in self.room_handlers: | def _check_room(self, name): if self.room_counter.contains(name): return if name in self.room_handlers: return self.room_handlers.pop(name).throw(threado.Finished()) | 0d3411d778f7adca0343fc3a03dcf489c0929bfe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14361/0d3411d778f7adca0343fc3a03dcf489c0929bfe/roomfarm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
13924,
12,
2890,
16,
508,
4672,
309,
365,
18,
13924,
67,
7476,
18,
12298,
12,
529,
4672,
327,
309,
508,
486,
316,
365,
18,
13924,
67,
11046,
30,
327,
365,
18,
13924,
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,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
13924,
12,
2890,
16,
508,
4672,
309,
365,
18,
13924,
67,
7476,
18,
12298,
12,
529,
4672,
327,
309,
508,
486,
316,
365,
18,
13924,
67,
11046,
30,
327,
365,
18,
13924,
6... |
buildIdTime = time.strptime(self.buildid, "%Y%m%d%H") | if len(self.buildid) == 12: buildIdTime = time.strptime(self.buildid, "%Y%m%d%H%M") else: buildIdTime = time.strptime(self.buildid, "%Y%m%d%H") | def _getTimeFromBuildId(self): buildIdTime = time.strptime(self.buildid, "%Y%m%d%H") return time.strftime("%a, %d %b %Y %H:%M:%S GMT", buildIdTime) | 063bd9031798da0e2a14de0d8709374c574f5f99 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13067/063bd9031798da0e2a14de0d8709374c574f5f99/PerfConfigurator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
950,
1265,
3116,
548,
12,
2890,
4672,
309,
562,
12,
2890,
18,
3510,
350,
13,
422,
2593,
30,
1361,
548,
950,
273,
813,
18,
701,
10650,
12,
2890,
18,
3510,
350,
16,
2213,
61,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
950,
1265,
3116,
548,
12,
2890,
4672,
309,
562,
12,
2890,
18,
3510,
350,
13,
422,
2593,
30,
1361,
548,
950,
273,
813,
18,
701,
10650,
12,
2890,
18,
3510,
350,
16,
2213,
61,... |
if os.path.exists(i): | if not os.path.exists(i): | def StartImportExportDaemon(mode, key_name, ca, host, port, instance, ieio, ieioargs): """Starts an import or export daemon. @param mode: Import/output mode @type key_name: string @param key_name: RSA key name (None to use cluster certificate) @type ca: string: @param ca: Remote CA in PEM format (None to use cluster certificate) @type host: string @param host: Remote host for export (None for import) @type port: int @param port: Remote port for export (None for import) @type instance: L{objects.Instance} @param instance: Instance object @param ieio: Input/output type @param ieioargs: Input/output arguments """ if mode == constants.IEM_IMPORT: prefix = "import" if not (host is None and port is None): _Fail("Can not specify host or port on import") elif mode == constants.IEM_EXPORT: prefix = "export" if host is None or port is None: _Fail("Host and port must be specified for an export") else: _Fail("Invalid mode %r", mode) if (key_name is None) ^ (ca is None): _Fail("Cluster certificate can only be used for both key and CA") (cmd_env, cmd_prefix, cmd_suffix) = \ _GetImportExportIoCommand(instance, mode, ieio, ieioargs) if key_name is None: # Use server.pem key_path = constants.NODED_CERT_FILE cert_path = constants.NODED_CERT_FILE assert ca is None else: (_, key_path, cert_path) = _GetX509Filenames(constants.CRYPTO_KEYS_DIR, key_name) assert ca is not None for i in [key_path, cert_path]: if os.path.exists(i): _Fail("File '%s' does not exist" % i) status_dir = _CreateImportExportStatusDir(prefix) try: status_file = utils.PathJoin(status_dir, _IES_STATUS_FILE) pid_file = utils.PathJoin(status_dir, _IES_PID_FILE) ca_file = utils.PathJoin(status_dir, _IES_CA_FILE) if ca is None: # Use server.pem ca = utils.ReadFile(constants.NODED_CERT_FILE) utils.WriteFile(ca_file, data=ca, mode=0400) cmd = [ constants.IMPORT_EXPORT_DAEMON, status_file, mode, "--key=%s" % key_path, "--cert=%s" % cert_path, "--ca=%s" % ca_file, ] if host: cmd.append("--host=%s" % host) if port: cmd.append("--port=%s" % port) if cmd_prefix: cmd.append("--cmd-prefix=%s" % cmd_prefix) if cmd_suffix: cmd.append("--cmd-suffix=%s" % cmd_suffix) logfile = _InstanceLogName(prefix, instance.os, instance.name) # TODO: Once _InstanceLogName uses tempfile.mkstemp, StartDaemon has # support for receiving a file descriptor for output utils.StartDaemon(cmd, env=cmd_env, pidfile=pid_file, output=logfile) # The import/export name is simply the status directory name return os.path.basename(status_dir) except Exception: shutil.rmtree(status_dir, ignore_errors=True) raise | dcaabc4f47c7af2669a9e4d786b295c1e91d00d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7542/dcaabc4f47c7af2669a9e4d786b295c1e91d00d3/backend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3603,
5010,
6144,
12858,
12,
3188,
16,
498,
67,
529,
16,
3474,
16,
1479,
16,
1756,
16,
791,
16,
9228,
1594,
16,
9228,
1594,
1968,
4672,
3536,
11203,
392,
1930,
578,
3359,
8131,
18,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3603,
5010,
6144,
12858,
12,
3188,
16,
498,
67,
529,
16,
3474,
16,
1479,
16,
1756,
16,
791,
16,
9228,
1594,
16,
9228,
1594,
1968,
4672,
3536,
11203,
392,
1930,
578,
3359,
8131,
18,
225... |
res = self.transDB.getTransformationWithStatus(['Active','Flush']) | res = self.transDB.getTransformations({'Status':['Active','Flush']}) | def getTransformations(self): # Obtain the transformations to be executed transName = gConfig.getValue(self.section+'/Transformation','All') if transName == 'All': gLogger.info("%s.getTransformations: Initializing general purpose agent." % AGENT_NAME) res = self.transDB.getTransformationWithStatus(['Active','Flush']) if not res['OK']: gLogger.error("%s.getTransformations: Failed to get transformations." % AGENT_NAME, res['Message']) return res transformations = res['Value'] gLogger.info("%s.getTransformations: Obtained %d transformations to process" % (AGENT_NAME,len(transformations))) else: gLogger.info("%s.getTransformations: Initializing for transformation %s." % (AGENT_NAME,transName)) res = self.transDB.getTransformation(transName) if not res['OK']: gLogger.error("%s.getTransformations: Failed to get transformation." % AGENT_NAME, res['Message']) return res transformations = [res['Value']] return S_OK(transformations) | 6ebf5272629cc51038fc8c36b6107d4be259d871 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/6ebf5272629cc51038fc8c36b6107d4be259d871/TransformationAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
4059,
1012,
12,
2890,
4672,
468,
24850,
326,
19245,
358,
506,
7120,
906,
461,
273,
314,
809,
18,
24805,
12,
2890,
18,
3464,
6797,
19,
15292,
17023,
1595,
6134,
309,
906,
461,
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,
336,
4059,
1012,
12,
2890,
4672,
468,
24850,
326,
19245,
358,
506,
7120,
906,
461,
273,
314,
809,
18,
24805,
12,
2890,
18,
3464,
6797,
19,
15292,
17023,
1595,
6134,
309,
906,
461,
422,
... |
if not len (self.current): | if not len (self.current) or self.current.lower() == "disabled": | def SetButtonLabel (self): label = self.current if not len (self.current): label = _("Disabled") self.Button.set_label (label) | ae3a20e0a55da939f7f2eeb74762fa3fa898a83c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1272/ae3a20e0a55da939f7f2eeb74762fa3fa898a83c/Settings.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
3616,
2224,
261,
2890,
4672,
1433,
273,
365,
18,
2972,
309,
486,
562,
261,
2890,
18,
2972,
13,
578,
365,
18,
2972,
18,
8167,
1435,
422,
315,
9278,
6877,
1433,
273,
389,
2932,
885... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1000,
3616,
2224,
261,
2890,
4672,
1433,
273,
365,
18,
2972,
309,
486,
562,
261,
2890,
18,
2972,
13,
578,
365,
18,
2972,
18,
8167,
1435,
422,
315,
9278,
6877,
1433,
273,
389,
2932,
885... |
"""'Magic' value setter This function tries to guess at what kind of value you want to store. If you pass in a valid UTF-8 or Unicode string, it treats it as a text value. If you pass in a list, it treats it as a list of string/Unicode values. If you pass in a string that is not valid UTF-8, it assumes it is a binary value. | """'Magic' value setter. This function tries to guess at what kind of value you want to store. If you pass in a valid UTF-8 or Unicode string, it treats it as a text value. If you pass in a list, it treats it as a list of string/Unicode values. If you pass in a string that is not valid UTF-8, it assumes it is a binary value. | def __setitem__(self, k, v): """'Magic' value setter | 29f7ea749b8f01e4dd6e920a96f10da34cb36e5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/29f7ea749b8f01e4dd6e920a96f10da34cb36e5d/apev2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1726,
972,
12,
2890,
16,
417,
16,
331,
4672,
3536,
11,
19289,
11,
460,
7794,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1726,
972,
12,
2890,
16,
417,
16,
331,
4672,
3536,
11,
19289,
11,
460,
7794,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
dnick = inick[1:] | dnick = inick[len(cfg.dc_to_irc_prefix):] if not dnick: raise NickError("Nothing after prefix") | def dc_from_irc(inick): # Decode an IRC-encoded DC nick, for use in Dtella. # Verify prefix if len(inick) <= 1 or inick[0] != cfg.dc_to_irc_prefix: raise NickError("Bad prefix") dnick = inick[1:] n_escapes = 0 for c in dnick: if c == '`': n_escapes += 1 if n_escapes: head, tail = dnick.rsplit('-', 1) escapes = base_convert(tail, base36_chars, escape_chars, n_escapes) if len(escapes) != n_escapes: raise NickError("Unknown escape sequence") dnick = '' n_escapes = 0 for c in head: if c == '`': dnick += escapes[n_escapes] n_escapes += 1 else: dnick += c return dnick | 965b53ff789f71f50745fdf284fcd0d0521c8f22 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12372/965b53ff789f71f50745fdf284fcd0d0521c8f22/dtella_bridgeserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6744,
67,
2080,
67,
481,
71,
12,
267,
1200,
4672,
468,
6209,
392,
467,
11529,
17,
10787,
21533,
10909,
16,
364,
999,
316,
463,
88,
1165,
69,
18,
225,
468,
8553,
1633,
309,
562,
12,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6744,
67,
2080,
67,
481,
71,
12,
267,
1200,
4672,
468,
6209,
392,
467,
11529,
17,
10787,
21533,
10909,
16,
364,
999,
316,
463,
88,
1165,
69,
18,
225,
468,
8553,
1633,
309,
562,
12,
2... |
self.primality = [false] | self.primality = [False] | def find_factor(self, n, factor_digits=None, B1=2000, **kwds): """ Splits off a single factor of n. See ECM.factor() """ if not 'c' in kwds: kwds['c'] = 1000000000 if not 'I' in kwds: kwds['I'] = 1 if not factor_digits is None: B1 = self.recommended_B1(factor_digits) kwds['one'] = '' kwds['cofdec'] = '' self.__cmd = self._ECM__startup_cmd(B1, None, kwds) child = pexpect.spawn(self.__cmd) | 9cf1352a7b2dc9fe95a48d08d6615cdd0c0a9de6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/9cf1352a7b2dc9fe95a48d08d6615cdd0c0a9de6/ecm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
6812,
12,
2890,
16,
290,
16,
5578,
67,
16649,
33,
7036,
16,
605,
21,
33,
17172,
16,
2826,
25577,
4672,
3536,
5385,
87,
3397,
279,
2202,
5578,
434,
290,
18,
2164,
7773,
49,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
6812,
12,
2890,
16,
290,
16,
5578,
67,
16649,
33,
7036,
16,
605,
21,
33,
17172,
16,
2826,
25577,
4672,
3536,
5385,
87,
3397,
279,
2202,
5578,
434,
290,
18,
2164,
7773,
49,
... |
mod = _sys_modules_get(fqname, UNTRIED) if mod is UNTRIED: try: | try: mod = _sys_modules_get(fqname, UNTRIED) if mod is UNTRIED: | def importHook(self, name, globals=None, locals=None, fromlist=None, level=-1): # first see if we could be importing a relative name #print "importHook(%s, %s, locals, %s)" % (name, getattr(globals, '__name__', None), fromlist) _sys_modules_get = sys.modules.get contexts = [None] if globals and level == -1: # The level indicates we should attempt relative imports, add the # package to searched contexts importernm = globals.get('__name__', '') if importernm: if hasattr(_sys_modules_get(importernm), '__path__'): # If you use the "from __init__ import" syntax, the package # name will have a __init__ in it. We want to strip it. if importernm[-len(".__init__"):] == ".__init__": importernm = importernm[:-len(".__init__")] contexts.insert(0,importernm) else: pkgnm = packagename(importernm) if pkgnm: contexts.insert(0,pkgnm) # so contexts is [pkgnm, None] or just [None] # now break the name being imported up so we get: # a.b.c -> [a, b, c] nmparts = namesplit(name) _self_doimport = self.doimport threaded = self.threaded for context in contexts: ctx = context for i in range(len(nmparts)): nm = nmparts[i] #print " importHook trying %s in %s" % (nm, ctx) if ctx: fqname = ctx + '.' + nm else: fqname = nm if threaded: self._acquire() mod = _sys_modules_get(fqname, UNTRIED) if mod is UNTRIED: try: mod = _self_doimport(nm, ctx, fqname) except Exception, e: print "FIXME: _self_doimport %r" % e, print " nm='%s' ctx='%s' fqname='%s'" % (nm, ctx, fqname) if threaded: self._release() raise if threaded: self._release() if mod: ctx = fqname else: break else: # no break, point i beyond end i = i + 1 if i: break | 1dadccaf55278fc044b3615f51d1e01d714f94bd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11925/1dadccaf55278fc044b3615f51d1e01d714f94bd/iu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
5394,
12,
2890,
16,
508,
16,
10941,
33,
7036,
16,
8985,
33,
7036,
16,
628,
1098,
33,
7036,
16,
1801,
29711,
21,
4672,
468,
1122,
2621,
309,
732,
3377,
506,
25077,
279,
3632,
508,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
5394,
12,
2890,
16,
508,
16,
10941,
33,
7036,
16,
8985,
33,
7036,
16,
628,
1098,
33,
7036,
16,
1801,
29711,
21,
4672,
468,
1122,
2621,
309,
732,
3377,
506,
25077,
279,
3632,
508,... |
andi t3, t3, 2 or reg, reg, t3 | andi t4, t3, 2, flags=(EZF,) or reg, reg, t4 mov t1, t1, t3, flags=(nCEZF,) | def macroop BSF_R_R { # Determine if the input was zero, and also move it to a temp reg. mov t1, t1, t0, dataSize=8 and t1, regm, regm, flags=(ZF,) bri t0, label("end"), flags=(CZF,) # Zero out the result register movi reg, reg, 0 subi t2, t1, 1 xor t1, t2, t1 # Bit 6 srli t3, t1, 32, dataSize=8 andi t3, t3, 32 or reg, reg, t3 # Bit 5 srli t3, t1, 16, dataSize=8 andi t3, t3, 16 or reg, reg, t3 # Bit 4 srli t3, t1, 8, dataSize=8 andi t3, t3, 8 or reg, reg, t3 # Bit 3 srli t3, t1, 4, dataSize=8 andi t3, t3, 4 or reg, reg, t3 # Bit 2 srli t3, t1, 2, dataSize=8 andi t3, t3, 2 or reg, reg, t3 # Bit 1 srli t3, t1, 1, dataSize=8 andi t3, t3, 1 or reg, reg, t3 | 3e7c07fe3694f0322ad14a3f78d57cc10c7ca6f6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7385/3e7c07fe3694f0322ad14a3f78d57cc10c7ca6f6/bit_scan.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
556,
605,
22395,
67,
54,
67,
54,
288,
468,
10229,
309,
326,
810,
1703,
3634,
16,
471,
2546,
3635,
518,
358,
279,
1906,
960,
18,
5730,
268,
21,
16,
268,
21,
16,
268,
20,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
556,
605,
22395,
67,
54,
67,
54,
288,
468,
10229,
309,
326,
810,
1703,
3634,
16,
471,
2546,
3635,
518,
358,
279,
1906,
960,
18,
5730,
268,
21,
16,
268,
21,
16,
268,
20,
16,
... |
handle, outname = tempfile.mkstemp() | if self.keep_temps: outname = 'strace%03d.txt' % self.temp_count self.temp_count += 1 handle = os.open(outname, os.O_CREAT) else: handle, outname = tempfile.mkstemp() | def __call__(self, *args): """ Run command and return its dependencies and outputs, using strace to determine dependencies (by looking at what files are opened or modified). """ handle, outname = tempfile.mkstemp() try: try: outfile = os.fdopen(handle, 'r') except: os.close(handle) raise try: status, deps, outputs = self._do_strace(args, outfile, outname) if status is None: raise ExecutionError( '%r was killed unexpectedly' % args[0], '', -1) finally: outfile.close() finally: os.remove(outname) | 62c48ce0b420b1fe48378d0f1ec717ee941781df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7381/62c48ce0b420b1fe48378d0f1ec717ee941781df/fabricate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
380,
1968,
4672,
3536,
1939,
1296,
471,
327,
2097,
5030,
471,
6729,
16,
1450,
609,
623,
358,
4199,
5030,
261,
1637,
7849,
622,
4121,
1390,
854,
10191,
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,
1001,
1991,
972,
12,
2890,
16,
380,
1968,
4672,
3536,
1939,
1296,
471,
327,
2097,
5030,
471,
6729,
16,
1450,
609,
623,
358,
4199,
5030,
261,
1637,
7849,
622,
4121,
1390,
854,
10191,
578,... |
("kahan",), | ("Kahan",), | def Precache(): pass#fixme | d63fd07c1902819d53e2b6e33c3c67ba3b9ddd7d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2883/d63fd07c1902819d53e2b6e33c3c67ba3b9ddd7d/faction_ships.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2962,
2493,
13332,
1342,
7,
904,
3501,
282,
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,
2962,
2493,
13332,
1342,
7,
904,
3501,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
try: return [self.latestInfo['user'], self.latestInfo['timestamp']] except KeyError: raise NoPage(u'API Error, nothing found in the APIs') | if self._infoLoaded: return [self._latestInfo['user'], self._latestInfo['timestamp']] inf = self.getFileVersionHistory()[0] return [inf[1], inf[0]] | def getLatestUploader(self): """ Function that uses the APIs to detect the latest uploader of the image """ if not self._infoLoaded: self._loadInfo() try: # We don't know the page's id, if any other better idea please change it return [self.latestInfo['user'], self.latestInfo['timestamp']] except KeyError: raise NoPage(u'API Error, nothing found in the APIs') | bac3828695dade5ead778d1c52a348dbd0e0e42a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/bac3828695dade5ead778d1c52a348dbd0e0e42a/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
18650,
28161,
12,
2890,
4672,
3536,
4284,
716,
4692,
326,
19947,
358,
5966,
326,
4891,
25062,
434,
326,
1316,
3536,
309,
486,
365,
6315,
1376,
8835,
30,
365,
6315,
945,
966,
1435,
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,
336,
18650,
28161,
12,
2890,
4672,
3536,
4284,
716,
4692,
326,
19947,
358,
5966,
326,
4891,
25062,
434,
326,
1316,
3536,
309,
486,
365,
6315,
1376,
8835,
30,
365,
6315,
945,
966,
1435,
7... |
if obj is None: | if o is None: | def wref(o): r''' Return a weak reference to object. This is almost the same as `weakref.ref()`, but accepts `None` too. >>> class O(object): ... pass >>> x = O() >>> xref = wref(x) >>> xref() is x True >>> del x >>> xref() is None True >>> xref = wref(None) >>> xref() is None True ''' if obj is None: ref = weakref.ref(set()) assert ref() is None else: ref = weakref.ref(obj) return ref | d941cae23a5b9251d54e8af4e3e9283e817e4f1d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3683/d941cae23a5b9251d54e8af4e3e9283e817e4f1d/varietes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
1734,
12,
83,
4672,
436,
26418,
2000,
279,
16046,
2114,
358,
733,
18,
1220,
353,
23889,
326,
1967,
487,
1375,
26008,
1734,
18,
1734,
1435,
9191,
1496,
8104,
1375,
7036,
68,
4885,
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,
341,
1734,
12,
83,
4672,
436,
26418,
2000,
279,
16046,
2114,
358,
733,
18,
1220,
353,
23889,
326,
1967,
487,
1375,
26008,
1734,
18,
1734,
1435,
9191,
1496,
8104,
1375,
7036,
68,
4885,
18... |
import epdb;epdb.st('f') | def cookObject(repos, cfg, recipeClass, sourceVersion, changeSetFile = None, prep=True, macros={}, targetLabel = None, resume = None, alwaysBumpCount = False, allowUnknownFlags = False, allowMissingSource = False, ignoreDeps = False, logBuild = False, crossCompile = None, callback = None, requireCleanSources = False, downloadOnly = False, groupOptions = None): """ Turns a recipe object into a change set, and sometimes commits the result. @param repos: Repository to both look for source files and file id's in. @type repos: repository.Repository @param cfg: conary configuration @type cfg: conarycfg.ConaryConfiguration @param recipeClass: class which will be instantiated into a recipe @type recipeClass: class descended from recipe.Recipe @type sourceVersion: the full conary verison of the recipeClass we are cooking. This source trove version should exist. If you know what you are doing, you can create troves with non-existant source versions by setting allowMissingSource @param changeSetFile: if set, the changeset is stored in this file instead of committed to a repository @type changeSetFile: str @param prep: If true, the build stops after the package is unpacked and None is returned instead of a changeset. @type prep: boolean @param downloadOnly: If true, the lookaside is populated, and the None is returned instead of a changeset. @type downloadOnly: boolean @param macros: set of macros for the build @type macros: dict @param targetLabel: label to use for the cooked troves; it is used as a new shadow from whatever version was previously built default), the sourceVersion label is used @type targetLabel: versions.Label @param resume: indicates whether to resume the previous build. If True, resume at the line of last breakage. If an integer, resume at that line. If 'policy', rerun the policy only. Note that resume is only valid when cooking a recipe from a file, not from the repository. @type resume: bool or str @param alwaysBumpCount: if True, the cooked troves will not share a full version with any other existing troves with the same name, even if their flavors would differentiate them. @type alwaysBumpCount: bool @param allowMissingSource: if True, do not complain if the sourceVersion specified does not point to an existing source trove. Warning -- this can lead to strange trove setups in the repository @type logBuild: bool @param logBuild: if True, log the build to a file that will be included in the changeset @param allowMissingSource: allow build of this trove when the source version specified does not point to an existing source trove. Warning -- this can lead to strange trove setups @type allowMissingSource: bool @param requireCleanSources: require that this build be clean - that its sources all be from the repository. @rtype: list of strings """ if not groupOptions: groupCookOptions = GroupCookOptions(alwaysBumpCount=alwaysBumpCount) if not isinstance(recipeClass, (list, tuple)): recipeClasses = [recipeClass] else: recipeClasses = recipeClass recipeClass = recipeClass[0] # every recipe passed into build at once must have the same # name and version. assert(len(set((x.name, x.version) for x in recipeClasses)) == 1) if not callback: callback = callbacks.CookCallback() if not (hasattr(recipeClass, 'name') and hasattr(recipeClass, 'version')): raise CookError('recipe class must have name and version defined') if '-' in recipeClass.version: raise builderrors.RecipeFileError( "Version string %s has illegal '-' character" %recipeClass.version) if not use.Arch.keys(): log.error('No architectures have been defined in %s -- ' 'cooking is not possible' % ' '.join(cfg.archDirs)) sys.exit(1) # check to make sure that policy exists policyFound = False for policyDir in cfg.policyDirs: if os.path.isdir(policyDir): policyFound = True break if not policyFound: log.error('No conary policy directories were found. ' 'You probably need to install\n' 'conary-policy. Try "conary update conary-policy".') sys.exit(1) use.allowUnknownFlags(allowUnknownFlags) fullName = recipeClass.name srcName = fullName + ':source' if repos: try: import epdb;epdb.st('f') trove = repos.getTrove(srcName, sourceVersion, deps.Flavor(), withFiles = False) sourceVersion = trove.getVersion() except errors.TroveMissing: if not allowMissingSource and targetLabel != versions.CookLabel(): raise RuntimeError, ('Cooking with non-existant source' ' version %s' % sourceVersion.asString()) except errors.OpenError: if targetLabel != versions.CookLabel(): raise if not sourceVersion.isOnLocalHost(): log.warning('Could not open repository -- not attempting to' ' share pathId information with the' ' repository. This cook will create new versions' ' for all files on update.') time.sleep(3) repos = None buildBranch = sourceVersion.branch() assert(not buildBranch.timeStamps() or max(buildBranch.timeStamps()) != 0) macros['buildbranch'] = buildBranch.asString() macros['buildlabel'] = buildBranch.label().asString() if targetLabel: signatureLabel = targetLabel signatureKey = selectSignatureKey(cfg, targetLabel) else: signatureKey = selectSignatureKey(cfg, sourceVersion.trailingLabel()) db = database.Database(cfg.root, cfg.dbPath) type = recipeClass.getType() if recipeClass.getType() == recipe.RECIPE_TYPE_GROUP: ret = cookGroupObjects(repos, db, cfg, recipeClasses, sourceVersion, macros = macros, targetLabel = targetLabel, alwaysBumpCount = alwaysBumpCount, requireCleanSources = requireCleanSources, callback = callback, groupOptions=groupOptions) needsSigning = True else: assert(len(recipeClasses) == 1) buildFlavor = getattr(recipeClass, '_buildFlavor', cfg.buildFlavor) try: use.setBuildFlagsFromFlavor(recipeClass.name, buildFlavor, error=False, warn=True) except AttributeError, msg: log.error('Error setting build flags from flavor %s: %s' % ( buildFlavor, msg)) sys.exit(1) if type in (recipe.RECIPE_TYPE_INFO, recipe.RECIPE_TYPE_PACKAGE): ret = cookPackageObject(repos, db, cfg, recipeClass, sourceVersion, prep = prep, macros = macros, targetLabel = targetLabel, resume = resume, alwaysBumpCount = alwaysBumpCount, ignoreDeps = ignoreDeps, logBuild = logBuild, crossCompile = crossCompile, requireCleanSources = requireCleanSources, downloadOnly = downloadOnly, signatureKey = signatureKey) needsSigning = False elif type == recipe.RECIPE_TYPE_REDIRECT: ret = cookRedirectObject(repos, db, cfg, recipeClass, sourceVersion, macros = macros, targetLabel = targetLabel, alwaysBumpCount = alwaysBumpCount) needsSigning = True elif type == recipe.RECIPE_TYPE_FILESET: ret = cookFilesetObject(repos, db, cfg, recipeClass, sourceVersion, buildFlavor, macros = macros, targetLabel = targetLabel, alwaysBumpCount = alwaysBumpCount) needsSigning = True else: raise AssertionError # cook*Object returns None if using prep or downloadOnly if ret is None: return [] (cs, built, cleanup) = ret if needsSigning: # sign the changeset signAbsoluteChangeset(cs, signatureKey) if changeSetFile: cs.writeToFile(changeSetFile) else: repos.commitChangeSet(cs, callback = callback) if cleanup: (fn, args) = cleanup fn(*args) return built | b0ea837ca7719f1ddf7691b3f74672518110f1d8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8747/b0ea837ca7719f1ddf7691b3f74672518110f1d8/cook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15860,
921,
12,
15564,
16,
2776,
16,
16100,
797,
16,
1084,
1444,
16,
26104,
812,
273,
599,
16,
13237,
33,
5510,
16,
24302,
28793,
1018,
2224,
273,
599,
16,
10774,
273,
599,
16,
3712,
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,
15860,
921,
12,
15564,
16,
2776,
16,
16100,
797,
16,
1084,
1444,
16,
26104,
812,
273,
599,
16,
13237,
33,
5510,
16,
24302,
28793,
1018,
2224,
273,
599,
16,
10774,
273,
599,
16,
3712,
3... | |
assert not isinstance(getattr(self, component), StringType), \ ('passed string as "%s" parameter; use "%s_name" instead' % (getattr(self, component), component, component)) | assert not isinstance(getattr(self, component), StringType), ( 'passed string "%s" as "%s" parameter; pass an instance, ' 'or use the "%s_name" parameter instead (in ' 'docutils.core.publish_* convenience functions).' % (getattr(self, component), component, component)) | def __init__(self, reader=None, parser=None, writer=None, source=None, source_class=io.FileInput, destination=None, destination_class=io.FileOutput, settings=None): """ Initial setup. If any of `reader`, `parser`, or `writer` are not specified, the corresponding ``set_...`` method should be called with a component name (`set_reader` sets the parser as well). """ | 5cd85b93baf1005f73b1f9bb7cf8b33ff9045a39 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8194/5cd85b93baf1005f73b1f9bb7cf8b33ff9045a39/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2949,
33,
7036,
16,
2082,
33,
7036,
16,
2633,
33,
7036,
16,
1084,
33,
7036,
16,
1084,
67,
1106,
33,
1594,
18,
812,
1210,
16,
2929,
33,
7036,
16,
2929,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2949,
33,
7036,
16,
2082,
33,
7036,
16,
2633,
33,
7036,
16,
1084,
33,
7036,
16,
1084,
67,
1106,
33,
1594,
18,
812,
1210,
16,
2929,
33,
7036,
16,
2929,
... |
y1 = gc.height() - y1 y2 = gc.height() - y2 | def set_on_gc(self, gc, bbox=None): # Apply transforms if self.transforms is not None: for func, f_args in self.transforms: if isinstance(f_args, tuple): func(gc, *f_args) else: func(gc, f_args) x1 = self.x1 x2 = self.x2 y1 = self.y1 y2 = self.y2 | f0e3b2b220fce5b431cdba0dd9ae38944e9aa225 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13166/f0e3b2b220fce5b431cdba0dd9ae38944e9aa225/renderer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
265,
67,
13241,
12,
2890,
16,
8859,
16,
8472,
33,
7036,
4672,
225,
468,
5534,
13680,
309,
365,
18,
25657,
353,
486,
599,
30,
364,
1326,
16,
284,
67,
1968,
316,
365,
18,
2565... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
265,
67,
13241,
12,
2890,
16,
8859,
16,
8472,
33,
7036,
4672,
225,
468,
5534,
13680,
309,
365,
18,
25657,
353,
486,
599,
30,
364,
1326,
16,
284,
67,
1968,
316,
365,
18,
2565... | |
' t ' : ' title:', ' ti ' : ' title:', ' title ' : ' title:', ' with-language ' : ' title:', | 't' : 'title:', 'ti' : 'title:', 'title' : 'title:', 'with-language' : 'title:', | def __init__(self, message): """Initialization.""" self.message = message | 855acf1f403f93dbc03543809cdbbd3d0c4c46af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/855acf1f403f93dbc03543809cdbbd3d0c4c46af/search_engine_query_parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
883,
4672,
3536,
17701,
12123,
365,
18,
2150,
273,
883,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
883,
4672,
3536,
17701,
12123,
365,
18,
2150,
273,
883,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
jsontext = site.getUrl( path, retry=True, data=data ) | if params['action'] in postAC: res, jsontext = site.postData(path, urllib.urlencode(params.items())) else: jsontext = site.getUrl( path, retry=True, data=data ) | def GetData(params, site = None, verbose = False, useAPI = False, retryCount = 5, encodeTitle = True): """Get data from the query api, and convert it into a data object """ if site is None: site = wikipedia.getSite() for k,v in params.iteritems(): if not IsString(v): params[k] = unicode(v) params['format'] = 'json' if not useAPI: params['noprofile'] = '' for k,v in params.iteritems(): if type(v) == type(u''): params[k] = ToUtf8(v) # Titles param might be long, case convert it to post request data = None titlecount = 0 if 'titles' in params: titlecount = params['titles'].count('|') if encodeTitle: data = {'titles' : params['titles']} del params['titles'] if useAPI: path = site.api_address() + urllib.urlencode(params.items()) else: path = site.query_address() + urllib.urlencode(params.items()) if verbose: if titlecount > 0: wikipedia.output(u"Requesting %d titles from %s:%s" % (titlecount, site.lang, path)) else: wikipedia.output(u"Request %s:%s" % (site.lang, path)) lastError = None retry_idle_time = 5 while retryCount >= 0: try: jsontext = "Nothing received" jsontext = site.getUrl( path, retry=True, data=data ) # This will also work, but all unicode strings will need to be converted from \u notation # decodedObj = eval( jsontext ) return simplejson.loads( jsontext ) except ValueError, error: retryCount -= 1 wikipedia.output(u"Error downloading data: %s" % error) wikipedia.output(u"Request %s:%s" % (site.lang, path)) wikipedia.debugDump('ApiGetDataParse', site, str(error) + '\n%s' % path, jsontext) lastError = error if retryCount >= 0: wikipedia.output(u"Retrying in %i seconds..." % retry_idle_time) time.sleep(retry_idle_time) # Next time wait longer, but not longer than half an hour retry_idle_time *= 2 if retry_idle_time > 300: retry_idle_time = 300 raise lastError | 91b30cbeb5b302fc67c224b24c4867af5e48c85b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/91b30cbeb5b302fc67c224b24c4867af5e48c85b/query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30837,
12,
2010,
16,
2834,
273,
599,
16,
3988,
273,
1083,
16,
999,
2557,
273,
1083,
16,
30084,
273,
1381,
16,
2017,
4247,
273,
1053,
4672,
3536,
967,
501,
628,
326,
843,
1536,
16,
471,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30837,
12,
2010,
16,
2834,
273,
599,
16,
3988,
273,
1083,
16,
999,
2557,
273,
1083,
16,
30084,
273,
1381,
16,
2017,
4247,
273,
1053,
4672,
3536,
967,
501,
628,
326,
843,
1536,
16,
471,... |
if value.startswith("["): if value.endswith("]"): value2 = value[1:-1].strip().split(",") if len(value2) == 1 and value2[0] == "": config[key] = [] else: config[key] = [s_or_i(s.strip()) for s in value2] | if (((value.startswith("[") and not value.endswith("]")) or (not value.startswith("[") and value.endswith("]")))): raise ConfigSyntaxErrorException( "config syntax error: list '%s' missing [ or ]" % value) elif value.startswith("[") and value.endswith("]"): value2 = value[1:-1].strip().split(",") if len(value2) == 1 and value2[0] == "": config[key] = [] | def s_or_i(text): """Takes a string and if it begins with " or ' and ends with " or ', then it returns the string. If it's an int, returns the int. Otherwise it returns the text. """ if text.startswith('"'): if text.endswith('"'): return text[1:-1] raise ConfigSyntaxErrorException("config syntax error: " "string '%s' missing end \"" % text) elif text.startswith("'"): if text.endswith("'"): return text[1:-1] raise ConfigSyntaxErrorException("config syntax error: " "string '%s' missing end '" % text) elif text.isdigit(): return int(text) return text | 3870208a3d1349b628fcddc90646e2248226ff6b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11836/3870208a3d1349b628fcddc90646e2248226ff6b/tools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
67,
280,
67,
77,
12,
955,
4672,
3536,
11524,
279,
533,
471,
309,
518,
17874,
598,
315,
578,
296,
471,
3930,
598,
315,
578,
2265,
1508,
518,
1135,
326,
533,
18,
225,
971,
518,
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,
272,
67,
280,
67,
77,
12,
955,
4672,
3536,
11524,
279,
533,
471,
309,
518,
17874,
598,
315,
578,
296,
471,
3930,
598,
315,
578,
2265,
1508,
518,
1135,
326,
533,
18,
225,
971,
518,
18... |
print "clicked on link to: %s" % q | def click_callback(widget,event): x,y = (event.x,event.y) path,column,cellx,celly = widget.get_path_at_pos(int(x),int(y)) q=column.get_data('link') print "clicked on link to: %s" % q if q: model=widget.get_model() iter=model.get_iter(path) new_query = q.clone() target=new_query['__target__'] del new_query['__target__'] new_query[target] = model.get_value(iter,column.get_data('column_number')) self.link_callback(new_query) | 09ab1193878c5cdc1513d6d272db661279faf388 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5568/09ab1193878c5cdc1513d6d272db661279faf388/GTKUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4682,
67,
3394,
12,
6587,
16,
2575,
4672,
619,
16,
93,
273,
261,
2575,
18,
92,
16,
2575,
18,
93,
13,
589,
16,
2827,
16,
3855,
92,
16,
2183,
715,
273,
3604,
18,
588,
67,
803,
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,
4682,
67,
3394,
12,
6587,
16,
2575,
4672,
619,
16,
93,
273,
261,
2575,
18,
92,
16,
2575,
18,
93,
13,
589,
16,
2827,
16,
3855,
92,
16,
2183,
715,
273,
3604,
18,
588,
67,
803,
67,
... | |
"Topic :: System :: Security", "Topic :: System :: Systems Administration :: Authentication/Directory", | "Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP", | def _package_doc(name): f = open(os.path.join(package, name)) return f.read() | c9aa3f1d2082ec5fac04f1e01c9383c38d4d3e56 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1858/c9aa3f1d2082ec5fac04f1e01c9383c38d4d3e56/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5610,
67,
2434,
12,
529,
4672,
284,
273,
1696,
12,
538,
18,
803,
18,
5701,
12,
5610,
16,
508,
3719,
327,
284,
18,
896,
1435,
225,
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,
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,
389,
5610,
67,
2434,
12,
529,
4672,
284,
273,
1696,
12,
538,
18,
803,
18,
5701,
12,
5610,
16,
508,
3719,
327,
284,
18,
896,
1435,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
An even more complicated plot:: sage: region_plot(sin(x)*sin(y) >= 1/4, (x,-10,10), (y,-10,10), incol='yellow', bordercol='black', plot_points=250) | An even more complicated plot, with dashed borders:: sage: region_plot(sin(x)*sin(y) >= 1/4, (x,-10,10), (y,-10,10), incol='yellow', bordercol='black', borderstyle='dashed', plot_points=250) | def region_plot(f, xrange, yrange, plot_points, incol, outcol, bordercol): r""" ``region_plot`` takes a boolean function of two variables, `f(x,y)` and plots the region where f is True over the specified ``xrange`` and ``yrange`` as demonstrated below. ``region_plot(f, (xmin, xmax), (ymin, ymax), ...)`` INPUT: - ``f`` -- a boolean function of two variables - ``(xmin, xmax)`` -- 2-tuple, the range of ``x`` values OR 3-tuple ``(x,xmin,xmax)`` - ``(ymin, ymax)`` -- 2-tuple, the range of ``y`` values OR 3-tuple ``(y,ymin,ymax)`` - ``plot_points`` -- integer (default: 100); number of points to plot in each direction of the grid - ``incol`` -- a color (default: ``'blue'``), the color inside the region - ``outcol`` -- a color (default: ``'white'``), the color of the outside of the region - ``bordercol`` -- a color (default: ``None``), the color of the border (``incol`` if not specified) EXAMPLES: Here we plot a simple function of two variables:: sage: x,y = var('x,y') sage: region_plot(cos(x^2+y^2) <= 0, (x, -3, 3), (y, -3, 3)) Here we play with the colors:: sage: region_plot(x^2+y^3 < 2, (x, -2, 2), (y, -2, 2), incol='lightblue', bordercol='gray') An even more complicated plot:: sage: region_plot(sin(x)*sin(y) >= 1/4, (x,-10,10), (y,-10,10), incol='yellow', bordercol='black', plot_points=250) A disk centered at the origin:: sage: region_plot(x^2+y^2<1, (x,-1,1), (y,-1,1)).show(aspect_ratio=1) A plot with more than one condition:: sage: region_plot([x^2+y^2<1, x<y], (x,-2,2), (y,-2,2)) Since it doesn't look very good, let's increase plot_points:: sage: region_plot([x^2+y^2<1, x<y], (x,-2,2), (y,-2,2), plot_points=400).show(aspect_ratio=1) #long time The first quadrant of the unit circle:: sage: region_plot([y>0, x>0, x^2+y^2<1], (-1.1, 1.1), (-1.1, 1.1), plot_points = 400).show(aspect_ratio=1) Here is another plot:: sage: region_plot(x*(x-1)*(x+1)+y^2<0, (x, -3, 2), (y, -3, 3), incol='lightblue', bordercol='gray', plot_points=50) If we want to keep only the region where x is positive:: sage: region_plot([x*(x-1)*(x+1)+y^2<0, x>-1], (x, -3, 2), (y, -3, 3), incol='lightblue', bordercol='gray', plot_points=50) Here we have a cut circle:: sage: region_plot([x^2+y^2<4, x>-1], (x, -2, 2), (y, -2, 2), incol='lightblue', bordercol='gray', plot_points=200).show(aspect_ratio=1) #long time """ from sage.plot.plot import Graphics from sage.plot.misc import setup_for_eval_on_grid if not isinstance(f, (list, tuple)): f = [f] variables = reduce(lambda g1, g2: g1.union(g2), [set(g.variables()) for g in f], set([])) f = [equify(g, variables) for g in f] g, ranges = setup_for_eval_on_grid(f, [xrange, yrange], plot_points) xrange,yrange=[r[:2] for r in ranges] xy_data_arrays = map(lambda g: [[g(x, y) for x in xsrange(*ranges[0], include_endpoint=True)] for y in xsrange(*ranges[1], include_endpoint=True)], g) xy_data_array = map(lambda *rows: map(lambda *vals: mangle_neg(vals), *rows), *xy_data_arrays) from matplotlib.colors import ListedColormap incol = rgbcolor(incol) outcol = rgbcolor(outcol) cmap = ListedColormap([incol, outcol]) cmap.set_over(outcol) cmap.set_under(incol) g = Graphics() g.add_primitive(ContourPlot(xy_data_array, xrange,yrange, dict(plot_points=plot_points, contours=[-1e307, 0, 1e307], cmap=cmap, fill=True))) if bordercol is not None: bordercol = rgbcolor(bordercol) g.add_primitive(ContourPlot(xy_data_array, xrange, yrange, dict(plot_points=plot_points, contours=[0], cmap=[bordercol], fill=False))) return g | c8fbc541f4470707607df5346671b7bd37a4fa08 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/c8fbc541f4470707607df5346671b7bd37a4fa08/contour_plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3020,
67,
4032,
12,
74,
16,
12314,
16,
677,
3676,
16,
3207,
67,
4139,
16,
316,
1293,
16,
596,
1293,
16,
5795,
1293,
4672,
436,
8395,
12176,
6858,
67,
4032,
10335,
5530,
279,
1250,
445,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3020,
67,
4032,
12,
74,
16,
12314,
16,
677,
3676,
16,
3207,
67,
4139,
16,
316,
1293,
16,
596,
1293,
16,
5795,
1293,
4672,
436,
8395,
12176,
6858,
67,
4032,
10335,
5530,
279,
1250,
445,... |
groupupdate | grouplist | groupinfo | groupremove | generate-rss > | groupupdate | grouplist | groupinfo | groupremove | generate-rss | makecache > | def usage(self): print _(""" | 18d518d1521511781d65bc686769f98de3ae36e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/18d518d1521511781d65bc686769f98de3ae36e1/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
12,
2890,
4672,
1172,
389,
2932,
3660,
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,
4084,
12,
2890,
4672,
1172,
389,
2932,
3660,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
rv = (filename, f.f_lineno, co.co_name) | rv = (co.co_filename, f.f_lineno, co.co_name) | def findCaller(self): """ Find the stack frame of the caller so that we can note the source file name, line number and function name. """ f = currentframe() #On some versions of IronPython, currentframe() returns None if #IronPython isn't run with -X:Frames. if f is not None: f = f.f_back rv = "(unknown file)", 0, "(unknown function)" while hasattr(f, "f_code"): co = f.f_code filename = os.path.normcase(co.co_filename) if filename == _srcfile: f = f.f_back continue rv = (filename, f.f_lineno, co.co_name) break return rv | b5bb58cf124da6ea0f51e3b3bb2dded5aa06ec65 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/b5bb58cf124da6ea0f51e3b3bb2dded5aa06ec65/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
11095,
12,
2890,
4672,
3536,
4163,
326,
2110,
2623,
434,
326,
4894,
1427,
716,
732,
848,
4721,
326,
1084,
585,
508,
16,
980,
1300,
471,
445,
508,
18,
3536,
284,
273,
783,
3789,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
11095,
12,
2890,
4672,
3536,
4163,
326,
2110,
2623,
434,
326,
4894,
1427,
716,
732,
848,
4721,
326,
1084,
585,
508,
16,
980,
1300,
471,
445,
508,
18,
3536,
284,
273,
783,
3789,
1... |
dm = 1 - (nm / de) dm[xrange(0,m),xrange(0,m)] = 0 | dm = 1.0 - (nm / de) dm[xrange(0,m),xrange(0,m)] = 0.0 | def pdist(X, metric='euclidean', p=2, V=None, VI=None): """ Y = pdist(X, method='euclidean', p=2) Computes the distance between m original observations in n-dimensional space. Returns a condensed distance matrix Y. For each i and j (i<j), the metric dist(u=X[i], v=X[j]) is computed and stored in the ij'th entry. See squareform to learn how to retrieve this entry. 1. Y = pdist(X) Computes the distance between m points using Euclidean distance (2-norm) as the distance metric between the points. The points are arranged as m n-dimensional row vectors in the matrix X. 2. Y = pdist(X, 'minkowski', p) Computes the distances using the Minkowski distance ||u-v||_p (p-norm) where p>=1. 3. Y = pdist(X, 'cityblock') Computes the city block or Manhattan distance between the points. 4. Y = pdist(X, 'seuclidean', V=None) Computes the standardized Euclidean distance. The standardized Euclidean distance between two n-vectors u and v is sqrt(\sum {(u_i-v_i)^2 / V[x_i]}). V is the variance vector; V[i] is the variance computed over all the i'th components of the points. If not passed, it is automatically computed. 5. Y = pdist(X, 'sqeuclidean') Computes the squared Euclidean distance ||u-v||_2^2 between the vectors. 6. Y = pdist(X, 'cosine') Computes the cosine distance between vectors u and v, 1 - uv^T ----------- |u|_2 |v|_2 where |*|_2 is the 2 norm of its argument *. 7. Y = pdist(X, 'correlation') Computes the correlation distance between vectors u and v. This is 1 - (u - n|u|_1)(v - n|v|_1)^T --------------------------------- , |(u - n|u|_1)|_2 |(v - n|v|_1)|^T where |*|_1 is the Manhattan (or 1-norm) of its argument *, and n is the common dimensionality of the vectors. 8. Y = pdist(X, 'hamming') Computes the normalized Hamming distance, or the proportion of those vector elements between two n-vectors u and v which disagree. To save memory, the matrix X can be of type boolean. 9. Y = pdist(X, 'jaccard') Computes the Jaccard distance between the points. Given two vectors, u and v, the Jaccard distance is the proportion of those elements u_i and v_i that disagree where at least one of them is non-zero. 10. Y = pdist(X, 'chebyshev') Computes the Chebyshev distance between the points. The Chebyshev distance between two n-vectors u and v is the maximum norm-1 distance between their respective elements. More precisely, the distance is given by d(u,v) = max {|u_i-v_i|}. 11. Y = pdist(X, 'canberra') Computes the Canberra distance between the points. The Canberra distance between two points u and v is |u_1-v_1| |u_2-v_2| |u_n-v_n| d(u,v) = ----------- + ----------- + ... + ----------- |u_1|+|v_1| |u_2|+|v_2| |u_n|+|v_n| 12. Y = pdist(X, 'braycurtis') Computes the Bray-Curtis distance between the points. The Bray-Curtis distance between two points u and v is |u_1-v_1| + |u_2-v_2| + ... + |u_n-v_n| d(u,v) = --------------------------------------- |u_1+v_1| + |u_2+v_2| + ... + |u_n+v_n| 13. Y = pdist(X, 'mahalanobis', VI=None) Computes the Mahalanobis distance between the points. The Mahalanobis distance between two points u and v is (u-v)(1/V)(u-v)^T where (1/V) is the inverse covariance. If VI is not None, VI will be used as the inverse covariance matrix. 14. Y = pdist(X, 'yule') Computes the Yule distance between each pair of boolean vectors. (see yule function documentation) 15. Y = pdist(X, 'matching') Computes the matching distance between each pair of boolean vectors. (see matching function documentation) 16. Y = pdist(X, 'dice') Computes the Dice distance between each pair of boolean vectors. (see dice function documentation) 17. Y = pdist(X, 'kulsinski') Computes the Kulsinski distance between each pair of boolean vectors. (see kulsinski function documentation) 17. Y = pdist(X, 'rogerstanimoto') Computes the Rogers-Tanimoto distance between each pair of boolean vectors. (see rogerstanimoto function documentation) 18. Y = pdist(X, 'russellrao') Computes the Russell-Rao distance between each pair of boolean vectors. (see russellrao function documentation) 19. Y = pdist(X, 'sokalmichener') Computes the Sokal-Michener distance between each pair of boolean vectors. (see sokalmichener function documentation) 20. Y = pdist(X, 'sokalsneath') Computes the Sokal-Sneath distance between each pair of boolean vectors. (see sokalsneath function documentation) 21. Y = pdist(X, f) Computes the distance between all pairs of vectors in X using the user supplied 2-arity function f. For example, Euclidean distance between the vectors could be computed as follows, dm = pdist(X, (lambda u, v: np.sqrt(((u-v)*(u-v).T).sum()))) Note that you should avoid passing a reference to one of the distance functions defined in this library. For example, dm = pdist(X, sokalsneath) would calculate the pair-wise distances between the vectors in X using the Python function sokalsneath. This would result in sokalsneath being called {n \choose 2} times, which is inefficient. Instead, the optimized C version is more efficient, and we call it using the following syntax. dm = pdist(X, 'sokalsneath') """ | 93bcbf411396d3547ee20bbf01691d79e112617c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5882/93bcbf411396d3547ee20bbf01691d79e112617c/hierarchy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
4413,
12,
60,
16,
3999,
2218,
73,
22392,
2187,
293,
33,
22,
16,
776,
33,
7036,
16,
12596,
33,
7036,
4672,
3536,
1624,
273,
293,
4413,
12,
60,
16,
707,
2218,
73,
22392,
2187,
293... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
4413,
12,
60,
16,
3999,
2218,
73,
22392,
2187,
293,
33,
22,
16,
776,
33,
7036,
16,
12596,
33,
7036,
4672,
3536,
1624,
273,
293,
4413,
12,
60,
16,
707,
2218,
73,
22392,
2187,
293... |
def redraw_balloons(self, event): | def _redraw_balloons(self, event): | def redraw_balloons(self, event): self.view_properties.hovered_event = event self._redraw_timeline() | e20ab2efe2ca244a8f02aef5ba7742e3642629eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5252/e20ab2efe2ca244a8f02aef5ba7742e3642629eb/timelineview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1118,
1899,
67,
70,
287,
383,
7008,
12,
2890,
16,
871,
4672,
365,
18,
1945,
67,
4738,
18,
24969,
329,
67,
2575,
273,
871,
365,
6315,
1118,
1899,
67,
26237,
1435,
225,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1118,
1899,
67,
70,
287,
383,
7008,
12,
2890,
16,
871,
4672,
365,
18,
1945,
67,
4738,
18,
24969,
329,
67,
2575,
273,
871,
365,
6315,
1118,
1899,
67,
26237,
1435,
225,
2,
-100,
-... |
def __init__(self, file_name, directory): | def __init__(self, file_name=None, directory=None): | def __init__(self, file_name, directory): """Constructor(message file name, corpus directory name).""" date = imaplib.Time2Internaldate(time.time())[1:-1] IMAPMessage.__init__(self, date) FileCorpus.FileMessage.__init__(self, file_name, directory) self.id = file_name self.directory = directory | c4d7670dff445a1db6fa6542323dae6b3cdc7cdc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/c4d7670dff445a1db6fa6542323dae6b3cdc7cdc/sb_pop3dnd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
585,
67,
529,
33,
7036,
16,
1867,
33,
7036,
4672,
3536,
6293,
12,
2150,
585,
508,
16,
13825,
1867,
508,
13,
12123,
1509,
273,
709,
69,
6673,
18,
950,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
585,
67,
529,
33,
7036,
16,
1867,
33,
7036,
4672,
3536,
6293,
12,
2150,
585,
508,
16,
13825,
1867,
508,
13,
12123,
1509,
273,
709,
69,
6673,
18,
950,
2... |
pdb_io = iotbx.pdb.input(file_name = pdb_io) | def analyze_pdb(self, filename=None, pdb_io=None, hierarchy=None, outliers_only=False): relevant_atom_names = { " CA ": None, " N ": None, " C ": None, " CB ": None} # FUTURE: set analysis = 'pdb:alt:res:chainID:resnum:dev:dihedralNABB:Occ:ALT:\n' output_list = [] cbetadev_ctr = 0 self.num_outliers = 0 self.expected_outliers = 0 self.outliers = '' self.summary = '' filename = pdb_io if(pdb_io is not None): pdb_io = iotbx.pdb.input(file_name = pdb_io) hierarchy = pdb_io.construct_hierarchy() for model in hierarchy.models(): for chain in model.chains(): for rg in chain.residue_groups(): for i_cf,cf in enumerate(rg.conformers()): for i_residue,residue in enumerate(cf.residues()): is_first = (i_cf == 0) is_alt_conf = False relevant_atoms = {} for atom in residue.atoms(): if (atom.name in relevant_atom_names): relevant_atoms[atom.name] = atom if (len(atom.parent().altloc) != 0): is_alt_conf = True if ((is_first or is_alt_conf) and len(relevant_atoms) == 4): resCA = relevant_atoms[" CA "] resN = relevant_atoms[" N "] resC = relevant_atoms[" C "] resCB = relevant_atoms[" CB "] dist, angleCAB, dihedralNCAB, angleNAB, dihedralCNAB, angleideal= \ self.idealized_calpha_angles(residue=residue) betaNCAB = self.construct_fourth(resN, resCA, resC, dist, angleCAB, dihedralNCAB, method="NCAB") betaCNAB = self.construct_fourth(resN, resCA, resC, dist, angleNAB, dihedralCNAB, method="CNAB") betaxyz = [(betaNCAB[0]+betaCNAB[0])/2, (betaNCAB[1]+betaCNAB[1])/2, (betaNCAB[2]+betaCNAB[2])/2] betadist = self.distance(resCA.xyz,betaxyz) if betadist == 0: continue if(betadist != dist): distTemp = [(betaxyz[0]-resCA.xyz[0]), (betaxyz[1]-resCA.xyz[1]), (betaxyz[2]-resCA.xyz[2])] betaxyz = [(resCA.xyz[0]+distTemp[0]*dist/betadist), (resCA.xyz[1]+distTemp[1]*dist/betadist), (resCA.xyz[2]+distTemp[2]*dist/betadist)] if(residue.resname != "GLY"): dev = self.distance(resCB.xyz,betaxyz) if(dev >=0.25 or outliers_only==False): if(dev >=0.25): cbetadev_ctr+=1 self.num_outliers+=1 d = geometry_restraints.dihedral(sites=[resN.xyz,resCA.xyz,betaxyz,resCB.xyz], angle_ideal=0, weight=1) dihedralNABB = d.angle_model | 98fb3342c3e021111bcf3891857f50b6d34f1637 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/98fb3342c3e021111bcf3891857f50b6d34f1637/cbetadev.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12375,
67,
17414,
12,
2890,
16,
1544,
33,
7036,
16,
10892,
67,
1594,
33,
7036,
16,
9360,
33,
7036,
16,
30434,
67,
3700,
33,
8381,
4672,
9368,
67,
7466,
67,
1973,
273,
288,
315,
6425,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12375,
67,
17414,
12,
2890,
16,
1544,
33,
7036,
16,
10892,
67,
1594,
33,
7036,
16,
9360,
33,
7036,
16,
30434,
67,
3700,
33,
8381,
4672,
9368,
67,
7466,
67,
1973,
273,
288,
315,
6425,
... | |
bt.clicked = (notify_show, (win, elementary.ELM_NOTIFY_ORIENT_TOP)) | bt.callback_clicked_add(notify_show, win, elementary.ELM_NOTIFY_ORIENT_TOP) | def notify_clicked(obj, it, *args, **kwargs): win = elementary.Window("notify", elementary.ELM_WIN_BASIC) win.title_set("Notify test") win.autodel_set(True) win.size_hint_min_set(160, 160) win.size_hint_max_set(320, 320) win.resize(320, 320) bg = elementary.Background(win) win.resize_object_add(bg) bg.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) bg.show() tb = elementary.Table(win) tb.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) win.resize_object_add(tb) tb.show() bt = elementary.Button(win) bt.label_set("Top") bt.clicked = (notify_show, (win, elementary.ELM_NOTIFY_ORIENT_TOP)) tb.pack(bt, 1, 0, 1, 1) bt.show() bt = elementary.Button(win) bt.label_set("Bottom") bt.clicked = (notify_show, (win, elementary.ELM_NOTIFY_ORIENT_BOTTOM)) tb.pack(bt, 1, 2, 1, 1) bt.show() bt = elementary.Button(win) bt.label_set("Left") bt.clicked = (notify_show, (win, elementary.ELM_NOTIFY_ORIENT_LEFT)) tb.pack(bt, 0, 1, 1, 1) bt.show() bt = elementary.Button(win) bt.label_set("Top Left") bt.clicked = (notify_show, (win, elementary.ELM_NOTIFY_ORIENT_TOP_LEFT)) tb.pack(bt, 0, 0, 1, 1) bt.show() bt = elementary.Button(win) bt.label_set("Bottom Left") bt.clicked = (notify_show, (win, elementary.ELM_NOTIFY_ORIENT_BOTTOM_LEFT)) tb.pack(bt, 0, 2, 1, 1) bt.show() bt = elementary.Button(win) bt.label_set("Right") bt.clicked = (notify_show, (win, elementary.ELM_NOTIFY_ORIENT_RIGHT)) tb.pack(bt, 2, 1, 1, 1) bt.show() bt = elementary.Button(win) bt.label_set("Top Right") bt.clicked = (notify_show, (win, elementary.ELM_NOTIFY_ORIENT_TOP_RIGHT)) tb.pack(bt, 2, 0, 1, 1) bt.show() bt = elementary.Button(win) bt.label_set("Bottom Right") bt.clicked = (notify_show, (win, elementary.ELM_NOTIFY_ORIENT_BOTTOM_RIGHT)) tb.pack(bt, 2, 2, 1, 1) bt.show() win.show() | ef127faaba8fc06ebbb7bd48a4185405cdfc6a4e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12343/ef127faaba8fc06ebbb7bd48a4185405cdfc6a4e/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
67,
7475,
329,
12,
2603,
16,
518,
16,
380,
1968,
16,
2826,
4333,
4672,
5657,
273,
930,
814,
18,
3829,
2932,
12336,
3113,
930,
814,
18,
2247,
49,
67,
24572,
67,
25642,
13,
5657,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
67,
7475,
329,
12,
2603,
16,
518,
16,
380,
1968,
16,
2826,
4333,
4672,
5657,
273,
930,
814,
18,
3829,
2932,
12336,
3113,
930,
814,
18,
2247,
49,
67,
24572,
67,
25642,
13,
5657,
... |
def __init__(self, stream=sys.stdout, tbformat='default', args=None, realtime=False): super(TextReporter, self).__init__(stream, tbformat, args, realtime) self.seenModules, self.seenClasses = {}, {} | def __init__(self, stream=sys.stdout, tbformat='default', args=None, realtime=False): super(TextReporter, self).__init__(stream, tbformat, args, realtime) self.seenModules, self.seenClasses = {}, {} | 2111afd113df8f03d5a8292816aa499e4230763f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2111afd113df8f03d5a8292816aa499e4230763f/reporter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1407,
33,
9499,
18,
10283,
16,
8739,
2139,
2218,
1886,
2187,
833,
33,
7036,
16,
2863,
957,
33,
8381,
4672,
2240,
12,
1528,
13289,
16,
365,
2934,
972,
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,
1407,
33,
9499,
18,
10283,
16,
8739,
2139,
2218,
1886,
2187,
833,
33,
7036,
16,
2863,
957,
33,
8381,
4672,
2240,
12,
1528,
13289,
16,
365,
2934,
972,
273... | |
pl2._contents = text | page2._contents = text | def oneDone(self, entry): title = entry.title username = entry.username ipedit = entry.ipedit timestamp = entry.timestamp text = entry.text editRestriction = entry.editRestriction moveRestriction = entry.moveRestriction pl = Page(self.site, title) for pl2 in self.pages: if pl2.sectionFreeTitle() == pl.sectionFreeTitle(): if not hasattr(pl2,'_contents') and not hasattr(pl2,'_getexception'): break else: output(u"BUG>> title %s (%s) not found in list" % (title, pl.aslink(forceInterwiki=True))) output(u'Expected one of: %s' % u','.join([pl2.aslink(forceInterwiki=True) for pl2 in self.pages])) raise PageNotFound | 7bae208fb5b06124e71a5603ccda36772d125b84 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/7bae208fb5b06124e71a5603ccda36772d125b84/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1245,
7387,
12,
2890,
16,
1241,
4672,
2077,
273,
1241,
18,
2649,
2718,
273,
1241,
18,
5053,
277,
1845,
305,
273,
1241,
18,
625,
4619,
2858,
273,
1241,
18,
5508,
977,
273,
1241,
18,
955... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1245,
7387,
12,
2890,
16,
1241,
4672,
2077,
273,
1241,
18,
2649,
2718,
273,
1241,
18,
5053,
277,
1845,
305,
273,
1241,
18,
625,
4619,
2858,
273,
1241,
18,
5508,
977,
273,
1241,
18,
955... |
self.treeChannels.get_selection().set_selected( (i,)) | self.treeChannels.get_selection().select_path( (i,)) | def add_new_channel( self, result = None, ask_download_new = True): result = util.normalize_feed_url( result) | 1f6cba78a874a0e2fbc672a1307cd97da635b619 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12778/1f6cba78a874a0e2fbc672a1307cd97da635b619/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2704,
67,
4327,
12,
365,
16,
563,
273,
599,
16,
6827,
67,
7813,
67,
2704,
273,
1053,
4672,
563,
273,
1709,
18,
12237,
67,
7848,
67,
718,
12,
563,
13,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
527,
67,
2704,
67,
4327,
12,
365,
16,
563,
273,
599,
16,
6827,
67,
7813,
67,
2704,
273,
1053,
4672,
563,
273,
1709,
18,
12237,
67,
7848,
67,
718,
12,
563,
13,
2,
-100,
-100,
-100,
... |
clean_html_directory: if True, all existing files in the html directory are removed before rebaselining. | def SetupHtmlDirectory(html_directory, clean_html_directory): """Setup the directory to store html results. All html related files are stored in the "rebaseline_html" subdirectory. Args: html_directory: parent directory that stores the rebaselining results. If None, a temp directory is created. clean_html_directory: if True, all existing files in the html directory are removed before rebaselining. Returns: the directory that stores the html related rebaselining results. """ if not html_directory: html_directory = tempfile.mkdtemp() elif not os.path.exists(html_directory): os.mkdir(html_directory) html_directory = os.path.join(html_directory, 'rebaseline_html') logging.info('Html directory: "%s"', html_directory) if clean_html_directory and os.path.exists(html_directory): shutil.rmtree(html_directory, True) logging.info('Deleted file at html directory: "%s"', html_directory) if not os.path.exists(html_directory): os.mkdir(html_directory) return html_directory | f9620c624d6a219abe2fb4af51598b253f2c7501 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/f9620c624d6a219abe2fb4af51598b253f2c7501/rebaseline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10939,
4353,
2853,
12,
2620,
67,
5149,
16,
2721,
67,
2620,
67,
5149,
4672,
3536,
7365,
326,
1867,
358,
1707,
1729,
1686,
18,
225,
4826,
1729,
3746,
1390,
854,
4041,
316,
326,
315,
266,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10939,
4353,
2853,
12,
2620,
67,
5149,
16,
2721,
67,
2620,
67,
5149,
4672,
3536,
7365,
326,
1867,
358,
1707,
1729,
1686,
18,
225,
4826,
1729,
3746,
1390,
854,
4041,
316,
326,
315,
266,
... | |
except: self._release_and_log_output(output) raise else: | finally: | def run(self, output, namespace, args): """Executes the represented handler with given 'args'. Note: This method MUST NOT change this object's internal state. """ if self._method is not None: handler = self._method else: lib_instance = self.library.get_instance() handler = self._get_handler(lib_instance, self._handler_name) args = self._process_args(args, namespace.variables) self._tracelog_args(output, args) utils.capture_output() try: ret = self._run_handler(handler, args, output, namespace) except: self._release_and_log_output(output) raise else: self._release_and_log_output(output) output.trace('Return: %s' % utils.unic(ret)) return ret | 426f74b21f3ce710b15f81ec97a56dcdecfa881c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7408/426f74b21f3ce710b15f81ec97a56dcdecfa881c/handlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
876,
16,
1981,
16,
833,
4672,
3536,
9763,
326,
10584,
1838,
598,
864,
296,
1968,
10332,
225,
3609,
30,
1220,
707,
10685,
4269,
2549,
333,
733,
1807,
2713,
919,
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,
1086,
12,
2890,
16,
876,
16,
1981,
16,
833,
4672,
3536,
9763,
326,
10584,
1838,
598,
864,
296,
1968,
10332,
225,
3609,
30,
1220,
707,
10685,
4269,
2549,
333,
733,
1807,
2713,
919,
18,
... |
handle = find_outgoing_tcp_commhandle(localip, localport, desthost, destport) message = "Network socket is in use by an external process!" if handle != None: message = " Duplicate handle exists with name: "+str(handle) raise Exception, message | raise PortInUseError("There is a duplicate connection which conflicts with the request!") | def openconnection(destip, destport,localip, localport, timeout): """ <Purpose> Opens a connection, returning a socket-like object <Arguments> destip: The destination ip to open communications with destport: The destination port to use for communication localip: The local ip to use for the communication localport: The local port to use for communication timeout: The maximum amount of time to wait to connect. This may be a floating point number or an integer <Exceptions> RepyArgumentError if the arguments are invalid. This includes both the types and values of arguments. AddressBindingError (descends NetworkError) if the localip isn't associated with the local system or is not allowed. PortRestrictedError (descends ResourceError) if the localport isn't allowed. PortInUseError (descends NetworkError) if the (localip, localport, destip, destport) tuple is already used. This will also occur if the operating system prevents the local IP / port from being used. ConnectionRefusedError (descends NetworkError) if the connection cannot be established because the destination port isn't being listened on. TimeoutError (common to all API functions that timeout) if the connection times out <Side Effects> TODO <Resource Consumption> This operation consumes 64*2 bytes of netsend (SYN, ACK) and 64 bytes of netrecv (SYN/ACK). This requires that the localport is allowed. Upon success, this call consumes an outsocket. <Returns> A socket-like object that can be used for communication. Use send, recv, and close just like you would an actual socket object in python. """ # check the validity of the IP addresses if not _is_valid_ip_address(destip): raise RepyArgumentError("Invalid IP address listed for destip: '"+destip+"'") if not _is_valid_ip_address(localip): raise RepyArgumentError("Invalid IP address listed for localip: '"+localip+"'") # Timeout must be positive (of course) if timeout < 0: raise RepyArgumentError("Invalid timeout '"+str(timeout)+"'. Must be positive.") # check the port arguments if not _is_valid_network_port(localport): raise RepyArgumentError("Invalid localport '"+str(localport)+"'. Must be between 1 and 65535, inclusive.") if not _is_valid_network_port(destport): raise RepyArgumentError("Invalid destport '"+str(localport)+"'. Must be between 1 and 65535, inclusive.") # Check if the specified local ip is allowed. # TODO: We may need to do something different to check if the localip is # actually a local IP. if not _ip_is_allowed(localip): raise AddressBindingError("Cannot bind to IP '"+str(localip)+"'. Is not local or is disallowed.") # Get our start time starttime = nonportable.getruntime() # Armon: Check for any pre-existing sockets. If they are being closed, wait for them. # This will also serve to check if repy has a pre-existing socket open on this same tuple exists = True while exists and nonportable.getruntime() - starttime < timeout: # Update the status (exists, status) = nonportable.os_api.exists_outgoing_network_socket(localip,localport,desthost,destport) if exists: # Check the socket state if "ESTABLISH" in status or "CLOSE_WAIT" in status: # Check if the socket is from this repy vessel handle = find_outgoing_tcp_commhandle(localip, localport, desthost, destport) message = "Network socket is in use by an external process!" if handle != None: message = " Duplicate handle exists with name: "+str(handle) raise Exception, message else: # Wait for socket cleanup time.sleep(RETRY_INTERVAL) else: # Check if a socket exists still and we timed out if exists: raise Exception, "Timed out checking for socket cleanup!" if localport: nanny.tattle_check('connport',localport) handle = generate_commhandle() # If allocation of an outsocket fails, we garbage collect and try again # -- this forces destruction of unreferenced objects, which is how we # free resources. try: nanny.tattle_add_item('outsockets',handle) except: gc.collect() nanny.tattle_add_item('outsockets',handle) try: s = _get_tcp_socket(localip,localport) # add the socket to the comminfo table comminfo[handle] = {'type':'TCP','remotehost':None, 'remoteport':None,'localip':localip,'localport':localport,'socket':s, 'outgoing':True, 'closing_lock':threading.Lock()} except: # the socket wasn't passed to the user prog... nanny.tattle_remove_item('outsockets',handle) raise try: thissock = EmulatedSocket(handle) # We set a timeout before we connect. This allows us to timeout slow # connections... oldtimeout = comminfo[handle]['socket'].gettimeout() # Set the new timeout comminfo[handle]['socket'].settimeout(timeout) # Store exceptions until we exit the loop, default to timed out # in case we are given a very small timeout connect_exception = Exception("Connection timed out!") # Ignore errors and retry if we have not yet reached the timeout while nonportable.getruntime() - starttime < timeout: try: comminfo[handle]['socket'].connect((desthost,destport)) break except Exception,e: # Check if the socket is already connected (EISCONN or WSAEISCONN) if _is_already_connected_exception(e): break # Check if this is recoverable, only continue if it is elif not _is_recoverable_network_exception(e): raise else: # Store the exception connect_exception = e # Sleep a bit, avoid excessive iterations of the loop time.sleep(0.2) else: # Raise any exception that was raised if connect_exception != None: raise connect_exception comminfo[handle]['remotehost']=desthost comminfo[handle]['remoteport']=destport except: _cleanup_socket(handle) raise else: # and restore the old timeout... comminfo[handle]['socket'].settimeout(oldtimeout) return thissock | f80cd355ff779db784e626207f6c5a3943c62735 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7280/f80cd355ff779db784e626207f6c5a3943c62735/emulcomm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
4071,
12,
10488,
625,
16,
1570,
655,
16,
3729,
625,
16,
1191,
655,
16,
2021,
4672,
3536,
411,
10262,
4150,
34,
6066,
773,
279,
1459,
16,
5785,
279,
2987,
17,
5625,
733,
282,
411,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
4071,
12,
10488,
625,
16,
1570,
655,
16,
3729,
625,
16,
1191,
655,
16,
2021,
4672,
3536,
411,
10262,
4150,
34,
6066,
773,
279,
1459,
16,
5785,
279,
2987,
17,
5625,
733,
282,
411,... |
except IOError: | except IOError, reason: | def main(self): | 0a0d835698e962ed05cdc6905c0f485f0490ed6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/0a0d835698e962ed05cdc6905c0f485f0490ed6e/pybench.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
2774,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
ws = Workspace.objects.get(pk = ws_pk) | ws = DAMWorkspace.objects.get(pk = ws_pk) | def test_set_name(self): ws_pk = 1 params = self.get_final_parameters({'name':'test_', }) response = self.client.post('/api/workspace/%s/set_name/'%ws_pk, params,) self.assertTrue(response.content == '') ws = Workspace.objects.get(pk = ws_pk) self.assertTrue(ws.name == 'test_') | 774c03fcc85d5555c72b71c04da9a7d1a510e957 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4589/774c03fcc85d5555c72b71c04da9a7d1a510e957/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
542,
67,
529,
12,
2890,
4672,
225,
4945,
67,
5465,
273,
404,
859,
273,
365,
18,
588,
67,
6385,
67,
3977,
12590,
11,
529,
11,
2497,
3813,
67,
2187,
289,
13,
225,
766,
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,
1842,
67,
542,
67,
529,
12,
2890,
4672,
225,
4945,
67,
5465,
273,
404,
859,
273,
365,
18,
588,
67,
6385,
67,
3977,
12590,
11,
529,
11,
2497,
3813,
67,
2187,
289,
13,
225,
766,
273,
... |
l = list(self.backend.iter_search_results('futanari', nsfw=True)) | l = list(self.backend.iter_search_results('anal', nsfw=True)) | def test_youjizz(self): self.assertTrue(len(self.backend.iter_search_results('anus', nsfw=False)) == 0) | 90292c19f89377cc2263c4fea9b44fd525319f6e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7471/90292c19f89377cc2263c4fea9b44fd525319f6e/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
19940,
78,
25695,
12,
2890,
4672,
365,
18,
11231,
5510,
12,
1897,
12,
2890,
18,
9993,
18,
2165,
67,
3072,
67,
4717,
2668,
304,
407,
2187,
3153,
11966,
33,
8381,
3719,
422,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
19940,
78,
25695,
12,
2890,
4672,
365,
18,
11231,
5510,
12,
1897,
12,
2890,
18,
9993,
18,
2165,
67,
3072,
67,
4717,
2668,
304,
407,
2187,
3153,
11966,
33,
8381,
3719,
422,
37... |
data = REQUEST.SESSION[self.absolute_url()][name] | data = REQUEST.SESSION[getRelURL(self, self.getPhysicalPath())][name] | def getSubObject(self, name, REQUEST, RESPONSE=None): """Get a dictionary of objects from the session """ try: data = REQUEST.SESSION[self.absolute_url()][name] except AttributeError: return except KeyError: return mtr = self.mimetypes_registry mt = mtr.classify(data, filename=name) return Wrapper(data, name, mt or 'application/octet') | a94ed380035610ac561107e95ff2c1b4ffe337c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/a94ed380035610ac561107e95ff2c1b4ffe337c2/BaseObject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7040,
921,
12,
2890,
16,
508,
16,
12492,
16,
20645,
33,
7036,
4672,
3536,
967,
279,
3880,
434,
2184,
628,
326,
1339,
3536,
775,
30,
501,
273,
12492,
18,
7042,
63,
588,
1971,
1785,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7040,
921,
12,
2890,
16,
508,
16,
12492,
16,
20645,
33,
7036,
4672,
3536,
967,
279,
3880,
434,
2184,
628,
326,
1339,
3536,
775,
30,
501,
273,
12492,
18,
7042,
63,
588,
1971,
1785,
12,
... |
if not os.path.exists(path_to_figures) or build_always: | if not path_exists_and_not_empty(path_to_figures) or build_always: | def download_as_text(url): try: furl = urllib2.urlopen(url) s = furl.read() return s except: return None | 5ed99ac8eaf32e12f072bf4840ac227186add59a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6341/5ed99ac8eaf32e12f072bf4840ac227186add59a/includevistrail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4224,
67,
345,
67,
955,
12,
718,
4672,
775,
30,
284,
718,
273,
11527,
22,
18,
295,
18589,
12,
718,
13,
272,
273,
284,
718,
18,
896,
1435,
327,
272,
1335,
30,
327,
599,
225,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4224,
67,
345,
67,
955,
12,
718,
4672,
775,
30,
284,
718,
273,
11527,
22,
18,
295,
18589,
12,
718,
13,
272,
273,
284,
718,
18,
896,
1435,
327,
272,
1335,
30,
327,
599,
225,
2,
-100... |
return app.translations.ngettext(singular, plural, n) | return translations.ngettext(singular, plural, n) | def ngettext(singular, plural, n): """Translate the possible pluralized string to the language of the application. """ app = zine.application.get_application() if app is None: if n == 1: return unicode(singular) return unicode(plural) return app.translations.ngettext(singular, plural, n) | ff0382db399bc9c58e8c38532fb68d4a961f9dff /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12815/ff0382db399bc9c58e8c38532fb68d4a961f9dff/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
29967,
12,
17835,
16,
7978,
16,
290,
4672,
3536,
12818,
326,
3323,
7978,
1235,
533,
358,
326,
2653,
434,
326,
2521,
18,
3536,
595,
273,
998,
558,
18,
3685,
18,
588,
67,
3685,
1435... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
29967,
12,
17835,
16,
7978,
16,
290,
4672,
3536,
12818,
326,
3323,
7978,
1235,
533,
358,
326,
2653,
434,
326,
2521,
18,
3536,
595,
273,
998,
558,
18,
3685,
18,
588,
67,
3685,
1435... |
"moduleinfo", "title", "opcodedesc", "verbatim", "funcdesc", "methoddesc", "excdesc", "datadesc", | "moduleinfo", "title", "verbatim", "opcodedesc", "classdesc", "funcdesc", "methoddesc", "excdesc", "datadesc", | def move_elements_by_name(doc, source, dest, name, sep=None): nodes = [] for child in source.childNodes: if child.nodeType == xml.dom.core.ELEMENT and child.tagName == name: nodes.append(child) for node in nodes: source.removeChild(node) dest.appendChild(node) if sep: dest.appendChild(doc.createTextNode(sep)) | 3759c0f7c4a36aa16f6e09ec1bb99e14f315dc6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3759c0f7c4a36aa16f6e09ec1bb99e14f315dc6f/docfixer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
67,
6274,
67,
1637,
67,
529,
12,
2434,
16,
1084,
16,
1570,
16,
508,
16,
5478,
33,
7036,
4672,
2199,
273,
5378,
364,
1151,
316,
1084,
18,
3624,
3205,
30,
309,
1151,
18,
2159,
55... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
67,
6274,
67,
1637,
67,
529,
12,
2434,
16,
1084,
16,
1570,
16,
508,
16,
5478,
33,
7036,
4672,
2199,
273,
5378,
364,
1151,
316,
1084,
18,
3624,
3205,
30,
309,
1151,
18,
2159,
55... |
raise TracError('Unsupported version control system "%s"' % self.repository_type) | raise TracError('Unsupported version control system "%s". ' 'Check that the Python bindings for "%s" are ' 'correctly installed.' % ((self.repository_type,)*2)) | def get_repository(self, authname): if not self._connector: candidates = [] for connector in self.connectors: for repos_type_, prio in connector.get_supported_types(): if self.repository_type != repos_type_: continue heappush(candidates, (-prio, connector)) if not candidates: raise TracError('Unsupported version control system "%s"' % self.repository_type) self._connector = heappop(candidates)[1] try: self._lock.acquire() tid = threading._get_ident() if tid in self._cache: repos = self._cache[tid] else: rtype, rdir = self.repository_type, self.repository_dir repos = self._connector.get_repository(rtype, rdir, authname) self._cache[tid] = repos return repos finally: self._lock.release() | cd9117a7fdcd53bd22d050d31a1560db7cf754e0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2831/cd9117a7fdcd53bd22d050d31a1560db7cf754e0/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9071,
12,
2890,
16,
1357,
529,
4672,
309,
486,
365,
6315,
23159,
30,
7965,
273,
5378,
364,
8703,
316,
365,
18,
4646,
18886,
30,
364,
13686,
67,
723,
67,
16,
14705,
83,
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,
336,
67,
9071,
12,
2890,
16,
1357,
529,
4672,
309,
486,
365,
6315,
23159,
30,
7965,
273,
5378,
364,
8703,
316,
365,
18,
4646,
18886,
30,
364,
13686,
67,
723,
67,
16,
14705,
83,
316,
... |
generatedId = self._genPrefix + `self._nextId` self._nextId = self._nextId + 1 self.sink.makeStatement(( self._context, (RESOURCE, RDFSink.forSomeSym), self._context, (RESOURCE, generatedId) )) return generatedId | global _nextId generatedId = self._genPrefix + `_nextId` _nextId = _nextId + 1 self.sink.makeStatement(( self._context, (RESOURCE, RDFSink.forSomeSym), self._context, (RESOURCE, generatedId) )) return generatedId | def _generate(self): generatedId = self._genPrefix + `self._nextId` # self._nextId = self._nextId + 1 self.sink.makeStatement(( self._context, (RESOURCE, RDFSink.forSomeSym), self._context, (RESOURCE, generatedId) )) # Note this is anonymous node return generatedId | d8d5550e85d4e1575de516acf94f0474eaafb56b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/d8d5550e85d4e1575de516acf94f0474eaafb56b/sax2rdf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7163,
12,
2890,
4672,
4374,
548,
273,
365,
6315,
4507,
2244,
397,
1375,
2890,
6315,
4285,
548,
68,
225,
468,
365,
6315,
4285,
548,
273,
365,
6315,
4285,
548,
397,
404,
365,
18,
17... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7163,
12,
2890,
4672,
4374,
548,
273,
365,
6315,
4507,
2244,
397,
1375,
2890,
6315,
4285,
548,
68,
225,
468,
365,
6315,
4285,
548,
273,
365,
6315,
4285,
548,
397,
404,
365,
18,
17... |
run_sql("UPDATE clsMETHOD SET last_updated=NOW()" | run_sql("UPDATE clsMETHOD SET last_updated=NOW()") | def update_date_of_last_run(): """ Update bibclassify daemon table information about last run time. """ run_sql("UPDATE clsMETHOD SET last_updated=NOW()" | 9617e5e9fb1d265fbd27c46bcff32aa53270e368 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2594/9617e5e9fb1d265fbd27c46bcff32aa53270e368/bibclassify_daemon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
712,
67,
792,
67,
2722,
67,
2681,
13332,
3536,
2315,
25581,
1106,
1164,
8131,
1014,
1779,
2973,
1142,
1086,
813,
18,
3536,
1086,
67,
4669,
2932,
8217,
2028,
5327,
7855,
1142,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
712,
67,
792,
67,
2722,
67,
2681,
13332,
3536,
2315,
25581,
1106,
1164,
8131,
1014,
1779,
2973,
1142,
1086,
813,
18,
3536,
1086,
67,
4669,
2932,
8217,
2028,
5327,
7855,
1142,
6... |
cmdclass.build_extension(self, ext) | self._build_extension(ext) | def build_extension(self, ext): try: pairs = self.compiler.depends_pairwise(ext.sources, ext.include_dirs, ext.depends) except: pass else: for source, depends in pairs: if newer_group(depends, source, 'newer'): os.utime(source, None) cmdclass.build_extension(self, ext) | 2d731bf0036dd1b1f5537ff47ad1aae607a4f2cb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14078/2d731bf0036dd1b1f5537ff47ad1aae607a4f2cb/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
6447,
12,
2890,
16,
1110,
4672,
775,
30,
5574,
273,
365,
18,
9576,
18,
27360,
67,
6017,
2460,
12,
408,
18,
10141,
16,
1110,
18,
6702,
67,
8291,
16,
1110,
18,
27360,
13,
133... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
6447,
12,
2890,
16,
1110,
4672,
775,
30,
5574,
273,
365,
18,
9576,
18,
27360,
67,
6017,
2460,
12,
408,
18,
10141,
16,
1110,
18,
6702,
67,
8291,
16,
1110,
18,
27360,
13,
133... |
document. This option can be dangerous, but if group members are | document. This option can be dangerous, but if group members are | def unlock(uri, http_user, name, sure = False): """ Make a shared group dir permissive. """ title = _("Make group %s permissive") % name data = '%s\n%s\n%s' % (w.backto(), __groups_actions(), w.menu(uri)) if not sure: description = _('''This will permit large access to files and folders in the group shared dir, and will allow any member of the group to modify / delete any document, even if he/she is not owner of the document. This option can be dangerous, but if group members are accustomed to work together, there is no problem. Generally speaking you will use this feature on small working groups. <br /> Warning: <strong> The operation may be lengthy because the system will change permissions of all current data </ strong> (duration is therefore depending on the volume of data, about 1 second for 100Mio).''') data += w.question(_("Are you sure you want to active permissiveness on group <strong>%s</strong>?") % name, description, yes_values = [ _("Activate") + ' >>', "/groups/unlock/%s/sure" % name, _("A") ], no_values = [ '<< ' + _("Cancel"), "/groups/list", _("N") ]) return w.page(title, data) else: # we are sure, do it ! command = [ "sudo", "mod", "group", "--quiet", "--no-colors", "--name", name, "--set-permissive" ] return w.page(title, data + w.run(command, uri, successfull_redirect = "/groups/list", err_msg = _("Failed to activate permissivenes on group <strong>%s</strong>!") % name)) | e74a9415e90d5a3af83e10abed2f1876ae4e528a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/e74a9415e90d5a3af83e10abed2f1876ae4e528a/groups.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7186,
12,
1650,
16,
1062,
67,
1355,
16,
508,
16,
3071,
273,
1083,
4672,
3536,
4344,
279,
5116,
1041,
1577,
293,
1840,
688,
18,
3536,
225,
2077,
273,
389,
2932,
6464,
1041,
738,
87,
293... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7186,
12,
1650,
16,
1062,
67,
1355,
16,
508,
16,
3071,
273,
1083,
4672,
3536,
4344,
279,
5116,
1041,
1577,
293,
1840,
688,
18,
3536,
225,
2077,
273,
389,
2932,
6464,
1041,
738,
87,
293... |
return output.strip() | id_suffix = '' if self.is_dirty(): id_suffix = self.dirty_branch_suffix return output.strip() + id_suffix | def tree_id(self): if not os.path.exists(self.get_checkoutdir()): return None try: output = get_output(['git', 'rev-parse', 'HEAD'], cwd = self.get_checkoutdir(), get_stderr=False, extra_env=get_git_extra_env()) except CommandError: return None except GitUnknownBranchNameError: return None return output.strip() | e6590805cb9a12446545d3ac40942ec1dbfd2b27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4596/e6590805cb9a12446545d3ac40942ec1dbfd2b27/git.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2151,
67,
350,
12,
2890,
4672,
309,
486,
1140,
18,
803,
18,
1808,
12,
2890,
18,
588,
67,
17300,
1214,
1435,
4672,
327,
599,
775,
30,
876,
273,
336,
67,
2844,
12,
3292,
6845,
2187,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2151,
67,
350,
12,
2890,
4672,
309,
486,
1140,
18,
803,
18,
1808,
12,
2890,
18,
588,
67,
17300,
1214,
1435,
4672,
327,
599,
775,
30,
876,
273,
336,
67,
2844,
12,
3292,
6845,
2187,
29... |
logging.error("Unable to set Python locale to: '%s'" % lc) | logging.debug("Unable to set Python locale to: '%s'" % lc) | def __setPythonLocale(self, lc): try: # Set the Python locale locale.setlocale(locale.LC_ALL, lc) except locale.Error: if __debug__: # Log the error only in debug mode logging.error("Unable to set Python locale to: '%s'" % lc) return False | 25c82594020afcf97d709ba5f29a4fed9559138b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/25c82594020afcf97d709ba5f29a4fed9559138b/i18nmanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
15774,
3916,
12,
2890,
16,
9109,
4672,
775,
30,
468,
1000,
326,
6600,
2573,
2573,
18,
542,
6339,
12,
6339,
18,
13394,
67,
4685,
16,
9109,
13,
1335,
2573,
18,
668,
30,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
15774,
3916,
12,
2890,
16,
9109,
4672,
775,
30,
468,
1000,
326,
6600,
2573,
2573,
18,
542,
6339,
12,
6339,
18,
13394,
67,
4685,
16,
9109,
13,
1335,
2573,
18,
668,
30,
309,
... |
add("-n", "--nosplash", action="store_true", | add("-n", "--nosplash", action="store_false", | def setupOptions(self): """ setupOptions() -> None Check and store all command-line arguments """ add = command_line.CommandLineParser.add_option add("-S", "--startup", action="store", type="str", default=None, dest="dotVistrails", help="Set startup file (default is ~/.vistrails/startup.py)") add("-?", action="help", help="show this help message and exit") add("-v", "--version", action="callback", callback=lambda option, opt, value, parser: self.printVersion(), help="print version information and quit") add("-V", "--verbose", action="store", type="int", default=None, dest="verbose", help="set verboseness level (0--2, " "default=0, higher means more verbose)") add("-n", "--nosplash", action="store_true", default = None, help="don't display splash on startup") add("-c", "--cache", action="store", type="int", default=None, dest="cache", help="enable/disable caching") add("-m", "--movies", action="store", type="int", default=None, dest="movies", help="""set automatic movie creation on spreadsheet " "(0 or 1, default=1. Set this to zero to work around vtk bug with " "offscreen renderer and opengl texture3d mappers)""") add("-s", "--multiheads", action="store_true", default = None, help="display the builder and spreadsheet on different screens " "(if available)") add("-x", "--maximized", action="store_true", default = None, help="Maximize VisTrails windows at startup") add("-b", "--noninteractive", action="store_true", default = None, help="run in non-interactive mode") add("-l", "--nologger", action="store_true", default = None, help="disable the logging") add("-d", "--debugsignals", action="store_true", default = None, help="debug Qt Signals") add("-a", "--parameters", action="store", dest="parameters", help="workflow parameter settings (non-interactive mode only)") add("-t", "--host", action="store", dest="host", help="hostname or ip address of database server") add("-r", "--port", action="store", type="int", default=3306, dest="port", help="database port") add("-f", "--db", action="store", dest="db", help="database name") add("-u", "--user", action="store", dest="user", help="database username") command_line.CommandLineParser.parse_options() | 094d85b37d7c12bb182ddc090c93d2383473dcea /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6341/094d85b37d7c12bb182ddc090c93d2383473dcea/application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
1320,
12,
2890,
4672,
3536,
3875,
1320,
1435,
317,
599,
2073,
471,
1707,
777,
1296,
17,
1369,
1775,
225,
3536,
527,
273,
1296,
67,
1369,
18,
21391,
2678,
18,
1289,
67,
3482,
527,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
1320,
12,
2890,
4672,
3536,
3875,
1320,
1435,
317,
599,
2073,
471,
1707,
777,
1296,
17,
1369,
1775,
225,
3536,
527,
273,
1296,
67,
1369,
18,
21391,
2678,
18,
1289,
67,
3482,
527,
... |
timestamp = time.time() | timestamp = now = time.time() | def validate(self): """ Validate filter condition (template method). """ super(TimeFilter, self).validate() timestamp = time.time() | 66ffaac957103fefa1835e46aac39a897a44e302 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4865/66ffaac957103fefa1835e46aac39a897a44e302/matching.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
12,
2890,
4672,
3536,
3554,
1034,
2269,
261,
3202,
707,
2934,
3536,
2240,
12,
950,
1586,
16,
365,
2934,
5662,
1435,
2858,
273,
813,
18,
957,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
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,
1954,
12,
2890,
4672,
3536,
3554,
1034,
2269,
261,
3202,
707,
2934,
3536,
2240,
12,
950,
1586,
16,
365,
2934,
5662,
1435,
2858,
273,
813,
18,
957,
1435,
2,
-100,
-100,
-100,
-100,
-100,
... |
which sends p[k] to a*p[k]. | which sends $p[k]$ to $a*p[k]$. | def theta(self,a): """ Returns the image of self under the theta automorphism which sends p[k] to a*p[k]. | 1ce5975ac0edfffc07f38897106680e9de837e56 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/1ce5975ac0edfffc07f38897106680e9de837e56/sfa.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7338,
12,
2890,
16,
69,
4672,
3536,
2860,
326,
1316,
434,
365,
3613,
326,
7338,
18472,
7657,
6228,
1492,
9573,
293,
63,
79,
65,
358,
279,
14,
84,
63,
79,
8009,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7338,
12,
2890,
16,
69,
4672,
3536,
2860,
326,
1316,
434,
365,
3613,
326,
7338,
18472,
7657,
6228,
1492,
9573,
293,
63,
79,
65,
358,
279,
14,
84,
63,
79,
8009,
2,
-100,
-100,
-100,
-... |
intState.addEvent(event) | if event is not None: intState.addEvent(event) | def removeInterest(self, handle, event=None): """ Stop looking in a (set of) zone(s) """ assert DoInterestManager.notify.debugCall() existed = False if DoInterestManager._interests.has_key(handle): existed = True intState = DoInterestManager._interests[handle] if intState.isPendingDelete(): self.notify.warning( 'removeInterest: interest %s already pending removal' % handle) else: if len(intState.events) > 0: # we're not pending a removal, but we have outstanding events? # probably we are waiting for an add/alter complete. # should we send those events now? self.notify.warning('removeInterest: abandoning events: %s' % intState.events) intState.clearEvents() scopeId = self._getNextScopeId() intState.state = InterestState.StatePendingDel intState.scope = scopeId intState.addEvent(event) if self.InterestDebug: print 'INTEREST DEBUG: removeInterest(): handle=%s, event=%s' % ( handle, event) self._sendRemoveInterest(handle, scopeId) if event is None: self._considerRemoveInterest(handle) else: DoInterestManager.notify.warning( "removeInterest: handle not found: %s" % (handle)) assert self.printInterestsIfDebug() return existed | aa781796713466b23329a4684d8945891f58a2ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/aa781796713466b23329a4684d8945891f58a2ef/DoInterestManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
29281,
12,
2890,
16,
1640,
16,
871,
33,
7036,
4672,
3536,
5131,
7849,
316,
279,
261,
542,
434,
13,
4157,
12,
87,
13,
3536,
1815,
2256,
29281,
1318,
18,
12336,
18,
4148,
1477,
143... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
29281,
12,
2890,
16,
1640,
16,
871,
33,
7036,
4672,
3536,
5131,
7849,
316,
279,
261,
542,
434,
13,
4157,
12,
87,
13,
3536,
1815,
2256,
29281,
1318,
18,
12336,
18,
4148,
1477,
143... |
Takes the direct product of the permutation groups listed in P. | Takes the direct product of the permutation groups listed in ``P``. | def direct_product_permgroups(P): """ Takes the direct product of the permutation groups listed in P. EXAMPLES:: sage: G1 = AlternatingGroup([1,2,4,5]) sage: G2 = AlternatingGroup([3,4,6,7]) sage: D = direct_product_permgroups([G1,G2,G1]) sage: D.order() 1728 sage: D = direct_product_permgroups([G1]) sage: D==G1 True sage: direct_product_permgroups([]) Symmetric group of order 1! as a permutation group """ from permgroup_named import SymmetricGroup n = len(P) if n == 0: return SymmetricGroup(1) if n == 1: return P[0] G = [H._gap_init_() for H in P] Glist = "" for H in G: Glist = Glist + H + "," cmd = "G:=DirectProduct([" + Glist[:-1] + "])" gap.eval(cmd) return PermutationGroup(gap_group=gap.eval("G")) | 2d077a3331069892dd585070aa02c876686672d2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/2d077a3331069892dd585070aa02c876686672d2/permgroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2657,
67,
5896,
67,
12160,
4650,
12,
52,
4672,
3536,
23004,
326,
2657,
3017,
434,
326,
17440,
3252,
12889,
316,
12176,
52,
68,
8338,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
611,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2657,
67,
5896,
67,
12160,
4650,
12,
52,
4672,
3536,
23004,
326,
2657,
3017,
434,
326,
17440,
3252,
12889,
316,
12176,
52,
68,
8338,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
611,... |
glPushName(0) | def finish(): """\ Finish sorting - objects recorded since "start" will be sorted and invoked now. """ if TEST_PYREX_OPENGL: quux.shapeRendererInit() # print "VBO %s enabled" % (('is not', 'is')[quux.shapeRendererGetInteger(quux.IS_VBO_ENABLED)]) quux.shapeRendererSetUseDynamicLOD(0) quux.shapeRendererStartDrawing() quux.shapeRendererSetStaticLODLevels(ColorSorter.sphereLevel, 1) ColorSorter._cur_shapelist.draw() quux.shapeRendererFinishDrawing() ColorSorter.sorting = False | 7997651af53055a7ee71653f664cfd1ce78a79ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/7997651af53055a7ee71653f664cfd1ce78a79ad/drawer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
13332,
3536,
64,
18560,
9602,
300,
2184,
16421,
3241,
315,
1937,
6,
903,
506,
3115,
471,
8187,
2037,
18,
3536,
309,
22130,
67,
16235,
862,
60,
67,
11437,
11261,
30,
719,
2616,
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,
4076,
13332,
3536,
64,
18560,
9602,
300,
2184,
16421,
3241,
315,
1937,
6,
903,
506,
3115,
471,
8187,
2037,
18,
3536,
309,
22130,
67,
16235,
862,
60,
67,
11437,
11261,
30,
719,
2616,
18,
... | |
report += "{{{\n%s}}}\n" % logContents | report += "{{{\n%s}}}\n" % stringify(logContents) | def readLog(logFile, logName="Log"): try: f = open(logFile, "rt") logContents = "%s\n---\n" % logName logContents += f.read() f.close() except KeyboardInterrupt: raise except: logContents = '' return logContents | edd57b6800e81f5015cf404b78349b0e58c32817 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12354/edd57b6800e81f5015cf404b78349b0e58c32817/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
1343,
12,
1330,
812,
16,
613,
461,
1546,
1343,
6,
4672,
775,
30,
284,
273,
1696,
12,
1330,
812,
16,
315,
3797,
7923,
613,
6323,
273,
2213,
87,
64,
82,
6062,
64,
82,
6,
738,
61... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1343,
12,
1330,
812,
16,
613,
461,
1546,
1343,
6,
4672,
775,
30,
284,
273,
1696,
12,
1330,
812,
16,
315,
3797,
7923,
613,
6323,
273,
2213,
87,
64,
82,
6062,
64,
82,
6,
738,
61... |
if options["Tokenizer", "reduce_habeas_headers"]: | if options["Tokenizer", "X-reduce_habeas_headers"]: | def tokenize_headers(self, msg): # Special tagging of header lines and MIME metadata. | edd8acc4c28a64560a2e951f80e71ad2d76bdd2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/edd8acc4c28a64560a2e951f80e71ad2d76bdd2c/tokenizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13672,
67,
2485,
12,
2890,
16,
1234,
4672,
468,
13409,
1047,
1998,
434,
1446,
2362,
471,
13195,
1982,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13672,
67,
2485,
12,
2890,
16,
1234,
4672,
468,
13409,
1047,
1998,
434,
1446,
2362,
471,
13195,
1982,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print "Match %s (x=%d): %s" % (repr(text[min(0, x-8):x+8]), x, | print "Match %s (x=%d): %s" % (repr(text[max(0, x-8):x+8]), x, | def __call__(self, text, x, end): print "Match %s (x=%d): %s" % (repr(text[min(0, x-8):x+8]), x, repr(self.msg)) return x | 99a899fc9f3d6c1dff8b2d511371fda4d88219f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/99a899fc9f3d6c1dff8b2d511371fda4d88219f3/Generate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
977,
16,
619,
16,
679,
4672,
1172,
315,
2060,
738,
87,
261,
92,
5095,
72,
4672,
738,
87,
6,
738,
261,
12715,
12,
955,
63,
1896,
12,
20,
16,
619,
17,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
977,
16,
619,
16,
679,
4672,
1172,
315,
2060,
738,
87,
261,
92,
5095,
72,
4672,
738,
87,
6,
738,
261,
12715,
12,
955,
63,
1896,
12,
20,
16,
619,
17,
... |
print '** Readline:',self, `rv` | def readline(self): import string while not '\n' in self.buf: new = self.sock.recv(0x7fffffff) if not new: break self.buf = self.buf + new if not '\n' in self.buf: rv = self.buf self.buf = '' else: i = string.index(self.buf, '\n') rv = self.buf[:i+1] self.buf = self.buf[i+1:] print '** Readline:',self, `rv` return rv | 107fdd473d1f82a175b8b399d44d4457d919e73a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/107fdd473d1f82a175b8b399d44d4457d919e73a/socket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12023,
12,
2890,
4672,
1930,
533,
1323,
486,
2337,
82,
11,
316,
365,
18,
4385,
30,
394,
273,
365,
18,
15031,
18,
18334,
12,
20,
92,
27,
18217,
74,
13,
309,
486,
394,
30,
898,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12023,
12,
2890,
4672,
1930,
533,
1323,
486,
2337,
82,
11,
316,
365,
18,
4385,
30,
394,
273,
365,
18,
15031,
18,
18334,
12,
20,
92,
27,
18217,
74,
13,
309,
486,
394,
30,
898,
365,
... | |
afficheclefs.ajoute_ligne(self, "100%", "1", "10", "7") | afficheclefs.ajoute_ligne(self, "100%", "1", "10", "7") | def f_longueur_base_to_form(self, enreg, penreg = None) : afficheclefs.ajoute_ligne(self, "100%", "1", "10", "7") self.__doc__.push() afficheclefs.champ_saisie(self, "f_longueur", "L", 3, 20, "Dimensions", enreg, penreg) | 01e92b4703465db94574486bad2c3ec0cc085dd0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6029/01e92b4703465db94574486bad2c3ec0cc085dd0/faune.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
67,
5748,
344,
295,
67,
1969,
67,
869,
67,
687,
12,
2890,
16,
570,
1574,
16,
14264,
1574,
273,
599,
13,
294,
7103,
1354,
557,
298,
2556,
18,
4365,
2571,
67,
80,
724,
73,
12,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
67,
5748,
344,
295,
67,
1969,
67,
869,
67,
687,
12,
2890,
16,
570,
1574,
16,
14264,
1574,
273,
599,
13,
294,
7103,
1354,
557,
298,
2556,
18,
4365,
2571,
67,
80,
724,
73,
12,
2... |
ms[key]) | value) | def setMilestoneList(self, m, key): """Remove all milestones, set them to `m`""" if self.hasTickets(): raise Exception("Will not modify database with existing tickets!") c = self.db().cursor() c.execute("""DELETE FROM milestone""") for ms in m: print "inserting milestone ", ms[key] c.execute("""INSERT INTO milestone (name) VALUES (%s)""", ms[key]) self.db().commit() | bdf7574edc4cb2b55e7db1424e146142fbbbc08d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/bdf7574edc4cb2b55e7db1424e146142fbbbc08d/sourceforge2trac.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15430,
18270,
682,
12,
2890,
16,
312,
16,
498,
4672,
3536,
3288,
777,
312,
14849,
5322,
16,
444,
2182,
358,
1375,
81,
68,
8395,
309,
365,
18,
5332,
6264,
2413,
13332,
1002,
1185,
2932,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15430,
18270,
682,
12,
2890,
16,
312,
16,
498,
4672,
3536,
3288,
777,
312,
14849,
5322,
16,
444,
2182,
358,
1375,
81,
68,
8395,
309,
365,
18,
5332,
6264,
2413,
13332,
1002,
1185,
2932,
... |
results = self.query(event_id=event_id) | results = self.query(event_id=id) | def get(self, id): """Return a setlist with the given ``id``. | 50f881b07c8e9327fcfe56bf57ece2429b6b881e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13822/50f881b07c8e9327fcfe56bf57ece2429b6b881e/query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
612,
4672,
3536,
990,
279,
444,
1098,
598,
326,
864,
12176,
350,
68,
8338,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
612,
4672,
3536,
990,
279,
444,
1098,
598,
326,
864,
12176,
350,
68,
8338,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if not name or ihatexml.nonXmlBMPRegexp.search(name): | if not name or ihatexml.nonXmlBMPRegexp.search(name) or name[0] == '"': | def insertDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] | e8b6742946260f3f4d11cc614d8b267b4bee04ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4487/e8b6742946260f3f4d11cc614d8b267b4bee04ac/etree_lxml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2243,
3244,
12387,
12,
2890,
16,
1147,
4672,
508,
273,
1147,
9614,
529,
11929,
1071,
548,
273,
1147,
9614,
482,
548,
11929,
30083,
273,
1147,
9614,
4299,
548,
11929,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
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,
2243,
3244,
12387,
12,
2890,
16,
1147,
4672,
508,
273,
1147,
9614,
529,
11929,
1071,
548,
273,
1147,
9614,
482,
548,
11929,
30083,
273,
1147,
9614,
4299,
548,
11929,
2,
-100,
-100,
-100,
... |
Tag.objects.update_tags(instance, value) | if instance._get_pk_val() is None: setattr(instance, "__%s_save_defered_tags" % self.name, value) else: Tag.objects.update_tags(instance, value) | def __set__(self, instance, value): """ Set an object's tags. """ if instance is None: raise AttributeError("%s can only be set on instances." % self.name) Tag.objects.update_tags(instance, value) | 84f3c701976f0dbf0c11f0c22fd1ff64aeba6ddf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4290/84f3c701976f0dbf0c11f0c22fd1ff64aeba6ddf/fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
972,
12,
2890,
16,
791,
16,
460,
4672,
3536,
1000,
392,
733,
1807,
2342,
18,
3536,
309,
791,
353,
599,
30,
1002,
6394,
27188,
87,
848,
1338,
506,
444,
603,
3884,
1199,
738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
972,
12,
2890,
16,
791,
16,
460,
4672,
3536,
1000,
392,
733,
1807,
2342,
18,
3536,
309,
791,
353,
599,
30,
1002,
6394,
27188,
87,
848,
1338,
506,
444,
603,
3884,
1199,
738,
... |
user,pw = self.passwd.find_user_password(realm, host) | user, pw = self.passwd.find_user_password(realm, req.get_full_url()) | def retry_http_basic_auth(self, host, req, realm): user,pw = self.passwd.find_user_password(realm, host) if pw is not None: raw = "%s:%s" % (user, pw) auth = 'Basic %s' % base64.encodestring(raw).strip() if req.headers.get(self.auth_header, None) == auth: return None req.add_header(self.auth_header, auth) return self.parent.open(req) else: return None | bfa1d5817e0123624ee4d85ca075e5c84453f7c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bfa1d5817e0123624ee4d85ca075e5c84453f7c6/urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3300,
67,
2505,
67,
13240,
67,
1944,
12,
2890,
16,
1479,
16,
1111,
16,
11319,
4672,
565,
729,
16,
8772,
273,
365,
18,
24002,
18,
4720,
67,
1355,
67,
3664,
12,
24056,
16,
1111,
18,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3300,
67,
2505,
67,
13240,
67,
1944,
12,
2890,
16,
1479,
16,
1111,
16,
11319,
4672,
565,
729,
16,
8772,
273,
365,
18,
24002,
18,
4720,
67,
1355,
67,
3664,
12,
24056,
16,
1111,
18,
58... |
self.run_command('SetFile -a V "' + os.path.join(volpath, ".VolumeIcon.icns") + '"') | def package_finish(self): channel_standin = 'Meerkat' # hah, our default channel is not usable on its own if not self.default_channel(): channel_standin = self.channel() | 99fe5351f983748848f048d1e316c03f6977dc77 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4269/99fe5351f983748848f048d1e316c03f6977dc77/viewer_manifest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2181,
67,
13749,
12,
2890,
4672,
1904,
67,
10145,
267,
273,
296,
4667,
264,
79,
270,
11,
225,
468,
366,
9795,
16,
3134,
805,
1904,
353,
486,
15603,
603,
2097,
4953,
309,
486,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2181,
67,
13749,
12,
2890,
4672,
1904,
67,
10145,
267,
273,
296,
4667,
264,
79,
270,
11,
225,
468,
366,
9795,
16,
3134,
805,
1904,
353,
486,
15603,
603,
2097,
4953,
309,
486,
365,
18,
... | |
if self.pid and self.paused: os.kill(self.pid, signal.SIGCONT) print "continued hatari with PID %d" % self.pid self.paused = False | return self.send_message("hatari-cont\n") | def unpause(self): if self.pid and self.paused: os.kill(self.pid, signal.SIGCONT) print "continued hatari with PID %d" % self.pid self.paused = False | 4fa40d0fa53f566e2da9a25725626441b833727b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8501/4fa40d0fa53f566e2da9a25725626441b833727b/hatari-console.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
19476,
12,
2890,
4672,
327,
365,
18,
4661,
67,
2150,
2932,
76,
8761,
77,
17,
1213,
64,
82,
7923,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
19476,
12,
2890,
4672,
327,
365,
18,
4661,
67,
2150,
2932,
76,
8761,
77,
17,
1213,
64,
82,
7923,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.assertEqual(actual,desired) def base_test_lines(self,lines): gc = agg.GraphicsContextArray((100,100)) | self.assertEqual(actual, desired) def base_lines(self, lines): gc = agg.GraphicsContextArray((100, 100)) | def test_add_path(self): path1 = agg.CompiledPath() path1.move_to(1.0,1.0) path1.translate_ctm(1.0,1.0) path1.line_to(2.0,2.0) #actually (3.0,3.0) path1.scale_ctm(2.0,2.0) path1.line_to(2.0,2.0) # actually (5.0,5.0) | e47282ce7056af747cbd7b863b37854c3c1dd9d6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13166/e47282ce7056af747cbd7b863b37854c3c1dd9d6/graphics_context_test_case.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1289,
67,
803,
12,
2890,
4672,
589,
21,
273,
10421,
18,
20733,
743,
1435,
589,
21,
18,
8501,
67,
869,
12,
21,
18,
20,
16,
21,
18,
20,
13,
589,
21,
18,
13929,
67,
299,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1289,
67,
803,
12,
2890,
4672,
589,
21,
273,
10421,
18,
20733,
743,
1435,
589,
21,
18,
8501,
67,
869,
12,
21,
18,
20,
16,
21,
18,
20,
13,
589,
21,
18,
13929,
67,
299,
8... |
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 | b925602f169d47270a064cf9eb03e21706ed25c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b925602f169d47270a064cf9eb03e21706ed25c3/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... |
ligolwSqliteNode = ligolw_sqlite_node(ligolwSqliteJob, dag, database, "S5_HM_INJ*"+type+"*"+cat+"*.xml.gz", p_node=[ligolwThincaToCoincNode], replace=True) ligolwSqliteNode2 = ligolw_sqlite_node(ligolwSqliteJob, dag, database, url, p_node=[ligolwSqliteNode], replace=True) sqliteNodeSimplify = sqlite_node(sqliteJob, dag, database, string.strip(cp.get('input',"simplify")), p_node=[ligolwSqliteNode2]) sqliteNodeRemoveH1H2 = sqlite_node(sqliteJob, dag, database, string.strip(cp.get('input',"remove_h1h2")),p_node=[sqliteNodeSimplify]) sqliteNodeCluster = sqlite_node(sqliteJob, dag, database, string.strip(cp.get('input',"cluster")),p_node=[sqliteNodeRemoveH1H2]) ligolwSqliteNode3 = ligolw_sqlite_node(ligolwSqliteJob, dag, database, database+".xml.gz", p_node=[sqliteNodeCluster], replace=False, extract=True) ligolwInspinjfindNode = ligolw_inspinjfind_node(ligolwInspinjfindJob, dag, database+".xml.gz", p_node=[ligolwSqliteNode3]) ligolwSqliteNode4 = ligolw_sqlite_node(ligolwSqliteJob, dag, database, database+".xml.gz", p_node=[ligolwInspinjfindNode], replace=True) | ligolwSqliteNode = ligolw_sqlite_node(ligolwSqliteJob, dag, database, "S5_HM_INJ*"+type+"*"+cat+"*.xml.gz",id, p_node=[ligolwThincaToCoincNode], replace=True) ligolwSqliteNode2 = ligolw_sqlite_node(ligolwSqliteJob, dag, database, url, id, p_node=[ligolwSqliteNode], replace=True) sqliteNodeSimplify = sqlite_node(sqliteJob, dag, database, string.strip(cp.get('input',"simplify")), id, p_node=[ligolwSqliteNode2]) sqliteNodeRemoveH1H2 = sqlite_node(sqliteJob, dag, database, string.strip(cp.get('input',"remove_h1h2")),id, p_node=[sqliteNodeSimplify]) sqliteNodeCluster = sqlite_node(sqliteJob, dag, database, string.strip(cp.get('input',"cluster")),id, p_node=[sqliteNodeRemoveH1H2]) ligolwSqliteNode3 = ligolw_sqlite_node(ligolwSqliteJob, dag, database, database+".xml.gz", id, p_node=[sqliteNodeCluster], replace=False, extract=True) ligolwInspinjfindNode = ligolw_inspinjfind_node(ligolwInspinjfindJob, dag, database+".xml.gz", id, p_node=[ligolwSqliteNode3]) ligolwSqliteNode4 = ligolw_sqlite_node(ligolwSqliteJob, dag, database, database+".xml.gz", id, p_node=[ligolwInspinjfindNode], replace=True) | def ifo_seg_dict(cp): out = {} out["H1"] = string.strip(cp.get('input','h1vetosegments')) out["H2"] = string.strip(cp.get('input','h2vetosegments')) out["L1"] = string.strip(cp.get('input','l1vetosegments')) return out | fa84b2dcea9c56113a7d87c49ee290301ff67aba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/fa84b2dcea9c56113a7d87c49ee290301ff67aba/highmass_post_process.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21479,
67,
5680,
67,
1576,
12,
4057,
4672,
596,
273,
2618,
596,
9614,
44,
21,
11929,
273,
533,
18,
6406,
12,
4057,
18,
588,
2668,
2630,
17023,
76,
21,
90,
278,
2584,
75,
1346,
26112,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21479,
67,
5680,
67,
1576,
12,
4057,
4672,
596,
273,
2618,
596,
9614,
44,
21,
11929,
273,
533,
18,
6406,
12,
4057,
18,
588,
2668,
2630,
17023,
76,
21,
90,
278,
2584,
75,
1346,
26112,
... |
filename = EasyDialogs.AskFileForOpen(message='Select file with aeut/aete resource:') | filename = EasyDialogs.AskFileForOpen( message='Select scriptable application', dialogOptionFlags=0x1056) | def main(): if len(sys.argv) > 1: for filename in sys.argv[1:]: processfile(filename) else: filename = EasyDialogs.AskFileForOpen(message='Select file with aeut/aete resource:') if not filename: sys.exit(0) processfile(filename) | fa1bf1c518528ae8ec9b24ce452edc930ec80a7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fa1bf1c518528ae8ec9b24ce452edc930ec80a7d/gensuitemodule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
309,
562,
12,
9499,
18,
19485,
13,
405,
404,
30,
364,
1544,
316,
2589,
18,
19485,
63,
21,
30,
14542,
1207,
768,
12,
3459,
13,
469,
30,
225,
1544,
273,
29442,
11885,
14072,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
309,
562,
12,
9499,
18,
19485,
13,
405,
404,
30,
364,
1544,
316,
2589,
18,
19485,
63,
21,
30,
14542,
1207,
768,
12,
3459,
13,
469,
30,
225,
1544,
273,
29442,
11885,
14072,... |
traceback.print_exc() print "Exception: %s" % detail command_result = False | connection_result = False command_output = detail | def attemptConnection(hostname, username, password, timeout=30, command=False, local_filepath=False, remote_filepath='/tmp/', execute=False, remove=False, sudo=False, run_as='root'): """Attempt to login to 'hostname' using 'username'/'password' and execute 'command'. Will excute the command via sudo if 'sudo' is set to True (as root by default) and optionally as a given user (run_as). Returns the command output if everything connected and ran successfully. Returns False if connecting was unsuccessful or an exception was encountered.""" debug("attemptConnection(%s, %s, <password>, %s, %s, %s, %s, %s, %s, %s, %s)" % (hostname, username, timeout, command, local_filepath, remote_filepath, execute, remove, sudo, run_as)) command_result = True # TODO: Add stderr handling if hostname != "": try: ssh = paramikoConnect(hostname, username, password, timeout) if local_filepath: sftpPut(ssh, local_filepath, remote_filepath) if execute: debug("Executing %s on %s" % (filename, hostname)) stdin, stdout, stderr = ssh.exec_command("chmod a+x %s" % remote_filepath) # Make it executable (a+x in case we run as another user via sudo) if sudo: stdout, stderr = sudoExecute(transport=ssh, command=command, password=password, run_as=run_as) else: stdin, stdout, stderr = ssh.exec_command(remote_filepath) command_result = stdout.readlines() if remove: ssh.exec_command("rm -f %s" % remote_filepath) if command: if sudo: stdout, stderr = sudoExecute(transport=ssh, command=command, password=password, run_as=run_as) else: stdin, stdout, stderr = ssh.exec_command(command) command_result = stdout.readlines() elif command is False and execute is False: # If we're not given anything to execute run the uptime command to make sure that we can execute *something* stdin, stdout, stderr = ssh.exec_command('uptime') command_result = stdout.readlines() ssh.close() command_result = "".join(command_result) command_result = normalizeString(command_result) except Exception, detail: # Connection failed traceback.print_exc() print "Exception: %s" % detail command_result = False ssh.close() return command_result | af991bd779b6fc6a4e78f3728de9053171539741 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11566/af991bd779b6fc6a4e78f3728de9053171539741/sshpt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4395,
1952,
12,
10358,
16,
2718,
16,
2201,
16,
2021,
33,
5082,
16,
1296,
33,
8381,
16,
1191,
67,
10561,
33,
8381,
16,
2632,
67,
10561,
2218,
19,
5645,
19,
2187,
1836,
33,
8381,
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,
4395,
1952,
12,
10358,
16,
2718,
16,
2201,
16,
2021,
33,
5082,
16,
1296,
33,
8381,
16,
1191,
67,
10561,
33,
8381,
16,
2632,
67,
10561,
2218,
19,
5645,
19,
2187,
1836,
33,
8381,
16,
1... |
self._code_lines.append(line) | self._code_lines.append(" %s" % line) | def _print_traceback(self, exctype, value, tb, limit=100): """Print up to limit stack trace entries from traceback.""" | cba23ac8fc30e86fcad2eb63feca0b243426f56d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12852/cba23ac8fc30e86fcad2eb63feca0b243426f56d/debug.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1188,
67,
21696,
12,
2890,
16,
431,
12387,
16,
460,
16,
8739,
16,
1800,
33,
6625,
4672,
3536,
5108,
731,
358,
1800,
2110,
2606,
3222,
628,
10820,
12123,
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,
1188,
67,
21696,
12,
2890,
16,
431,
12387,
16,
460,
16,
8739,
16,
1800,
33,
6625,
4672,
3536,
5108,
731,
358,
1800,
2110,
2606,
3222,
628,
10820,
12123,
2,
-100,
-100,
-100,
-100,
... |
return getMultiAdapter((self(query), self.request), name='display_query_results')( | return getMultiAdapter((self(query), self.request), name='display_query_results')( | def html_results(self, query): options = dict(original_context=self.context) return getMultiAdapter((self(query), self.request), name='display_query_results')( **options) | 1f8f238b38c60ad64c7bf841c36e4aba6eb1ec4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12192/1f8f238b38c60ad64c7bf841c36e4aba6eb1ec4a/querybuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
67,
4717,
12,
2890,
16,
843,
4672,
702,
273,
2065,
12,
8830,
67,
2472,
33,
2890,
18,
2472,
13,
327,
31863,
4216,
12443,
2890,
12,
2271,
3631,
365,
18,
2293,
3631,
508,
2218,
5417... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
67,
4717,
12,
2890,
16,
843,
4672,
702,
273,
2065,
12,
8830,
67,
2472,
33,
2890,
18,
2472,
13,
327,
31863,
4216,
12443,
2890,
12,
2271,
3631,
365,
18,
2293,
3631,
508,
2218,
5417... |
def parsestr(self, text): return self.parse(StringIO(text)) | def parsestr(self, text, headersonly=0): return self.parse(StringIO(text), headersonly=headersonly) | def parsestr(self, text): return self.parse(StringIO(text)) | a181f481971a60b4af42c0324ef552dcdb7800e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a181f481971a60b4af42c0324ef552dcdb7800e3/Parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8940,
313,
12,
2890,
16,
977,
4672,
327,
365,
18,
2670,
12,
780,
4294,
12,
955,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8940,
313,
12,
2890,
16,
977,
4672,
327,
365,
18,
2670,
12,
780,
4294,
12,
955,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for sopt in option._short_opts: opts.append(sopt + metavar) for lopt in option._long_opts: opts.append(lopt + "=" + metavar) else: for opt in option._short_opts + option._long_opts: opts.append(opt) | short_opts = [sopt + metavar for sopt in option._short_opts] long_opts = [lopt + "=" + metavar for lopt in option._long_opts] else: short_opts = option._short_opts long_opts = option._long_opts if self.short_first: opts = short_opts + long_opts else: opts = long_opts + short_opts | def format_option_strings_short_first (self, option): opts = [] # list of "-a" or "--foo=FILE" strings takes_value = option.takes_value() if takes_value: metavar = option.metavar or option.dest.upper() for sopt in option._short_opts: opts.append(sopt + metavar) for lopt in option._long_opts: opts.append(lopt + "=" + metavar) else: for opt in option._short_opts + option._long_opts: opts.append(opt) return ", ".join(opts) | 05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
3482,
67,
10219,
67,
6620,
67,
3645,
261,
2890,
16,
1456,
4672,
1500,
273,
5378,
15604,
468,
666,
434,
3701,
69,
6,
578,
5238,
11351,
33,
3776,
6,
2064,
5530,
67,
1132,
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,
3482,
67,
10219,
67,
6620,
67,
3645,
261,
2890,
16,
1456,
4672,
1500,
273,
5378,
15604,
468,
666,
434,
3701,
69,
6,
578,
5238,
11351,
33,
3776,
6,
2064,
5530,
67,
1132,
273,
... |
print method.__name__ + `args` | if verbose: print method.__name__ + `args` if not simulate: method(*args) | def main(): try: opts, args = getopt.gnu_getopt(sys.argv[1:], 'u:g:sh', ['uid-map=', 'gid-map=', 'simulate']) except getopt.GetoptError, e: usage(e) simulate = False uidmap = IdMap() gidmap = IdMap() for opt, val in opts: if opt in ('-u', '--uid-map'): uidmap = IdMap.fromline(val) elif opt in ('-g', '--gid-map'): gidmap = IdMap.fromline(val) elif opt in ('-s', '--simulate'): simulate = True else: usage() if len(args) < 1: usage() delta = args[0] paths = args[1:] print `(uidmap, gidmap, delta, paths, simulate)` changes = parse_delta(delta) if paths: pathmap = dirindex.PathMap(paths) changes = [ change for change in parse_delta(delta) if pathmap.is_included(change.path) ] for method, args in fixstat(changes, uidmap, gidmap): print method.__name__ + `args` | c0f6757ae081f2bce8dabdd35281a15eeec3d045 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10616/c0f6757ae081f2bce8dabdd35281a15eeec3d045/cmd_fixstat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
1600,
89,
67,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
296,
89,
30,
75,
30,
674,
2187,
10228,
1911,
17,
1458,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
1600,
89,
67,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
296,
89,
30,
75,
30,
674,
2187,
10228,
1911,
17,
1458,
33,
... |
self.log.info( "Removing dir %s" % dirTpSyncTo ) | self.log.info( "Removing dir %s" % dirToSyncTo ) | def syncDir( self, bundleID, dirToSyncTo ): dirCreated = False if not os.path.isdir( dirToSyncTo ): self.log.info( "Creating dir %s" % dirToSyncTo ) os.makedirs( dirToSyncTo ) dirCreated = True currentHash = self.__getHash( bundleID, dirToSyncTo ) self.log.info( "Current hash for bundle %s in dir %s is '%s'" % ( bundleID, dirToSyncTo, currentHash ) ) buff = cStringIO.StringIO() transferClient = self.__getTransferClient() result = transferClient.receiveFile( buff, ( bundleID, currentHash ) ) if not result[ 'OK' ]: self.log.error( "Could not sync dir", result[ 'Message' ] ) if dirCreated: self.log.info( "Removing dir %s" % dirTpSyncTo ) os.unlink( dirToSyncTo ) buff.close() return result newHash = result[ 'Value' ] if newHash == currentHash: self.log.info( "Dir %s was already in sync" % dirToSyncTo ) return S_OK( False ) buff.seek( 0 ) self.log.info( "Synchronizing dir with remote bundle" ) tF = tarfile.open( name = 'dummy', mode = "r:gz", fileobj = buff ) for tarinfo in tF: tF.extract( tarinfo, dirToSyncTo ) tF.close() buff.close() self.__setHash( bundleID, dirToSyncTo, newHash ) self.log.info( "Dir has been synchronized" ) return S_OK( True ) | 62f382d1903dfdc2388f8a4457ba67aeff182bd3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/62f382d1903dfdc2388f8a4457ba67aeff182bd3/BundleDeliveryClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3792,
1621,
12,
365,
16,
3440,
734,
16,
1577,
774,
4047,
774,
262,
30,
1577,
6119,
273,
1083,
309,
486,
1140,
18,
803,
18,
291,
1214,
12,
1577,
774,
4047,
774,
262,
30,
365,
18,
1330... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3792,
1621,
12,
365,
16,
3440,
734,
16,
1577,
774,
4047,
774,
262,
30,
1577,
6119,
273,
1083,
309,
486,
1140,
18,
803,
18,
291,
1214,
12,
1577,
774,
4047,
774,
262,
30,
365,
18,
1330... |
f = function([start, stop, step], out.shape, mode=compile.mode.get_default_mode().excluding('fusion')) | mode = theano.config.mode if mode == 'FAST_COMPILE': mode = 'FAST_RUN' mode = compile.mode.get_mode(mode).excluding('fusion') f = function([start, stop, step], out.shape, mode=mode) | def test_infer_shape(self): start, stop, step = iscalars('start', 'stop', 'step') out = arange(start, stop, step) f = function([start, stop, step], out.shape, mode=compile.mode.get_default_mode().excluding('fusion')) assert len(f.maker.env.toposort())==7 | 056f4fa1fdda37e82070ca1d2da498c234916f97 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/056f4fa1fdda37e82070ca1d2da498c234916f97/test_basic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
25889,
67,
4867,
12,
2890,
4672,
787,
16,
2132,
16,
2235,
273,
353,
3473,
87,
2668,
1937,
2187,
296,
5681,
2187,
296,
4119,
6134,
596,
273,
9660,
12,
1937,
16,
2132,
16,
2235... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
25889,
67,
4867,
12,
2890,
4672,
787,
16,
2132,
16,
2235,
273,
353,
3473,
87,
2668,
1937,
2187,
296,
5681,
2187,
296,
4119,
6134,
596,
273,
9660,
12,
1937,
16,
2132,
16,
2235... |
def setPreview(parent,text): parent.vp.begin() parent.vp.write(text) parent.vp.end() | def isKde(): return 1 def setPreviewWidget(parent): parent.sourcePreview.hide() parent.vp=KHTMLPart (parent.Preview, "HTMLPart", parent.Preview) parent.sourcePreview = parent.vp.view() parent.Preview.layout().addWidget(parent.sourcePreview) def setPreview(parent,text): parent.vp.begin() parent.vp.write(text) parent.vp.end() | def setPreview(parent,text): | 003b98616c9360bcb5917931eb2a3843c60ac796 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2266/003b98616c9360bcb5917931eb2a3843c60ac796/KdeQt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
11124,
12,
2938,
16,
955,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
11124,
12,
2938,
16,
955,
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... |
dep = string.lower(dep) | dep = dep.lower() | def __FindSvcDeps(findName): if type(findName) is pywintypes.UnicodeType: findName = str(findName) dict = {} k = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services") num = 0 while 1: try: svc = win32api.RegEnumKey(k, num) except win32api.error: break num = num + 1 sk = win32api.RegOpenKey(k, svc) try: deps, typ = win32api.RegQueryValueEx(sk, "DependOnService") except win32api.error: deps = () for dep in deps: dep = string.lower(dep) dep_on = dict.get(dep, []) dep_on.append(svc) dict[dep]=dep_on return __ResolveDeps(findName, dict) | 49ceb192567e4a7c306d6d8751099ed3bc98161d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/677/49ceb192567e4a7c306d6d8751099ed3bc98161d/win32serviceutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3125,
17444,
14430,
12,
4720,
461,
4672,
309,
618,
12,
4720,
461,
13,
353,
2395,
91,
474,
989,
18,
16532,
559,
30,
1104,
461,
273,
609,
12,
4720,
461,
13,
2065,
273,
2618,
417,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3125,
17444,
14430,
12,
4720,
461,
4672,
309,
618,
12,
4720,
461,
13,
353,
2395,
91,
474,
989,
18,
16532,
559,
30,
1104,
461,
273,
609,
12,
4720,
461,
13,
2065,
273,
2618,
417,
... |
context = response.context[0] request = context['review_request'] | request = self.getContextVar(response, 'review_request') | def testReviewDetail1(self): """Testing review_detail view (1)""" response = self.client.get('/r/1/') self.assertEqual(response.status_code, 200) | 68436132cbfb1a72c8b6c31673ac62d4c83d91ef /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1600/68436132cbfb1a72c8b6c31673ac62d4c83d91ef/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
9159,
6109,
21,
12,
2890,
4672,
3536,
22218,
10725,
67,
8992,
1476,
261,
21,
15574,
766,
273,
365,
18,
2625,
18,
588,
2668,
19,
86,
19,
21,
2473,
13,
365,
18,
11231,
5812,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
9159,
6109,
21,
12,
2890,
4672,
3536,
22218,
10725,
67,
8992,
1476,
261,
21,
15574,
766,
273,
365,
18,
2625,
18,
588,
2668,
19,
86,
19,
21,
2473,
13,
365,
18,
11231,
5812,
12,
... |
if (not check_intermediate) or len(plist) < 2: | if not check_intermediate: | def __init__(self, master, name, destroy_physically=1, check_intermediate=1): if check_intermediate: path = master._subwidget_name(name) try: path = path[len(master._w)+1:] plist = path.split('.') except: plist = [] | 0e64202fd7e8802fc99fff5243b06ca4602f7f94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0e64202fd7e8802fc99fff5243b06ca4602f7f94/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4171,
16,
508,
16,
5546,
67,
844,
1900,
6478,
33,
21,
16,
866,
67,
2761,
6785,
33,
21,
4672,
309,
866,
67,
2761,
6785,
30,
589,
273,
4171,
6315,
1717,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4171,
16,
508,
16,
5546,
67,
844,
1900,
6478,
33,
21,
16,
866,
67,
2761,
6785,
33,
21,
4672,
309,
866,
67,
2761,
6785,
30,
589,
273,
4171,
6315,
1717,
... |
maps = [x.strip('.bsp') for x in files if splitext(x)[1] == '.bsp'] | maps = [x[:-4] for x in files if splitext(x)[1] == '.bsp'] | def getMapList(): # Check to make sure the value of "gg_map_vote" is 1-4 if int(gg_map_vote_list_source) not in range(1, 5): raise ValueError('"gg_map_vote_list_source" must be 1-4: current ' + 'value "%s"' % int(gg_map_vote)) # Check the maps directory for a list of all maps (option 4) if int(gg_map_vote_list_source) == 4: files = listdir(dict_mapListSource[4]) maps = [x.strip('.bsp') for x in files if splitext(x)[1] == '.bsp'] else: # Check a specific file for a list of all maps (options 1-3) with open(dict_mapListSource[int(gg_map_vote_list_source)], 'r') as f: # Normal list ? if int(gg_map_vote_list_source) != 3: maps = [x.strip() for x in f.readlines() if x.strip() != '' and not x.strip().startswith("//")] # Restriction list ? else: maps = [z[0] for z in [y.replace(' ' * (y.count(' ') - 1), '').split(' ') for y in [x.strip().replace('\t', ' ') for x in f.readlines()] if not (y == '' or y.startswith('/'))] if len(z) == 1 or (int(z[1]) if z[1].isdigit() else 0) <= len(getUseridList('#all'))] # Remove any maps from the list that were voted for previously if int(gg_map_vote_dont_show_last_maps): for map_name in list_lastMaps: if map_name in maps: maps.remove(map_name) # Make sure that the maps list is not empty if not maps: error = 'The map list generated by "gg_map_vote" is empty.' # Could it be do to the restrictions ? if int(gg_map_vote_list_source) == 3: error += (' **You should add more maps or reduce your ' + 'min player restrictions ' + '(Currently: %s).' % dict_mapListSource[3]) # Could it be do to too many last maps ? if int(gg_map_vote_dont_show_last_maps): error += (' **You should reduce ' + 'gg_map_vote_dont_show_last_maps ' + '(File: %s) ' % gg_map_vote_dont_show_last_maps + 'or add more maps.') raise ValueError(error) # Only allow the number of maps as declared by "gg_map_vote_size" if int(gg_map_vote_size): while len(maps) > int(gg_map_vote_size): maps.remove(random.choice(maps)) random.shuffle(maps) return maps | 7c36ffd6dd9b68aa182602729399cd7354efd9cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4555/7c36ffd6dd9b68aa182602729399cd7354efd9cb/gg_map_vote.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15489,
682,
13332,
468,
2073,
358,
1221,
3071,
326,
460,
434,
315,
14253,
67,
1458,
67,
25911,
6,
353,
404,
17,
24,
309,
509,
12,
14253,
67,
1458,
67,
25911,
67,
1098,
67,
3168,
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,
15489,
682,
13332,
468,
2073,
358,
1221,
3071,
326,
460,
434,
315,
14253,
67,
1458,
67,
25911,
6,
353,
404,
17,
24,
309,
509,
12,
14253,
67,
1458,
67,
25911,
67,
1098,
67,
3168,
13,
... |
input_file = file(resolve(input_), 'r') | input_file = codecs.open(resolve(input_), 'r', 'utf-8') | def resolve(*args): return ctxt.resolve(dir_, *args) | 07353c764b331463f596eb1ea6d0f4e7b8e3278d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4547/07353c764b331463f596eb1ea6d0f4e7b8e3278d/shtools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2245,
30857,
1968,
4672,
327,
14286,
18,
10828,
12,
1214,
67,
16,
380,
1968,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2245,
30857,
1968,
4672,
327,
14286,
18,
10828,
12,
1214,
67,
16,
380,
1968,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return (gtz_count, ltz_count) | return (gtz_count, ltz_count, use_tz_var) | def clean(x): if isbytestring(x): x = x.decode(preferred_encoding, 'replace') x.replace(u'\0', '') return x | 359abd5d8ba42a1c572d553a5907481efbc9f80d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/359abd5d8ba42a1c572d553a5907481efbc9f80d/sony_cache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
12,
92,
4672,
309,
353,
3890,
371,
12,
92,
4672,
619,
273,
619,
18,
3922,
12,
23616,
67,
5999,
16,
296,
2079,
6134,
619,
18,
2079,
12,
89,
8314,
20,
2187,
28707,
327,
619,
2,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
12,
92,
4672,
309,
353,
3890,
371,
12,
92,
4672,
619,
273,
619,
18,
3922,
12,
23616,
67,
5999,
16,
296,
2079,
6134,
619,
18,
2079,
12,
89,
8314,
20,
2187,
28707,
327,
619,
2,
... |
extdir = join(dirname(abspath(__file__)), "extension") if not isdir(extdir): extdir = join(dirname(dirname(abspath(__file__))), "extension") assert isdir(extdir), "can't find extension" | extdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "extension") if not os.path.isdir(extdir): extdir = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "extension") assert os.path.isdir(extdir), "can't find extension" | def create_extension_dir(): extension_dir = _copy_zipped_extension("chrome-extension.zip") if extension_dir: return extension_dir extension_dir = join(dirname(abspath(__file__)), "chrome-extension.zip") extension_dir = _copy_zipped_extension(extension_dir) if extension_dir: return extension_dir path = mkdtemp() # FIXME: Copied manually extdir = join(dirname(abspath(__file__)), "extension") if not isdir(extdir): extdir = join(dirname(dirname(abspath(__file__))), "extension") assert isdir(extdir), "can't find extension" # shutil.copytree need to create the directory shutil.rmtree(path) shutil.copytree(extdir, path) return path | e2a6ce6a2597c286306a0157793c2088416ad0f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3504/e2a6ce6a2597c286306a0157793c2088416ad0f0/driver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
6447,
67,
1214,
13332,
2710,
67,
1214,
273,
389,
3530,
67,
4450,
1845,
67,
6447,
2932,
343,
10896,
17,
6447,
18,
4450,
7923,
309,
2710,
67,
1214,
30,
327,
2710,
67,
1214,
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,
1,
1,
1,
1,
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,
6447,
67,
1214,
13332,
2710,
67,
1214,
273,
389,
3530,
67,
4450,
1845,
67,
6447,
2932,
343,
10896,
17,
6447,
18,
4450,
7923,
309,
2710,
67,
1214,
30,
327,
2710,
67,
1214,
225,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.