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 |
|---|---|---|---|---|---|---|
invokeLog(cmd, buildLogFile) | invokeLog(cmd, buildLogFile) | def buildAll(self, buildConf): for target in buildConf['targets']: # Prepare log file if ('buildLogDir' in buildConf): if not os.path.isdir(buildConf['buildLogDir']): os.mkdir(buildConf['buildLogDir']) buildLog = os.path.join(buildConf['buildLogDir'], target + '_' + self.startTimeString + '.log') self.log("Opening build log file " + buildLog) buildLogFile = open(buildLog, 'w') # Assemble batbuild command line if (os.path.isabs(buildConf['batbuild'])): cmd = buildConf['batbuild'] else: cmd = os.path.join(self.testConf['qxPathAbs'], buildConf['batbuild']) cmd += " -w " + buildConf['stageDir'] if target[0] == target[0].capitalize(): cmd += " " + buildConf['targets'][target] self.log("Building " + target + "\n " + cmd) | d8067347d13e3b8bd01934f64c3a0e3a3c28c6a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/d8067347d13e3b8bd01934f64c3a0e3a3c28c6a8/qxtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
1595,
12,
2890,
16,
1361,
3976,
4672,
364,
1018,
316,
1361,
3976,
3292,
11358,
3546,
30,
468,
7730,
613,
585,
309,
7707,
3510,
1343,
1621,
11,
316,
1361,
3976,
4672,
309,
486,
1140... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
1595,
12,
2890,
16,
1361,
3976,
4672,
364,
1018,
316,
1361,
3976,
3292,
11358,
3546,
30,
468,
7730,
613,
585,
309,
7707,
3510,
1343,
1621,
11,
316,
1361,
3976,
4672,
309,
486,
1140... |
if sources and sources.first() is not source: | if sources: if sources.first() is source: return | def _setSource(self, source): sources = self.sources if sources and sources.first() is not source: sources.clear() if source is not None: sources.append(source) | a949e2974de9beced59ba528542b688306a3c9fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/a949e2974de9beced59ba528542b688306a3c9fb/collections.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
1830,
12,
2890,
16,
1084,
4672,
5550,
273,
365,
18,
10141,
309,
5550,
30,
309,
5550,
18,
3645,
1435,
353,
1084,
30,
327,
5550,
18,
8507,
1435,
309,
1084,
353,
486,
599,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
1830,
12,
2890,
16,
1084,
4672,
5550,
273,
365,
18,
10141,
309,
5550,
30,
309,
5550,
18,
3645,
1435,
353,
1084,
30,
327,
5550,
18,
8507,
1435,
309,
1084,
353,
486,
599,
30,
... |
algebra system [Rasch03]. | algebra system [Rasch03]_. | def wigner_3j(j_1, j_2, j_3, m_1, m_2, m_3, prec=None): r""" Calculate the Wigner 3j symbol `Wigner3j(j_1,j_2,j_3,m_1,m_2,m_3)`. INPUT: - ``j_1``, ``j_2``, ``j_3``, ``m_1``, ``m_2``, ``m_3`` - integer or half integer - ``prec`` - precision, default: None. Providing a precision can drastically speed up the calculation. OUTPUT: rational number times the square root of a rational number (if prec=None), or real number if a precision is given EXAMPLES:: sage: wigner_3j(2, 6, 4, 0, 0, 0) sqrt(5/143) sage: wigner_3j(2, 6, 4, 0, 0, 1) 0 sage: wigner_3j(0.5, 0.5, 1, 0.5, -0.5, 0) sqrt(1/6) sage: wigner_3j(40, 100, 60, -10, 60, -50) 95608/18702538494885*sqrt(21082735836735314343364163310/220491455010479533763) sage: wigner_3j(2500, 2500, 5000, 2488, 2400, -4888, prec=64) 7.60424456883448589e-12 It is an error to have arguments that are not integer or half integer values:: sage: wigner_3j(2.1, 6, 4, 0, 0, 0) Traceback (most recent call last): ... ValueError: j values must be integer or half integer sage: wigner_3j(2, 6, 4, 1, 0, -1.1) Traceback (most recent call last): ... ValueError: m values must be integer or half integer NOTES: The Wigner 3j symbol obeys the following symmetry rules: - invariant under any permutation of the columns (with the exception of a sign change where `J:=j_1+j_2+j_3`): .. math:: Wigner3j(j_1,j_2,j_3,m_1,m_2,m_3) =Wigner3j(j_3,j_1,j_2,m_3,m_1,m_2) =Wigner3j(j_2,j_3,j_1,m_2,m_3,m_1) =(-1)^J Wigner3j(j_3,j_2,j_1,m_3,m_2,m_1) =(-1)^J Wigner3j(j_1,j_3,j_2,m_1,m_3,m_2) =(-1)^J Wigner3j(j_2,j_1,j_3,m_2,m_1,m_3) - invariant under space inflection, i. e. .. math:: Wigner3j(j_1,j_2,j_3,m_1,m_2,m_3) =(-1)^J Wigner3j(j_1,j_2,j_3,-m_1,-m_2,-m_3) - symmetric with respect to the 72 additional symmetries based on the work by [Regge58] - zero for `j_1`, `j_2`, `j_3` not fulfilling triangle relation - zero for `m_1+m_2+m_3\neq 0` - zero for violating any one of the conditions `j_1\ge|m_1|`, `j_2\ge|m_2|`, `j_3\ge|m_3|` ALGORITHM: This function uses the algorithm of [Edmonds74] to calculate the value of the 3j symbol exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [Rasch03]. REFERENCES: - [Regge58] 'Symmetry Properties of Clebsch-Gordan Coefficients', T. Regge, Nuovo Cimento, Volume 10, pp. 544 (1958) - [Edmonds74] 'Angular Momentum in Quantum Mechanics', A. R. Edmonds, Princeton University Press (1974) - [Rasch03] 'Efficient Storage Scheme for Pre-calculated Wigner 3j, 6j and Gaunt Coefficients', J. Rasch and A. C. H. Yu, SIAM J. Sci. Comput. Volume 25, Issue 4, pp. 1416-1428 (2003) AUTHORS: - Jens Rasch (2009-03-24): initial version """ if int(j_1 * 2) != j_1 * 2 or int(j_2 * 2) != j_2 * 2 or \ int(j_3 * 2) != j_3 * 2: raise ValueError("j values must be integer or half integer") if int(m_1 * 2) != m_1 * 2 or int(m_2 * 2) != m_2 * 2 or \ int(m_3 * 2) != m_3 * 2: raise ValueError("m values must be integer or half integer") if (m_1 + m_2 + m_3 <> 0): return 0 prefid = Integer((-1) ** (int(j_1 - j_2 - m_3))) m_3 = -m_3 a1 = j_1 + j_2 - j_3 if (a1 < 0): return 0 a2 = j_1 - j_2 + j_3 if (a2 < 0): return 0 a3 = -j_1 + j_2 + j_3 if (a3 < 0): return 0 if (abs(m_1) > j_1) or (abs(m_2) > j_2) or (abs(m_3) > j_3): return 0 maxfact = max(j_1 + j_2 + j_3 + 1, j_1 + abs(m_1), j_2 + abs(m_2), \ j_3 + abs(m_3)) _calc_factlist(maxfact) argsqrt = Integer(_Factlist[int(j_1 + j_2 - j_3)] * \ _Factlist[int(j_1 - j_2 + j_3)] * \ _Factlist[int(-j_1 + j_2 + j_3)] * \ _Factlist[int(j_1 - m_1)] * \ _Factlist[int(j_1 + m_1)] * \ _Factlist[int(j_2 - m_2)] * \ _Factlist[int(j_2 + m_2)] * \ _Factlist[int(j_3 - m_3)] * \ _Factlist[int(j_3 + m_3)]) / \ _Factlist[int(j_1 + j_2 + j_3 + 1)] ressqrt = argsqrt.sqrt(prec) if type(ressqrt) is ComplexNumber: ressqrt = ressqrt.real() imin = max(-j_3 + j_1 + m_2, -j_3 + j_2 - m_1, 0) imax = min(j_2 + m_2, j_1 - m_1, j_1 + j_2 - j_3) sumres = 0 for ii in range(imin, imax + 1): den = _Factlist[ii] * \ _Factlist[int(ii + j_3 - j_1 - m_2)] * \ _Factlist[int(j_2 + m_2 - ii)] * \ _Factlist[int(j_1 - ii - m_1)] * \ _Factlist[int(ii + j_3 - j_2 + m_1)] * \ _Factlist[int(j_1 + j_2 - j_3 - ii)] sumres = sumres + Integer((-1) ** ii) / den res = ressqrt * sumres * prefid return res | c6a90d820f57455b2ff6063db98cb5e6f7a11f83 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/c6a90d820f57455b2ff6063db98cb5e6f7a11f83/wigner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
724,
264,
67,
23,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
312,
67,
21,
16,
312,
67,
22,
16,
312,
67,
23,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
724,
264,
67,
23,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
312,
67,
21,
16,
312,
67,
22,
16,
312,
67,
23,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... |
conflict2 = [ x for x in \ otherTrove.getNewFileList() if x[0] == pathId] | files = (otherTrove.getNewFileList() + otherTrove.getChangedFileList()) conflict2 = [ x for x in files if x[0] == pathId] | def merge(self, otherCs): self.files.update(otherCs.files) | d21e30ea1c8ab0bf7c0468473633e966b49d9cbc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/d21e30ea1c8ab0bf7c0468473633e966b49d9cbc/changeset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2691,
12,
2890,
16,
1308,
14272,
4672,
365,
18,
2354,
18,
2725,
12,
3011,
14272,
18,
2354,
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... | [
1,
1,
1,
1,
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,
2691,
12,
2890,
16,
1308,
14272,
4672,
365,
18,
2354,
18,
2725,
12,
3011,
14272,
18,
2354,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
return mask_and_ovr(1) | return mask_and_ovr(1, 'NEAREST') | def mask_15(): return mask_and_ovr(1) | a1e29113b3fa9b8b0a8e8b23a259621ad0ad11df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10289/a1e29113b3fa9b8b0a8e8b23a259621ad0ad11df/mask.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3066,
67,
3600,
13332,
327,
3066,
67,
464,
67,
1527,
86,
12,
21,
16,
296,
5407,
9332,
882,
6134,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3066,
67,
3600,
13332,
327,
3066,
67,
464,
67,
1527,
86,
12,
21,
16,
296,
5407,
9332,
882,
6134,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
"""Test 'frame variable this' aand 'expr this' when stopped inside a constructor.""" | """Test 'frame variable this' and 'expr this' when stopped inside a constructor.""" | def test_with_dwarf_and_expr_parser(self): """Test 'frame variable this' aand 'expr this' when stopped inside a constructor.""" self.buildDwarf() self.class_types_expr_parser() | e334b352f1685142edd6a84f5444cd83ab12c008 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11986/e334b352f1685142edd6a84f5444cd83ab12c008/TestClassTypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1918,
67,
72,
905,
74,
67,
464,
67,
8638,
67,
4288,
12,
2890,
4672,
3536,
4709,
296,
3789,
2190,
333,
11,
471,
296,
8638,
333,
11,
1347,
9627,
4832,
279,
3885,
12123,
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1918,
67,
72,
905,
74,
67,
464,
67,
8638,
67,
4288,
12,
2890,
4672,
3536,
4709,
296,
3789,
2190,
333,
11,
471,
296,
8638,
333,
11,
1347,
9627,
4832,
279,
3885,
12123,
365,
... |
self.rgb_mul_sliders = NSliderBlock(3, [(0, 1000, 500, 'R'), (0, 1000, 500, 'G'), (0, 1000, 500, 'B')], | self.rgb_mul_sliders = NSliderBlock(3, [(0, 1000, 500, 'R', .002), (0, 1000, 500, 'G', .002), (0, 1000, 500, 'B', .002)], | def __init__(self, img, callback): QWidget.__init__(self) | 186eee357ab9a9a1d91f0651f6a9efcffa5aff79 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12573/186eee357ab9a9a1d91f0651f6a9efcffa5aff79/qt_plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3774,
16,
1348,
4672,
2238,
4609,
16186,
2738,
972,
12,
2890,
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,
... | [
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
3774,
16,
1348,
4672,
2238,
4609,
16186,
2738,
972,
12,
2890,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if a.index(-2,-10) != 0: raise TestFailed, 'list index, negative start argument' | if a.index(0,-4) != 2: raise TestFailed, 'list index, -start argument' if a.index(-2,-10) != 0: raise TestFailed, 'list index, very -start argument' | def __getitem__(self, key): return str(key) + '!!!' | 2743d87d7934535f16a0ea062a28c21ea18e5a24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2743d87d7934535f16a0ea062a28c21ea18e5a24/test_types.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
498,
4672,
327,
609,
12,
856,
13,
397,
296,
8548,
5124,
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,
31571,
972,
12,
2890,
16,
498,
4672,
327,
609,
12,
856,
13,
397,
296,
8548,
5124,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
sys.last_type and sys.last_value. The return value is a list of | sys.exc_info()[0] and sys.exc_info()[1]. The return value is a list of | def format_exception_only(etype, value): """Format the exception part of a traceback. The arguments are the exception type and value such as given by sys.last_type and sys.last_value. The return value is a list of strings, each ending in a newline. Normally, the list contains a single string; however, for SyntaxError exceptions, it contains several lines that (when printed) display detailed information about where the syntax error occurred. The message indicating which exception occurred is always the last string in the list. """ # An instance should not have a meaningful value parameter, but # sometimes does, particularly for string exceptions, such as # >>> raise string1, string2 # deprecated # # Clear these out first because issubtype(string1, SyntaxError) # would throw another exception and mask the original problem. if (isinstance(etype, BaseException) or isinstance(etype, types.InstanceType) or etype is None or type(etype) is str): return [_format_final_exc_line(etype, value)] stype = etype.__name__ if not issubclass(etype, SyntaxError): return [_format_final_exc_line(stype, value)] # It was a syntax error; show exactly where the problem was found. lines = [] try: msg, (filename, lineno, offset, badline) = value.args except Exception: pass else: filename = filename or "<string>" lines.append(' File "%s", line %d\n' % (filename, lineno)) if badline is not None: lines.append(' %s\n' % badline.strip()) if offset is not None: caretspace = badline[:offset].lstrip() # non-space whitespace (likes tabs) must be kept for alignment caretspace = ((c.isspace() and c or ' ') for c in caretspace) # only three spaces to account for offset1 == pos 0 lines.append(' %s^\n' % ''.join(caretspace)) value = msg lines.append(_format_final_exc_line(stype, value)) return lines | 85e1478ca412f93e584046b44633283f6241df84 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/85e1478ca412f93e584046b44633283f6241df84/traceback.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
4064,
67,
3700,
12,
5872,
16,
460,
4672,
3536,
1630,
326,
1520,
1087,
434,
279,
10820,
18,
225,
1021,
1775,
854,
326,
1520,
618,
471,
460,
4123,
487,
864,
635,
2589,
18,
10075... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4064,
67,
3700,
12,
5872,
16,
460,
4672,
3536,
1630,
326,
1520,
1087,
434,
279,
10820,
18,
225,
1021,
1775,
854,
326,
1520,
618,
471,
460,
4123,
487,
864,
635,
2589,
18,
10075... |
""" | """ | def fl_glwincreate(config, context, w, h): """ fl_glwincreate(config, context, w, h) -> window """ retval = _fl_glwincreate(config, context, w, h) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
7043,
8082,
2640,
12,
1425,
16,
819,
16,
341,
16,
366,
4672,
3536,
1183,
67,
7043,
8082,
2640,
12,
1425,
16,
819,
16,
341,
16,
366,
13,
317,
2742,
3536,
225,
5221,
273,
389... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
7043,
8082,
2640,
12,
1425,
16,
819,
16,
341,
16,
366,
4672,
3536,
1183,
67,
7043,
8082,
2640,
12,
1425,
16,
819,
16,
341,
16,
366,
13,
317,
2742,
3536,
225,
5221,
273,
389... |
items = (posixpath.join(path, name) for name in obj[path].iternames()) | items = (posixpath.join(path, name) for name in obj[path].iterkeys()) | def h5py_item_completer(context, command): """Compute possible item matches for dict-like objects""" base, item = re_item_match.split(command)[1:4:2] # we don't want to call any functions, but I couldn't find a robust regex # that filtered them without unintended side effects. So keys containing # "(" will not complete. try: assert '(' not in base except AssertionError: raise ValueError() try: obj = eval(base, context.shell.user_ns) except: return [] path, target = posixpath.split(item) if path: items = (posixpath.join(path, name) for name in obj[path].iternames()) else: items = obj.iternames() items = list(items) readline.set_completer_delims(' \t\n`!@#$^&*()=+[{]}\\|;:\'",<>?') return [i for i in items if i[:len(item)] == item] | ff9d4ad29621aa11221063764752bb9fe757ad51 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10380/ff9d4ad29621aa11221063764752bb9fe757ad51/_ipy_completer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
366,
25,
2074,
67,
1726,
67,
832,
17754,
12,
2472,
16,
1296,
4672,
3536,
7018,
3323,
761,
1885,
364,
2065,
17,
5625,
2184,
8395,
225,
1026,
16,
761,
273,
283,
67,
1726,
67,
1916,
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,
366,
25,
2074,
67,
1726,
67,
832,
17754,
12,
2472,
16,
1296,
4672,
3536,
7018,
3323,
761,
1885,
364,
2065,
17,
5625,
2184,
8395,
225,
1026,
16,
761,
273,
283,
67,
1726,
67,
1916,
18,
... |
sage: [24157817, 39088169, 63245986] sage: fibs = fibonacci_range(10, 100) | [14930352, 24157817, 39088169, 63245986] sage: fibs = [i for i in fibonacci_range(10, 100)] | def fibonacci_range(start, stop, algorithm='pari'): r""" Returns an iterator over all of the Fibonacci numbers in the given range from \code{f_n = start} to \code{f_n = stop} EXAMPLES: sage: fibs_in_some_range = [i for i in fibonacci_range(10^7, 10^8)] sage: len(fibs_in_some_range) 3 sage: fibs_in_some_range sage: [24157817, 39088169, 63245986] sage: fibs = fibonacci_range(10, 100) sage: fibs [13, 21, 34, 55, 89] """ from sage.rings.integer_ring import ZZ start = ZZ(start) if stop == None: stop = start start = ZZ(0) else: stop = ZZ(stop) # iterate until we've gotten high enough fn = 0 n = 0 while fn < start: fn = fibonacci(n) print n, fn n += 1 while True: fn = fibonacci(n) n += 1 if fn < stop: yield fn else: return | 52003a02ffe89f107e5076d5270f4e9656e76a90 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/52003a02ffe89f107e5076d5270f4e9656e76a90/combinat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
495,
265,
8981,
77,
67,
3676,
12,
1937,
16,
2132,
16,
4886,
2218,
1065,
77,
11,
4672,
436,
8395,
2860,
392,
2775,
1879,
777,
434,
326,
478,
495,
265,
8981,
77,
5600,
316,
326,
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,
284,
495,
265,
8981,
77,
67,
3676,
12,
1937,
16,
2132,
16,
4886,
2218,
1065,
77,
11,
4672,
436,
8395,
2860,
392,
2775,
1879,
777,
434,
326,
478,
495,
265,
8981,
77,
5600,
316,
326,
8... |
import mox as Mox | import pymox.mox as Mox | def OnTestsLoad(): import sys old_path = sys.path global mox try: directory, _file = os.path.split(__file__) sys.path.append(os.path.abspath(os.path.join(directory, 'pymox'))) sys.path.append(os.path.abspath(os.path.join(directory, '..'))) try: import mox as Mox mox = Mox except ImportError: print "Trying to automatically checkout pymox." import subprocess subprocess.call(['svn', 'co', 'http://pymox.googlecode.com/svn/trunk', os.path.join(directory, 'pymox')], shell=True) try: import mox as Mox mox = Mox except ImportError: print >> sys.stderr, ("\nError, failed to load pymox\n") raise finally: # Restore the path sys.path = old_path | 5602ca4770ac930c207dacfe7034207ada347b2c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6076/5602ca4770ac930c207dacfe7034207ada347b2c/super_mox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
14650,
2563,
13332,
1930,
2589,
1592,
67,
803,
273,
2589,
18,
803,
2552,
312,
2409,
775,
30,
1867,
16,
389,
768,
273,
1140,
18,
803,
18,
4939,
12,
972,
768,
972,
13,
2589,
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,
2755,
14650,
2563,
13332,
1930,
2589,
1592,
67,
803,
273,
2589,
18,
803,
2552,
312,
2409,
775,
30,
1867,
16,
389,
768,
273,
1140,
18,
803,
18,
4939,
12,
972,
768,
972,
13,
2589,
18,
... |
self.max_login_attempts[1] = 0 | self.attempted_logins = 0 | def ftp_PASS(self, line): # TODO - brute force protection: 'freeze'/'sleep' (without blocking the main loop) # PI for a certain amount of time if authentication fails. if not self.username: self.respond("503 Login with USER first") return if self.username == 'anonymous': line = '' if self.authorizer.has_user(self.username): if self.authorizer.validate_authentication(self.username, line): if not self.msg_login: self.respond("230 User %s logged in." %self.username) else: self.push("230-%s\r\n" %self.msg_login) self.respond("230 Welcome.") self.authenticated = True self.max_login_attempts[1] = 0 self.fs.root = self.authorizer.get_home_dir(self.username) self.log("User %s logged in." %self.username) else: self.max_login_attempts[1] += 1 if self.max_login_attempts[0] == self.max_login_attempts[1]: self.log("Maximum login attempts. Disconnecting.") self.respond("530 Maximum login attempts. Disconnecting.") self.close() else: self.respond("530 Authentication failed.") self.username = "" else: if self.username.lower() == 'anonymous': self.respond("530 Anonymous access not allowed.") self.log('Authentication failed: anonymous access not allowed.') else: self.respond("530 Authentication failed.") self.log('Authentication failed: unknown username "%s".' %self.username) self.username = "" | 038a954425a48feb99b246b07f88389b6f601664 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3782/038a954425a48feb99b246b07f88389b6f601664/FTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13487,
67,
10884,
12,
2890,
16,
980,
4672,
468,
2660,
300,
5186,
624,
2944,
17862,
30,
296,
29631,
11,
2473,
19607,
11,
261,
13299,
9445,
326,
2774,
2798,
13,
468,
282,
7024,
364,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13487,
67,
10884,
12,
2890,
16,
980,
4672,
468,
2660,
300,
5186,
624,
2944,
17862,
30,
296,
29631,
11,
2473,
19607,
11,
261,
13299,
9445,
326,
2774,
2798,
13,
468,
282,
7024,
364,
279,
... |
print response | def testPostTVRobustness(self): """ Test that bad json TV syntax fails gracefully, i.e. doesn't kill the server! """ data = """{ "type":"ConceptNode", "name":"SimpleTVMutations", "truthvalue": {"simple": {"str":0.5, "count":10}} }""" import random r = random.Random() for i in range(0,40): data_copy = list(data) data_copy[r.randint(0,len(data)-1)] = ' ' data_copy = ''.join(data_copy) req = urllib2.Request(rest_url + 'atom/',data_copy) response = urllib2.urlopen(req).read() try: result = json.loads(response) except ValueError: print response self.assertEqual(server_process.returncode, None) | 128d92bce497367c7c6ac10d31f07b5bf9b24ef3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10249/128d92bce497367c7c6ac10d31f07b5bf9b24ef3/REST_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3349,
56,
10986,
947,
641,
4496,
12,
2890,
4672,
3536,
7766,
716,
5570,
1163,
399,
58,
6279,
6684,
25063,
16,
277,
18,
73,
18,
3302,
1404,
8673,
326,
1438,
5,
3536,
501,
273,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3349,
56,
10986,
947,
641,
4496,
12,
2890,
4672,
3536,
7766,
716,
5570,
1163,
399,
58,
6279,
6684,
25063,
16,
277,
18,
73,
18,
3302,
1404,
8673,
326,
1438,
5,
3536,
501,
273,
353... | |
self.command_show("busy "+args) | self.command_show("busy "+arg) | def command_busy(self, arg): """ /busy [msg] """ self.command_show("busy "+args) | 32398ba5863d84dead3df954f2f1b6d4fcd49022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9814/32398ba5863d84dead3df954f2f1b6d4fcd49022/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1296,
67,
9274,
93,
12,
2890,
16,
1501,
4672,
3536,
342,
9274,
93,
306,
3576,
65,
3536,
365,
18,
3076,
67,
4500,
2932,
9274,
93,
13773,
1968,
13,
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,
1296,
67,
9274,
93,
12,
2890,
16,
1501,
4672,
3536,
342,
9274,
93,
306,
3576,
65,
3536,
365,
18,
3076,
67,
4500,
2932,
9274,
93,
13773,
1968,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,... |
(cr, uid, {'date_create':time.strftime('%Y-%m-%d %H:%M:%S'),'server_id' : ids[0],'name':_('Please verify Email Server, without verification you can not send Email(s).')}) raise osv.except_osv(_('Server Error!'), _('Please verify Email Server, without verification you can not send Email(s).')) | (cr, uid, {'date_create':time.strftime('%Y-%m-%d %H:%M:%S'),'server_id' : ids[0], 'name':_(error_msg[msg])}) raise osv.except_osv(_('Server Error!'), _(error_msg[msg])) | def test_verify_email(self, cr, uid, ids, toemail, test=False, code=False): serverid = ids[0] self.open_connection(cr, uid, ids, serverid) | f0013a2bab5b38545f27bdafa1ba5cf23c99024c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/f0013a2bab5b38545f27bdafa1ba5cf23c99024c/smtpclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
8705,
67,
3652,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
358,
3652,
16,
1842,
33,
8381,
16,
981,
33,
8381,
4672,
225,
1438,
350,
273,
3258,
63,
20,
65,
365,
18,
3190,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1842,
67,
8705,
67,
3652,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
358,
3652,
16,
1842,
33,
8381,
16,
981,
33,
8381,
4672,
225,
1438,
350,
273,
3258,
63,
20,
65,
365,
18,
3190,
... |
libraries=['gmp']) | libraries=['mpfr','gmp']) | def is_newer(file1, file2): """ Return True if either file2 does not exist or is older than file1. If file1 does not exist, always return False. """ if not os.path.exists(file1): return False if not os.path.exists(file2): return True if os.path.getmtime(file2) < os.path.getmtime(file1): return True return False | d185300fa94d4993679d9ffe751236586d2d8ea0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/d185300fa94d4993679d9ffe751236586d2d8ea0/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
2704,
264,
12,
768,
21,
16,
585,
22,
4672,
3536,
2000,
1053,
309,
3344,
585,
22,
1552,
486,
1005,
578,
353,
12156,
2353,
585,
21,
18,
225,
971,
585,
21,
1552,
486,
1005,
16,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
2704,
264,
12,
768,
21,
16,
585,
22,
4672,
3536,
2000,
1053,
309,
3344,
585,
22,
1552,
486,
1005,
578,
353,
12156,
2353,
585,
21,
18,
225,
971,
585,
21,
1552,
486,
1005,
16,... |
self.close() | self.handle_close() | def handle_read(self): try: self.data = self.data + self.recv(8192) except: print """ | 9eb36b0ba14388c68d42a46c215a4db9e14b59c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10401/9eb36b0ba14388c68d42a46c215a4db9e14b59c4/myth_py_wii.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
896,
12,
2890,
4672,
775,
30,
365,
18,
892,
273,
365,
18,
892,
397,
365,
18,
18334,
12,
28,
15561,
13,
1335,
30,
1172,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1640,
67,
896,
12,
2890,
4672,
775,
30,
365,
18,
892,
273,
365,
18,
892,
397,
365,
18,
18334,
12,
28,
15561,
13,
1335,
30,
1172,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.body.append(node.astext()) | self.body.extend(['\n', node.astext(), '\n']) | def visit_raw(self, node): if node.get('format') == 'lout': self.body.append(node.astext()) # Keep non-Lout raw text out of output: raise nodes.SkipNode | 544440c7f6145f4088ce7ce07b13fae4e87b8570 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/544440c7f6145f4088ce7ce07b13fae4e87b8570/lout.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
1899,
12,
2890,
16,
756,
4672,
309,
756,
18,
588,
2668,
2139,
6134,
422,
296,
14533,
4278,
365,
18,
3432,
18,
14313,
12,
3292,
64,
82,
2187,
756,
18,
689,
408,
9334,
2337,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
1899,
12,
2890,
16,
756,
4672,
309,
756,
18,
588,
2668,
2139,
6134,
422,
296,
14533,
4278,
365,
18,
3432,
18,
14313,
12,
3292,
64,
82,
2187,
756,
18,
689,
408,
9334,
2337,
... |
def task(ident): global running rmutex.acquire() delay = random.random() * numtasks * 0.02 rmutex.release() if verbose: print 'task', ident, 'will run for', round(delay, 2), 'sec' time.sleep(delay) if verbose: print 'task', ident, 'done' mutex.acquire() running = running - 1 if running == 0: done.release() mutex.release() next_ident = 0 def newtask(): global next_ident, running mutex.acquire() next_ident = next_ident + 1 if verbose: print 'creating task', next_ident thread.start_new_thread(task, (next_ident,)) running = running + 1 mutex.release() for i in range(numtasks): newtask() print 'waiting for all tasks to complete' done.acquire() print 'all tasks done' class barrier: def __init__(self, n): self.n = n self.waiting = 0 self.checkin = thread.allocate_lock() self.checkout = thread.allocate_lock() self.checkout.acquire() def enter(self): checkin, checkout = self.checkin, self.checkout checkin.acquire() self.waiting = self.waiting + 1 if self.waiting == self.n: self.waiting = self.n - 1 checkout.release() return checkin.release() checkout.acquire() self.waiting = self.waiting - 1 if self.waiting == 0: checkin.release() return checkout.release() numtrips = 3 def task2(ident): global running for i in range(numtrips): if ident == 0: delay = 0.001 else: rmutex.acquire() delay = random.random() * numtasks * 0.02 rmutex.release() if verbose: print 'task', ident, 'will run for', round(delay, 2), 'sec' time.sleep(delay) if verbose: print 'task', ident, 'entering barrier', i bar.enter() if verbose: print 'task', ident, 'leaving barrier', i mutex.acquire() running -= 1 finished = running == 0 mutex.release() if finished: done.release() print '\n*** Barrier Test ***' if done.acquire(0): raise ValueError, "'done' should have remained acquired" bar = barrier(numtasks) running = numtasks for i in range(numtasks): thread.start_new_thread(task2, (i,)) done.acquire() print 'all tasks done' if hasattr(thread, 'stack_size'): print '\n*** Changing thread stack size ***' if thread.stack_size() != 0: raise ValueError, "initial stack_size not 0" thread.stack_size(0) if thread.stack_size() != 0: raise ValueError, "stack_size not reset to default" from os import name as os_name if os_name in ("nt", "os2", "posix"): tss_supported = 1 try: thread.stack_size(4096) except ValueError: print 'caught expected ValueError setting stack_size(4096)' except thread.error: tss_supported = 0 print 'platform does not support changing thread stack size' if tss_supported: failed = lambda s, e: s != e fail_msg = "stack_size(%d) failed - should succeed" for tss in (262144, 0x100000, 0): thread.stack_size(tss) if failed(thread.stack_size(), tss): raise ValueError, fail_msg % tss print 'successfully set stack_size(%d)' % tss for tss in (262144, 0x100000): print 'trying stack_size = %d' % tss next_ident = 0 for i in range(numtasks): newtask() print 'waiting for all tasks to complete' done.acquire() print 'all tasks done' thread.stack_size(0) | if __name__ == "__main__": test_main() | def task(ident): global running rmutex.acquire() delay = random.random() * numtasks * 0.02 rmutex.release() if verbose: print 'task', ident, 'will run for', round(delay, 2), 'sec' time.sleep(delay) if verbose: print 'task', ident, 'done' mutex.acquire() running = running - 1 if running == 0: done.release() mutex.release() | 215803e429bc0013d0a60bea8cf8ad8506a32290 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10078/215803e429bc0013d0a60bea8cf8ad8506a32290/test_thread.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1562,
12,
6392,
4672,
2552,
3549,
6692,
322,
338,
18,
1077,
1039,
1435,
4624,
273,
2744,
18,
9188,
1435,
380,
818,
9416,
380,
374,
18,
3103,
6692,
322,
338,
18,
9340,
1435,
309,
3988,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1562,
12,
6392,
4672,
2552,
3549,
6692,
322,
338,
18,
1077,
1039,
1435,
4624,
273,
2744,
18,
9188,
1435,
380,
818,
9416,
380,
374,
18,
3103,
6692,
322,
338,
18,
9340,
1435,
309,
3988,
... |
"""connect to a BuildBot buildslave using pb. makes use of the value set in L{twisted.trial.itrial.IReporter.args} | """connect to a BuildBot buildslave using pb. makes use of the value set in L{twisted.trial.itrial.IReporter.args} | def connectToSlave(self): """connect to a BuildBot buildslave using pb. makes use of the value set in L{twisted.trial.itrial.IReporter.args} """ | 0890a2331ecc0224902839aa0bfb229eaa875f68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0890a2331ecc0224902839aa0bfb229eaa875f68/itrial.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
774,
20302,
12,
2890,
4672,
3536,
3612,
358,
279,
3998,
6522,
1361,
27352,
1450,
6386,
18,
7297,
999,
434,
326,
460,
444,
316,
511,
95,
11246,
25444,
18,
17493,
18,
305,
566,
287,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
774,
20302,
12,
2890,
4672,
3536,
3612,
358,
279,
3998,
6522,
1361,
27352,
1450,
6386,
18,
7297,
999,
434,
326,
460,
444,
316,
511,
95,
11246,
25444,
18,
17493,
18,
305,
566,
287,
... |
pass | self.body.append(self.context.pop()) | def depart_image(self, node): pass | 8dadf098d728a635e638201f889811c930dc9e5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1532/8dadf098d728a635e638201f889811c930dc9e5f/html4css1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
2730,
12,
2890,
16,
756,
4672,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
2730,
12,
2890,
16,
756,
4672,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
["$D/regression/tst_grouped_data", "P31"], | ["$D/regression/tst_grouped_data.py", "P31"], | def run(): tst_list = ( "$D/regression/tst_adp_aniso_restraints.py", "$D/math/boost_python/tst_math.py", "$D/xray/boost_python/tst_f_model.py", "$D/array_family/boost_python/tst_flex.py", "$D/uctbx/boost_python/tst_uctbx.py", "$D/uctbx/boost_python/tst_crystal_orientation.py", "$D/sgtbx/boost_python/tst_sgtbx.py", "$D/sgtbx/boost_python/tst_N_fold_rot.py", "$D/crystal/tst_ext.py", "$D/adptbx/boost_python/tst_adptbx.py", "$D/miller/boost_python/tst_miller.py", "$D/eltbx/boost_python/tst_chemical_elements.py", "$D/eltbx/boost_python/tst_xray_scattering.py", "$D/eltbx/boost_python/tst_henke.py", "$D/eltbx/boost_python/tst_icsd_radii.py", "$D/eltbx/boost_python/tst_neutron.py", "$D/eltbx/boost_python/tst_sasaki.py", "$D/eltbx/boost_python/tst_tiny_pse.py", "$D/eltbx/boost_python/tst_wavelengths.py", "$D/xray/boost_python/tst_xray.py", "$D/maptbx/boost_python/tst_maptbx.py", "$D/dmtbx/boost_python/tst_dmtbx.py", "$D/translation_search/boost_python/tst_translation_search.py", "$D/geometry_restraints/tst_ext.py", "$D/geometry_restraints/tst_proxy_registry.py", "$D/adp_restraints/tst_ext.py", ["$D/regression/tst_krivy_gruber.py", "--Quick"], "$D/regression/tst_sgtbx.py", "$D/regression/tst_itvb_2001_table_a1427_hall_symbols.py", "$D/regression/tst_space_group_type_tidy_cb_op_t.py", ["$D/regression/tst_sgtbx_denominators.py", "P31"], "$D/regression/tst_sgtbx_subgroups.py", "$D/regression/tst_sgtbx_lattice_symmetry.py", ["$D/regression/tst_adp_constraints.py", "P3"], "$D/regression/tst_sgtbx_site_constraints.py", "$D/regression/tst_reflection_statistics.py", "$D/regression/tst_sgtbx_harker.py", "$D/regression/tst_twin_target.py", "$D/sgtbx/symbol_confidence.py", "$D/sgtbx/bravais_types.py", "$D/regression/tst_miller_lookup_utils.py", ["$D/regression/tst_crystal.py", "I41/acd"], ["$D/regression/tst_direct_space_asu.py", "I41/acd"], "$D/regression/tst_pair_asu_table.py", "$D/regression/tst_crystal_asu_clusters.py", "$D/regression/tst_coordination_sequences.py", ["$D/regression/tst_crystal_close_packing.py", "R-3mr"], ["$D/regression/tst_xray.py", "I41/acd"], "$D/regression/tst_structure_factors_multithread.py", ["$D/regression/tst_miller.py", "P31"], ["$D/regression/tst_reciprocal_space_asu.py", "P312"], ["$D/regression/tst_triplet_generator.py", "P41"], ["$D/regression/tst_emma.py", "P31"], ["$D/regression/tst_find_centre_of_inversion.py", "P31"], ["$D/regression/tst_expand_to_p1.py", "P31"], ["$D/regression/tst_change_basis.py", "P31"], ["$D/regression/tst_wilson_plot.py", "P31"], "$D/regression/tst_xray_target_functors.py", ["$D/regression/tst_xray_derivatives.py", "P31"], ["$D/regression/tst_xray_fast_gradients.py", "P31"], ["$D/regression/tst_xray_minimization.py", "--F", "P31"], ["$D/regression/tst_xray_minimization.py", "--F_sq", "P31"], "$D/maptbx/tst_real_space_refinement.py", ["$D/regression/tst_maptbx_structure_factors.py", "P31"], ["$D/regression/tst_miller_merge_equivalents.py", "P31"], ["$D/regression/tst_grouped_data", "P31"], ["$D/regression/tst_miller_fft_map.py", "P31"], ["$D/regression/tst_sampled_model_density.py", "P31"], ["$D/regression/tst_fast_nv1995.py", "F222"], "$D/regression/tst_geometry_restraints.py", "$D/regression/tst_geometry_restraints_lbfgs.py", "$D/regression/tst_geometry_restraints_2.py", ["$D/development/make_cns_input.py", "P31"], ["$D/development/tst_cns_epsilon.py", "P31"], ["$D/development/tst_cns_hl.py", "P31"], ["$D/development/run_shelx.py", "P31"], "$D/regression/tst_pointgroup_tools.py", "$D/sgtbx/sub_lattice_tools.py", "$D/sgtbx/cosets.py", "$D/regression/tst_find_best_cell.py", ) build_dir = libtbx.env.under_build("cctbx") dist_dir = libtbx.env.dist_path("cctbx") test_utils.run_tests(build_dir, dist_dir, tst_list) | 94558eb7bfe36edb120e31758f9b924dbafb2812 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/696/94558eb7bfe36edb120e31758f9b924dbafb2812/run_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
13332,
268,
334,
67,
1098,
273,
261,
4662,
40,
19,
1574,
16345,
19,
88,
334,
67,
361,
84,
67,
304,
9699,
67,
455,
313,
1598,
87,
18,
2074,
3113,
4662,
40,
19,
15949,
19,
25018,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
13332,
268,
334,
67,
1098,
273,
261,
4662,
40,
19,
1574,
16345,
19,
88,
334,
67,
361,
84,
67,
304,
9699,
67,
455,
313,
1598,
87,
18,
2074,
3113,
4662,
40,
19,
15949,
19,
25018,... |
nodcoord = [] for n in nodes: nodcoord.append( self.Coord[n] ) nodcoord = N.array(nodcoord) | nodcoord = N.array([self.Coord[n] for n in nodes]) | def getElement(self, elename): """Create an element instance from the connectivity information (the Element class holds a list of nodes) |elem| is the name (i.e. the number) of the element (This used to be ElementFactory) """ # test whether the element already exists, shortcut if exists try: return self.elementCache[elename] except: pass conn = self.Conn[elename] nodes = conn[1] sh = ShapeFunctions.shapeFunctions[conn[0]]() | 7d8f9cb4320fdd8fc9b604d50de630c5126d68f5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7248/7d8f9cb4320fdd8fc9b604d50de630c5126d68f5/FEval.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7426,
12,
2890,
16,
415,
1069,
4672,
3536,
1684,
392,
930,
791,
628,
326,
20301,
1779,
261,
5787,
3010,
667,
14798,
279,
666,
434,
2199,
13,
571,
10037,
96,
353,
326,
508,
261,
77,
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,
7426,
12,
2890,
16,
415,
1069,
4672,
3536,
1684,
392,
930,
791,
628,
326,
20301,
1779,
261,
5787,
3010,
667,
14798,
279,
666,
434,
2199,
13,
571,
10037,
96,
353,
326,
508,
261,
77,
18,... |
if not self._reading and cursor.atBlockEnd() and not \ cursor.hasSelection(): | if not self._reading and self._in_buffer(position) and \ cursor.atBlockEnd() and not cursor.hasSelection(): | def _event_filter_console_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_down = event.modifiers() & QtCore.Qt.AltModifier shift_down = event.modifiers() & QtCore.Qt.ShiftModifier | 4212c3a5a35f1a8330abc93ed6ed15b0e6ceb3a1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/4212c3a5a35f1a8330abc93ed6ed15b0e6ceb3a1/console_widget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2575,
67,
2188,
67,
8698,
67,
856,
1028,
12,
2890,
16,
871,
4672,
3536,
4008,
498,
2641,
364,
326,
6808,
977,
3604,
358,
752,
279,
2983,
17,
5625,
1560,
18,
3536,
10883,
329,
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,
389,
2575,
67,
2188,
67,
8698,
67,
856,
1028,
12,
2890,
16,
871,
4672,
3536,
4008,
498,
2641,
364,
326,
6808,
977,
3604,
358,
752,
279,
2983,
17,
5625,
1560,
18,
3536,
10883,
329,
273,... |
self.debug_building_ = "--debug-building" in bjam.variable("ARV") | self.debug_building_ = "--debug-building" in bjam.variable("ARGV") | def __init__ (self): # All targets that are currently being built. # Only the key is id (target), the value is the actual object. self.targets_being_built_ = {} | 58f1d1f5fe34dac0e92592136b060c6929c5a0ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9981/58f1d1f5fe34dac0e92592136b060c6929c5a0ce/targets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
4672,
468,
4826,
5774,
716,
854,
4551,
3832,
6650,
18,
468,
5098,
326,
498,
353,
612,
261,
3299,
3631,
326,
460,
353,
326,
3214,
733,
18,
365,
18,
11358,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
4672,
468,
4826,
5774,
716,
854,
4551,
3832,
6650,
18,
468,
5098,
326,
498,
353,
612,
261,
3299,
3631,
326,
460,
353,
326,
3214,
733,
18,
365,
18,
11358,
67... |
request.theme.add_msg('<strong>%s</strong><br>%s' % ( | request.theme.add_msg('<strong>%s</strong><br>' % ( | def send_page(self, **keywords): """ Output the formatted page. | 06a4349c3d48a551cc02c2bfe66bcd631ddce69e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/06a4349c3d48a551cc02c2bfe66bcd631ddce69e/Page.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
2433,
12,
2890,
16,
2826,
11771,
4672,
3536,
3633,
326,
4955,
1363,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
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,
1366,
67,
2433,
12,
2890,
16,
2826,
11771,
4672,
3536,
3633,
326,
4955,
1363,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def process(item_id, source, metadata) | def process(item_id, source, metadata): | def process(item_id, source, metadata) """Perform the exporting process and return the absolute path to the resulting file. | c9754e05637fe8ae6727d4e5be1958891d33a3c4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12043/c9754e05637fe8ae6727d4e5be1958891d33a3c4/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12,
1726,
67,
350,
16,
1084,
16,
1982,
4672,
3536,
4990,
326,
3359,
310,
1207,
471,
327,
326,
4967,
589,
358,
326,
8156,
585,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12,
1726,
67,
350,
16,
1084,
16,
1982,
4672,
3536,
4990,
326,
3359,
310,
1207,
471,
327,
326,
4967,
589,
358,
326,
8156,
585,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
media.item = DirItem(media.mountdir, None) | media.item = DirItem(media.mountdir, None, create_metainfo=False) | def identify(self, media): """ magic! Try to find out as much as possible about the disc in the rom drive: title, image, play options, ... """ # Check drive status (tray pos, disc ready) try: CDSL_CURRENT = ( (int ) ( ~ 0 >> 1 ) ) fd = os.open(media.devicename, os.O_RDONLY | os.O_NONBLOCK) if os.uname()[0] == 'FreeBSD': try: data = array.array('c', '\000'*4096) (address, length) = data.buffer_info() buf = pack('BBHP', CD_MSF_FORMAT, 0, length, address) s = ioctl(fd, CDIOREADTOCENTRYS, buf) s = CDS_DISC_OK except: s = CDS_NO_DISC else: s = ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT) except: # maybe we need to close the fd if ioctl fails, maybe # open fails and there is no fd try: os.close(fd) except: pass media.drive_status = None return | afbf6bc3c449611dfdd9884985752e4ec42387fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/afbf6bc3c449611dfdd9884985752e4ec42387fc/rom_drives.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9786,
12,
2890,
16,
3539,
4672,
3536,
8146,
5,
6161,
358,
1104,
596,
487,
9816,
487,
3323,
2973,
326,
19169,
316,
326,
24137,
14316,
30,
2077,
16,
1316,
16,
6599,
702,
16,
1372,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9786,
12,
2890,
16,
3539,
4672,
3536,
8146,
5,
6161,
358,
1104,
596,
487,
9816,
487,
3323,
2973,
326,
19169,
316,
326,
24137,
14316,
30,
2077,
16,
1316,
16,
6599,
702,
16,
1372,
3536,
... |
maintainer="Zope Corporation", | maintainer="Zope Foundation and Contributors", | def read_file(*path): base_dir = os.path.dirname(__file__) file_path = (base_dir, ) + tuple(path) return file(os.path.join(*file_path)).read() | 16d64841c93a69cae03b19fca5c30829be71f6db /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10048/16d64841c93a69cae03b19fca5c30829be71f6db/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
768,
30857,
803,
4672,
1026,
67,
1214,
273,
1140,
18,
803,
18,
12287,
12,
972,
768,
972,
13,
585,
67,
803,
273,
261,
1969,
67,
1214,
16,
262,
397,
3193,
12,
803,
13,
327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
768,
30857,
803,
4672,
1026,
67,
1214,
273,
1140,
18,
803,
18,
12287,
12,
972,
768,
972,
13,
585,
67,
803,
273,
261,
1969,
67,
1214,
16,
262,
397,
3193,
12,
803,
13,
327,
... |
connect_ring(r, z, ring, prev_r, prev_z, prev_ring, ring_marker) prev_ring = ring prev_r, prev_z = r, z if closure == EXT_CLOSE_IN_Z: add_polygons([tuple(prev_ring[::-1])], plus_z_closure_marker) | connect_ring(i, i+1, ring_marker) | def connect_ring(r, z, ring, prev_r, prev_z, prev_ring, marker): if _is_same_float(z, prev_z): assert not _is_same_float(r, prev_r) # we're moving purely outward--this doesn't need fans, only plane # surfaces. Special casing this leads to more freedom for TetGen # and hence better meshes. | 3ced297c55913885e4b6094b0c0e25c20e66ad10 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11985/3ced297c55913885e4b6094b0c0e25c20e66ad10/tet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
67,
8022,
12,
86,
16,
998,
16,
9221,
16,
2807,
67,
86,
16,
2807,
67,
94,
16,
2807,
67,
8022,
16,
5373,
4672,
309,
389,
291,
67,
14307,
67,
5659,
12,
94,
16,
2807,
67,
94,
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,
3077,
67,
8022,
12,
86,
16,
998,
16,
9221,
16,
2807,
67,
86,
16,
2807,
67,
94,
16,
2807,
67,
8022,
16,
5373,
4672,
309,
389,
291,
67,
14307,
67,
5659,
12,
94,
16,
2807,
67,
94,
4... |
if results_for_opft_item._nbhits == 0: | if results_for_opft_item._nbhits == 0: | def search_pattern(req, p=None, f=None, colls=[], m=None, hit_hints=0): """Searches for pattern 'p' and field 'f' and returns dict of recIDs HitLists per each collection in 'colls'. - Optionally, the function accepts the match type argument 'm'. If it is set (e.g. from advanced search interface), then it performs this kind of matching. If it is not set, then a guess is made. - Calls search_in_bibwords() and/or search_in_bibxxx() functions. - If hit_hints is set, than print lots of hints on current search. Useful for debugging and/or when search gives zero hits. - Called by main().""" ## create empty output results set: results_out = {} for coll in colls: results_out[coll] = HitList() results_out[coll]._nbhits = 0 ## if p is not defined, return all hits in given collections: if not p: for coll in colls: results_out[coll]._set = collrecs_cache[coll]._set results_out[coll]._nbhits = collrecs_cache[coll]._nbhits return results_out ## now we are sure to have some p: good. ## create search units: opft_items = create_opft_search_units(req, p, f, m) #req.write("<p>%s" % opft_items) ## search regardless of collection: results_in_any_collection = HitList() results_in_any_collection_empty = 1 # to be able to skip first set operation for opft_item in opft_items: results_for_opft_item = {} oi, pi, fi, ti = opft_item[0], opft_item[1], opft_item[2], opft_item[3] # firstly, launch search for this pattern item: if ti == 'a' or ti == 'r': # we are doing either direct bibxxx search or phrase search or regexp search results_for_opft_item = search_in_bibxxx(req, pi, fi, ti) elif ti == 'w': # we are doing bibwords search results_for_opft_item = search_in_bibwords(req, pi, fi) else: print_warning(req, "Search type '%s' is not defined." % ti, "Error") return None if hit_hints: results_for_opft_item.calculate_nbhits() if results_for_opft_item._nbhits == 0: text = "Search term <em>%s</em>" % pi if fi: text += " inside <em>%s</em> " % fi print_warning(req, "%s did not match any record. Nearest terms in any collection are: %s" % (text, create_nearest_terms_box(req.args, pi, fi)), "") return results_out # empty if dbg: print_warning(req, "Item <strong>%s:%s</strong> gave %d hits." % (fi, pi, results_for_opft_item._nbhits), "") # secondly, apply the set intersect/union/disjunction functions: if dbg: t1 = os.times()[4] if results_in_any_collection_empty: results_in_any_collection = results_for_opft_item results_in_any_collection_empty = 0 else: if oi == '+': results_in_any_collection.intersect(results_for_opft_item) elif oi == '-': results_in_any_collection.difference(results_for_opft_item) elif oi == '|': results_in_any_collection.union(results_for_opft_item) else: print_warning(req, "Invalid set operation %s." % oi, "Error") if dbg: t2 = os.times()[4] print_warning(req, "Set operation '%s' took %.2f seconds." % (oi, (t2 - t1)), "Profile") ## before doing collection intersection, see how many hits we have now: results_in_any_collection.calculate_nbhits() ## return all hits if no collection list specified (useful for WebSearch Admin to determine collection ## recID universe): if colls == []: return results_in_any_collection ## were there no hits at all before doing collection intersection? if results_in_any_collection._nbhits == 0: # pattern not found in any public/private collection: if hit_hints: text = """All search terms matched but boolean query returned no hits. Please combine your search terms differently.""" url_args = req.args text += """<blockquote><table class="nearesttermsbox" cellpadding="0" cellspacing="0" border="0">""" for opft_item in opft_items: oi, pi, fi, ti = opft_item[0], opft_item[1], opft_item[2], opft_item[3] url_args_new = re.sub(r'(^|\&)p=.*?(\&|$)', r'\1p='+urllib.quote(pi)+r'\2', url_args) url_args_new = re.sub(r'(^|\&)f=.*?(\&|$)', r'\1f='+urllib.quote(fi)+r'\2', url_args_new) text += """<tr><td class="nearesttermsboxbody" align="right">%s</td><td class="nearesttermsboxbody" width="15"> </td><td class="nearesttermsboxbody" align="left"><a class="nearestterms" href="%s/search.py?%s">%s</a></td></tr>""" % \ (get_word_nbhits(pi, fi), weburl, url_args_new, pi) text += """</table></blockquote>""" print_warning(req, text, "") return results_out # still empty ## intersect with collection universe: if dbg: t1 = os.times()[4] if colls: for coll in colls: results_out[coll]._set = Numeric.bitwise_and(results_in_any_collection._set, collrecs_cache[coll]._set) if dbg: t2 = os.times()[4] print_warning(req, "Intersecting with collection hitlist universe took %.2f seconds." % ((t2 - t1)), "Profile") ## count number of hits in given collections: results_out_nb_hits_total = 0 for coll in colls: results_out[coll].calculate_nbhits() results_out_nb_hits_total += results_out[coll]._nbhits if results_out_nb_hits_total == 0: # pattern had been found but not in the collections chosen by the user: if hit_hints: # try to search in Home: results_in_Home = HitList() results_in_Home._set = Numeric.bitwise_and(results_in_any_collection._set, collrecs_cache[cdsname]._set) results_in_Home.calculate_nbhits() if results_in_Home._nbhits > 0: # some hits found in Home, so propose this search: url_args = req.args url_args = re.sub(r'(^|\&)cc=.*?(\&|$)', r'\2', url_args) url_args = re.sub(r'(^|\&)c=.*?(\&[^c]+=|$)', r'\2', url_args) url_args = re.sub(r'^\&+', '', url_args) url_args = re.sub(r'\&+$', '', url_args) print_warning(req, """Match found in other public collections: <a class="nearestterms" href="%s/search.py?%s">%d hits</a>.""" % (weburl, url_args, results_in_Home._nbhits), "") else: # no hits found in Home, recommend different search terms: text = """No public collection matched your query. If you were looking for a non-public document, please choose the desired restricted collection first.""" print_warning(req, text, "") return results_out | c8bc8e9e8dcaad50892504a6b2ad935d0e8bb72d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/c8bc8e9e8dcaad50892504a6b2ad935d0e8bb72d/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
4951,
12,
3658,
16,
293,
33,
7036,
16,
284,
33,
7036,
16,
645,
3251,
22850,
6487,
312,
33,
7036,
16,
6800,
67,
24598,
33,
20,
4672,
3536,
16294,
364,
1936,
296,
84,
11,
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,
1623,
67,
4951,
12,
3658,
16,
293,
33,
7036,
16,
284,
33,
7036,
16,
645,
3251,
22850,
6487,
312,
33,
7036,
16,
6800,
67,
24598,
33,
20,
4672,
3536,
16294,
364,
1936,
296,
84,
11,
471... |
self.removeTransformationOutput(transDict['TransformationID']) | self.removeTransformationOutput( transDict['TransformationID'] ) | def execute( self ): """ The TransformationCleaningAgent execution method. """ self.enableFlag = self.am_getOption('EnableFlag','True') if not self.enableFlag == 'True': self.log.info( 'TransformationCleaningAgent is disabled by configuration option %s/EnableFlag' % ( self.section ) ) return S_OK( 'Disabled via CS flag' ) | c3853ad0438058db66814335a87076cdaecd2d33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/c3853ad0438058db66814335a87076cdaecd2d33/TransformationCleaningAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
365,
262,
30,
3536,
1021,
21274,
7605,
310,
3630,
4588,
707,
18,
3536,
365,
18,
7589,
4678,
273,
365,
18,
301,
67,
588,
1895,
2668,
8317,
4678,
17023,
5510,
6134,
309,
486,
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,
1836,
12,
365,
262,
30,
3536,
1021,
21274,
7605,
310,
3630,
4588,
707,
18,
3536,
365,
18,
7589,
4678,
273,
365,
18,
301,
67,
588,
1895,
2668,
8317,
4678,
17023,
5510,
6134,
309,
486,
3... |
for database, cursor in self.connections: | for _database, _cursor in self.connections: | def __init__(self, limit = 100, sql_host = 'sql', sql_user = '', sql_pass = '', sql_host_prefix = 'sql-s', no_db = False, use_autoconn = False, http_retry_timeout = 30, http_max_retries = -1, http_callback = lambda *args: None, mysql_retry_timeout = 60, mysql_max_retries = -1, mysql_callback = lambda *args: None): self.conn = HTTPPool(retry_timeout = http_retry_timeout, max_retries = http_max_retries, callback = http_callback) if no_db: return self.sql_host, self.sql_host_prefix = sql_host, sql_host_prefix self.sql_user, self.sql_passwd = sql_user, sql_passwd self.use_autoconn = use_autoconn self.mysql_retry_timeout = mysql_retry_timeout self.mysql_max_retries = mysql_max_retries self.mysql_callback = mysql_callback self.connections = [] self.databases = {} self.clusters = {} self.domains = {} database, cursor = self.connect(sql_host) self.cursor.execute('SELECT dbname, domain, server FROM toolserver.wiki ORDER BY size DESC LIMIT %s', (limit, )) for dbname, domain, server in self.cursor.fetchall(): if server not in self.clusters: for database, cursor in self.connections: try: cursor.execute('USE ' + dbname) except MySQL.Error, e: if e[0] != 1044: raise else: self.clusters[server] = (database, cursor) if not server in self.clusters: self.clusters[server] = self.connect(sql_host_prefix + str(server)) self.domains[dbname] = domain self.databases[dbname] = self.clusters[server] cursor.execute('SELECT dbname, ns_id, ns_name FROM toolserver.namespace') self.namespaces = dict((((i[0], i[1]), i[2].decode('utf-8')) for i in self.cursor)) | 718de7551540bbee157bf8fd61d53394e444d520 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/718de7551540bbee157bf8fd61d53394e444d520/checkusage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1800,
273,
2130,
16,
1847,
67,
2564,
273,
296,
4669,
2187,
1847,
67,
1355,
273,
10226,
1847,
67,
5466,
273,
10226,
1847,
67,
2564,
67,
3239,
273,
296,
46... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1800,
273,
2130,
16,
1847,
67,
2564,
273,
296,
4669,
2187,
1847,
67,
1355,
273,
10226,
1847,
67,
5466,
273,
10226,
1847,
67,
2564,
67,
3239,
273,
296,
46... |
Gathers self.content-length worth of data | Gathers self.content-length worth of data in attach_buffer | def rawDataReceived(self, data): """ Called when data is received in raw data mode Gathers self.content-length worth of data Returns what it doesn't use """ if self.length is not None: self.attach_buffer.write(data) buff_len = self.attach_buffer.tell() if buff_len >= self.length: data = self.attach_buffer.getvalue() data, rest = data[:self.length], data[self.length:] self.handleResponseEnd(data) self.length = None self.attach_buffer = StringIO() return rest | 382ee43230b4edd23aa42a717e9fc5a3d328e8bc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7045/382ee43230b4edd23aa42a717e9fc5a3d328e8bc/rtsp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16503,
8872,
12,
2890,
16,
501,
4672,
3536,
11782,
1347,
501,
353,
5079,
316,
1831,
501,
1965,
611,
29722,
365,
18,
1745,
17,
2469,
26247,
434,
501,
316,
3306,
67,
4106,
2860,
4121,
518,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16503,
8872,
12,
2890,
16,
501,
4672,
3536,
11782,
1347,
501,
353,
5079,
316,
1831,
501,
1965,
611,
29722,
365,
18,
1745,
17,
2469,
26247,
434,
501,
316,
3306,
67,
4106,
2860,
4121,
518,... |
print _("beta version in use:"), CURRENT_VERSION | print _("beta version %s in use:") % CURRENT_VERSION | def check_update(self): """checks newst version """ newst_version = urllib2.urlopen("http://pyload.nady.biz/files/version.txt").readline().strip() if CURRENT_VERSION < newst_version: print _("new update on pyload.de.rw:"), newst_version #newer version out elif CURRENT_VERSION == newst_version: print _("newst update in use:"), CURRENT_VERSION #using newst version else: print _("beta version in use:"), CURRENT_VERSION #using beta version | 8b1e215d8c26e02670fa809868120dcccb9db446 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9838/8b1e215d8c26e02670fa809868120dcccb9db446/Core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
2725,
12,
2890,
4672,
3536,
12366,
394,
334,
1177,
3536,
394,
334,
67,
1589,
273,
11527,
22,
18,
295,
18589,
2932,
2505,
2207,
2074,
945,
18,
82,
361,
93,
18,
70,
452,
19,
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,
866,
67,
2725,
12,
2890,
4672,
3536,
12366,
394,
334,
1177,
3536,
394,
334,
67,
1589,
273,
11527,
22,
18,
295,
18589,
2932,
2505,
2207,
2074,
945,
18,
82,
361,
93,
18,
70,
452,
19,
2... |
jigsAngleActionText = "<u><b>Measure Angle</b></u></b></p><br>"\ | jigsAngleActionText = "<u><b>Measure Angle Jig</b></u></b></p><br>"\ | def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "fileopen", self.fileOpenAction.iconSet().pixmap() ) self.fileOpenAction.setWhatsThis( fileOpenText ) #### Save File #### fileSaveText = "<u><b>Save File</b></u> (Ctrl + S)</b></p><br> "\ "<p><img source=\"filesave\"><br> "\ "Saves the current file."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "filesave", self.fileSaveAction.iconSet().pixmap() ) self.fileSaveAction.setWhatsThis( fileSaveText ) ############################################## # Edit Toolbar ############################################## #### Undo #### editUndoText = "<u><b>Undo</b></u> (Ctrl + Z)</b></p><br> "\ "<p><img source=\"editUndo\"><br> "\ "Reverses the last edit or command to the active part. "\ "<b>Currently not implemented</b>."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editUndo", self.editUndoAction.iconSet().pixmap() ) self.editUndoAction.setWhatsThis( editUndoText ) #### Redo #### editRedoText = "<u><b>Redo</b></u> (Ctrl + Y)</b></p><br> "\ "<p><img source=\"editRedo\"> <br>"\ "Re-applies the actions or commands on which you have used "\ "the Undo command. <b>Currently not implemented</b>."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editRedo", self.editRedoAction.iconSet().pixmap() ) self.editRedoAction.setWhatsThis( editRedoText ) #### Cut #### editCutText = "<u><b>Cut</b></u> (Ctrl + X)</b></p><br> "\ "<p><img source=\"editCut\"><br> "\ "Removes the selected object(s) and stores the cut data on the"\ "clipboard."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editCut", self.editCutAction.iconSet().pixmap() ) self.editCutAction.setWhatsThis( editCutText ) #### Copy #### editCopyText = "<u><b>Copy</b></u> (Ctrl + C)</b></p><br> "\ "<p><img source=\"editCopy\"><br> "\ "Places a copy of the selected chunk(s) on the clipboard "\ "while leaving the original chunk(s) unaffected."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editCopy", self.editCopyAction.iconSet().pixmap() ) self.editCopyAction.setWhatsThis( editCopyText ) #### Paste #### editPasteText = "<u><b>Paste</b></u> (Ctrl + V)</b></p><br> "\ "<p><img source=\"editPaste\"><br> "\ "When selecting this feature, you are placed in "\ "<b>Build Atom</b> mode where you may paste copies "\ "of clipboard objects into the model where ever you click."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editPaste", self.editPasteAction.iconSet().pixmap() ) self.editPasteAction.setWhatsThis( editPasteText ) #### Delete #### editDeleteText = "<u><b>Delete</b></u> (DEL)</b></p><br> "\ "<p><img source=\"editDelete\"><br> "\ "Deletes the selected object(s). "\ "For this Alpha release, deleted objects are permanantly lost.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editDelete", self.editDeleteAction.iconSet().pixmap() ) self.editDeleteAction.setWhatsThis( editDeleteText ) ############################################## # View Toolbar ############################################## #### Home View #### setViewHomeActionText = "<u><b>Home</b></u> (Home)<br>"\ "<p><img source=\"setViewHome\"><br> "\ "When you create a new model, it appears in a default view orientation (FRONT view). When you open an existing model, it appears in the orientation it was last saved. You can change the default orientation by selecting <b>Set Home View to Current View</b> from the <b>View</b> menu.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewHome", self.setViewHomeAction.iconSet().pixmap() ) self.setViewHomeAction.setWhatsThis( setViewHomeActionText ) #### Fit to Window #### setViewFitToWindowActionText = "<u><b>Fit To Window</b></u><br>"\ "<p><img source=\"setViewFitToWindow\"><br> "\ "Refits the model to the screen so you can view the entire model."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewFitToWindow", self.setViewFitToWindowAction.iconSet().pixmap() ) self.setViewFitToWindowAction.setWhatsThis( setViewFitToWindowActionText ) #### Recenter #### setViewRecenterActionText = "<u><b>Recenter</b></u><br>"\ "<p><img source=\"setViewRecenter\"><br> "\ "Changes the view center and zoom factor so that the origin is in the "\ "center of the view and you can view the entire model."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewRecenter", self.setViewRecenterAction.iconSet().pixmap() ) self.setViewRecenterAction.setWhatsThis( setViewRecenterActionText ) #### Zoom Tool #### setzoomToolActionText = "<u><b>Zoom Tool</b></u><br>"\ "<p><img source=\"setzoomTool\"><br> "\ "Allows the user to zoom into a specific area of the model by specifying a rectangular area. "\ "This is done by holding down the left button and dragging the mouse.</p>"\ "<p>A mouse with a mouse wheel can also be used to zoom in and out "\ "at any time, without using the Zoom Tool.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setzoomTool", self.zoomToolAction.iconSet().pixmap() ) self.zoomToolAction.setWhatsThis( setzoomToolActionText ) #### Pan Tool #### setpanToolActionText = "<u><b>Pan Tool</b></u><br>"\ "<p><img source=\"setpanTool\"><br> "\ "Allows X-Y panning using the left mouse button.</p>"\ "<p>Users with a 3-button mouse can pan the model at any time by pressing "\ "the middle mouse button while holding down the Shift key.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setpanTool", self.panToolAction.iconSet().pixmap() ) self.panToolAction.setWhatsThis( setpanToolActionText ) #### Rotate Tool #### setrotateToolActionText = "<u><b>Rotate Tool</b></u><br>"\ "<p><img source=\"setrotateTool\"><br> "\ "Allows free rotation using the left mouse button.</p>"\ "<p>Users with a 3-button mouse can rotate the model at any time by pressing "\ "the middle mouse button and dragging the mouse.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setrotateTool", self.rotateToolAction.iconSet().pixmap() ) self.rotateToolAction.setWhatsThis( setrotateToolActionText ) #### Orthographic Projection #### setViewOrthoActionText = "<u><b>Orthographic Projection</b></u><br>"\ "<p><img source=\"setViewOrtho\"><br> "\ "Sets nonperspective (or parallel) projection, with no foreshortening."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewOrtho", self.setViewOrthoAction.iconSet().pixmap() ) self.setViewOrthoAction.setWhatsThis( setViewOrthoActionText ) #### Perspective Projection #### setViewPerspecActionText = "<u><b>Perspective Projection</b></u><br>"\ "<p><img source=\"setViewPerspec\"><br> "\ "Set perspective projection, drawing objects slightly larger "\ "that are closer to the viewer."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewPerspec", self.setViewPerspecAction.iconSet().pixmap() ) self.setViewPerspecAction.setWhatsThis( setViewPerspecActionText ) #### Normal To #### setViewNormalToActionText = "<u><b>Normal To</b></u><br>"\ "<p><img source=\"setViewNormalTo\"><br> "\ "Orients view to the normal vector of the plane defined by "\ "3 or more selected atoms, or a jig's axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewNormalTo", self.setViewNormalToAction.iconSet().pixmap() ) self.setViewNormalToAction.setWhatsThis( setViewNormalToActionText ) #### Parallel To #### setViewParallelToActionText = "<u><b>Parallel To</b></u><br>"\ "<p><img source=\"setViewParallelTo\"><br> "\ "Orients view parallel to the vector defined by 2 selected atoms."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewParallelTo", self.setViewParallelToAction.iconSet().pixmap() ) self.setViewParallelToAction.setWhatsThis( setViewParallelToActionText ) #### Front View #### setViewFrontActionText = "<u><b>Front View</b></u><br>"\ "<p><img source=\"setViewFront\"><br> "\ "Orients the view to the Front View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewFront", self.setViewFrontAction.iconSet().pixmap() ) self.setViewFrontAction.setWhatsThis( setViewFrontActionText ) #### Back View #### setViewBackActionText = "<u><b>Back View</b></u><br>"\ "<p><img source=\"setViewBack\"><br> "\ "Orients the view to the Back View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewBack", self.setViewBackAction.iconSet().pixmap() ) self.setViewBackAction.setWhatsThis( setViewBackActionText ) #### Top View #### setViewTopActionText = "<u><b>Top View</b></u><br>"\ "<p><img source=\"setViewTop\"><br> "\ "Orients the view to the Top View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewTop", self.setViewTopAction.iconSet().pixmap() ) self.setViewTopAction.setWhatsThis( setViewTopActionText ) #### Bottom View #### setViewBottomActionText = "<u><b>Bottom View</b></u><br>"\ "<p><img source=\"setViewBottom\"><br> "\ "Orients the view to the Bottom View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewBottom", self.setViewBottomAction.iconSet().pixmap() ) self.setViewBottomAction.setWhatsThis( setViewBottomActionText ) #### Left View #### setViewLeftActionText = "<u><b>Left View</b></u><br>"\ "<p><img source=\"setViewLeft\"><br> "\ "Orients the view to the Left View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewLeft", self.setViewLeftAction.iconSet().pixmap() ) self.setViewLeftAction.setWhatsThis( setViewLeftActionText ) #### Right View #### setViewRightActionText = "<u><b>Right View</b></u><br>"\ "<p><img source=\"setViewRight\"><br> "\ "Orients the view to the Right View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewRight", self.setViewRightAction.iconSet().pixmap() ) self.setViewRightAction.setWhatsThis( setViewRightActionText ) #### Opposite View #### setViewOppositeActionText = "<u><b>Opposite View</b></u><br>"\ "<p><img source=\"setViewOpposite\"><br> "\ "Rotates the view 180 degrees."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewOpposite", self.setViewOppositeAction.iconSet().pixmap() ) self.setViewOppositeAction.setWhatsThis( setViewOppositeActionText ) #### Rotate +90 #### setViewPlus90ActionText = "<u><b>Rotate +90</b></u><br>"\ "<p><img source=\"setViewPlus90\"><br> "\ "Increment the current view by 90 degrees around the vertical axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewPlus90", self.setViewPlus90Action.iconSet().pixmap() ) self.setViewPlus90Action.setWhatsThis( setViewPlus90ActionText ) #### Rotate -90 #### setViewMinus90ActionText = "<u><b>Rotate -90</b></u><br>"\ "<p><img source=\"setViewMinus90\"><br> "\ "Decrement the current view by 90 degrees around the vertical axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewMinus90", self.setViewMinus90Action.iconSet().pixmap() ) self.setViewMinus90Action.setWhatsThis( setViewMinus90ActionText ) ############################################## # Grids Toolbar ############################################## #### Surface 100 #### orient100ActionText = "<u><b>Surface 100</b></u><br>"\ "<p><img source=\"orient100Action\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,0,0) surface of a diamond lattice."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "orient100Action", self.orient100Action.iconSet().pixmap() ) self.orient100Action.setWhatsThis(orient100ActionText ) #### Surface 110 #### orient110ActionText = "<u><b>Surface 110</b></u><br>"\ "<p><img source=\"orient110Action\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,1,0) surface of a diamond lattice."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "orient110Action", self.orient110Action.iconSet().pixmap() ) self.orient110Action.setWhatsThis(orient110ActionText ) #### Surface 111 #### orient111ActionText = "<u><b>Surface 111</b></u><br>"\ "<p><img source=\"orient111Action\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,1,1) surface of a diamond lattice."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "orient111Action", self.orient111Action.iconSet().pixmap() ) self.orient111Action.setWhatsThis(orient111ActionText ) ############################################## # Molecular Display toolbar ############################################## #### Display Default #### dispDefaultActionText = "<u><b>Display Default</b></u><br>"\ "<p><img source=\"dispDefaultAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Default</b> , rendering them in the <b>Current Display Mode</b>."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to the <b>Default Display Mode</b>. " \ "All chunks with their display setting set to <b>Default</b> will be rendered in the "\ "<b>Default Display Mode</b>."\ "</p>"\ "<p>The <b>Default Display Mode</b> can be changed via the "\ "<b>Edit > Preferences</b> menu and selecting the <b>General</b> tab."\ "</p>"\ "<p>The <b>Current or Default Display Mode</b> is displayed in the status bar in the "\ "lower right corner of the main window."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispDefaultAction", self.dispDefaultAction.iconSet().pixmap() ) self.dispDefaultAction.setWhatsThis(dispDefaultActionText ) #### Display Invisible #### dispInvisActionText = "<u><b>Display Invisible</b></u><br>"\ "<p><img source=\"dispInvisAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Invisible</b>, making them invisible."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Invisible</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispInvisAction", self.dispInvisAction.iconSet().pixmap() ) self.dispInvisAction.setWhatsThis(dispInvisActionText ) #### Display Lines #### dispLinesActionText = "<u><b>Display Lines</b></u><br>"\ "<p><img source=\"dispLinesAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ " <b>Lines</b>. Only bonds are rendered as colored lines."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Lines</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispLinesAction", self.dispLinesAction.iconSet().pixmap() ) self.dispLinesAction.setWhatsThis(dispLinesActionText ) #### Display Tubes #### dispTubesActionText = "<u><b>Display Tubes</b></u><br>"\ "<p><img source=\"dispTubesAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Tubes</b>. Atoms and bonds are rendered as colored tubes."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Tubes</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispTubesAction", self.dispTubesAction.iconSet().pixmap() ) self.dispTubesAction.setWhatsThis(dispTubesActionText ) #### Display CPK #### dispCPKActionText = "<u><b>Display CPK</b></u><br>"\ "<p><img source=\"dispCPKAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>CPK</b> mode, also known as <b>\"Ball and Sticks\"</b> mode. Atoms are rendered "\ "as spheres and bonds are rendered as narrow cylinders."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>CPK</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispCPKAction", self.dispCPKAction.iconSet().pixmap() ) self.dispCPKAction.setWhatsThis(dispCPKActionText ) #### Display VdW #### dispVdWActionText = "<u><b>Display VdW</b></u><br>"\ "<p><img source=\"dispVdWAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Van der Waals</b> mode. Atoms are rendered as spheres with "\ "a size equal to the VdW radius. Bonds are not rendered."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>VdW</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispVdWAction", self.dispVdWAction.iconSet().pixmap() ) self.dispVdWAction.setWhatsThis(dispVdWActionText ) ############################################## # Select toolbar ############################################## #### Select All #### selectAllActionText = "<u><b>Select All</b></u> (Ctrl + A)</b></p><br>"\ "<p><img source=\"selectAllAction\"><br> "\ "During <b>Select Atoms</b> mode, this will select all the atoms in "\ "the model. Otherwise, this will select all the chunks in the model."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectAllAction", self.selectAllAction.iconSet().pixmap() ) self.selectAllAction.setWhatsThis(selectAllActionText ) #### Select None #### selectNoneActionText = "<u><b>Select None</b></u></p><br>"\ "<p><img source=\"selectNoneAction\"><br> "\ "Unselects everything currently selected.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectNoneAction", self.selectNoneAction.iconSet().pixmap() ) self.selectNoneAction.setWhatsThis(selectNoneActionText ) #### Invert Selection #### selectInvertActionText = "<u><b>Invert Selection</b></u> <br> (Ctrl + Shift + I)</b></p><br>"\ "<p><img source=\"selectInvertAction\"><br> "\ "Inverts the current selection.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectInvertAction", self.selectInvertAction.iconSet().pixmap() ) self.selectInvertAction.setWhatsThis(selectInvertActionText ) #### Select Connected #### selectConnectedActionText = "<u><b>Select Connected</b></u> (Ctrl + Shift + C)</b></p><br>"\ "<p><img source=\"selectConnectedAction\"><br> "\ "Selects all the atoms that can be reached by the currently selected atom "\ "via an unbroken chain of bonds. </p>"\ "<p>To use this feature, you must first be in "\ "<b>Select Atoms</b> mode and select at least one atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectConnectedAction", self.selectConnectedAction.iconSet().pixmap() ) self.selectConnectedAction.setWhatsThis(selectConnectedActionText ) #### Select Doubly #### selectDoublyActionText = "<u><b>Select Doubly</b></u></b></p><br>"\ "<p><img source=\"selectDoublyAction\"><br> "\ "Selects all the atoms that can be reached from a currently selected "\ "atom through two disjoint unbroken chains of bonds. Atoms singly "\ "connected to this group and unconnected to anything else are also "\ "included in the selection.</p>"\ "<p>To use this feature, you must first be in "\ "<b>Select Atoms</b> mode and select at least one atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectDoublyAction", self.selectDoublyAction.iconSet().pixmap() ) self.selectDoublyAction.setWhatsThis(selectDoublyActionText ) #### Expand Selection #### selectExpandActionText = "<u><b>Expand Selection</b></u> (Ctrl + D)</b></p><br>"\ "<p><img source=\"selectExpandAction\"><br> "\ "Selects any atom that is a neighbor of a currently selected atom."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectExpandAction", self.selectExpandAction.iconSet().pixmap() ) self.selectExpandAction.setWhatsThis(selectExpandActionText ) #### Contract Selection #### selectContractActionText = "<u><b>Contract Selection</b></u> (Ctrl + Shift + D)</b></p><br>"\ "<p><img source=\"selectContractAction\"><br> "\ "Unselects any atom that has an open bond."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectContractAction", self.selectContractAction.iconSet().pixmap() ) self.selectContractAction.setWhatsThis(selectContractActionText ) ############################################## # Modify Toolbar ############################################## #### Minimize Selection #### modifyMinimizeSelActionText = "<u><b>Minimize Selection</b></u> (Ctrl + M)</b></p><br>"\ "<p><img source=\"modifyMinimizeSelAction\"><br> "\ "Arranges the atoms (<i>of the current selection</i>) to their chemically stable point of "\ "equilibrium in reference to the other atoms in the structure."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyMinimizeSelAction", self.modifyMinimizeSelAction.iconSet().pixmap() ) self.modifyMinimizeSelAction.setWhatsThis(modifyMinimizeSelActionText ) #### Minimize All #### modifyMinimizeAllActionText = "<u><b>Minimize All</b></u></p><br>"\ "<p><img source=\"modifyMinimizeAllAction\"><br> "\ "Arranges the atoms (<i>of the entire part</i>) to their chemically stable point of "\ "equilibrium in reference to the other atoms in the structure."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyMinimizeAllAction", self.modifyMinimizeAllAction.iconSet().pixmap() ) self.modifyMinimizeAllAction.setWhatsThis(modifyMinimizeAllActionText ) #### Hydrogenate #### modifyHydrogenateActionText = "<u><b>Hydrogenate</b></u> </b></p><br>"\ "<p><img source=\"modifyHydrogenateAction\"><br> "\ "Adds hydrogen atoms to all the open bonds in the selection.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyHydrogenateAction", self.modifyHydrogenateAction.iconSet().pixmap() ) self.modifyHydrogenateAction.setWhatsThis(modifyHydrogenateActionText ) #### Dehydrogenate #### modifyDehydrogenateActionText = "<u><b>Dehydrogenate</b></u><br>"\ "<p><img source=\"modifyDehydrogenateAction\"><br> "\ "Removes all hydrogen atoms from the selection.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyDehydrogenateAction", self.modifyDehydrogenateAction.iconSet().pixmap() ) self.modifyDehydrogenateAction.setWhatsThis(modifyDehydrogenateActionText ) #### Passivate #### modifyPassivateActionText = "<u><b>Passivate</b></u> (Ctrl + P)</b></p><br>"\ "<p><img source=\"modifyPassivateAction\"><br> "\ "Changes the types of incompletely bonded atoms to atoms with the "\ "right number of bonds, using atoms with the best atomic radius."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyPassivateAction", self.modifyPassivateAction.iconSet().pixmap() ) self.modifyPassivateAction.setWhatsThis(modifyPassivateActionText ) #### Stretch #### modifyStretchActionText = "<u><b>Stretch</b></u><br>"\ "<p><img source=\"modifyStretchAction\"><br> "\ "Stretches the bonds of the selected chunk(s).</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyStretchAction", self.modifyStretchAction.iconSet().pixmap() ) self.modifyStretchAction.setWhatsThis(modifyStretchActionText ) #### Delete Bonds #### modifyDeleteBondsActionText = "<u><b>Delete Bonds</b></u><br>"\ "<p><img source=\"modifyDeleteBondsAction\"><br> "\ "Delete all bonds between selected and unselected atoms or chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyDeleteBondsAction", self.modifyDeleteBondsAction.iconSet().pixmap() ) self.modifyDeleteBondsAction.setWhatsThis(modifyDeleteBondsActionText ) #### Separate #### modifySeparateActionText = "<u><b>Separate</b></u><br>"\ "<p><img source=\"modifySeparateAction\"><br> "\ "Creates a new chunk from the currently selected atoms.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifySeparateAction", self.modifySeparateAction.iconSet().pixmap() ) self.modifySeparateAction.setWhatsThis(modifySeparateActionText ) #### Merge Chunks #### modifyMergeActionText = "<u><b>Merge Chunks</b></u><br>"\ "<p><img source=\"modifyMergeAction\"><br> "\ "Merges two or more chunks into a single chunk.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyMergeAction", self.modifyMergeAction.iconSet().pixmap() ) self.modifyMergeAction.setWhatsThis(modifyMergeActionText ) #### Invert Chunks #### modifyInvertActionText = "<u><b>Invert</b></u><br>"\ "<p><img source=\"modifyInvertAction\"><br> "\ "Inverts the atoms of the selected chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyInvertAction", self.modifyInvertAction.iconSet().pixmap() ) self.modifyInvertAction.setWhatsThis(modifyInvertActionText ) #### Align to Common Axis #### modifyAlignCommonAxisActionText = "<u><b>Align To Common Axis</b></u><br>"\ "<p><img source=\"modifyAlignCommonAxis\"><br> "\ "Aligns one or more chunks to the axis of the first selected chunk."\ "You must select two or more chunks before using this feature."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyAlignCommonAxis", self. modifyAlignCommonAxisAction.iconSet().pixmap() ) self. modifyAlignCommonAxisAction.setWhatsThis( modifyAlignCommonAxisActionText ) ############################################## # Tools Toolbar ############################################## #### Select Chunks #### toolsSelectMoleculesActionText = "<u><b>Select Chunks</b></u><!-- [[Feature:Select Chunks Mode]] --><br>"\ "<p><img source=\" toolsSelectMoleculesAction\"><br> "\ "<b>Select Chunks</b> allows you to select/unselect chunks with the mouse.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Click/Drag</b> - selects a chunk(s).</p>"\ "<p><b>Ctrl+Left Click/Drag</b> - removes chunk(s) from selection.</p>"\ "<p><b>Shift+Left Click/Drag</b> - adds chunk(s) to selection."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsSelectMoleculesAction", self. toolsSelectMoleculesAction.iconSet().pixmap() ) self. toolsSelectMoleculesAction.setWhatsThis( toolsSelectMoleculesActionText ) #### Select Atoms #### toolsSelectAtomsActionText = "<u><b>Select Atoms</b></u><!-- [[Feature:Select Atoms Mode]] --><br>"\ "<p><img source=\" toolsSelectAtomsAction\"><br> "\ "<b>Select Atoms</b> allows you to select/unselect atoms with the mouse.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Click/Drag</b> - selects an atom(s).</p>"\ "<p><b>Ctrl+Left Click/Drag</b> - removes atom(s) from selection.</p>"\ "<p><b>Shift+Left Click/Drag</b> - adds atom(s) to selection."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsSelectAtomsAction", self. toolsSelectAtomsAction.iconSet().pixmap() ) self. toolsSelectAtomsAction.setWhatsThis( toolsSelectAtomsActionText ) #### Move Chunks #### toolsMoveMoleculeActionText = "<u><b>Move Chunks</b></u><!-- [[Feature:Move Chunks Mode]] --><br>"\ "<p><img source=\" toolsMoveMoleculeAction\"><br> "\ "Activates <b>Move Chunks</b> mode, allowing you to select, "\ "move and rotate one of more chunks with the mouse.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Drag</b> - moves the selected chunk(s).</p>"\ "<p><b>Ctrl+Left Drag</b> - freely rotates selected chunk(s).</p>"\ "<p><b>Shift+Left Drag</b> - constrained movement and rotation of a chunk about its own axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsMoveMoleculeAction", self. toolsMoveMoleculeAction.iconSet().pixmap() ) self. toolsMoveMoleculeAction.setWhatsThis( toolsMoveMoleculeActionText ) #### Build Atoms Tool #### toolsDepositAtomActionText = "<u><b>Build Tool</b></u><!-- [[Feature:Build Mode]] --><br>"\ "<p><img source=\" toolsDepositAtomAction\"><br> "\ "<b>Build Tool</b> allows you to deposit individual atoms or add/move/delete "\ "atoms from an existing chunk. Build Tool can also be used to paste "\ "copies of chunks from the clipboard into the part.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Click</b> - adds an atom or pastes a chunk from the clipboard. "\ "New atoms can be connected to an existing chunk if an open bond is highlighted "\ "during a left click.</p>"\ "<p><b>Ctrl+Left Click</b> - deletes a highlighted atom or bond.</p>"\ "<p><b>Shift+Left Drag</b> - moves an atom or open bond. An open bond will be "\ "connected to another open bond if the mouse button is released over a different "\ "open bond."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsDepositAtomAction", self. toolsDepositAtomAction.iconSet().pixmap() ) self. toolsDepositAtomAction.setWhatsThis( toolsDepositAtomActionText ) #### Cookie Cutter #### toolsCookieCutActionText = "<u><b>Cookie Cutter Tool</b></u><!-- [[Feature:Cookie Cutter Mode]] --><br>"\ "<p><><img source=\" toolsCookieCutAction\"><br> "\ "Activates <b>Cookie Cutter</b> mode, allowing you to cut out 3-D shapes from a "\ "slab of diamond or lonsdaleite lattice.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsCookieCutAction", self. toolsCookieCutAction.iconSet().pixmap() ) self. toolsCookieCutAction.setWhatsThis( toolsCookieCutActionText ) #### Extrude Tool #### toolsExtrudeActionText = "<u><b>Extrude Tool</b></u><!-- [[Feature:Extrude Mode]] --><br>"\ "<p><img source=\" toolsExtrudeAction\"><br> "\ "Activates <b>Extrude</b> mode, allowing you to create a rod or ring using a chunk as "\ "a repeating unit.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsExtrudeAction", self. toolsExtrudeAction.iconSet().pixmap() ) self. toolsExtrudeAction.setWhatsThis( toolsExtrudeActionText ) #### Fuse Chunks Tool #### toolsFuseChunksActionText = "<u><b>Fuse Chunks Tool</b></u><!-- [[Feature:Fuse Chunks Mode]] --><br>"\ "<p><img source=\" toolsFuseChunksAction\"><br> "\ "<b>Fuse Chunks</b> can be used to interactively join two or more "\ "chunks by dragging chunks around and fusing them together. "\ "Two types of fusing are supported:<br><br>"\ "<b>Make Bonds</b> creates bonds between the existing open bonds) "\ "of two or more chunks. Bonds are drawn (and undrawn) as chunks "\ "are moved together (and apart).<br><br>"\ "<b>Fuse Atoms</b> fuses overlapping atoms between chunks. Overlapping "\ "pairs of atoms are highlighted in green and blue to indicate which atoms "\ "will be fused.<br>"\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsFuseChunksAction", self. toolsFuseChunksAction.iconSet().pixmap() ) self.toolsFuseChunksAction.setWhatsThis( toolsFuseChunksActionText ) #### Fuse Atoms Tool #### toolsFuseAtomsActionText = "<u><b>Fuse Atoms Tool</b></u><!-- [[Feature:Fuse Atoms Mode]] (nim?) --><br>"\ "<p><img source=\" toolsFuseAtomsAction\"><br> "\ "<b>Fuse Atoms</b> fuses the overlapping atoms between two or more chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsFuseAtomsAction", self. toolsFuseAtomsAction.iconSet().pixmap() ) self.toolsFuseAtomsAction.setWhatsThis( toolsFuseAtomsActionText ) #### Movie Player #### simMoviePlayerActionText = "<u><b>Movie Player</b></u><br>"\ "<p><img source=\" simMoviePlayerAction\"><br> "\ "Plays the most recent trajectory (movie) file created by the <b>Simulator</b>.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " simMoviePlayerAction", self. simMoviePlayerAction.iconSet().pixmap() ) self. simMoviePlayerAction.setWhatsThis( simMoviePlayerActionText ) #### Simulator #### simSetupActionText = "<u><b>Simulator</b></u><br>"\ "<p><img source=\" simSetupAction\"><br> "\ "Creates a trajectory (movie) file by calculating the inter-atomic potentials and bonding "\ "of the entire model. The user determines the number of frames in the movie, the time step, "\ "and the temperature for the simulation.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " simSetupAction", self. simSetupAction.iconSet().pixmap() ) self. simSetupAction.setWhatsThis( simSetupActionText ) #### Plot Tool #### simPlotToolActionText = "<u><b>Plot Tool</b></u><br>"\ "<p><img source=\" simPlotToolAction\"><br> "\ "Plots a simulator trace file using GNUplot. A simulation must be run to create "\ "the trace file, and the part must have a jig that writes output to the trace file. <br><br>"\ "The following list of jigs write data to the trace file:<br>"\ "<b>Rotary Motors:</b> speed (GHz) and torque (nn-nm)<br>"\ "<b>Linear Motors:</b> displacement (pm)<br>"\ "<b>Anchors:</b> torque (nn-nm)<br>"\ "<b>Thermostats:</b> energy added (zJ)<br>"\ "<b>Thermometer:</b> temperature (K)<br>"\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " simPlotToolAction", self. simPlotToolAction.iconSet().pixmap() ) self. simPlotToolAction.setWhatsThis( simPlotToolActionText ) ############################################## # Dashboard Buttons ############################################## #### Done #### toolsDoneActionText = "<u><b>Done</b></u><br>"\ "<p><img source=\" toolsDoneAction\"><br> "\ "Completes the current operation and enters Select Chunks mode."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsDoneAction", self. toolsDoneAction.iconSet().pixmap() ) self. toolsDoneAction.setWhatsThis( toolsDoneActionText ) #### Cancel #### toolsCancelActionText = "<u><b>Cancel</b></u><br>"\ "<p><img source=\" toolsCancelAction\"><br> "\ "Cancels the current operation and enters Select Chunks mode."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsCancelAction", self.toolsCancelAction.iconSet().pixmap() ) self. toolsCancelAction.setWhatsThis( toolsCancelActionText ) #### Back up #### toolsBackUpActionText = "<u><b>Back Up</b></u><br>"\ "<p><img source=\" toolsBackUpAction\"><br> "\ "Undoes the previous operation."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsBackUpAction", self.toolsBackUpAction.iconSet().pixmap() ) self. toolsBackUpAction.setWhatsThis( toolsBackUpActionText ) #### Start Over #### toolsStartOverActionText = "<u><b>Start Over</b></u><br>"\ "<p><img source=\"toolsStartOverAction\"><br> "\ "Cancels the current operation, leaving the user in the current mode."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "toolsStartOverAction", self.toolsStartOverAction.iconSet().pixmap() ) self.toolsStartOverAction.setWhatsThis(toolsStartOverActionText ) #### Add Layers #### ccAddLayerActionText = "<u><b>Add Layer</b></u><br>"\ "<p><img source=\"ccAddLayerAction\"><br> "\ "Adds a new layer of diamond lattice to the existing layer.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "ccAddLayerAction", self.ccAddLayerAction.iconSet().pixmap() ) self.ccAddLayerAction.setWhatsThis(ccAddLayerActionText ) ############################################## # Jigs ############################################## #### Anchor #### jigsAnchorActionText = "<u><b>Anchor</b></u><br>"\ "<p><img source=\"jigsAnchorAction\"><br> "\ "Attaches a <b>Anchor</b> to the selected atom(s), which "\ "constrains its motion during a minimization or simulation.</p>"\ "<p>To create an Anchor, enter <b>Select Atoms</b> mode, "\ "select the atom(s) you want to anchor and then select this action. "\ "Anchors are drawn as a black wireframe box around each selected atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsAnchorAction", self.jigsAnchorAction.iconSet().pixmap() ) self.jigsAnchorAction.setWhatsThis(jigsAnchorActionText ) #### Rotary Motor #### jigsMotorActionText = "<u><b>Rotary Motor</b></u><br>"\ "<p><img source=\"jigsMotorAction\"><br> "\ "Attaches a <b>Rotary Motor</b> to the selected atoms. The Rotary Motor is used by "\ "the simulator to apply rotary motion to a set of atoms during a simulation run. You may "\ "specify the <b>torque (in nN*nm)</b> and <b>speed (in Ghz)</b> of the motor.</p>"\ "<p>To create a Rotary Motor, enter <b>Select Atoms</b> mode, "\ "select the atoms you want to attach the motor to and then select this action.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsMotorAction", self.jigsMotorAction.iconSet().pixmap() ) self.jigsMotorAction.setWhatsThis(jigsMotorActionText ) #### Linear Motor #### jigsLinearMotorActionText = "<u><b>Linear Motor</b></u><br>"\ "<p><img source=\"jigsLinearMotorAction\"><br> "\ "Attaches a <b>Linear Motor</b> to the selected atoms. The Linear Motor is used by "\ "the simulator to apply linear motion to a set of atoms during a simulation run. You may "\ "specify the <b>force (in nN*nm)</b> and <b>stiffness (in N/m)</b> of the motor.</p>"\ "<p>To create a Linear Motor, enter <b>Select Atoms</b> mode, "\ "select the atoms you want to attach the motor to and then select this action.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsLinearMotorAction", self.jigsLinearMotorAction.iconSet().pixmap() ) self.jigsLinearMotorAction.setWhatsThis(jigsLinearMotorActionText ) #### Thermostat #### jigsStatActionText = "<u><b>Thermostat</b></u><br>"\ "<p><img source=\"jigsStatAction\"><br> "\ "Attaches a <b>Langevin Thermostat</b> to a single selected atom, thereby associating "\ "the themostat to the entire molecule of which the selected atom is a member. The user "\ "specifies the temperature (in Kelvin).</p>"\ "<p>The Langevin Thermostat is used to set and hold the temperature "\ "of a molecule during a simulation run.</p>"\ "<p>To create a Langevin Thermostat, enter <b>Select Atoms</b> mode, "\ "select a single atom and then select this action. The thermostat is drawn as a "\ "blue wireframe box around the selected atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsStatAction", self.jigsStatAction.iconSet().pixmap() ) self.jigsStatAction.setWhatsThis(jigsStatActionText ) #### Thermometer #### jigsThermoActionText = "<u><b>Thermometer</b></u><br>"\ "<p><img source=\"jigsThermoAction\"><br> "\ "Attaches a <b>Thermometer</b> to a single selected atom, thereby associating "\ "the themometer to the entire molecule of which the selected atom is a member. "\ "<p>The temperature of the molecule will be recorded and written to a trace file "\ "during a simulation run.</p>"\ "<p>To create a Thermometer, enter <b>Select Atoms</b> mode, "\ "select a single atom and then select this action. The thermometer is drawn as a "\ "dark red wireframe box around the selected atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsThermoAction", self.jigsThermoAction.iconSet().pixmap() ) self.jigsThermoAction.setWhatsThis(jigsThermoActionText ) #### ESP Image #### jigsESPImageActionText = "<u><b>ESP Image</b></u></b></p><br>"\ "<p><img source=\"jigsESPImageAction\"><br> "\ "An <b>ESP Image</b> allows the user to visualize the electrostatic potential "\ "of points on the face of a square 2D surface. Nano-Hive's MPQC ESP Plane plug-in "\ "is used to calculate the electrostatic potential.</p>"\ "<p>To create an ESP Image, enter <b>Select Atoms</b> mode, "\ "select three or more atoms and then select this jig. The ESP Image is drawn as a "\ "plane with a bounding volume."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsESPImageAction", self.jigsESPImageAction.iconSet().pixmap() ) self.jigsESPImageAction.setWhatsThis(jigsESPImageActionText ) #### Atom Set #### jigsAtomSetActionText = "<u><b>Atom Set</b></u></b></p><br>"\ "<p><img source=\"jigsAtomSetAction\"><br> "\ "An <b>Atom Set</b> jig provides a convienient way to save an atom "\ "selection which can be reselected later.</p>"\ "<p>To create an Atom Set, enter <b>Select Atoms</b> mode, "\ "select any number of atoms and then select this jig. The Atom Set is "\ "drawn as a set of wireframe boxes around each atom in the selection.</p>"\ "<p>To reselect the atoms in an Atom Set, select it's context "\ "menu in the Model Tree and click the menu item that states "\ "<b>Select this jig's atoms</b>."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsAtomSetAction", self.jigsAtomSetAction.iconSet().pixmap() ) self.jigsAtomSetAction.setWhatsThis(jigsAtomSetActionText ) #### Measure Distance #### jigsDistanceActionText = "<u><b>Measure Distance</b></u></b></p><br>"\ "<p><img source=\"jigsDistanceAction\"><br> "\ "A <b>Measure Distance</b> jig functions as a dimension to display the "\ "distance between two atoms.</p>"\ "<p>To create the Measure Distance jig, enter <b>Select Atoms</b> mode, "\ "select two atoms and then select this jig. The Measure Distance jig is "\ "drawn as a pair of wireframe boxes around each atom connected by "\ "a line and a pair of numbers. The first number is the distance between the "\ "VdW radii (this can be a negative number for atoms that are close together). "\ "The second number is the distance between the nuclei.</p>"\ "<p>The Measure Distance jig will write the two distance values to the trace file "\ "for each frame of a simulation run and can be plotted using the Plot Tool."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsDistanceAction", self.jigsDistanceAction.iconSet().pixmap() ) self.jigsDistanceAction.setWhatsThis(jigsDistanceActionText ) #### Measure Angle #### jigsAngleActionText = "<u><b>Measure Angle</b></u></b></p><br>"\ "<p><img source=\"jigsAngleAction\"><br> "\ "A <b>Measure Angle</b> jig functions as a dimension to display the "\ "angle between three atoms.</p>"\ "<p>To create the Measure Angle jig, enter <b>Select Atoms</b> mode, "\ "select three atoms and then select this jig. The Measure Angle jig is "\ "drawn as a set of wireframe boxes around each atom and a number "\ "which is the angle between the three atoms.</p>"\ "<p>The Measure Angle jig will write the angle value to the trace file "\ "for each frame of a simulation run and can be plotted using the Plot Tool."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsAngleAction", self.jigsAngleAction.iconSet().pixmap() ) self.jigsAngleAction.setWhatsThis(jigsAngleActionText ) #### Measure Dihedral #### jigsDihedralActionText = "<u><b>Measure Dihedral</b></u></b></p><br>"\ "<p><img source=\"jigsDihedralAction\"><br> "\ "A <b>Measure Dihedral</b> jig functions as a dimension to display the "\ "dihedral angle of a four atom sequence.</p>"\ "<p>To create the Measure Dihedral jig, enter <b>Select Atoms</b> mode, "\ "select four atoms and then select this jig. The Measure Dihedral jig is "\ "drawn as a set of wireframe boxes around each atom and a number "\ "which is the dihedral angle value.</p>"\ "<p>The Measure Dihedral jig will write the dihedral angle value to the trace file "\ "for each frame of a simulation run and can be plotted using the Plot Tool."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsDihedralAction", self.jigsDihedralAction.iconSet().pixmap() ) self.jigsDihedralAction.setWhatsThis(jigsDihedralActionText ) ############################################## # Display ############################################## #### Display Object Color #### dispObjectColorActionText = "<u><b>Object Color</b></u><br>"\ "<p><img source=\"dispObjectColorAction\"><br> "\ "Allows you to change the color of the selected object(s).</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispObjectColorAction", self.dispObjectColorAction.iconSet().pixmap() ) self.dispObjectColorAction.setWhatsThis(dispObjectColorActionText ) #### Display Background Color #### dispBGColorActionText = "<u><b>Background Color</b></u><br>"\ "<p><img source=\"dispBGColorAction\"><br> "\ "Allows you to change the background color of the main window.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispBGColorAction", self.dispBGColorAction.iconSet().pixmap() ) self.dispBGColorAction.setWhatsThis(dispBGColorActionText ) ############################################## # Help Toolbar ############################################## #### What's This #### helpWhatsThisText = "<u><b>What's This</b></u><br>"\ "<p><img source=\"helpWhatsThis\"><br> "\ "Click this option to invoke a small question mark that is attached to the mouse pointer. "\ "Click on a feature which you would like more information about. "\ "A popup box appears with information about the feature.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "helpWhatsThis", self.helpWhatsThisAction.iconSet().pixmap() ) self.helpWhatsThisAction.setWhatsThis( helpWhatsThisText ) ############################################## # Datum Display Toolbar ############################################## #### Display Trihedron #### dispTrihedronText = "<u><b>Display Trihedron</b></u><br>"\ "<p><img source=\"dispTrihedron\"><br> "\ "Toggles the trihedron on and off.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispTrihedron", self.dispTrihedronAction.iconSet().pixmap() ) self.dispTrihedronAction.setWhatsThis(dispTrihedronText ) #### Display Csys #### dispCsysText = "<u><b>Display Csys Axis</b></u><br>"\ "<p><img source=\"dispCsys\"><br> "\ "Toggles the coordinate system axis on and off."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispCsys", self.dispCsysAction.iconSet().pixmap() ) self.dispCsysAction.setWhatsThis(dispCsysText ) #### Display Datum Lines #### dispDatumLinesText = "<u><b>Display Datum Lines</b></u><br>"\ "<p><img source=\"dispDatumLines\"><br> "\ "Toggles Datum Lines on and off.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispDatumLines", self.dispDatumLinesAction.iconSet().pixmap() ) self.dispDatumLinesAction.setWhatsThis(dispDatumLinesText ) #### Display Datum Planes #### dispDatumPlanesText = "<u><b>Display Datum Planes</b></u><br>"\ "<p><img source=\"dispDatumPlanes\"><br> "\ "Toggles Datum Planes on and off.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispDatumPlanes", self.dispDatumPlanesAction.iconSet().pixmap() ) self.dispDatumPlanesAction.setWhatsThis(dispDatumPlanesText ) #### Display Grid #### dispGridText = "<u><b>Display 3-D Grid</b></u><br>"\ "<p><img source=\"dispGrid\"><br> "\ "Toggles the 3-D grid on and off."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispGrid", self.dispGridAction.iconSet().pixmap() ) self.dispGridAction.setWhatsThis(dispGridText ) #### Display Open Bonds #### dispOpenBondsText = "<u><b>Display Singlets</b></u><br>"\ "<p><img source=\"dispOpenBonds\"><br> "\ "Toggles Singlets on and off."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispOpenBonds", self.dispOpenBondsAction.iconSet().pixmap() ) self.dispOpenBondsAction.setWhatsThis(dispOpenBondsText ) | c9a25d437341caa5f0c88a4ab02c54ebb7627482 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/c9a25d437341caa5f0c88a4ab02c54ebb7627482/whatsthis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
2888,
2323,
2503,
12,
2890,
4672,
225,
19709,
26487,
7,
468,
1387,
13288,
3215,
19709,
26487,
7,
225,
11849,
7,
3502,
1387,
11849,
7,
225,
585,
3678,
1528,
273,
3532,
89,
4438,
70,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
2888,
2323,
2503,
12,
2890,
4672,
225,
19709,
26487,
7,
468,
1387,
13288,
3215,
19709,
26487,
7,
225,
11849,
7,
3502,
1387,
11849,
7,
225,
585,
3678,
1528,
273,
3532,
89,
4438,
70,
... |
'******************************************************** | ******************************************************** | def initializeConfig(self, cfg=None): if cfg is None: cfg = self.handle.getConfig() ui = self.handle.ui ui.write('''\ | 97264c405a2c2d9bf329ebcf3d9753a3c1f48507 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8748/97264c405a2c2d9bf329ebcf3d9753a3c1f48507/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
809,
12,
2890,
16,
2776,
33,
7036,
4672,
309,
2776,
353,
599,
30,
2776,
273,
365,
18,
4110,
18,
588,
809,
1435,
5915,
273,
365,
18,
4110,
18,
4881,
5915,
18,
2626,
2668,
6309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4046,
809,
12,
2890,
16,
2776,
33,
7036,
4672,
309,
2776,
353,
599,
30,
2776,
273,
365,
18,
4110,
18,
588,
809,
1435,
5915,
273,
365,
18,
4110,
18,
4881,
5915,
18,
2626,
2668,
6309,
... |
if url: | if url is not None: | def load_url(url, verbose = False, gz = False, xmldoc = None): """ This function has the same behaviour as load_filename() but accepts a URL instead of a filename. Any source from which Python's urllib2 library can read data is acceptable. stdin is parsed if the URL is None. If the optional xmldoc argument is provided and is not None, the parsed XML tree will be appended to that document, otherwise a new document will be created. Example: >>> from glue.ligolw import utils >>> xmldoc = utils.load_url("file://localhost/tmp/data.xml") Bugs: - Due to limitations in Python's gzip support and in the way its URL library transfers data, it is not possible to read gzipped XML files from remote locations. Reading gzipped XML files locally should work correctly. """ if verbose: print >>sys.stderr, "reading %s ..." % (url or "stdin") if url: # hack to detect local files: urlopen() returns an object # that does not support seeking, which prevents GzipFile # from working correctly; by opening local files as # regular files, this gets gzip support working for the # local case; still can't read .xml.gz files from a remote # host, though; what's needed is some kind of buffering # wrapper to provide seeking (I don't think GzipFile wants # to seek very far) (scheme, host, path, nul, nul, nul) = urlparse.urlparse(url) if scheme.lower() in ("", "file") and host.lower() in ("", "localhost"): fileobj = file(path) else: fileobj = urllib2.urlopen(url) else: fileobj = sys.stdin if gz: fileobj = gzip.GzipFile(mode = "rb", fileobj = fileobj) if xmldoc == None: xmldoc = ligolw.Document() ligolw.make_parser(ContentHandler(xmldoc)).parse(fileobj) return xmldoc | 7567ffee48a6f61868139e76e9072ef48d505add /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3589/7567ffee48a6f61868139e76e9072ef48d505add/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
718,
12,
718,
16,
3988,
273,
1083,
16,
14136,
273,
1083,
16,
2025,
2434,
273,
599,
4672,
3536,
1220,
445,
711,
326,
1967,
14273,
487,
1262,
67,
3459,
1435,
1496,
8104,
279,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
718,
12,
718,
16,
3988,
273,
1083,
16,
14136,
273,
1083,
16,
2025,
2434,
273,
599,
4672,
3536,
1220,
445,
711,
326,
1967,
14273,
487,
1262,
67,
3459,
1435,
1496,
8104,
279,
1... |
def readinto(self, b: bytes) -> int: """readinto(b: bytes) -> int. Read up to len(b) bytes into b. | def readinto(self, b: bytearray) -> int: """readinto(b: bytearray) -> int. Read up to len(b) bytes into b. | def readinto(self, b: bytes) -> int: """readinto(b: bytes) -> int. Read up to len(b) bytes into b. | 35d42ead6ae06a4bd274751bbe03afa806ff8a26 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/35d42ead6ae06a4bd274751bbe03afa806ff8a26/io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
18591,
12,
2890,
16,
324,
30,
1731,
13,
317,
509,
30,
3536,
896,
18591,
12,
70,
30,
1731,
13,
317,
509,
18,
225,
2720,
731,
358,
562,
12,
70,
13,
1731,
1368,
324,
18,
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,
855,
18591,
12,
2890,
16,
324,
30,
1731,
13,
317,
509,
30,
3536,
896,
18591,
12,
70,
30,
1731,
13,
317,
509,
18,
225,
2720,
731,
358,
562,
12,
70,
13,
1731,
1368,
324,
18,
2,
-100,... |
self.__grid.RefreshTable() | self.__grid.FullRefresh() | def __init__(self, parent, title, testProcedure, tuples, animateAll, feelingViewerPath, pythonPath, preferences): wx.Dialog.__init__(self, parent, wx.ID_ANY, title, style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX | wx.CLIP_CHILDREN) sizer = wx.BoxSizer(wx.HORIZONTAL) self.__grid = FExecutionGrid(self, testProcedure, True, feelingViewerPath, pythonPath) self.__grid.AppendExecutionContext() self.__grid.SetAnimateAll(animateAll) (mainWidth, mainHeight, mainBlessed, mainPrevious, mainDiff, mainColumns) = preferences self.__grid.SetPreferences(mainWidth, mainHeight, mainBlessed, mainPrevious, mainDiff, mainColumns, False) i = 0 for test, execution in tuples: self.__grid.AddExecution(i, test, execution) i = i + 1 self.__grid.RefreshTable() sizer.Add(self.__grid, 1, wx.EXPAND) self.SetSizer(sizer) sizer.Fit(self) self.Bind(wx.EVT_SIZE, self.__OnSize) self.__grid.AdjustScrollbars() | cf8f8788a56009d8e5bb8dea8dc09844cd516ad4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11176/cf8f8788a56009d8e5bb8dea8dc09844cd516ad4/FExecutionDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
2077,
16,
1842,
17213,
16,
10384,
16,
14671,
1595,
16,
1656,
292,
310,
18415,
743,
16,
5790,
743,
16,
12750,
4672,
7075,
18,
6353,
16186,
2738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
2077,
16,
1842,
17213,
16,
10384,
16,
14671,
1595,
16,
1656,
292,
310,
18415,
743,
16,
5790,
743,
16,
12750,
4672,
7075,
18,
6353,
16186,
2738,
... |
return redirect_to_url(req, target, apache.HTTP_MOVED_PERMANENTLY) | return redirect_to_url(req, target) | def legacy_collection(self, req, form): """Collection URL backward compatibility handling.""" accepted_args = dict(legacy_collection_default_urlargd) accepted_args.update({'referer' : (str, ''), 'realm' : (str, '')}) argd = wash_urlargd(form, accepted_args) | b0a53870704df5df168e98715f470029e877ff44 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/b0a53870704df5df168e98715f470029e877ff44/websearch_webinterface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8866,
67,
5548,
12,
2890,
16,
1111,
16,
646,
4672,
3536,
2532,
1976,
12555,
8926,
5057,
12123,
8494,
67,
1968,
273,
2065,
12,
17386,
67,
5548,
67,
1886,
67,
718,
3175,
72,
13,
8494,
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,
8866,
67,
5548,
12,
2890,
16,
1111,
16,
646,
4672,
3536,
2532,
1976,
12555,
8926,
5057,
12123,
8494,
67,
1968,
273,
2065,
12,
17386,
67,
5548,
67,
1886,
67,
718,
3175,
72,
13,
8494,
67... |
self.fileSize = size | self.fileSize = fmtsize(size) | def chooseFile(self, default, size, saveas, dir): self.file = default self.fileSize = size if saveas == '': saveas = default self.downloadTo = abspath(saveas) return saveas | 475bc2502a2632d7599dddb0ed5ed686f6cf773d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/475bc2502a2632d7599dddb0ed5ed686f6cf773d/btdownloadcurses.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9876,
812,
12,
2890,
16,
805,
16,
963,
16,
1923,
345,
16,
1577,
4672,
365,
18,
768,
273,
805,
365,
18,
768,
1225,
273,
1325,
1467,
12,
1467,
13,
309,
1923,
345,
422,
875,
30,
1923,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9876,
812,
12,
2890,
16,
805,
16,
963,
16,
1923,
345,
16,
1577,
4672,
365,
18,
768,
273,
805,
365,
18,
768,
1225,
273,
1325,
1467,
12,
1467,
13,
309,
1923,
345,
422,
875,
30,
1923,
... |
self.displayed_name=filename | self.displayed_name=os.path.split(filename)[1] self.displayed_name = gnomevfs.unescape_string_for_display(self.displayed_name) | def __init__(self, filename="", displayed_name="", expected_hash="", size=0): if displayed_name: self.displayed_name=displayed_name else: self.displayed_name=filename self.filename=filename # the Hash loaded from file self.expected_hash=expected_hash # the Hash calculated self.real_hash="" # the file size self.size=size self.status=HASH_NOT_CHECKED | 65876d1e2138464085ca6544043de6d507359d13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2200/65876d1e2138464085ca6544043de6d507359d13/parano.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1544,
1546,
3113,
10453,
67,
529,
1546,
3113,
2665,
67,
2816,
1546,
3113,
963,
33,
20,
4672,
309,
10453,
67,
529,
30,
365,
18,
5417,
329,
67,
529,
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,
1001,
2738,
972,
12,
2890,
16,
1544,
1546,
3113,
10453,
67,
529,
1546,
3113,
2665,
67,
2816,
1546,
3113,
963,
33,
20,
4672,
309,
10453,
67,
529,
30,
365,
18,
5417,
329,
67,
529,
33,
... |
self.AppendUnique(CPPPATH=blitz_generated) | self.AppendUnique(CPPPATH = [blitz_generated] ) | def __init__(self, **kwargs): SConsEnvironment.__init__(self, **kwargs) self.Decider('MD5-timestamp') self["ENV"] = os.environ win32 = self["PLATFORM"] == "win32" # Print statements if not os.environ.has_key("VERBOSE"): self.Replace(CXXCOMSTR = "Compiling $TARGET") self.Replace(LINKCOMSTR = "Linking $TARGET") self.Replace(SHCXXCOMSTR = "Compiling $TARGET") self.Replace(SHLINKCOMSTR = "Linking $TARGET") # CXX if os.environ.has_key("CXX"): self.Replace(CXX = os.environ["CXX"]) # CXXFLAGS self.Append(CPPFLAGS="-D_REENTRANT") if os.environ.has_key("CXXFLAGS"): self.Append(CPPFLAGS=self.Split(os.environ["CXXFLAGS"])) else: if not win32: self.Append(CPPFLAGS=self.Split("-O0 -g -Wall")) self.Append(CPPFLAGS=self.Split("-ansi")) # self.Append(CPPFLAGS=self.Split("-pedantic -ansi")) Ice fails pedantic due to extra ";" self.Append(CPPFLAGS=self.Split("-Wno-long-long -Wnon-virtual-dtor")) # self.Append(CPPFLAGS=self.Split("-Wno-long-long -Wctor-dtor-privacy -Wnon-virtual-dtor")) Ice fails the ctor check. self.Append(CPPFLAGS=self.Split("-Wno-unused-parameter -Wno-unused-function -Wunused-variable -Wunused-value -Werror")) else: if self["CC"] == "cl": self.Append(CPPFLAGS=self.Split("/MD")) # # CPPPATH # self.AppendUnique(CPPPATH=blitz_generated) if ice_home: self.Append(CPPPATH=os.path.join(ice_home, "include")) if os.environ.has_key("CPPPATH"): self.AppendUnique(CPPPATH=os.environ["CPPPATH"].split(os.path.pathsep)) if win32: if os.path.exists(r"C:\Ice-3.3.0\include"): self.AppendUnique(CPPPATH=["C:\Ice-3.3.0\include"]) if os.path.exists(r"C:\Program Files\Microsoft Platform SDK\Include"): self.AppendUnique(CPPPATH=["C:\Program Files\Microsoft Platform SDK\Include"]) if os.environ.has_key("INCLUDE"): include = os.environ["INCLUDE"].split(os.path.pathsep) self.AppendUnique(CPPPATH=include) else: if os.path.exists("/opt/local/include"): self.AppendUnique(CPPPATH=["/opt/local/include"]) | 17c29d206f4a125b1e99b596a1e2ac07aaa1c464 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12409/17c29d206f4a125b1e99b596a1e2ac07aaa1c464/blitz_tools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2826,
4333,
4672,
20487,
5494,
16186,
2738,
972,
12,
2890,
16,
2826,
4333,
13,
365,
18,
1799,
3585,
2668,
6188,
25,
17,
5508,
6134,
365,
9614,
11986,
11929... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2826,
4333,
4672,
20487,
5494,
16186,
2738,
972,
12,
2890,
16,
2826,
4333,
13,
365,
18,
1799,
3585,
2668,
6188,
25,
17,
5508,
6134,
365,
9614,
11986,
11929... |
gclient_scm.CreateSCM( | gclient.gclient_scm.CreateSCM( | def OptIsRev333(options): return OptIsRev(options, 333) | 90ba161b70b445eba62b2a376e4fa2f508854e13 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6076/90ba161b70b445eba62b2a376e4fa2f508854e13/gclient_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12056,
2520,
10070,
3707,
23,
12,
2116,
4672,
327,
12056,
2520,
10070,
12,
2116,
16,
890,
3707,
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... | [
1,
1,
1,
1,
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,
12056,
2520,
10070,
3707,
23,
12,
2116,
4672,
327,
12056,
2520,
10070,
12,
2116,
16,
890,
3707,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
" return JSVAL_VOID;\n", | " return 0;\n", | def writeTraceableArgumentConversion(f, member, i, name, type, haveCcx, rvdeclared): argVal = "_arg%d" % i params = { 'name': name, 'argVal': argVal } typeName = getBuiltinOrNativeTypeName(type) if typeName is not None: template = traceableArgumentConversionTemplates.get(typeName) if template is not None: f.write(substitute(template, params)) return rvdeclared # else fall through; the type isn't supported yet. elif isInterfaceType(type): if type.name == 'nsIVariant': # Totally custom. assert haveCcx template = ( " nsCOMPtr<nsIVariant> ${name}(already_AddRefed<nsIVariant>(" "XPCVariant::newVariant(ccx, ${argVal})));\n" " if (!${name}) {\n") f.write(substitute(template, params)) writeFailure(f, getTraceInfoDefaultReturn(member.realtype), 2) return rvdeclared elif type.name == 'nsIAtom': # Should have special atomizing behavior. Fall through. pass else: if not rvdeclared: f.write(" nsresult rv;\n"); f.write(" %s *%s;\n" % (type.name, name)) f.write(" xpc_qsSelfRef %sref;\n" % name) f.write(" rv = xpc_qsUnwrapArg<%s>(" "cx, %s, &%s, &%sref.ptr, &vp.array[%d]);\n" % (type.name, argVal, name, name, 2 + i)) f.write(" if (NS_FAILED(rv)) {\n") if haveCcx: f.write(" xpc_qsThrowBadArgWithCcx(ccx, rv, %d);\n" % i) else: # XXX Fix this to return a real error! f.write(" xpc_qsThrowBadArgWithDetails(cx, rv, %d, " "\"%s\", \"%s\");\n" % (i, member.iface.name, member.name)) writeFailure(f, getTraceInfoDefaultReturn(member.realtype), 2) return True print member warn("Unable to unbox argument of type %s (for traceable arg)" % type.name) f.write(" !; // TODO - Unbox argument %s = arg%d\n" % (name, i)) return rvdeclared | 2fa0c6b4d6c84eedf3bba5ad940113fd4dff1584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11102/2fa0c6b4d6c84eedf3bba5ad940113fd4dff1584/qsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
3448,
429,
1379,
6814,
12,
74,
16,
3140,
16,
277,
16,
508,
16,
618,
16,
1240,
39,
71,
92,
16,
5633,
16571,
4672,
1501,
3053,
273,
4192,
3175,
9,
72,
6,
738,
277,
225,
859,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
3448,
429,
1379,
6814,
12,
74,
16,
3140,
16,
277,
16,
508,
16,
618,
16,
1240,
39,
71,
92,
16,
5633,
16571,
4672,
1501,
3053,
273,
4192,
3175,
9,
72,
6,
738,
277,
225,
859,
27... |
return self.graph( data, file, plot_type = 'BarGraph', statistics_line=True, *args, **kw ) def lineGraph(self, data, file, *args, **kw ): return self.graph( data, file, plot_type = 'LineGraph', statistics_line=True, *args, **kw ) | return self.graph( data, file, plot_type = 'BarGraph', statistics_line = True, *args, **kw ) def lineGraph( self, data, file, *args, **kw ): return self.graph( data, file, plot_type = 'LineGraph', statistics_line = True, *args, **kw ) | def barGraph( self, data, file, *args, **kw ): return self.graph( data, file, plot_type = 'BarGraph', statistics_line=True, *args, **kw ) | b29a492313d58334c8d949840590cb63407c88cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/b29a492313d58334c8d949840590cb63407c88cf/PlottingClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4653,
4137,
12,
365,
16,
501,
16,
585,
16,
380,
1968,
16,
2826,
9987,
262,
30,
327,
365,
18,
4660,
12,
501,
16,
585,
16,
3207,
67,
723,
273,
296,
5190,
4137,
2187,
7691,
67,
1369,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4653,
4137,
12,
365,
16,
501,
16,
585,
16,
380,
1968,
16,
2826,
9987,
262,
30,
327,
365,
18,
4660,
12,
501,
16,
585,
16,
3207,
67,
723,
273,
296,
5190,
4137,
2187,
7691,
67,
1369,
... |
gr = grLoad | def usingDeps(logConf, dset): grLoad = graph.digraph() grLoad.add_nodes(self._classList) | cc63842e2c36d25c959121cbb39df1cd38f7ab50 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/cc63842e2c36d25c959121cbb39df1cd38f7ab50/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1450,
14430,
12,
1330,
3976,
16,
23626,
4672,
3821,
2563,
273,
2667,
18,
5606,
1483,
1435,
3821,
2563,
18,
1289,
67,
4690,
12,
2890,
6315,
1106,
682,
13,
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,
1450,
14430,
12,
1330,
3976,
16,
23626,
4672,
3821,
2563,
273,
2667,
18,
5606,
1483,
1435,
3821,
2563,
18,
1289,
67,
4690,
12,
2890,
6315,
1106,
682,
13,
2,
-100,
-100,
-100,
-100,
-100,... | |
Return True if d can be used as a vector for self. | Return ``True`` if ``d`` can be used as a vector for ``self``. | def is_vector(self, d): """ Return True if d can be used as a vector for self. EXAMPLE:: sage: sr = mq.SR() sage: sr SR(1,1,1,4) sage: k = sr.base_ring() sage: A = Matrix(k, 1, 1, [k.gen()]) sage: B = sr.vector(A) sage: sr.is_vector(A) False sage: sr.is_vector(B) True """ return is_Matrix(d) and \ d.nrows() == self.r*self.c*self.e and \ d.ncols() == 1 and \ d.base_ring() == self.base_ring() | 64b5e0e9186de5235119791631990329cc9aecfa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/64b5e0e9186de5235119791631990329cc9aecfa/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
7737,
12,
2890,
16,
302,
4672,
3536,
2000,
12176,
5510,
10335,
309,
12176,
72,
10335,
848,
506,
1399,
487,
279,
3806,
364,
12176,
2890,
68,
8338,
225,
5675,
21373,
2866,
225,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
7737,
12,
2890,
16,
302,
4672,
3536,
2000,
12176,
5510,
10335,
309,
12176,
72,
10335,
848,
506,
1399,
487,
279,
3806,
364,
12176,
2890,
68,
8338,
225,
5675,
21373,
2866,
225,
27... |
space() | if node.hasComplexChildren(): line() else: space() | def compileNode(node): if node.type in [ "commentsBefore", "commentsAfter" ]: return if node.get("breakBefore", False) and not node.isFirstChild(True): sep() if node.getChild("commentsBefore", False) != None: commentCounter = 0 commentsBefore = node.getChild("commentsBefore") isFirst = node.isFirstChild() previous = node.getPreviousSibling(False, True) if previous and previous.type == "case": inCase = True else: inCase = False for child in commentsBefore.children: docComment = child.get("detail") in [ "javadoc", "qtdoc" ] headComment = child.get("detail") in [ "header" ] divComment = child.get("detail") in [ "divider" ] if not child.isFirstChild(): pass elif inCase: pass elif not isFirst: sep() elif not headComment: line() write(child.get("text")) # separator after divider/head comments if divComment or headComment: sep() # separator after block comments which are not for documentation elif child.get("detail") == "block" and not docComment: sep() else: line() ##################################################################################################################### # Opening... ##################################################################################################################### # # OPEN: MAP ################################## if node.type == "map": par = node.parent # No break before return statement if node.hasParent() and node.parent.type == "expression" and node.parent.parent.type == "return": pass elif node.isComplex(): line() write("{") if node.isComplex(): line() plus() elif node.hasChildren(True): space() # # OPEN: ARRAY ################################## elif node.type == "array": write("[") if node.isComplex(): line() plus() elif node.hasChildren(True): space() # # OPEN: BLOCK ################################## elif node.type == "block": if node.hasChildren(): if node.isComplex(): line() # in else, try to find the mode of the previous if first elif node.hasParent() and node.parent.type == "elseStatement": stmnt = node.parent.parent.getChild("statement") if stmnt.getChild("block", False) and stmnt.getChild("block", False).isComplex(): line() else: space() # in if, try to find the mode of the parent if (if existent) elif node.hasParent() and node.parent.type == "statement" and node.parent.parent.type == "loop" and node.parent.parent.get("loopType") == "IF": if node.parent.parent.hasParent() and node.parent.parent.parent.type == "elseStatement": stmnt = node.parent.parent.parent.parent.getChild("statement") if stmnt.getChild("block", False) and stmnt.getChild("block", False).isComplex(): line() else: space() else: space() # in catch/finally, try to find the mode of the try statement elif node.hasParent() and node.parent.hasParent() and node.parent.parent.type in [ "catch", "finally" ]: if node.parent.parent.parent.getChild("statement").getChild("block").isComplex(): line() else: space() else: space() else: space() write("{") if node.hasChildren(): plus() line() # # OPEN: PARAMS ################################## elif node.type == "params": write("(") # # OPEN: GROUP ################################## elif node.type == "group": write("(") # # OPEN: CASE ################################## elif node.type == "case": # force double new lines if not node.isFirstChild() and not node.getPreviousSibling(True).type == "case": sep() minus() line() write("case") space() # # OPEN: CATCH ################################## elif node.type == "catch": # If this statement block or the previous try were not complex, be not complex here, too if not node.getChild("statement").getChild("block").isComplex() and not node.parent.getChild("statement").getChild("block").isComplex(): noline() space() write("catch") # # OPEN: BREAK ################################## elif node.type == "break": write("break") if node.get("label", False): space() write(node.get("label", False)) # # OPEN: CONTINUE ################################## elif node.type == "continue": write("continue") if node.get("label", False): space() write(node.get("label", False)) # # OPEN: ELSE ################################## elif node.type == "elseStatement": if node.hasChild("commentsBefore"): pass else: # If this statement block and the previous were not complex, be not complex here, too inner = node.getChild("block", False) # Find inner IF statement (e.g. if; else if) if not inner and node.hasChild("loop"): inner = node.getChild("loop").getChild("statement").getChild("block", False) selfSimple = not inner or not inner.isComplex() prev = node.parent.getChild("statement") prevSimple = not prev.hasChild("block") or not prev.getChild("block").isComplex() if selfSimple and prevSimple and inner: noline() space() write("else") # This is a elseStatement without a block around (a set of {}) if not node.hasChild("block"): space() # # OPEN: TRY ################################## elif node.type == "switch": # Additional new line before each switch/try if not node.isFirstChild(True) and not node.getChild("commentsBefore", False): prev = node.getPreviousSibling(False, True) # No separation after case statements if prev != None and prev.type == "case": pass else: sep() if node.get("switchType") == "catch": write("try") elif node.get("switchType") == "case": write("switch") # # OPEN: FINALLY ################################## elif node.type == "finally": write("finally") # # OPEN: DELETE ################################## elif node.type == "delete": write("delete") space() # # OPEN: THROW ################################## elif node.type == "throw": write("throw") space() # # OPEN: NEW ################################## elif node.type == "instantiation": write("new") space() # # OPEN: RETURN ################################## elif node.type == "return": write("return") if node.hasChildren(): space() # # OPEN: DEFINITION LIST ################################## elif node.type == "definitionList": write("var") space() # # OPEN: DEFAULT ################################## elif node.type == "default": minus() # force double new lines sep() write("default") write(":") plus() line() # # OPEN: KEYVALUE ################################## elif node.type == "keyvalue": keyString = node.get("key") keyQuote = node.get("quote", False) if keyQuote != None: # print "USE QUOTATION" if keyQuote == "doublequotes": keyString = '"' + keyString + '"' else: keyString = "'" + keyString + "'" elif keyString in config.JSPROTECTED or not KEY.match(keyString): print "Warning: Auto protect key: %s" % keyString keyString = "\"" + keyString + "\"" if node.getChild("value").isComplex() and not node.isFirstChild(True): sep() write(keyString) space() # Fill with spaces # Do this only if the parent is complex (many entries) # But not if the value itself is complex if node.parent.isComplex() and not node.getChild("value").isComplex(): write(" " * (node.parent.get("maxKeyLength") - len(keyString))) write(":") space() # # OPEN: KEY ################################## elif node.type == "key": if node.parent.type == "accessor": write("[") # # OPEN: RIGHT ################################## elif node.type == "right": if node.parent.type == "accessor": write(".") # # OPEN: EXPRESSION ################################## elif node.type == "expression": if node.parent.type == "loop": loopType = node.parent.get("loopType") if loopType == "DO": stmnt = node.parent.getChild("statement") compact = stmnt.hasChild("block") and not stmnt.getChild("block").isComplex() if compact: noline() space() write("while") space() # open expression block of IF/WHILE/DO-WHILE/FOR statements write("(") elif node.parent.type == "catch": # open expression block of CATCH statement write("(") elif node.parent.type == "switch" and node.parent.get("switchType") == "case": # open expression block of SWITCH statement write("(") # # OPEN: LOOP ################################## elif node.type == "loop": # Additional new line before each loop if not node.isFirstChild(True) and not node.getChild("commentsBefore", False): prev = node.getPreviousSibling(False, True) # No separation after case statements if prev != None and prev.type == "case": pass else: sep() loopType = node.get("loopType") if loopType == "IF": write("if") space() elif loopType == "WHILE": write("while") space() elif loopType == "FOR": write("for") space() elif loopType == "DO": write("do") space() elif loopType == "WITH": write("with") space() else: print "Warning: Unknown loop type: %s" % loopType # # OPEN: FUNCTION ################################## elif node.type == "function": write("function") functionName = node.get("name", False) if functionName != None: space() write(functionName) # # OPEN: IDENTIFIER ################################## elif node.type == "identifier": name = node.get("name", False) if name != None: write(name) # # OPEN: DEFINITION ################################## elif node.type == "definition": if node.parent.type != "definitionList": write("var") space() write(node.get("identifier")) # # OPEN: CONSTANT ################################## elif node.type == "constant": if node.get("constantType") == "string": if node.get("detail") == "singlequotes": write("'") else: write('"') write(node.get("value")) if node.get("detail") == "singlequotes": write("'") else: write('"') else: write(node.get("value")) # # OPEN: THIRD (?: operation) ################################## elif node.type == "third": if node.parent.type == "operation": if node.parent.get("operator") == "HOOK": space() write(":") space() # # OPEN: LABEL ################################## elif node.type == "labelTerminator": write(":") # # OPEN: BODY ################################## elif node.type == "body": if not node.parent.getChild("params"): write("()") # # OPEN: COMMENT ################################## elif node.type == "comment": # insert a space before and no newline in the case of after comments if node.get("connection") == "after": noline() space() write(node.get("text")) # new line after inline comment (for example for syntactical reasons) if node.get("detail") == "inline": line() else: space() # # OPEN: ASSIGNMENT ################################## elif node.type == "assignment": if node.parent.type == "definition": oper = node.get("operator", False) realNode = node.parent.parent inForLoop = realNode.hasParent() and realNode.parent.type in [ "first", "second", "third" ] and realNode.parent.parent.type == "loop" and realNode.parent.parent.get("loopType") == "FOR" if not inForLoop and not oper in [ "INC", "DEC" ]: space() if oper != None: write(getTokenSource(oper)) else: write("=") if not inForLoop and not oper in [ "INC", "DEC" ]: space() # # INSIDE: FOR LOOP ################################## if node.hasParent() and node.parent.type == "loop" and node.parent.get("loopType") == "FOR": if node.type == "first": write("(") elif node.type == "statement": write(")") else: if node.type == "second" and not node.parent.hasChild("first"): write("(") if node.type == "third" and not node.parent.hasChild("first") and not node.parent.hasChild("second"): write("(") if not result.endswith(";") and not result.endswith("\n"): semicolon() space() # # INSIDE: OPERATION ################################## if node.hasParent() and node.parent.type == "operation": if node.parent.get("left", False) == True: oper = node.parent.get("operator") if oper == "TYPEOF": write("typeof") space() else: write(getTokenSource(oper)) ##################################################################################################################### # Children content ##################################################################################################################### if node.hasChildren(): for child in node.children: compileNode(child) ##################################################################################################################### # Closing node ##################################################################################################################### # # CLOSE: MAP ################################## if node.type == "map": if node.isComplex(): line() minus() elif node.hasChildren(True): space() write("}") # # CLOSE: ARRAY ################################## elif node.type == "array": if node.isComplex(): line() minus() elif node.hasChildren(True): space() write("]") # # CLOSE: KEY ################################## elif node.type == "key": if node.hasParent() and node.parent.type == "accessor": write("]") # # CLOSE: BLOCK ################################## elif node.type == "block": if node.hasChildren(): minus() line() write("}") comment(node) if node.hasChildren(): # Newline afterwards if node.parent.type == "body" and node.parent.parent.type == "function": # But only when this isn't a function block inside a assignment if node.parent.parent.parent.type in [ "right", "params" ]: pass elif node.parent.parent.parent.type == "value" and node.parent.parent.parent.parent.type == "keyvalue": pass else: line() else: line() # # CLOSE: PARAMS ################################## elif node.type == "params": write(")") # # CLOSE: SWITCH ################################## elif node.type == "switch": if node.get("switchType") == "case": minus() minus() line() write("}") comment(node) line() # Force a additinal line feed after each switch/try if not node.isLastChild(): sep() # # CLOSE: GROUP ################################## elif node.type == "group": write(")") # # CLOSE: CASE ################################## elif node.type == "case": write(":") comment(node) plus() line() # # CLOSE: CALL ################################## elif node.type == "call": if not node.getChild("params", False): write("()") # # CLOSE: FUNCTION ################################## elif node.type == "function": if not node.getChild("params", False): write("()") # # CLOSE: EXPRESSION ################################## elif node.type == "expression": if node.parent.type == "loop": write(")") # e.g. a if-construct without a block {} if node.parent.getChild("statement").hasChild("block"): pass elif node.parent.type == "loop" and node.parent.get("loopType") == "DO": pass else: space() elif node.parent.type == "catch": write(")") elif node.parent.type == "switch" and node.parent.get("switchType") == "case": write(")") comment(node) line() write("{") plus() plus() # # CLOSE: LOOP ################################## elif node.type == "loop": if node.get("loopType") == "DO": semicolon() comment(node) # Force a additinal line feed after each loop if not node.isLastChild(): sep() # # CLOSE: FIRST ################################## elif node.type == "first": if node.hasParent() and node.parent.type == "operation" and node.parent.get("left", False) != True: oper = node.parent.get("operator") if node.parent.parent.type == "statementList": realNode = node.parent.parent else: realNode = node.parent inForLoop = realNode.hasParent() and realNode.parent.type in [ "first", "second", "third" ] and realNode.parent.parent.type == "loop" and realNode.parent.parent.get("loopType") == "FOR" if oper == "IN": space() write("in") space() elif oper == "INSTANCEOF": space() write("instanceof") space() else: if not inForLoop and not oper in [ "INC", "DEC" ]: space() write(getTokenSource(oper)) if not inForLoop and not oper in [ "INC", "DEC" ]: space() # # CLOSE: LEFT ################################## elif node.type == "left": if node.hasParent() and node.parent.type == "assignment": oper = node.parent.get("operator", False) if node.parent.parent.type == "statementList": realNode = node.parent.parent else: realNode = node.parent inForLoop = realNode.hasParent() and realNode.parent.type in [ "first", "second", "third" ] and realNode.parent.parent.type == "loop" and realNode.parent.parent.get("loopType") == "FOR" if not inForLoop and not oper in [ "INC", "DEC" ]: space() if oper != None: write(getTokenSource(oper)) else: write("=") if not inForLoop and not oper in [ "INC", "DEC" ]: space() # # CLOSE: IDENTIFIER ################################## elif node.type == "identifier": if node.hasParent() and node.parent.type == "variable" and not node.isLastChild(True): write(".") # # CLOSE: ACCESSOR ################################## elif node.type == "accessor": if node.hasParent() and node.parent.type == "variable" and not node.isLastChild(True): write(".") # # CLOSE: KEYVALUE ################################## elif node.type == "keyvalue": if node.hasParent() and node.parent.type == "map" and not node.isLastChild(True): write(",") if node.getChild("value").isComplex() and not node.isLastChild(True): sep() elif node.parent.isComplex(): line() else: space() # # CLOSE: DEFINITION ################################## elif node.type == "definition": if node.hasParent() and node.parent.type == "definitionList" and not node.isLastChild(True): write(",") space() # # CLOSE: OTHER ################################## if node.hasParent() and not node.type in [ "comment", "commentsBefore", "commentsAfter" ]: # Add comma dividers between statements in these parents if node.parent.type in [ "array", "params", "statementList" ] and not node.isLastChild(True): write(",") space() # Semicolon handling if node.type in [ "block", "assignment", "call", "operation", "definitionList", "return", "break", "continue", "delete", "accessor", "instantiation", "throw", "variable" ]: # Default semicolon handling if node.parent.type in [ "block", "file" ]: semicolon() comment(node) line() if node.isComplex() and not node.isLastChild(): sep() # Special handling for switch statements elif node.parent.type == "statement" and node.parent.parent.type == "switch" and node.parent.parent.get("switchType") == "case": semicolon() comment(node) line() if node.isComplex() and not node.isLastChild(): sep() # Special handling for loops (e.g. if) without blocks {} elif node.parent.type in [ "statement", "elseStatement" ] and not node.parent.hasChild("block") and node.parent.parent.type == "loop": semicolon() comment(node) line() if node.isComplex() and not node.isLastChild(): sep() # # CLOSE: COMMENT ################################## # Rest of the after comments (not inserted previously) comment(node) | 9cf07c1c2688fd9e673e7730f281973f5d893b41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5718/9cf07c1c2688fd9e673e7730f281973f5d893b41/prettyprint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
907,
12,
2159,
4672,
225,
309,
756,
18,
723,
316,
306,
315,
9231,
4649,
3113,
315,
9231,
4436,
6,
308,
30,
327,
565,
309,
756,
18,
588,
2932,
8820,
4649,
3113,
1083,
13,
471,
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,
4074,
907,
12,
2159,
4672,
225,
309,
756,
18,
723,
316,
306,
315,
9231,
4649,
3113,
315,
9231,
4436,
6,
308,
30,
327,
565,
309,
756,
18,
588,
2932,
8820,
4649,
3113,
1083,
13,
471,
4... |
self.params['map_path'] = '/usr/local/share/pyx12/map' self.params['pickle_path'] = '/usr/local/share/pyx12/map' | def __init__(self, *config_files): ParamsBase.__init__(self) self.params['map_path'] = '/usr/local/share/pyx12/map' self.params['pickle_path'] = '/usr/local/share/pyx12/map' for filename in config_files: self.logger.debug('Read param file: %s' % (filename)) self._read_config_file(filename) | 6a42b4e6040291085c65f8bf1e9c02996cfce05c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11528/6a42b4e6040291085c65f8bf1e9c02996cfce05c/params.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1425,
67,
2354,
4672,
8861,
2171,
16186,
2738,
972,
12,
2890,
13,
565,
364,
1544,
316,
642,
67,
2354,
30,
365,
18,
4901,
18,
4148,
2668,
1994,
579,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
380,
1425,
67,
2354,
4672,
8861,
2171,
16186,
2738,
972,
12,
2890,
13,
565,
364,
1544,
316,
642,
67,
2354,
30,
365,
18,
4901,
18,
4148,
2668,
1994,
579,
... | |
sage: ap = r.available_packages() sage: ap[:3] ['aaMI', 'abind', 'AcceptanceSampling'] | sage: ap = r.available_packages() sage: len(ap) > 20 True | def available_packages(self): """ Returns a list of all available R package names. | cc0ae2fe046cb29c675913dd00183435eaa1f913 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/cc0ae2fe046cb29c675913dd00183435eaa1f913/r.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2319,
67,
10308,
12,
2890,
4672,
3536,
2860,
279,
666,
434,
777,
2319,
534,
2181,
1257,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2319,
67,
10308,
12,
2890,
4672,
3536,
2860,
279,
666,
434,
777,
2319,
534,
2181,
1257,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
task = self._install(pkg, cs, lk, None, pruneweight, depth) for res in task: yield res | task = trans.TaskInstall(self, pkg, cs, lk, None, pruneweight, self._yieldweight) for res in task: yield res; pruneweight=min(pruneweight,self._pruneweight); task.setWeights(pruneweight, self._yieldweight) | def _upgrade(self, pkgs, changeset, locked, pending, pruneweight, depth=0): depth += 1 trace(2, depth, "_upgrade(%s)", (pkgs)) | c2ff0e2fa3473e5898baf091e7a39f94abf28732 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8317/c2ff0e2fa3473e5898baf091e7a39f94abf28732/transaction.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
15097,
12,
2890,
16,
16922,
16,
22463,
16,
8586,
16,
4634,
16,
846,
318,
359,
1274,
16,
3598,
33,
20,
4672,
3598,
1011,
404,
2606,
12,
22,
16,
3598,
16,
4192,
15097,
9275,
87,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
15097,
12,
2890,
16,
16922,
16,
22463,
16,
8586,
16,
4634,
16,
846,
318,
359,
1274,
16,
3598,
33,
20,
4672,
3598,
1011,
404,
2606,
12,
22,
16,
3598,
16,
4192,
15097,
9275,
87,
2... |
print tmpnoloc if tmploc is not None and tmpnoloc is not None: if tmploc.rating is None: tmploc.rating = tmpnoloc.rating if tmploc.comments is not None: tmploc.comments = tmpnoloc.comments if tmploc.tags is None: tmploc.tags = tmpnoloc.tags | if tmpnoloc is not None: if tmploc.rating is None: tmploc.rating = tmpnoloc.rating if tmploc.comments is not None: tmploc.comments = tmpnoloc.comments if tmploc.tags is None: tmploc.tags = tmpnoloc.tags | def fetch(self): if not self.isbn: return try: lang = get_lang() lang = lang[:2] if re.match(r'(fr.*|de.*)', lang) else 'all' if lang == 'all': self.results = get_social_metadata(self.title, self.book_author, self.publisher, self.isbn, verbose=self.verbose, lang='all')[0] else: tmploc = ThreadwithResults(AmazonError, self.verbose, get_social_metadata, self.title, self.book_author, self.publisher,self.isbn, verbose=self.verbose, lang=lang) tmpnoloc = ThreadwithResults(AmazonError, self.verbose, get_social_metadata, self.title, self.book_author, self.publisher, self.isbn, verbose=self.verbose, lang='all') tmploc.start() tmpnoloc.start() tmploc.join() tmpnoloc.join() tmploc= tmploc.get_result() if tmploc is not None: tmploc = tmploc[0] tmpnoloc= tmpnoloc.get_result() if tmpnoloc is not None: tmpnoloc = tmpnoloc[0] print tmpnoloc if tmploc is not None and tmpnoloc is not None: if tmploc.rating is None: tmploc.rating = tmpnoloc.rating if tmploc.comments is not None: tmploc.comments = tmpnoloc.comments if tmploc.tags is None: tmploc.tags = tmpnoloc.tags self.results = tmploc except Exception, e: self.exception = e self.tb = traceback.format_exc() | 5c89b576e31b85e17cf14e85a72b1b876f87579c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/5c89b576e31b85e17cf14e85a72b1b876f87579c/amazonbis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
12,
2890,
4672,
309,
486,
365,
18,
291,
13392,
30,
327,
775,
30,
3303,
273,
336,
67,
4936,
1435,
3303,
273,
3303,
10531,
22,
65,
309,
283,
18,
1916,
12,
86,
11,
12,
4840,
4509,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
12,
2890,
4672,
309,
486,
365,
18,
291,
13392,
30,
327,
775,
30,
3303,
273,
336,
67,
4936,
1435,
3303,
273,
3303,
10531,
22,
65,
309,
283,
18,
1916,
12,
86,
11,
12,
4840,
4509,... |
self.show() | if debug_pref("MT debug: show after replace", Choice_boolean_True, non_debug = True, prefs_key = True): self.show() | def expand_if_open(item): if item is rootItem: return node = item.node open = node.openable() and node.open index = self.qtmodel.indexdict[item] self.setExpanded( index, open ) | 09f4b2b5afd4e506347273952e6321d8037ddbc7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/09f4b2b5afd4e506347273952e6321d8037ddbc7/modelTreeGui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
67,
430,
67,
3190,
12,
1726,
4672,
309,
761,
353,
1365,
1180,
30,
327,
756,
273,
761,
18,
2159,
1696,
273,
756,
18,
3190,
429,
1435,
471,
756,
18,
3190,
770,
273,
365,
18,
2331... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
67,
430,
67,
3190,
12,
1726,
4672,
309,
761,
353,
1365,
1180,
30,
327,
756,
273,
761,
18,
2159,
1696,
273,
756,
18,
3190,
429,
1435,
471,
756,
18,
3190,
770,
273,
365,
18,
2331... |
webcommands.changeset = webcommands.rev = kwweb_changeset webcommands.filediff = webcommands.diff = kwweb_filediff | def kwweb_filediff(web, req, tmpl): try: _kwtemplater.matcher = util.never except AttributeError: pass return web.filediff(tmpl, web.filectx(req)) | fccc3b48cb568f0d49fe72ea7746183f3e259c3d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/fccc3b48cb568f0d49fe72ea7746183f3e259c3d/keyword.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5323,
4875,
67,
768,
5413,
12,
4875,
16,
1111,
16,
10720,
4672,
775,
30,
389,
9987,
27380,
2045,
18,
22761,
273,
1709,
18,
4644,
502,
1335,
6394,
30,
1342,
327,
3311,
18,
768,
5413,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5323,
4875,
67,
768,
5413,
12,
4875,
16,
1111,
16,
10720,
4672,
775,
30,
389,
9987,
27380,
2045,
18,
22761,
273,
1709,
18,
4644,
502,
1335,
6394,
30,
1342,
327,
3311,
18,
768,
5413,
12... | |
err("%s already ran %s" % (semname,freq),log) | msg="%s already ran %s" % (semname,freq) sys.stderr.write("%\n" % msg) log.debug(msg) | def main(): # expect to be called with # <freq> <semaphore-name> <module-name> args if len(sys.argv) < 4: Usage(sys.stderr) sys.exit(1) (freq,semname,modname)=sys.argv[1:4] run_args=sys.argv[4:] cloudinit.logging_set_from_cfg_file() log = logging.getLogger() log.info("cloud-init-run-module %s" % sys.argv[1:]) cloud = cloudinit.CloudInit() try: cloud.get_data_source() except Exception as e: fail("Failed to get instance data\n\t%s" % traceback.format_exc(),log) if cloud.sem_has_run(semname,freq): err("%s already ran %s" % (semname,freq),log) sys.exit(0) try: mod = __import__('cloudinit.' + modname) inst = getattr(mod,modname) except: fail("Failed to load module cloudinit.%s\n" % modname) import os cfg_path = None cfg_env_name = cloudinit.cfg_env_name if os.environ.has_key(cfg_env_name): cfg_path = os.environ[cfg_env_name] try: cloud.sem_and_run(semname, freq, inst.run, [run_args,cfg_path,log], False) except Exception as e: fail("Execution of %s failed:%s" % (semname,e), log) sys.exit(0) | ed3f86d5e459b9a76f73630e8072578cfe9d8fc3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10142/ed3f86d5e459b9a76f73630e8072578cfe9d8fc3/cloud-init-run-module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
4489,
358,
506,
2566,
598,
468,
282,
411,
10212,
34,
411,
307,
1458,
76,
479,
17,
529,
34,
411,
2978,
17,
529,
34,
833,
309,
562,
12,
9499,
18,
19485,
13,
411,
1059... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
4489,
358,
506,
2566,
598,
468,
282,
411,
10212,
34,
411,
307,
1458,
76,
479,
17,
529,
34,
411,
2978,
17,
529,
34,
833,
309,
562,
12,
9499,
18,
19485,
13,
411,
1059... |
parser.add_option("-d", "--maildir", dest="mailbox", help="mailbox (this or mailbox is required)") | parser.add_option("-d", "--maildir", dest="maildir", help="mailbox (this or mailbox is required)") | def main(mb, smtp_server): # do the work count = 0 errors = 0 msg = mb.next() count = count + 1 while msg is not None: document = msg.fp.read() headers = msg.__str__( ) # remove Delivered-To headers new_headers = "" for line in headers.splitlines(True): if not line.startswith("Delivered-To"): new_headers += line fullmsg = new_headers + '\x0a' + document try: print "%d Sending mail From: %s on date: %s" % (count, msg.getaddr('From')[1], msg['Date']) server = smtplib.SMTP(smtp_server) server.set_debuglevel(False) server.sendmail(msg.getaddr('From')[1], options.email, fullmsg) server.quit() # for debugging #print fullmsg except: print "Error sending message %d" % (count) print "Exception: ", sys.exc_info()[0] errors = errors + 1 # check queue size before continuing if "localhost" == smtp_server: (num_active, num_deferred, num_hold) = check_postfix_queues.get_queue_lengths() sleep_time = 1 print "Active: %d Deferred: %d" % (num_active, num_deferred) while num_active + num_deferred > threshold: time.sleep(sleep_time) (num_active, num_deferred, num_hold) = check_postfix_queues.get_queue_lengths() print "Active: %d Deferred: %d" % (num_active, num_deferred) sleep_time = sleep_time + 1 else: time.sleep(5) # go to next message msg = mb.next() count = count + 1 print "Attempted to send %d messages, received %d errors" % (count, errors) | 47f9937a256c6e75556efbedc3e9246548bfd067 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11912/47f9937a256c6e75556efbedc3e9246548bfd067/resend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
1627,
16,
17660,
67,
3567,
4672,
468,
741,
326,
1440,
1056,
273,
374,
1334,
273,
374,
1234,
273,
4903,
18,
4285,
1435,
1056,
273,
1056,
397,
404,
1323,
1234,
353,
486,
599,
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,
2774,
12,
1627,
16,
17660,
67,
3567,
4672,
468,
741,
326,
1440,
1056,
273,
374,
1334,
273,
374,
1234,
273,
4903,
18,
4285,
1435,
1056,
273,
1056,
397,
404,
1323,
1234,
353,
486,
599,
3... |
data = DoxyfileParse(source[0].get_contents(), str(source[0].dir)) | data = DoxyfileParse(source[0].abspath) | def DoxyEmitter(source, target, env): """Doxygen Doxyfile emitter""" # possible output formats and their default values and output locations output_formats = { "HTML": ("YES", "html"), "LATEX": ("YES", "latex"), "RTF": ("NO", "rtf"), "MAN": ("YES", "man"), "XML": ("NO", "xml"), } data = DoxyfileParse(source[0].get_contents(), str(source[0].dir)) targets = [] out_dir = data.get("OUTPUT_DIRECTORY", ".") # add our output locations for (k, v) in output_formats.items(): if data.get("GENERATE_" + k, v[0]) == "YES": # Grmpf ... need to use a File object here. The problem is, that # Dir.scan() is implemented to just return the directory entries # and does *not* invoke the source-file scanners .. ARGH !! dir = env.Dir( os.path.join(str(source[0].dir), out_dir, data.get(k + "_OUTPUT", v[1])) ) node = env.File( os.path.join(str(dir), ".stamp" ) ) env.Clean(node, dir) targets.append( node ) if data.has_key("GENERATE_TAGFILE"): targets.append(env.File( os.path.join(str(source[0].dir), data["GENERATE_TAGFILE"]) )) # don't clobber targets for node in targets: env.Precious(node) return (targets, source) | 1be18a2af8b3880d492f80349c68c4d9cf1ae16a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2548/1be18a2af8b3880d492f80349c68c4d9cf1ae16a/Doxygen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2256,
1698,
13476,
12,
3168,
16,
1018,
16,
1550,
4672,
3536,
3244,
1698,
4507,
2256,
1698,
768,
11520,
8395,
468,
3323,
876,
6449,
471,
3675,
805,
924,
471,
876,
7838,
876,
67,
11962,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2256,
1698,
13476,
12,
3168,
16,
1018,
16,
1550,
4672,
3536,
3244,
1698,
4507,
2256,
1698,
768,
11520,
8395,
468,
3323,
876,
6449,
471,
3675,
805,
924,
471,
876,
7838,
876,
67,
11962,
27... |
print >> sys.stderr, " <labFile> An annotation file from wave surfer" print >> sys.stderr, " <attributeName> Attribute name for the segmentation" print >> sys.stderr, " <labelFilter> A regular expresion to filter segments by label (default: all segments)" print >> sys.stderr, " <childScope> If defined the child scope that should contain the label attribute (by default it is discarded)" print >> sys.stderr, " <labelAttribute> The attribute that holds the label" | print >> sys.stderr, " <labFileList> A list of annotation files from wave surfer ('-' means stdin)" print >> sys.stderr, " <segmentationAttr> Attribute name for the segmentation" print >> sys.stderr, " <labelFilter> A regular expresion to filter segments by label (default: all segments)" print >> sys.stderr, " <childScope> If defined the child scope that should contain the label attribute (by default it is discarded)" print >> sys.stderr, " <labelAttribute> The attribute that holds the label" | def Lab2Plot(labfile, output, attributeName, filter, childScope, labelAttribute): print >> output, '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>' print >> output, '<DescriptorsPool>' print >> output, '\t<ScopePool name="Song" size="1">' tokens = list() labelFilter = re.compile(filter) for line in labfile: segment = line.split(" ",3) if len(segment)!=3: print >> sys.stderr, "Found a line with %s tokens, 3 expected"%len(segment) continue segment[2]=segment[2].rstrip().lstrip() if not labelFilter.match(segment[2]): continue tokens.append(segment) sampleRate=44100 print >> output, '\t\t<AttributePool name="%s" size="%s">'%(attributeName, len(tokens)) , for segment in tokens : print >> output, float(segment[0])*sampleRate, float(segment[1])*sampleRate, print >> output, '</AttributePool>' print >> output, '\t</ScopePool>' if childScope!=None: print >> output, '\t<ScopePool name="%s" size="%s">' % (childScope, len(tokens)) print >> output, '\t\t<AttributePool name="%s">' % (labelAttribute) for segment in tokens : print >> output, '\t\t\t<Enumerated>%s</Enumerated>' % ( segment[2] ) print >> output, '\t\t</AttributePool>' print >> output, '\t</ScopePool>' print >> output, '</DescriptorsPool>' return dict.fromkeys([ segment[2] for segment in tokens ]).keys() # unique labels | f646eda301256e171621c2f85311c090f7b0abda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1456/f646eda301256e171621c2f85311c090f7b0abda/Lab2Pools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
511,
378,
22,
11532,
12,
7411,
768,
16,
876,
16,
9734,
16,
1034,
16,
1151,
3876,
16,
1433,
1499,
4672,
1172,
1671,
876,
16,
16617,
2902,
1177,
1546,
21,
18,
20,
6,
2688,
1546,
5159,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
511,
378,
22,
11532,
12,
7411,
768,
16,
876,
16,
9734,
16,
1034,
16,
1151,
3876,
16,
1433,
1499,
4672,
1172,
1671,
876,
16,
16617,
2902,
1177,
1546,
21,
18,
20,
6,
2688,
1546,
5159,
... |
if not field.store: if not field._fnct_search: self.__exp[i] = self.__DUMMY_LEAF else: subexp = field.search(cr, uid, table, left, [self.__exp[i]], context=context) self.__exp[i] = '&' self.__exp.insert(i + 1, self.__DUMMY_LEAF) for j, se in enumerate(subexp): self.__exp.insert(i + 2 + j, se) | if not field._fnct_search: self.__exp[i] = self.__DUMMY_LEAF else: subexp = field.search(cr, uid, table, left, [self.__exp[i]], context=context) self.__exp[i] = '&' self.__exp.insert(i + 1, self.__DUMMY_LEAF) for j, se in enumerate(subexp): self.__exp.insert(i + 2 + j, se) | def rg(ids, table, parent): if not ids: return [] ids2 = table.search(cr, uid, [(parent, 'in', ids)], context=context) return ids + rg(ids2, table, parent) | 9148fc2662f99d7578a9688919567b94ee89e42d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9148fc2662f99d7578a9688919567b94ee89e42d/expression.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14524,
12,
2232,
16,
1014,
16,
982,
4672,
309,
486,
3258,
30,
327,
5378,
3258,
22,
273,
1014,
18,
3072,
12,
3353,
16,
4555,
16,
306,
12,
2938,
16,
296,
267,
2187,
3258,
13,
6487,
819... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14524,
12,
2232,
16,
1014,
16,
982,
4672,
309,
486,
3258,
30,
327,
5378,
3258,
22,
273,
1014,
18,
3072,
12,
3353,
16,
4555,
16,
306,
12,
2938,
16,
296,
267,
2187,
3258,
13,
6487,
819... |
'user_id': fields.many2one('res.users', 'User Ref.', required=True, ondelete='cascade'), 'resource': fields.char('Resource Name', size=64, required=True) } | 'user_id': fields.many2one('res.users', 'User Ref.', required=True, ondelete='cascade', select=True), 'resource': fields.char('Resource Name', size=64, required=True, select=True) } def _auto_init(self, cr, context=None): super(view_sc, self)._auto_init(cr, context) cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'ir_ui_view_sc_user_id_resource\'') if not cr.fetchone(): cr.execute('CREATE INDEX ir_ui_view_sc_user_id_resource ON ir_ui_view_sc (user_id, resource)') | def graph_get(self, cr, uid, id, model, node_obj, conn_obj, src_node, des_node,label,scale,context={}): if not label: label = [] nodes=[] nodes_name=[] transitions=[] start=[] tres={} labels={} no_ancester=[] blank_nodes = [] | aeed07950ceb164ca8508db93d9c69a9556242bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/aeed07950ceb164ca8508db93d9c69a9556242bb/ir_ui_view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2667,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
938,
16,
756,
67,
2603,
16,
1487,
67,
2603,
16,
1705,
67,
2159,
16,
2832,
67,
2159,
16,
1925,
16,
5864,
16,
2472,
12938,
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,
2667,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
938,
16,
756,
67,
2603,
16,
1487,
67,
2603,
16,
1705,
67,
2159,
16,
2832,
67,
2159,
16,
1925,
16,
5864,
16,
2472,
12938,
4... |
lst = [self.path.find_or_declare(f) for f in self.env[CFG_FILES]] | lst = [self.root.find_or_declare(f) for f in self.env[CFG_FILES]] | def clean(self): """clean the data and some files in the build dir .. well, TODO""" Logs.debug('build: clean called') | edc70fa0fc080134b05b7749702338716e436f3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2886/edc70fa0fc080134b05b7749702338716e436f3b/Build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
12,
2890,
4672,
3536,
6200,
326,
501,
471,
2690,
1390,
316,
326,
1361,
1577,
6116,
5492,
16,
2660,
8395,
20238,
18,
4148,
2668,
3510,
30,
2721,
2566,
6134,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
12,
2890,
4672,
3536,
6200,
326,
501,
471,
2690,
1390,
316,
326,
1361,
1577,
6116,
5492,
16,
2660,
8395,
20238,
18,
4148,
2668,
3510,
30,
2721,
2566,
6134,
2,
-100,
-100,
-100,
-10... |
return 1 | def create_list(userdesc, perms, vhost, listname, desc, advertise, modlevel, inslevel, owners, members): """ Create a new list. @root """ name = vhost.lower() + VHOST_SEP + listname.lower(); if Utils.list_exists(name): return 0 owner = [] for o in owners: email = to_forlife(o)[0] if email is not None: owner.append(email) if len(owner) is 0: return 0 mlist = MailList.MailList() try: oldmask = os.umask(002) pw = sha.new('foobar').hexdigest() try: mlist.Create(name, owner[0], pw) finally: os.umask(oldmask) mlist.real_name = listname mlist.host_name = 'listes.polytechnique.org' mlist.description = desc mlist.advertised = int(advertise) is 0 mlist.default_member_moderation = int(modlevel) is 2 mlist.generic_nonmember_action = int(modlevel) > 0 mlist.subscribe_policy = 2 * (int(inslevel) is 1) mlist.admin_notify_mchanges = (mlist.subscribe_policy or mlist.generic_nonmember_action or mlist.default_member_moderation or not mlist.advertised) mlist.owner = owner mlist.subject_prefix = '['+listname+'] ' mlist.max_message_size = 0 inverted_listname = listname.lower() + '_' + vhost.lower() mlist.msg_footer = "_______________________________________________\n" \ + "Liste de diffusion %(real_name)s\n" \ + "http://listes.polytechnique.org/members/" + inverted_listname mlist.header_filter_rules = [] mlist.header_filter_rules.append(('X-Spam-Flag: Unsure, tests=bogofilter', mm_cfg.HOLD, False)) mlist.header_filter_rules.append(('X-Spam-Flag: Yes, tests=bogofilter', mm_cfg.HOLD, False)) mlist.Save() mlist.Unlock() if ON_CREATE_CMD != '': try: os.system(ON_CREATE_CMD + ' ' + name) except: pass check_options(userdesc, perms, mlist, True) mass_subscribe(userdesc, perms, mlist, members) # avoid the "-1 mail to moderate" bug mlist = MailList.MailList(name) mlist._UpdateRecords() mlist.Save() return 1 finally: mlist.Unlock() return 0 | f72731f698b36c12306361fdd881a4a5ae9913e7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5724/f72731f698b36c12306361fdd881a4a5ae9913e7/lists.rpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
1098,
12,
1355,
5569,
16,
13793,
16,
16574,
16,
666,
529,
16,
3044,
16,
31553,
16,
681,
2815,
16,
2763,
2815,
16,
25937,
16,
4833,
4672,
3536,
1788,
279,
394,
666,
18,
632,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
1098,
12,
1355,
5569,
16,
13793,
16,
16574,
16,
666,
529,
16,
3044,
16,
31553,
16,
681,
2815,
16,
2763,
2815,
16,
25937,
16,
4833,
4672,
3536,
1788,
279,
394,
666,
18,
632,
... | |
query = session.query(hebergementTable).join('province').join('proprio') | query = session.query(hebergementTable).join('province').join('proprio').outerjoin('reservations') | def action_search(self, action, data): wrapper = getSAWrapper('gites_wallons') session = wrapper.session hebergementTable = wrapper.getMapper('hebergement') proprioTable = wrapper.getMapper('proprio') provincesTable = wrapper.getMapper('province') episTable = wrapper.getMapper('link_hebergement_epis') hebergementType = data.get('hebergementType') provinces = data.get('provinces') classification = data.get('classification') capacityMin = data.get('capacityMin') roomAmount = data.get('roomAmount') checkAnimals = data.get('animals') checkSmokers = data.get('smokers') seeResults = self.request.form.has_key('form.seeResults') | 522b4ac0479a0aef812d94a8bba993770536d0d9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10188/522b4ac0479a0aef812d94a8bba993770536d0d9/SearchHebergement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
3072,
12,
2890,
16,
1301,
16,
501,
4672,
4053,
273,
1322,
37,
3611,
2668,
75,
2997,
67,
8019,
7008,
6134,
1339,
273,
4053,
18,
3184,
3904,
31317,
820,
1388,
273,
4053,
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,
1301,
67,
3072,
12,
2890,
16,
1301,
16,
501,
4672,
4053,
273,
1322,
37,
3611,
2668,
75,
2997,
67,
8019,
7008,
6134,
1339,
273,
4053,
18,
3184,
3904,
31317,
820,
1388,
273,
4053,
18,
58... |
print "*"*100 print "Testing ufunc" if ufunc(6): print "Succes" else: print "Fail!" | def matmul(niter=2): for m in range(2,niter+2): for n in range(2,niter+2): for k in range(2,niter+2): Asrc = random_list([k,m]) Bsrc = random_list([m,k]) Ad = np.array(Asrc, dtype=float, dist=True) Af = np.array(Asrc, dtype=float, dist=False) Bd = np.array(Bsrc, dtype=float, dist=True) Bf = np.array(Bsrc, dtype=float, dist=False) Cd = np.dot(Ad,Bd) Cf = np.dot(Af,Bf) if not array_equal(Cd,Cf): print "Error in matrix multiplication!" return False return True | 61a38fb6c72a4c2407ae89e3c9c936f06e59866b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4342/61a38fb6c72a4c2407ae89e3c9c936f06e59866b/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30805,
12,
82,
2165,
33,
22,
4672,
364,
312,
316,
1048,
12,
22,
16,
82,
2165,
15,
22,
4672,
364,
290,
316,
1048,
12,
22,
16,
82,
2165,
15,
22,
4672,
364,
417,
316,
1048,
12,
22,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30805,
12,
82,
2165,
33,
22,
4672,
364,
312,
316,
1048,
12,
22,
16,
82,
2165,
15,
22,
4672,
364,
290,
316,
1048,
12,
22,
16,
82,
2165,
15,
22,
4672,
364,
417,
316,
1048,
12,
22,
... | |
return event.Continue | if self.default_action: possible_actions = [self.default_action] else: return event.Continue | def find_method(self, servlet, ret_value): possible_actions = [] for name, value in servlet.fields.items(): if name == self.action_name: possible_actions.append(value) elif name.startswith(self.action_name): possible_actions.append(name[len(self.action_name):]) if not possible_actions: return event.Continue if len(possible_actions) > 1: raise httpexceptions.HTTPBadRequest( "More than one action received: %s" % ', '.join(map(repr, possible_actions))) action = possible_actions[0] name, method = self.get_method(servlet, action) if name is None: raise httpexceptions.Forbidden( "Action method not found: %r" % action) if not self.valid_method(name, method): raise httpexceptions.Forbidden( "Method not allowed: %r" % action) return method() | 70f1fa9f5e88aa9083802b7f575bcf9862da06dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11400/70f1fa9f5e88aa9083802b7f575bcf9862da06dc/dispatch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
2039,
12,
2890,
16,
8100,
16,
325,
67,
1132,
4672,
3323,
67,
4905,
273,
5378,
364,
508,
16,
460,
316,
8100,
18,
2821,
18,
3319,
13332,
309,
508,
422,
365,
18,
1128,
67,
529... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
2039,
12,
2890,
16,
8100,
16,
325,
67,
1132,
4672,
3323,
67,
4905,
273,
5378,
364,
508,
16,
460,
316,
8100,
18,
2821,
18,
3319,
13332,
309,
508,
422,
365,
18,
1128,
67,
529... |
print "WARNING: error parsing context menu request (%s)" % data | def handleContextMenuSelect(self, id, area, viewName): try: obj = db.getObjectByID(int(id)) except: print "WARNING: error parsing context menu request (%s)" % data traceback.print_exc() else: view = self.templateHandle.getTemplateVariable(viewName) if not controller.selection.isSelected(area, view, int(id)): self.handleSelect(area, viewName, id, False, False) popup = menu.makeContextMenu(self.currentName, view, controller.selection.getSelectionForArea(area), int(id)) if popup: delegate.showContextMenu(popup) | 125d838aa3a93711d0a4eeaea06c947da09403bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12354/125d838aa3a93711d0a4eeaea06c947da09403bd/app.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
27315,
3391,
12,
2890,
16,
612,
16,
5091,
16,
22244,
4672,
775,
30,
1081,
273,
1319,
18,
588,
921,
13331,
12,
474,
12,
350,
3719,
1335,
30,
10820,
18,
1188,
67,
10075,
1435,
469,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
27315,
3391,
12,
2890,
16,
612,
16,
5091,
16,
22244,
4672,
775,
30,
1081,
273,
1319,
18,
588,
921,
13331,
12,
474,
12,
350,
3719,
1335,
30,
10820,
18,
1188,
67,
10075,
1435,
469,... | |
titles.append(line.strip()) | line = line.strip() line = re.sub(r'^"|"$', '', line) line = line.replace('""', '"') titles.append(line) | def get_titles(): f = urllib.urlopen('http://localhost:%d/gateway.cgi/csv/changes/title' % port) titles = [] for line in f: titles.append(line.strip()) return titles | 5e7eba015f0536b0d7924b5b217a312503c5247d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11510/5e7eba015f0536b0d7924b5b217a312503c5247d/mksuggest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
17643,
13332,
284,
273,
11527,
18,
295,
18589,
2668,
2505,
2207,
13014,
5319,
72,
19,
11127,
18,
19062,
19,
6715,
19,
6329,
19,
2649,
11,
738,
1756,
13,
14693,
273,
5378,
364,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
17643,
13332,
284,
273,
11527,
18,
295,
18589,
2668,
2505,
2207,
13014,
5319,
72,
19,
11127,
18,
19062,
19,
6715,
19,
6329,
19,
2649,
11,
738,
1756,
13,
14693,
273,
5378,
364,
... |
if o == "-d": | if o == '-c': cmd = a if o == '-d': | def main(): debug = 0 try: opts, args = getopt.getopt(sys.argv[1:], "d") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.exit(2) for o, a in opts: if o == "-d": debug = 1 global flist, root root = Tk() fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) if args: for filename in sys.argv[1:]: flist.open(filename) aPath = os.path.abspath(os.path.dirname(filename)) if not aPath in sys.path: sys.path.insert(0, aPath) else: aPath = os.getcwd() if not aPath in sys.path: sys.path.insert(0, aPath) t = PyShell(flist) flist.pyshell = t t.begin() if debug: t.open_debugger() root.mainloop() | df95520d5088c816678f35b469940b23a88a32a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/df95520d5088c816678f35b469940b23a88a32a8/PyShell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1198,
273,
374,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
315,
72,
7923,
1335,
336,
3838,
18,
1636,
16,
1234,
30,
258... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1198,
273,
374,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
315,
72,
7923,
1335,
336,
3838,
18,
1636,
16,
1234,
30,
258... |
ceUniqueID = self.am_getOption('CEUniqueID','Torque') | ceUniqueID = self.am_getOption( 'CEUniqueID', 'Torque' ) | def initialize(self,loops=0): """Sets default parameters and creates CE instance """ self.maxcount = loops | 364464017f61dc703439c7a2235a47d4ba35aafe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/364464017f61dc703439c7a2235a47d4ba35aafe/DiracSiteAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
16,
383,
4473,
33,
20,
4672,
3536,
2785,
805,
1472,
471,
3414,
29538,
791,
3536,
365,
18,
1896,
1883,
273,
14075,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
16,
383,
4473,
33,
20,
4672,
3536,
2785,
805,
1472,
471,
3414,
29538,
791,
3536,
365,
18,
1896,
1883,
273,
14075,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
<?php echo date("m.d.y"); ?> | <?php echo date("m.d.y"); ?> | def makePage( _T, _N, _M, MIRRORS_DATA, lang, charset ): navigation = Tree \ ( [ P ( contents = [ Img( src = '/images/pointer.png' ), A( _N['home'], href=makeURL( '', lang ))] ), Tree \ ( [ P ( contents = [ Img( src = '/images/englishlogo.png' ), A( 'English', href='%(BASE)s' )]), P ( contents = [ Img( src = '/images/germanylogo.png' ), A( 'Deutsch', href='%(BASE)sde/' )]), P ( contents = [ Img( src = '/images/francelogo.png' ), A( 'Français', href='%(BASE)sfr/' )]), P ( contents = [ Img( src = '/images/italylogo.png' ), A( 'Italiano', href='%(BASE)sit/' )]), P ( contents = [ Img( src = '/images/netherlandslogo.png' ), A( 'Nederlands', href='%(BASE)snl/' )]), P ( contents = [ Img( src = '/images/polandlogo.png' ), A( 'Polski', href='%(BASE)spl/' )]), P ( contents = [ Img( src = '/images/portugallogo.png' ), A( 'Português', href='%(BASE)spt/' )]), P ( contents = [ Img( src = '/images/russialogo.png' ), A( 'Русский', href='%(BASE)sru/' )]), P ( contents = [ Img( src = '/images/finlandlogo.png' ), A( 'Suomi', href='%(BASE)sfi/' )]), P ( contents = [ Img( src = '/images/swedenlogo.png' ), A( 'Svenska', href='%(BASE)ssv/' )]) ] ), BR(), P ( contents = [ Img( src = '/images/pointer.png' ), A( _N['news'], href=makeURL( 'news/', lang ) )]), Tree ( A( _N['archive'], href=makeURL( 'news/archive/', lang ) ) ), BR(), P ( contents = [ Img( src = '/images/pointer.png' ), A( _N['introduction'], href=makeURL( 'introduction/', lang ) ) ]), Tree \ ( [ #A( _N['status'], href=makeURL('introduction/status/everything.html' ), A( _N['screenshots'], href=makeURL( 'pictures/screenshots/', lang) ), A( _N['ports'], href=makeURL( 'introduction/ports', lang ) ), A( _N['license'], href='%(BASE)slicense.html' ) ] ), BR(), P ( contents = [ Img( src = '/images/pointer.png' ), A( _N['download'], href=makeURL( 'download', lang ) )]), BR(), P ( contents = [ Img( src = '/images/pointer.png' ), _N['documentation'] ]), Tree \ ( [ A( _N['users'], href=makeURL( 'documentation/users/', lang ) ), Tree \ ( [ A( _N['installation'], href=makeURL( 'documentation/users/installation', lang ) ), A( _N['using'], href=makeURL( 'documentation/users/using', lang ) ), A( _N['shell'], href=makeURL( 'documentation/users/shell/index', lang ) ), A( _N['faq'], href=makeURL( 'documentation/users/faq', lang ) ), #_N['ports'], #A( _N['links'], href=makeURL( 'documentation/users/links', lang ) ) ] ), A( _N['developers'], href=makeURL( 'documentation/developers/index', lang ) ), Tree \ ( [ A( _N['contribute'], href=makeURL( 'documentation/developers/contribute', lang ) ), A( 'Roadmap', href=makeURL( 'documentation/developers/roadmap', lang ) ), A( _N['bug-tracker'], href='http://sourceforge.net/tracker/?atid=439463&group_id=43586&func=browse' ), A( _N['working-with-subversion'], href=makeURL( 'documentation/developers/svn', lang ) ), A( _N['compiling'], href=makeURL( 'documentation/developers/compiling', lang ) ), A( _N['application-development-manual'], href=makeURL( 'documentation/developers/app-dev/index', lang ) ), A( _N['zune-application-development-manual'], href=makeURL( 'documentation/developers/zune-application-development', lang ) ), A( _N['system-development-manual'], href=makeURL( 'documentation/developers/system-development', lang ) ), A( _N['debugging-manual'], href=makeURL( 'documentation/developers/debugging', lang ) ), A( _N['reference'], href=makeURL( 'documentation/developers/autodocs/index', lang ) ), A( _N['specifications'], href=makeURL( 'documentation/developers/specifications/', lang ) ), A( _N['ui-style-guide'], href=makeURL( 'documentation/developers/ui', lang ) ), A( _N['documenting'], href=makeURL( 'documentation/developers/documenting', lang ) ), A( _N['porting'], href=makeURL( 'documentation/developers/porting', lang ) ), #A( _N['translating'], href=makeURL( 'documentation/developers/translating', lang ) ), A( _N['summaries'], href=makeURL( 'documentation/developers/summaries/', lang ) ), A( _N['links'], href=makeURL( 'documentation/developers/links', lang ) ) ] ) ] ), BR(), P ( contents = [ Img( src = '/images/pointer.png' ), A( _N['contact'], href=makeURL( 'contact', lang ) )]), Tree \ ( [ A( _N['mailing-lists'], href=makeURL( 'contact', lang, 'mailing-lists' ) ), #A( _N['forums'], href=makeURL( 'contact', lang, 'forums' ) ), A( _N['irc-channels'], href=makeURL( 'contact', lang, 'irc-channels' ) ) ] ), BR(), P ( contents = [ Img( src = '/images/pointer.png' ), A( _N['credits'], href=makeURL( 'credits', lang ) )]), P ( contents = [ Img( src = '/images/pointer.png' ), A( 'Acknowledgements', href=makeURL( 'acknowledgements', lang ) )]), BR(), P ( contents = [ Img( src = '/images/pointer.png' ), _N['pictures']]), Tree \ ( [ A( _N['developers'], href=makeURL( 'pictures/developers/', lang ) ), A( _N['developers-together'], href=makeURL( 'pictures/developers-together/', lang ) ) ] ), BR(), P ( contents = [ Img( src = '/images/pointer.png' ), A( _N['sponsors'], href=makeURL( 'sponsors', lang ) )]), P ( contents = [ Img( src = '/images/pointer.png' ), A( _N['linking'], href=makeURL( 'linking', lang ) )]), P ( contents = [ Img( src = '/images/pointer.png' ), A( _N['links'], href=makeURL( 'links', lang ) )]) ] ) counter = Img( src = 'http://www.hepe.com/cgi-bin/wwwcount.cgi?df=aros.dat&dd=E&ft=0' ) sponsors = Table\ ( cellspacing = 5, cellpadding = 0, contents = [ TR ( TD ( A ( Img( src = '%(ROOT)simages/trustec-small.png', border = 0 ), href = 'http://www.trustsec.de/' ) ) ), TR ( TD ( A ( Img( src = '%(ROOT)simages/genesi-small.gif', border = 0 ), href = 'http://www.pegasosppc.com/' ) ) ), TR ( TD ( A \ ( Img \ ( src = 'http://sflogo.sourceforge.net/sflogo.php?group_id=43586&type=1', width = 88, height = 31, border = 0, alt = 'SourceForge Logo' ), href = 'http://sourceforge.net/' ) ) ) ] ) bar = Table( border = 0, cellpadding = 2, cellspacing = 2, width = 171, valign = 'top', contents = [ TR( valign = 'top', contents = [ TD( rowspan = 8, width=15 ), TD() ] ), TR( valign = 'top', contents = TD( navigation ) ), TR( TD(), height=15 ), TR( valign = 'top', contents = TD( align = 'center', contents = counter ) ), TR( TD(), height=15 ), TR( valign = 'top', contents = TD( align = 'center', contents = sponsors ) ), TR( TD(), height=30 ), TR \ ( valign = 'top', contents = TD \ ( align = 'center', contents = A \ ( Img \ ( src = '%(ROOT)simages/noeupatents-small.png', border = 0 ), href = 'http://petition.eurolinux.org/' ) ) ) ] ) statsPHP = ''' <?php //define("_BBC_PAGE_NAME", "my page title"); define("_BBCLONE_DIR", "%(ROOT)smybbclone/"); define("COUNTER", _BBCLONE_DIR."index.php"); if (file_exists(COUNTER)) include_once(COUNTER); ?> ''' statsPHP2 = ''' <?php echo date("m.d.y"); ?> ''' statsPHP3 = ''' <?php echo "<map name=\\"map\\">"; echo "<area shape=\\"rect\\" coords=\\"11,80,82,95\\" alt=\\"http://www.aros.org\\" href=\\"http://www.aros.org\\">"; echo "<area shape=\\"rect\\" coords=\\"87,78,165,95\\" alt=\\"AROS-Exec\\" href=\\"http://www.aros-exec.org\\">"; echo "<area shape=\\"rect\\" coords=\\"244,77,323,95166,77,240,95\\" alt=\\"Team AROS\\" href=\\"http://www.teamaros.org\\">"; echo "<area shape=\\"rect\\" coords=\\"166,77,240,95\\" alt=\\"AROS-Exec Archives\\" href=\\"http://archives.aros-exec.org\\">"; echo "</map>"; ?> ''' statsPHP4 = ''' <?php echo "<table width=\\"100%%\\"><tr><td>"; echo "<div style=\\"text-align: right;\\">"; echo "<font color=\\"#aaaaaa\\">"; ?> ''' statsPHP6 = ''' <?php echo "</font></div>"; echo "</p></tr></td></table>"; ?> ''' statsPHP5= ''' <?php include( '/home/groups/a/ar/aros/htdocs/rsfeed/browserdetect.php'); $win_ie56 = (browser_detection('browser') == 'ie' ) && (browser_detection('number') >= 5 ) && (browser_detection('number') < 7 ); if ($win_ie56) { echo \"<img src=\\"/images/kittymascot.gif\\" style=\\"float:right\\" border=\\"0\\"></img><img src=\\"/images/toplogomenu.gif\\" border=\\"0\\" usemap=\\"#map\\"></img>"; } else { echo \"<img src=\\"/images/kittymascot.png\\" style=\\"float:right\\" border=\\"0\\"></img><img src=\\"/images/toplogomenu.png\\" border=\\"0\\" usemap=\\"#map\\"></img>"; } ?> ''' page = HTML( [ Head( [ Charset( charset ), Title( 'AROS Research Operating System' ), Link( href = '%(ROOT)saros.css', type = 'text/css', rel = 'stylesheet' ), Meta( name = 'keywords', content = 'AROS, OS, operating system, research, open source, portage' ) ] ), Body( style = 'margin: 0px;', bgcolor = '#ffffff', contents = [ statsPHP3, Table( border = 0, cellspacing = 0, cellpadding = 0, width = '100%%', contents = [ TR( [ TD( halign = 'top', width = '100%%', height = 109, background='/images/backgroundtop.png' ,rowspan = 4, contents = statsPHP5) | 846194f3836b7e3473a516c54c1f17757297aebf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4747/846194f3836b7e3473a516c54c1f17757297aebf/page.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
1964,
12,
389,
56,
16,
389,
50,
16,
389,
49,
16,
490,
7937,
2784,
55,
67,
4883,
16,
3303,
16,
4856,
262,
30,
10394,
273,
4902,
521,
261,
306,
453,
261,
2939,
273,
306,
2221,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
1964,
12,
389,
56,
16,
389,
50,
16,
389,
49,
16,
490,
7937,
2784,
55,
67,
4883,
16,
3303,
16,
4856,
262,
30,
10394,
273,
4902,
521,
261,
306,
453,
261,
2939,
273,
306,
2221,
... |
cacheId = "lib-%s" % key | cacheId = "lib-%s" % self._config.absPath(lib["manifest"]) | def mostRecentlyChangedIn(lib): # this should go into another class youngFiles = {} # for each interesting library part for category in ["class", "translation", "resource"]: catPath = os.path.normpath(os.path.join(lib["path"], lib[category])) # find youngest file file, mtime = filetool.findYoungest(catPath) youngFiles[mtime] = file | 6ecd689f56bf3697526f91c2ba2898e6b0ec03ce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/6ecd689f56bf3697526f91c2ba2898e6b0ec03ce/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4486,
17076,
715,
5033,
382,
12,
2941,
4672,
225,
468,
333,
1410,
1960,
1368,
4042,
667,
677,
465,
75,
2697,
273,
2618,
468,
364,
1517,
26122,
5313,
1087,
364,
3150,
316,
8247,
1106,
311... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4486,
17076,
715,
5033,
382,
12,
2941,
4672,
225,
468,
333,
1410,
1960,
1368,
4042,
667,
677,
465,
75,
2697,
273,
2618,
468,
364,
1517,
26122,
5313,
1087,
364,
3150,
316,
8247,
1106,
311... |
'object=%s' % self.object), 'end=%s' % self.end), 'encoding=%s' % self.encoding), 'args=%s' % self.args), 'start=%s' % self.start), 'reason=%s' % self.reason), | 'object=%s' % self.object, 'end=%s' % self.end, 'encoding=%s' % self.encoding, 'args=%s' % self.args, 'start=%s' % self.start, 'reason=%s' % self.reason, | def __str__(self): # this is a bad hack, please supply an implementation res = ' '.join([ 'object=%s' % self.object), 'end=%s' % self.end), 'encoding=%s' % self.encoding), 'args=%s' % self.args), 'start=%s' % self.start), 'reason=%s' % self.reason), ]) return res | 7d942c2f4a7e8f483ad5b90e36ffc05a872090d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/7d942c2f4a7e8f483ad5b90e36ffc05a872090d2/exceptions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
468,
333,
353,
279,
5570,
11769,
16,
9582,
14467,
392,
4471,
400,
273,
296,
2418,
5701,
3816,
296,
1612,
5095,
87,
11,
738,
365,
18,
1612,
16,
296,
409,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
468,
333,
353,
279,
5570,
11769,
16,
9582,
14467,
392,
4471,
400,
273,
296,
2418,
5701,
3816,
296,
1612,
5095,
87,
11,
738,
365,
18,
1612,
16,
296,
409,... |
stdout = util.popen(cmd) | stdout = util.popen(cmd, mode='rb') | def getfile(self, name, rev): cmd = 'p4 -G print "%s#%s"' % (self.depotname[name], rev) stdout = util.popen(cmd) | 375dde695f0bc234cd11a2e547d43ce0077e5add /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/375dde695f0bc234cd11a2e547d43ce0077e5add/p4.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
768,
12,
2890,
16,
508,
16,
5588,
4672,
1797,
273,
296,
84,
24,
300,
43,
1172,
2213,
87,
7,
9,
87,
5187,
738,
261,
2890,
18,
323,
13130,
529,
63,
529,
6487,
5588,
13,
3909,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
768,
12,
2890,
16,
508,
16,
5588,
4672,
1797,
273,
296,
84,
24,
300,
43,
1172,
2213,
87,
7,
9,
87,
5187,
738,
261,
2890,
18,
323,
13130,
529,
63,
529,
6487,
5588,
13,
3909,
27... |
if putlock is not None: try: putlock.release() except ValueError: pass | def on_state_change(task): state, args = task try: state_handlers[state](*args) except KeyError: debug("Unknown job state: %s (args=%s)" % (state, args)) | a0626c9d702519e6880d3d1da18871f7403b808f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2024/a0626c9d702519e6880d3d1da18871f7403b808f/pool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
2019,
67,
3427,
12,
4146,
4672,
919,
16,
833,
273,
1562,
775,
30,
919,
67,
11046,
63,
2019,
29955,
14,
1968,
13,
1335,
4999,
30,
1198,
2932,
4874,
1719,
919,
30,
738,
87,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
603,
67,
2019,
67,
3427,
12,
4146,
4672,
919,
16,
833,
273,
1562,
775,
30,
919,
67,
11046,
63,
2019,
29955,
14,
1968,
13,
1335,
4999,
30,
1198,
2932,
4874,
1719,
919,
30,
738,
87,
26... | |
</n:p> | </n:div> | def format(self, args): log = XML.dig(args.message.xml, "message", "body", "commit", "log") if log: return Util.extractSummary(log) | 3ca8bf1f567841c65bf98a27376d9f66a0a956ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9478/3ca8bf1f567841c65bf98a27376d9f66a0a956ba/Commit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
833,
4672,
613,
273,
3167,
18,
5606,
12,
1968,
18,
2150,
18,
2902,
16,
315,
2150,
3113,
315,
3432,
3113,
315,
7371,
3113,
315,
1330,
7923,
309,
613,
30,
327,
3564,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
833,
4672,
613,
273,
3167,
18,
5606,
12,
1968,
18,
2150,
18,
2902,
16,
315,
2150,
3113,
315,
3432,
3113,
315,
7371,
3113,
315,
1330,
7923,
309,
613,
30,
327,
3564,
... |
self._addCommand((op, (sc, sr), (ec, er), weight, color)) | self._addCommand((c[0],)+((sc, sr), (ec, er))+c[3:]) | def _cr_1_1(self,n,repeatRows, cmds): for op, (sc, sr), (ec, er), weight, color in cmds: if sr>=0 and sr>=repeatRows and sr<n and er>=0 and er<n: continue if sr>=repeatRows and sr<n: sr=repeatRows elif sr>=repeatRows and sr>=n: sr=sr+repeatRows-n if er>=repeatRows and er<n: er=repeatRows elif er>=repeatRows and er>=n: er=er+repeatRows-n self._addCommand((op, (sc, sr), (ec, er), weight, color)) | 11eb40f3a3d8b8d0f34ebf418a68ac6839a1a3b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/11eb40f3a3d8b8d0f34ebf418a68ac6839a1a3b0/tables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3353,
67,
21,
67,
21,
12,
2890,
16,
82,
16,
9374,
4300,
16,
13446,
4672,
364,
1061,
16,
261,
1017,
16,
9133,
3631,
261,
557,
16,
6445,
3631,
3119,
16,
2036,
316,
13446,
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,
389,
3353,
67,
21,
67,
21,
12,
2890,
16,
82,
16,
9374,
4300,
16,
13446,
4672,
364,
1061,
16,
261,
1017,
16,
9133,
3631,
261,
557,
16,
6445,
3631,
3119,
16,
2036,
316,
13446,
30,
309,... |
return time(hour=int(h), minute=int(m), second=int(float(s)), microsecond=int(modf(float(s))[0]*1000000)) except: | h, m, s = int(h), int(m), float(s) return time(hour=h, minute=m, second=int(s), microsecond=int(math.modf(s)[0] * 1000000)) except ValueError: | def Time_or_None(s): from math import modf try: h, m, s = s.split(':') return time(hour=int(h), minute=int(m), second=int(float(s)), microsecond=int(modf(float(s))[0]*1000000)) except: return None | d57be3fb50892ee155eb1bc9066cbcf3f02e4bf8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10477/d57be3fb50892ee155eb1bc9066cbcf3f02e4bf8/times.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2647,
67,
280,
67,
7036,
12,
87,
4672,
628,
4233,
1930,
681,
74,
775,
30,
366,
16,
312,
16,
272,
273,
272,
18,
4939,
2668,
2497,
13,
366,
16,
312,
16,
272,
273,
509,
12,
76,
3631,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2647,
67,
280,
67,
7036,
12,
87,
4672,
628,
4233,
1930,
681,
74,
775,
30,
366,
16,
312,
16,
272,
273,
272,
18,
4939,
2668,
2497,
13,
366,
16,
312,
16,
272,
273,
509,
12,
76,
3631,
... |
if (api_port, main_port) != (api_host, api_port): | if (main_host, main_port) != (api_host, api_port): | def run(self): if not self._bound_socket: self._bound_socket = eventlet.listen((self.config.interface, self.config.port)) eventlet.spawn(eventlet.wsgi.server, self._bound_socket, self._root_wsgi_app, log=EmptyLogShim()) # We can't get the main interface host, port from config, in case it # was passed in directly to the constructor as a bound sock. main_host, main_port = self._bound_socket.getsockname() logger.info("Listening to hookbox on http://%s:%s", main_host, main_port) | 7d9044cf32f3429bc5b4d095c42576776e7928c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13219/7d9044cf32f3429bc5b4d095c42576776e7928c6/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
309,
486,
365,
6315,
3653,
67,
7814,
30,
365,
6315,
3653,
67,
7814,
273,
871,
1810,
18,
18085,
12443,
2890,
18,
1425,
18,
5831,
16,
365,
18,
1425,
18,
655,
3719,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
309,
486,
365,
6315,
3653,
67,
7814,
30,
365,
6315,
3653,
67,
7814,
273,
871,
1810,
18,
18085,
12443,
2890,
18,
1425,
18,
5831,
16,
365,
18,
1425,
18,
655,
3719,
... |
e = start_dir if start_tail: e = e.Entry(start_tail[0]) targets.append(e) continue | return [orig], fmt % str(orig) | def build_dir_target_climb(self, dir, tail): """Create targets in corresponding build directories | 913e7dcaa17f6f9aeee5e94ed8200c2df7f3389b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12817/913e7dcaa17f6f9aeee5e94ed8200c2df7f3389b/FS.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
1214,
67,
3299,
67,
830,
381,
70,
12,
2890,
16,
1577,
16,
5798,
4672,
3536,
1684,
5774,
316,
4656,
1361,
6402,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
1214,
67,
3299,
67,
830,
381,
70,
12,
2890,
16,
1577,
16,
5798,
4672,
3536,
1684,
5774,
316,
4656,
1361,
6402,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
p = preparse(source) | if len(cmds): cmd_seq = cmds + '\n_sage_eval_returnval_ = ' + source if preparse: cmd_seq = preparser.preparse_file(cmd_seq) else: if preparse: source = preparser.preparse(source) | def sage_eval(source, locals={}): r""" Obtain a \SAGE object from the input string by evaluate it using SAGE. This means calling eval after preparsing and with globals equal to everything included in the scope of \code{from sage.all import *}.). If the object has an _sage_ method it is called and the value is returned. Otherwise str is called on the object, and all preparsing is applied and the resulting expression is evaluated in the context of \code{from sage.all import *}. To evaluate the expression with certain variables set, use the locals argument, which should be a dictionary. EXAMPLES: This example illustrates that preparsing is applied. sage: eval('2^3') 1 sage: sage_eval('2^3') 8 Note that you have explicitly define variables and pass them as the second option: sage: x = PolynomialRing(RationalField(),"x").gen() sage: sage_eval('x^2+1', locals={'x':x}) x^2 + 1 This illustrates interfaces: sage: f = gp('2/3') sage: type(f) <class 'sage.interfaces.gp.GpElement'> sage: f._sage_() 2/3 sage: type(f._sage_()) <type 'sage.rings.rational.Rational'> sage: a = gap(939393/2433) sage: a._sage_() 313131/811 sage: type(a._sage_()) <type 'sage.rings.rational.Rational'> This example illustrates that evaluation occurs in the context of \code{from sage.all import *}. Even though bernoulli has been redefined in the local scope, when calling \code{sage_eval} the default value meaning of bernoulli is used. Likewise for QQ below. sage: bernoulli = lambda x : x^2 sage: bernoulli(6) 36 sage: eval('bernoulli(6)') 36 sage: sage_eval('bernoulli(6)') 1/42 sage: QQ = lambda x : x^2 sage: QQ(2) 4 sage: sage_eval('QQ(2)') 2 sage: parent(sage_eval('QQ(2)')) Rational Field This example illustrates setting a variable for use in evaluation. sage: x = 5 sage: eval('4/3 + x', {'x':25}) 26 sage: sage_eval('4/3 + x', locals={'x':25}) 79/3 This example illustrates how \code{sage_eval} can be useful when evaluating the output of other computer algebra systems. sage: R.<x> = PolynomialRing(RationalField()) sage: gap.eval('R:=PolynomialRing(Rationals,["x"]);') 'PolynomialRing(..., [ x ])' sage: ff = gap.eval('x:=IndeterminatesOfPolynomialRing(R);; f:=x^2+1;'); ff 'x^2+1' sage: sage_eval(ff, locals={'x':x}) x^2 + 1 sage: eval(ff) Traceback (most recent call last): ... RuntimeError: Use ** for exponentiation, not '^', which means xor in Python, and has the wrong precedence. Here you can see eval simply will not work but \code{sage_eval} will. """ if not isinstance(source, basestring): raise TypeError, "source must be a string." import sage.all p = preparse(source) try: return eval(p, sage.all.__dict__, locals) except SyntaxError, msg: raise SyntaxError, "%s\nError using SAGE to evaluate '%s'"%(msg, p) | 1b4ae08b7fd14b38a52e7d5db5cbe13f4bdbe525 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/1b4ae08b7fd14b38a52e7d5db5cbe13f4bdbe525/sage_eval.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
410,
67,
8622,
12,
3168,
16,
8985,
12938,
4672,
436,
8395,
24850,
279,
521,
55,
2833,
733,
628,
326,
810,
533,
635,
5956,
518,
1450,
348,
2833,
18,
225,
1220,
4696,
4440,
5302,
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,
410,
67,
8622,
12,
3168,
16,
8985,
12938,
4672,
436,
8395,
24850,
279,
521,
55,
2833,
733,
628,
326,
810,
533,
635,
5956,
518,
1450,
348,
2833,
18,
225,
1220,
4696,
4440,
5302,
18... |
if context.get('contact_display', 'contact')=='partner': | if context.get('contact_display', 'contact')=='partner' and r['partner_id']: | def name_get(self, cr, user, ids, context={}): if not len(ids): return [] res = [] for r in self.read(cr, user, ids, ['name','zip','city','partner_id', 'street']): if context.get('contact_display', 'contact')=='partner': res.append((r['id'], r['partner_id'][1])) else: addr = r['name'] or '' if r['name'] and (r['zip'] or r['city']): addr += ', ' addr += (r['street'] or '') + ' ' + (r['zip'] or '') + ' ' + (r['city'] or '') res.append((r['id'], addr.strip() or '/')) return res | 0d8dcf48159c429f594e72e8630633bbc9c2823b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0d8dcf48159c429f594e72e8630633bbc9c2823b/partner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
508,
67,
588,
12,
2890,
16,
4422,
16,
729,
16,
3258,
16,
819,
12938,
4672,
309,
486,
562,
12,
2232,
4672,
327,
5378,
400,
273,
5378,
364,
436,
316,
365,
18,
896,
12,
3353,
16,
729,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
508,
67,
588,
12,
2890,
16,
4422,
16,
729,
16,
3258,
16,
819,
12938,
4672,
309,
486,
562,
12,
2232,
4672,
327,
5378,
400,
273,
5378,
364,
436,
316,
365,
18,
896,
12,
3353,
16,
729,
... |
"%s://hg.mozilla.org/releases/mozilla-1.9.1/" % match.group(1) ) | SWITCH_MOZILLA_REPO_REPLACE % match.group(1) ) | def move_to_stable(): """Backup (unused anymore) trunk checkout of Mozilla. Also switch checkout to MOZILLA_BASE_REV of Mozilla 1.9.1. """ # Do nothing if this function was already successfully run. # Shortcut: checking file existence is enough. if os.path.exists(TREE_STATE_FILE): return mozilla_path = os.path.join(topsrcdir, 'mozilla') # Do nothing if there is no Mozilla directory. if not os.path.exists(mozilla_path): return import ConfigParser, re config = ConfigParser.ConfigParser() config.read([os.path.join(mozilla_path, '.hg', 'hgrc')]) if not config.has_option('paths', 'default'): # Abort, not to get into a possibly inconsistent state. sys.exit("Error: default path in mozilla/.hg/hgrc is undefined!") # Compile the Mozilla trunk regex. m_c_regex = re.compile(MOZILLA_TRUNK_REPO_REGEXP, re.I) match = m_c_regex.match(config.get('paths', 'default')) # Do nothing if not pulling from Mozilla trunk. if not match: return config.set('paths', 'default', "%s://hg.mozilla.org/releases/mozilla-1.9.1/" % match.group(1) ) if config.has_option('paths', 'default-push'): match = m_c_regex.match(config.get('paths', 'default-push')) # Do not update this property if not pushing to Mozilla trunk. if match: config.set('paths', 'default-push', "%s://hg.mozilla.org/releases/mozilla-1.9.1/" % match.group(1) ) hgopts = [] if options.hgopts: hgopts = options.hgopts.split() mozilla_trunk_path = os.path.join(topsrcdir, '.mozilla-trunk') print "Moving mozilla to .mozilla-trunk..." try: os.rename(mozilla_path, mozilla_trunk_path) except: # Print the exception without its traceback. sys.excepthook(sys.exc_info()[0], sys.exc_info()[1], None) sys.exit("Error: Mozilla directory renaming failed!") # Locally clone common repository history. check_call_noisy([options.hg, 'clone', '-r', MOZILLA_BASE_REV] + hgopts + [mozilla_trunk_path, mozilla_path]) #Rewrite hgrc for new local mozilla repo based on pre-existing hgrc # but with new values f = open(os.path.join(topsrcdir, 'mozilla', '.hg', 'hgrc'), 'w') try: config.write(f) finally: f.close() | cfa7c7ed5429e1717a50dc19064e911fb4d4d70f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11044/cfa7c7ed5429e1717a50dc19064e911fb4d4d70f/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
67,
869,
67,
15021,
13332,
3536,
6248,
261,
14375,
16828,
13,
25917,
13926,
434,
19058,
10745,
18,
225,
8080,
1620,
13926,
358,
16070,
62,
2627,
2534,
67,
8369,
67,
862,
58,
434,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
67,
869,
67,
15021,
13332,
3536,
6248,
261,
14375,
16828,
13,
25917,
13926,
434,
19058,
10745,
18,
225,
8080,
1620,
13926,
358,
16070,
62,
2627,
2534,
67,
8369,
67,
862,
58,
434,
1... |
return self._executeSingleStorageElementFunction(storageElementName,physicalFile,'replicateFile',argsDict={sourceSize:size}) else: return self._executeStorageElementFunction(storageElementName,physicalFile,'replicateFile',argsDict={sourceSize:size}) | return self._executeSingleStorageElementFunction(storageElementName,physicalFile,'replicateFile',argsDict={'sourceSize':size}) else: return self._executeStorageElementFunction(storageElementName,physicalFile,'replicateFile',argsDict={'sourceSize':size}) | def replicateStorageFile(self,physicalFile,size,storageElementName,singleFile=False): """ Replicate a physical file to a storage element | 66f736a181ac902d787b307be6f96aaa5f86ab96 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/66f736a181ac902d787b307be6f96aaa5f86ab96/ReplicaManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28476,
3245,
812,
12,
2890,
16,
20441,
812,
16,
1467,
16,
5697,
30584,
16,
7526,
812,
33,
8381,
4672,
3536,
868,
1780,
340,
279,
11640,
585,
358,
279,
2502,
930,
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,
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,
28476,
3245,
812,
12,
2890,
16,
20441,
812,
16,
1467,
16,
5697,
30584,
16,
7526,
812,
33,
8381,
4672,
3536,
868,
1780,
340,
279,
11640,
585,
358,
279,
2502,
930,
2,
-100,
-100,
-100,
-... |
shortened = string.lstrip(data) | shortened = data.lstrip() | def skip_leading_nodes(children, start=0): """Return index into children of a node at which paragraph building should begin or a recursive call to fixup_paras_helper() should be made (for subsections, etc.). When the return value >= len(children), we've built all the paras we can from this list of children. """ i = len(children) while i > start: # skip over leading comments and whitespace: child = children[start] nodeType = child.nodeType if nodeType == TEXT: data = child.data shortened = string.lstrip(data) if shortened: if data != shortened: # break into two nodes: whitespace and non-whitespace child.splitText(len(data) - len(shortened)) return start + 1 return start # all whitespace, just skip elif nodeType == ELEMENT: tagName = child.tagName if tagName in RECURSE_INTO_PARA_CONTAINERS: return start if tagName not in PARA_LEVEL_ELEMENTS + PARA_LEVEL_PRECEEDERS: return start start = start + 1 return start | 3c171d1b9f1420a6bbce02f1511ffb6b621863ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c171d1b9f1420a6bbce02f1511ffb6b621863ef/docfixer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2488,
67,
27200,
67,
4690,
12,
5906,
16,
787,
33,
20,
4672,
3536,
990,
770,
1368,
2325,
434,
279,
756,
622,
1492,
10190,
10504,
1410,
2376,
578,
279,
5904,
745,
358,
2917,
416,
67,
106... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2488,
67,
27200,
67,
4690,
12,
5906,
16,
787,
33,
20,
4672,
3536,
990,
770,
1368,
2325,
434,
279,
756,
622,
1492,
10190,
10504,
1410,
2376,
578,
279,
5904,
745,
358,
2917,
416,
67,
106... |
result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id, date_invoice, payment_term, partner_bank_id) | result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id, date_invoice, payment_term, partner_bank_id, company_id) | def onchange_partner_id(self, cr, uid, ids, type, partner_id, date_invoice=False, payment_term=False, partner_bank_id=False): # Copy partner data to invoice, also the new field payment_type result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id, date_invoice, payment_term, partner_bank_id) payment_type = False if partner_id: partner_line = self.pool.get('res.partner').browse(cr, uid, partner_id) if partner_line: if type=='in_invoice' or type=='in_refund': payment_type = partner_line.payment_type_supplier.id else: payment_type = partner_line.payment_type_customer.id if payment_type: result['value']['payment_type'] = payment_type return self.onchange_payment_type(cr, uid, ids, payment_type, partner_id, result) | 5e7f5fe46874a6afd43dc6097ccec8e9823dc6b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/5e7f5fe46874a6afd43dc6097ccec8e9823dc6b2/account_invoice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
31993,
67,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
618,
16,
19170,
67,
350,
16,
1509,
67,
16119,
33,
8381,
16,
5184,
67,
6408,
33,
8381,
16,
19170,
67,
10546,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
31993,
67,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
618,
16,
19170,
67,
350,
16,
1509,
67,
16119,
33,
8381,
16,
5184,
67,
6408,
33,
8381,
16,
19170,
67,
10546,... |
print 'debug handleCleanerLabel=', self.cleaner.name | def handleCleanerLabel(self, label): self.cleaner.name = _(getText(label.childNodes)) print 'debug handleCleanerLabel=', self.cleaner.name | e1fc33677a1647dbce770100c3a593e4e505209f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7853/e1fc33677a1647dbce770100c3a593e4e505209f/CleanerML.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
7605,
264,
2224,
12,
2890,
16,
1433,
4672,
365,
18,
6200,
264,
18,
529,
273,
389,
12,
588,
1528,
12,
1925,
18,
3624,
3205,
3719,
1172,
296,
4148,
1640,
7605,
264,
2224,
33,
2187,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
7605,
264,
2224,
12,
2890,
16,
1433,
4672,
365,
18,
6200,
264,
18,
529,
273,
389,
12,
588,
1528,
12,
1925,
18,
3624,
3205,
3719,
1172,
296,
4148,
1640,
7605,
264,
2224,
33,
2187,... | |
if nickmask == cfg.dc_to_irc_prefix + '*': | LOG.info("TKL: Adding Qline: %s" % nickmask) nick_re = wild_to_regex(nickmask) if nick_re.match(cfg.dc_to_irc_prefix): LOG.error("DC nick prefix is Q-lined! Terminating.") self.transport.loseConnection() reactor.stop() | def handleCmd_TKL(self, prefix, args): | a9a25212b38d59aa435d8c12f638e176c64c36b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8524/a9a25212b38d59aa435d8c12f638e176c64c36b9/bridge_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
5931,
67,
56,
47,
48,
12,
2890,
16,
1633,
16,
833,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
5931,
67,
56,
47,
48,
12,
2890,
16,
1633,
16,
833,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
serverParamsTest(CERTFILE, ssl.PROTOCOL_TLSv1, ssl.CERT_NONE, CERTFILE, CERTFILE, ssl.PROTOCOL_TLSv1, chatty=True, connectionchatty=True) def testReadCert(self): | server_params_test(CERTFILE, ssl.PROTOCOL_TLSv1, ssl.CERT_NONE, CERTFILE, CERTFILE, ssl.PROTOCOL_TLSv1, chatty=True, connectionchatty=True) def test_getpeercert(self): | def testEcho (self): | 3945c867d60b1d53299799dd09b6753dcd0a9546 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/3945c867d60b1d53299799dd09b6753dcd0a9546/test_ssl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
19704,
261,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
19704,
261,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
""" default function to retrieve the name of the action from a form | """Default function to retrieve the name of the action from a form | def _get_action(self, resource, context): """ default function to retrieve the name of the action from a form """ for name in context.get_form_keys(): if name.startswith(';'): # Browsers send the mouse coordinates with image submits if name.endswith(('.x', '.y')): name = name[:-2] action = 'action_%s' % name[1:] # Save the query of the action into context.form_query if '?' in action: action, query = action.split('?') # Deserialize query using action specific schema schema = getattr(self, '%s_query_schema' % action, None) context.form_query = decode_query(query, schema) context.form_action = action break else: context.form_action = 'action' | 7940eee6ad823100eebfdd9b1ec4baddc4c015db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12681/7940eee6ad823100eebfdd9b1ec4baddc4c015db/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
1128,
12,
2890,
16,
1058,
16,
819,
4672,
3536,
1868,
445,
358,
4614,
326,
508,
434,
326,
1301,
628,
279,
646,
3536,
364,
508,
316,
819,
18,
588,
67,
687,
67,
2452,
1333... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
1128,
12,
2890,
16,
1058,
16,
819,
4672,
3536,
1868,
445,
358,
4614,
326,
508,
434,
326,
1301,
628,
279,
646,
3536,
364,
508,
316,
819,
18,
588,
67,
687,
67,
2452,
1333... |
if self.interface: try: self.change_status(self.accounts, '') except dbus.DBusException: pass | if self.current != '': self.change_status(self.accounts, '') | def quit(self): if self.interface: try: self.change_status(self.accounts, '') except dbus.DBusException: pass | eeca23ef0331d7060f02026bc5e835bb87421c48 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4764/eeca23ef0331d7060f02026bc5e835bb87421c48/gajim_status.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9706,
12,
2890,
4672,
309,
365,
18,
5831,
30,
775,
30,
365,
18,
3427,
67,
2327,
12,
2890,
18,
13739,
16,
28707,
1335,
21866,
18,
2290,
407,
503,
30,
1342,
2,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9706,
12,
2890,
4672,
309,
365,
18,
5831,
30,
775,
30,
365,
18,
3427,
67,
2327,
12,
2890,
18,
13739,
16,
28707,
1335,
21866,
18,
2290,
407,
503,
30,
1342,
2,
-100,
-100,
-100,
-100,
... |
arr_geo_types.extend( arrStakeholders.split(',') ); arr_geo_types.extend( arrSupplyChains.split(',') ); landscape_types = arrLandscapeTypes.split(','); administrative_levels = arrAdministrativeLevels.split(','); | if arrStakeholders: arr_geo_types.extend( arrStakeholders.split(',') ); if arrSupplyChains: arr_geo_types.extend( arrSupplyChains.split(',') ); landscape_types = [] if arrLandscapeTypes: landscape_types = arrLandscapeTypes.split(','); else: landscape_types = [''] administrative_levels = [] if arrAdministrativeLevels: administrative_levels = arrAdministrativeLevels.split(','); else: administrative_levels = [''] | def search_geopoints_frontpage(self, arrStakeholders='', arrSupplyChains='', arrAdministrativeLevels='', arrLandscapeTypes='', path='', geo_types=None, geo_query=None, REQUEST=None): """ """ arr_geo_types = [] arr_geo_types.extend( arrStakeholders.split(',') ); arr_geo_types.extend( arrSupplyChains.split(',') ); | d9cf3fcd5b650aba728da7d88d9dc5b3926f0577 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3287/d9cf3fcd5b650aba728da7d88d9dc5b3926f0577/GeoMapTool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
908,
556,
763,
87,
67,
10211,
2433,
12,
2890,
16,
2454,
510,
911,
9000,
2218,
2187,
2454,
3088,
1283,
15945,
2218,
2187,
2454,
4446,
3337,
1535,
12240,
2218,
2187,
2454,
29398,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
908,
556,
763,
87,
67,
10211,
2433,
12,
2890,
16,
2454,
510,
911,
9000,
2218,
2187,
2454,
3088,
1283,
15945,
2218,
2187,
2454,
4446,
3337,
1535,
12240,
2218,
2187,
2454,
29398,
... |
action="store", type="str", default=None) | action="store", type="string", default=None) | def parseOptions(): parser = OptionParser(usage="%prog [options] list|xml|delete") common = OptionGroup(parser, "Options") common.add_option("--quiet", help="Be quiet", action="store_true", default=False) parser.add_option_group(common) common = OptionGroup(parser, "Filter") # Filter on IP common.add_option("-s", "--orig-src", help="Source address from original direction", action="store", type="str", default=None) common.add_option("-d", "--orig-dst", help="Destination address from original direction", action="store", type="str", default=None) common.add_option("-r", "--reply-src", help="Source address from reply direction", action="store", type="str", default=None) common.add_option("-q", "--reply-dst", help="Destination address from reply direction", action="store", type="str", default=None) # Filter on port common.add_option("--orig-src-port", "--sport", help="Source port from original direction", action="store", type="int", default=None) common.add_option("--orig-dst-port", "--dport", help="Destination port from original direction", action="store", type="int", default=None) common.add_option("--reply-src-port", help="Source port from reply direction", action="store", type="int", default=None) common.add_option("--reply-dst-port", help="Destination port from reply direction", action="store", type="int", default=None) common.add_option("-p", "--protonum", help="Layer 4 Protocol, eg. 'udp' (default: tcp)", action="store", type="str", default="tcp") common.add_option("-f", "--family", help="Layer 3 Protocol, eg. 'ipv6' (default: ipv4)", action="store", type="str", default="ipv4") parser.add_option_group(common) # Parse options values, arguments = parser.parse_args() # Check option values if values.orig_src: values.orig_src = IP(values.orig_src) if values.orig_dst: values.orig_dst = IP(values.orig_dst) if values.reply_src: values.reply_src = IP(values.reply_src) if values.reply_dst: values.reply_dst = IP(values.reply_dst) if values.protonum: if values.protonum not in IPPROTO_REVERSE_NAMES: print "Unknow protocol number: %s" % values.protonum sys.exit(1) else: values.protonum = IPPROTO_REVERSE_NAMES[values.protonum] if values.family not in L3PROTONUM_REVERSE_NAMES: print "Unknow layer 3 protocol: %s" % values.family sys.exit(1) else: values.family = L3PROTONUM_REVERSE_NAMES[values.family] if len(arguments) != 1 or arguments[0] not in ("list", "xml", "delete"): parser.print_help() sys.exit(1) return values, arguments[0] | 306bc1c760f323751680387b5619bfcb236a084a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12504/306bc1c760f323751680387b5619bfcb236a084a/conntrack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
1320,
13332,
2082,
273,
18862,
12,
9167,
11613,
14654,
306,
2116,
65,
666,
96,
2902,
96,
3733,
7923,
225,
2975,
273,
2698,
1114,
12,
4288,
16,
315,
1320,
7923,
2975,
18,
1289,
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,
1109,
1320,
13332,
2082,
273,
18862,
12,
9167,
11613,
14654,
306,
2116,
65,
666,
96,
2902,
96,
3733,
7923,
225,
2975,
273,
2698,
1114,
12,
4288,
16,
315,
1320,
7923,
2975,
18,
1289,
67,
... |
SetEnvironmentVariable("CM3_INSTALL", ConvertPath(InstallRoot)); ConfigFile = os.environ.get("M3CONFIG") if not ConfigFile: ConfigFile = GetConfigForDistribution(Config) SetEnvironmentVariable("M3CONFIG", ConvertPath(ConfigFile)) NativeRoot = Root Root = ConvertPath(Root).replace("\\", "\\\\") SetEnvironmentVariable("CM3_ROOT", Root); Root = NativeRoot | SetEnvironmentVariable("CM3_INSTALL", ConvertPath(InstallRoot)) SetEnvironmentVariable("M3CONFIG", ConvertPath(os.environ.get("M3CONFIG") or GetConfigForDistribution(Config))) SetEnvironmentVariable("CM3_ROOT", ConvertPath(Root).replace("\\", "\\\\")) | def ConvertPath(a): # This isn't "roundtrip", this is one (or both) is a nop. return ConvertFromCygwinPath(ConvertToCygwinPath(a)) | 33f4f17d3e22c6aec6479ea2e15029c60cebdadc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9328/33f4f17d3e22c6aec6479ea2e15029c60cebdadc/pylib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4037,
743,
12,
69,
4672,
468,
1220,
5177,
1404,
315,
2260,
25125,
3113,
333,
353,
1245,
261,
280,
3937,
13,
353,
279,
28797,
18,
327,
4037,
1265,
39,
4338,
8082,
743,
12,
2723,
774,
39... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4037,
743,
12,
69,
4672,
468,
1220,
5177,
1404,
315,
2260,
25125,
3113,
333,
353,
1245,
261,
280,
3937,
13,
353,
279,
28797,
18,
327,
4037,
1265,
39,
4338,
8082,
743,
12,
2723,
774,
39... |
gtk.glade.bindtextdomain(invest.defs.GETTEXT_PACKAGE, invest.defs.GNOMELOCALEDIR) gtk.glade.textdomain(invest.defs.GETTEXT_PACKAGE) | def _check(path): return exists(path) and isdir(path) and isfile(path+"/ChangeLog") | 2d7da6b3f82afec820eeba808f0cbcf56bfe4009 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11078/2d7da6b3f82afec820eeba808f0cbcf56bfe4009/invest-applet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
12,
803,
4672,
327,
1704,
12,
803,
13,
471,
9783,
12,
803,
13,
471,
8814,
12,
803,
9078,
19,
3043,
1343,
7923,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
12,
803,
4672,
327,
1704,
12,
803,
13,
471,
9783,
12,
803,
13,
471,
8814,
12,
803,
9078,
19,
3043,
1343,
7923,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
" from results dir...") | " from debug dir...") | def postprocess(test, params, env): """ Postprocess all VMs and images according to the instructions in params. @param test: An Autotest test object. @param params: Dict containing all VM and image parameters. @param env: The environment (a dict-like object). """ process(test, params, env, postprocess_image, postprocess_vm) # See if we should get rid of all PPM files if not params.get("keep_ppm_files") == "yes": # Remove them all logging.debug("'keep_ppm_files' not specified; removing all PPM files" " from results dir...") rm_cmd = "rm -vf %s" % os.path.join(test.debugdir, "*.ppm") kvm_subprocess.run_fg(rm_cmd, logging.debug, "(rm) ", timeout=5.0) #execute any post_commands if params.get("post_command"): process_command(test, params, env, params.get("post_command"), params.get("post_command_timeout"), params.get("post_command_noncritical")) | 9ec4dcdc62be4630a92d2be1a5f3ea107213ad8a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10349/9ec4dcdc62be4630a92d2be1a5f3ea107213ad8a/kvm_preprocessing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
2567,
12,
3813,
16,
859,
16,
1550,
4672,
3536,
5616,
2567,
777,
776,
6947,
471,
4602,
4888,
358,
326,
12509,
316,
859,
18,
225,
632,
891,
1842,
30,
1922,
11809,
352,
395,
1842,
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,
1603,
2567,
12,
3813,
16,
859,
16,
1550,
4672,
3536,
5616,
2567,
777,
776,
6947,
471,
4602,
4888,
358,
326,
12509,
316,
859,
18,
225,
632,
891,
1842,
30,
1922,
11809,
352,
395,
1842,
7... |
for key, value in kwargs.items(): | field_ids = [ob.prop_name() for ob in context._get_schema().objectValues() if ob.visible] for key in field_ids: | def updateSessionFrom(self, REQUEST=None, **kwargs): """Update session from a given language""" # Update kwargs from request if not REQUEST: return parents = REQUEST.get('PARENTS', None) if not parents: return | ae25a76f946d99a7a759709483a5cb5737fdcd5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/ae25a76f946d99a7a759709483a5cb5737fdcd5d/NyFolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
2157,
1265,
12,
2890,
16,
12492,
33,
7036,
16,
2826,
4333,
4672,
3536,
1891,
1339,
628,
279,
864,
2653,
8395,
468,
2315,
1205,
628,
590,
309,
486,
12492,
30,
327,
6298,
273,
12492,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
2157,
1265,
12,
2890,
16,
12492,
33,
7036,
16,
2826,
4333,
4672,
3536,
1891,
1339,
628,
279,
864,
2653,
8395,
468,
2315,
1205,
628,
590,
309,
486,
12492,
30,
327,
6298,
273,
12492,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.