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 |
|---|---|---|---|---|---|---|
decoded = decoder.decode(b"", True) | decoded = decoder.decode(b"", final=True) | def tell(self): if not self._seekable: raise IOError("underlying stream is not seekable") if not self._telling: raise IOError("telling position disabled by next() call") self.flush() position = self.buffer.tell() decoder = self._decoder if decoder is None or self._snapshot is None: if self._decoded_text: # This should never happen. raise AssertionError("pending decoded text") return position | 1e18b9ecf014bdc7f0b206c49c140c4f21edcb70 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/1e18b9ecf014bdc7f0b206c49c140c4f21edcb70/io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9276,
12,
2890,
4672,
309,
486,
365,
6315,
16508,
429,
30,
1002,
8340,
2932,
9341,
6291,
1407,
353,
486,
6520,
429,
7923,
309,
486,
365,
6315,
88,
1165,
310,
30,
1002,
8340,
2932,
88,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9276,
12,
2890,
4672,
309,
486,
365,
6315,
16508,
429,
30,
1002,
8340,
2932,
9341,
6291,
1407,
353,
486,
6520,
429,
7923,
309,
486,
365,
6315,
88,
1165,
310,
30,
1002,
8340,
2932,
88,
... |
dirname = os.path.join(test_support.TESTFN,u'Gr\xfc\xdf-\u66e8\u66e9\u66eb') | dirname = os.path.join(test_support.TESTFN, u'Gr\xfc\xdf-\u66e8\u66e9\u66eb') | def test_directory(self): dirname = os.path.join(test_support.TESTFN,u'Gr\xfc\xdf-\u66e8\u66e9\u66eb') filename = u'\xdf-\u66e8\u66e9\u66eb' oldwd = os.getcwd() os.mkdir(dirname) os.chdir(dirname) f = open(filename, 'w') f.write((filename + '\n').encode("utf-8")) f.close() os.access(filename,os.R_OK) os.remove(filename) os.chdir(oldwd) os.rmdir(dirname) | a0c3b390c3b5f18a2a158476f368fce931fcc2bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/a0c3b390c3b5f18a2a158476f368fce931fcc2bb/test_pep277.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5149,
12,
2890,
4672,
4283,
273,
1140,
18,
803,
18,
5701,
12,
3813,
67,
13261,
18,
16961,
19793,
16,
582,
11,
20799,
64,
30772,
64,
92,
2180,
6943,
89,
6028,
73,
28,
64,
89... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5149,
12,
2890,
4672,
4283,
273,
1140,
18,
803,
18,
5701,
12,
3813,
67,
13261,
18,
16961,
19793,
16,
582,
11,
20799,
64,
30772,
64,
92,
2180,
6943,
89,
6028,
73,
28,
64,
89... |
image = PIL_Image.open(cStringIO.StringIO(logo.data)) | image = PIL_Image.open(cStringIO.StringIO(str(logo.data))) | def getImageFromZODB(self, name) : """Retrieves an Image from the ZODB, converts it to PIL, and makes it 0.75 inch high. """ try : # try to get it from ZODB logo = getattr(self.parent.context, name) except AttributeError : # not found ! return None | a92f5e65d9bd9a762451c3cdf959dd9912842827 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a92f5e65d9bd9a762451c3cdf959dd9912842827/rlzope.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10567,
1265,
62,
19786,
12,
2890,
16,
508,
13,
294,
3536,
6960,
392,
3421,
628,
326,
2285,
19786,
16,
7759,
518,
358,
29407,
16,
471,
7297,
518,
374,
18,
5877,
316,
343,
3551,
18,
3536... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10567,
1265,
62,
19786,
12,
2890,
16,
508,
13,
294,
3536,
6960,
392,
3421,
628,
326,
2285,
19786,
16,
7759,
518,
358,
29407,
16,
471,
7297,
518,
374,
18,
5877,
316,
343,
3551,
18,
3536... |
undo['virtual'][j + "/" + arch] = self.binaries['testing'][arch][1][j][:] self.binaries['testing'][arch][1][j].remove(binary) if len(self.binaries['testing'][arch][1][j]) == 0: del self.binaries['testing'][arch][1][j] del self.binaries['testing'][arch][0][binary] | undo['virtual'][j + "/" + arch] = binaries[arch][1][j][:] binaries[arch][1][j].remove(binary) if len(binaries[arch][1][j]) == 0: del binaries[arch][1][j] del binaries[arch][0][binary] | def doop_source(self, pkg): | 59b36ea1bf248c8b337353565b2ecc0547783fab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2784/59b36ea1bf248c8b337353565b2ecc0547783fab/britney.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
556,
67,
3168,
12,
2890,
16,
3475,
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,
... | [
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,
741,
556,
67,
3168,
12,
2890,
16,
3475,
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,
... |
if issubclass(datatype, Enumerate): | if is_datatype(datatype, Enumerate): | def build_form_namespace(self, fields): """ This utility method builds a namespace suitable to use to produce an HTML form. Its input data is a list (fields) that defines the form variables to consider: [(<field name>, <is field required>), ...] | 3e12542c0271084475030525dc0f33d6cfba0fca /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/3e12542c0271084475030525dc0f33d6cfba0fca/context.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
687,
67,
4937,
12,
2890,
16,
1466,
4672,
3536,
1220,
12788,
707,
10736,
279,
1981,
10631,
358,
999,
358,
11402,
392,
3982,
646,
18,
29517,
810,
501,
353,
279,
666,
261,
2821,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
687,
67,
4937,
12,
2890,
16,
1466,
4672,
3536,
1220,
12788,
707,
10736,
279,
1981,
10631,
358,
999,
358,
11402,
392,
3982,
646,
18,
29517,
810,
501,
353,
279,
666,
261,
2821,
... |
self.tree.finalize() | def mainLoop(self): (CharactersToken, SpaceCharactersToken, StartTagToken, EndTagToken, CommentToken, DoctypeToken) = (tokenTypes["Characters"], tokenTypes["SpaceCharacters"], tokenTypes["StartTag"], tokenTypes["EndTag"], tokenTypes["Comment"], tokenTypes["Doctype"]) | 468db49ec2728cbe54566489407821660d0c5d69 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9368/468db49ec2728cbe54566489407821660d0c5d69/html5parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
6452,
12,
2890,
4672,
261,
11600,
1345,
16,
14059,
11600,
1345,
16,
3603,
1805,
1345,
16,
4403,
1805,
1345,
16,
9821,
1345,
16,
2256,
12387,
1345,
13,
273,
261,
2316,
2016,
9614,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6452,
12,
2890,
4672,
261,
11600,
1345,
16,
14059,
11600,
1345,
16,
3603,
1805,
1345,
16,
4403,
1805,
1345,
16,
9821,
1345,
16,
2256,
12387,
1345,
13,
273,
261,
2316,
2016,
9614,
1... | |
locale.setlocale(locale.LC_ALL, locale.normalize(locale._build_localename(locale.getdefaultlocale()))) | loc = locale.getdefaultlocale()[0] enc = locale.getpreferredencoding() ln = locale._build_localename((loc, enc)) try: locale.setlocale(locale.LC_ALL, ln) except locale.Error: locale.setlocale(locale.LC_ALL, loc) | def resetlocale(): # locale.resetlocale is bugged with some locales. # we need to normalize the result of locale.getdefaultlocale() locale.setlocale(locale.LC_ALL, locale.normalize(locale._build_localename(locale.getdefaultlocale()))) | 9c38a58c9c0ad8da9688ec98664e275cc53fb4fd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/9c38a58c9c0ad8da9688ec98664e275cc53fb4fd/translate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
6339,
13332,
468,
2573,
18,
6208,
6339,
353,
7934,
2423,
598,
2690,
6922,
18,
468,
732,
1608,
358,
3883,
326,
563,
434,
2573,
18,
588,
1886,
6339,
1435,
1829,
273,
2573,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
6339,
13332,
468,
2573,
18,
6208,
6339,
353,
7934,
2423,
598,
2690,
6922,
18,
468,
732,
1608,
358,
3883,
326,
563,
434,
2573,
18,
588,
1886,
6339,
1435,
1829,
273,
2573,
18,
588,
... |
if len( args ) < 1: usage() | from DIRAC.Interfaces.API.DiracAdmin import DiracAdmin | def usage(): print 'Usage: %s <DIRAC SITE NAME> [<DIRAC SITE NAME>]' % ( Script.scriptName ) DIRAC.exit( 2 ) | 345d6fc5e23e6784a35270a4615fa3def4a28358 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/345d6fc5e23e6784a35270a4615fa3def4a28358/dirac-admin-site-mask-logging.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
4537,
2226,
23832,
6048,
34,
306,
32,
4537,
2226,
23832,
6048,
34,
3864,
738,
261,
7739,
18,
4263,
461,
262,
18544,
2226,
18,
8593,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
4537,
2226,
23832,
6048,
34,
306,
32,
4537,
2226,
23832,
6048,
34,
3864,
738,
261,
7739,
18,
4263,
461,
262,
18544,
2226,
18,
8593,
12,
... |
if match: return match.group(1, 2) | if match: return map(unquote, match.group(1, 2)) | def splituser(host): """splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.""" global _userprog if _userprog is None: import re _userprog = re.compile('^([^@]*)@(.*)$') match = _userprog.match(host) if match: return match.group(1, 2) return None, host | 567ca8e732a75682adfdca08daaf2afa59582ad9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/567ca8e732a75682adfdca08daaf2afa59582ad9/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
1355,
12,
2564,
4672,
3536,
4939,
1355,
2668,
1355,
10531,
24002,
65,
36,
2564,
10531,
655,
3864,
13,
15431,
296,
1355,
10531,
24002,
65,
2187,
296,
2564,
10531,
655,
3864,
12123,
25... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
1355,
12,
2564,
4672,
3536,
4939,
1355,
2668,
1355,
10531,
24002,
65,
36,
2564,
10531,
655,
3864,
13,
15431,
296,
1355,
10531,
24002,
65,
2187,
296,
2564,
10531,
655,
3864,
12123,
25... |
for id in uniq(ids): | for id in ids: | def serialize_xrefs_files(self, output): headers = self.headers.keys() headers.sort() for file in headers: module = self.modulename_file(file) output.write(" <file name='%s'>\n" % (module)) dict = self.headers[file] ids = dict.functions.keys() + dict.variables.keys() + \ | a2e844a3b3503367a4418187e77ccc977f186909 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12659/a2e844a3b3503367a4418187e77ccc977f186909/apibuild.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4472,
67,
92,
9316,
67,
2354,
12,
2890,
16,
876,
4672,
1607,
273,
365,
18,
2485,
18,
2452,
1435,
1607,
18,
3804,
1435,
364,
585,
316,
1607,
30,
1605,
273,
365,
18,
1711,
332,
1069,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4472,
67,
92,
9316,
67,
2354,
12,
2890,
16,
876,
4672,
1607,
273,
365,
18,
2485,
18,
2452,
1435,
1607,
18,
3804,
1435,
364,
585,
316,
1607,
30,
1605,
273,
365,
18,
1711,
332,
1069,
6... |
if (self.value in (None, UNKNOWN)): return super(VariableDoc, self).is_detailed() | pval = super(VariableDoc, self).is_detailed() if pval or self.value in (None, UNKNOWN): return pval | def is_detailed(self): if (self.value in (None, UNKNOWN)): return super(VariableDoc, self).is_detailed() if isinstance(self.value, GenericValueDoc): # [XX] This is a little hackish -- we assume that the # summary lines will have SUMMARY_REPR_LINELEN chars, # that len(name) of those will be taken up by the name, # and that 3 of those will be taken up by " = " between # the name & val. Note that if any docwriter uses a # different formula for maxlen for this, then it will # not get the right value for is_detailed(). maxlen = self.value.SUMMARY_REPR_LINELEN-3-len(self.name) return (not self.value.summary_pyval_repr(maxlen).is_complete) else: return self.value.is_detailed() | 75c33ce63d000927d8d4ac167bc896f3bff063ec /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11420/75c33ce63d000927d8d4ac167bc896f3bff063ec/apidoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
72,
6372,
12,
2890,
4672,
27640,
273,
2240,
12,
3092,
1759,
16,
365,
2934,
291,
67,
72,
6372,
1435,
309,
27640,
578,
365,
18,
1132,
316,
261,
7036,
16,
13598,
4672,
327,
27640... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
72,
6372,
12,
2890,
4672,
27640,
273,
2240,
12,
3092,
1759,
16,
365,
2934,
291,
67,
72,
6372,
1435,
309,
27640,
578,
365,
18,
1132,
316,
261,
7036,
16,
13598,
4672,
327,
27640... |
assert_raises_with_msg(TimeoutError, 'Test timeout 1s exceeded', | assert_raises_with_msg(TimeoutError, 'Test timeout 1 second exceeded.', | def test_method_stopped_if_timeout(self): os.environ['ROBOT_THREAD_TESTING'] = 'initial value' self.tout.secs = 0.01 assert_raises_with_msg(TimeoutError, 'Test timeout 1s exceeded', self.tout.run, sleeping, (0.05,), {}, self.logger) self._verify_debug_msg(self.logger.msgs[0]) time.sleep(0.1) assert_equals(os.environ['ROBOT_THREAD_TESTING'], 'initial value') | 62023eb1a3ffca8bc1d94d7a732da33a5e9fc587 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6988/62023eb1a3ffca8bc1d94d7a732da33a5e9fc587/test_timeouts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2039,
67,
24228,
67,
430,
67,
4538,
12,
2890,
4672,
1140,
18,
28684,
3292,
1457,
38,
1974,
67,
21730,
67,
16961,
1360,
3546,
273,
296,
6769,
460,
11,
365,
18,
88,
659,
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,
1842,
67,
2039,
67,
24228,
67,
430,
67,
4538,
12,
2890,
4672,
1140,
18,
28684,
3292,
1457,
38,
1974,
67,
21730,
67,
16961,
1360,
3546,
273,
296,
6769,
460,
11,
365,
18,
88,
659,
18,
... |
def validate(self, object, name, value): | def validate(self, obj, name, value): """Make sure the given name follows Container naming rules. Returns the validated name. """ | def validate(self, object, name, value): if value == '' or value == None: return value s = super(ContainerName, self).validate(object, name, value) # normal string validation m = self._namecheck_rgx.search(s) if m is None or m.group() != s: raise TraitError("name '%s' contains illegal characters" % s) return s | 8586d67f5d42158f614b7fc3ff6c91066cfdb680 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12610/8586d67f5d42158f614b7fc3ff6c91066cfdb680/container.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
12,
2890,
16,
1081,
16,
508,
16,
460,
4672,
3536,
6464,
3071,
326,
864,
508,
13040,
4039,
14634,
2931,
18,
2860,
326,
10266,
508,
18,
3536,
309,
460,
422,
875,
578,
460,
422,
599... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
12,
2890,
16,
1081,
16,
508,
16,
460,
4672,
3536,
6464,
3071,
326,
864,
508,
13040,
4039,
14634,
2931,
18,
2860,
326,
10266,
508,
18,
3536,
309,
460,
422,
875,
578,
460,
422,
599... |
if type(t1) == types.FunctionType and type(t2) == types.FunctionType: | if iscallable(t1) and iscallable(t2): | def func(val): if type(t1) == types.FunctionType and type(t2) == types.FunctionType: return t1(val) or t2(val) else: raise exceptions.ValueError("We expect a function valueXXX") | 0808dd362a5f2dd5d90d950500fd972461718062 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/401/0808dd362a5f2dd5d90d950500fd972461718062/simuOpt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1326,
12,
1125,
4672,
309,
353,
7293,
12,
88,
21,
13,
471,
353,
7293,
12,
88,
22,
4672,
327,
268,
21,
12,
1125,
13,
578,
268,
22,
12,
1125,
13,
469,
30,
1002,
4798,
18,
23610,
2932... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1326,
12,
1125,
4672,
309,
353,
7293,
12,
88,
21,
13,
471,
353,
7293,
12,
88,
22,
4672,
327,
268,
21,
12,
1125,
13,
578,
268,
22,
12,
1125,
13,
469,
30,
1002,
4798,
18,
23610,
2932... |
return ElementTree.tostring(self._to_tree(version, encoding)) | tree_string = ElementTree.tostring(self._to_tree(version, encoding)) if pretty_print and xmlString is not None: return xmlString(tree_string).toprettyxml() return tree_string | def to_string(self, version=1, encoding=None): """Converts this object to XML.""" return ElementTree.tostring(self._to_tree(version, encoding)) | 2dc5428bd878a62864f9b02697b6415ef6fc0377 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5609/2dc5428bd878a62864f9b02697b6415ef6fc0377/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
1080,
12,
2890,
16,
1177,
33,
21,
16,
2688,
33,
7036,
4672,
3536,
5692,
333,
733,
358,
3167,
12123,
327,
22566,
18,
14627,
371,
12,
2890,
6315,
869,
67,
3413,
12,
1589,
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,
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,
358,
67,
1080,
12,
2890,
16,
1177,
33,
21,
16,
2688,
33,
7036,
4672,
3536,
5692,
333,
733,
358,
3167,
12123,
327,
22566,
18,
14627,
371,
12,
2890,
6315,
869,
67,
3413,
12,
1589,
16,
... |
self._dimensions[colnum][tagname] = m.group(1) | try: self._dimensions[colnum][tagname] = eval(m.group(1)) except: self._dimensions[colnum][tagname] = m.group(1) | def _parse_meta_data(self, line): m = self._META_STEPRE.match(line) if m is not None: self._dimensions.append(int(m.group(1))) return True | ce0d6d6e3f318e716fbafff029cf2efd5038f0ab /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6471/ce0d6d6e3f318e716fbafff029cf2efd5038f0ab/data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
3901,
67,
892,
12,
2890,
16,
980,
4672,
312,
273,
365,
6315,
19294,
67,
882,
41,
3670,
18,
1916,
12,
1369,
13,
309,
312,
353,
486,
599,
30,
365,
6315,
14797,
18,
6923,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
2670,
67,
3901,
67,
892,
12,
2890,
16,
980,
4672,
312,
273,
365,
6315,
19294,
67,
882,
41,
3670,
18,
1916,
12,
1369,
13,
309,
312,
353,
486,
599,
30,
365,
6315,
14797,
18,
6923,... |
self.hboxlayout6.addWidget(self.label_13) | self.hboxlayout7.addWidget(self.label_13) | def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(QtCore.QSize(QtCore.QRect(0,0,776,532).size()).expandedTo(MainWindow.minimumSizeHint())) MainWindow.setWindowIcon(QtGui.QIcon(" ")) | 63111e1c9754b5d54a0f7495871ccaf05c2651b1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1108/63111e1c9754b5d54a0f7495871ccaf05c2651b1/main_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13943,
12,
2890,
16,
12740,
3829,
4672,
12740,
3829,
18,
542,
16707,
2932,
6376,
3829,
7923,
12740,
3829,
18,
15169,
12,
23310,
4670,
18,
53,
1225,
12,
23310,
4670,
18,
53,
6120,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13943,
12,
2890,
16,
12740,
3829,
4672,
12740,
3829,
18,
542,
16707,
2932,
6376,
3829,
7923,
12740,
3829,
18,
15169,
12,
23310,
4670,
18,
53,
1225,
12,
23310,
4670,
18,
53,
6120,
1... |
if ci.state == 6: | if ci.state == py_pjsua.PJSIP_INV_STATE_DISCONNECTED: | def on_call_state(call_id, e): global g_current_call ci = py_pjsua.call_get_info(call_id) write_log(3, call_name(call_id) + " state = " + `ci.state_text`) if ci.state == 6: g_current_call = py_pjsua.PJSUA_INVALID_ID | ebac5dd3ba22a443b9d9de1b314b6bf6205428fa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8531/ebac5dd3ba22a443b9d9de1b314b6bf6205428fa/pjsua_app.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
1991,
67,
2019,
12,
1991,
67,
350,
16,
425,
4672,
2552,
314,
67,
2972,
67,
1991,
9039,
273,
2395,
67,
84,
2924,
11886,
18,
1991,
67,
588,
67,
1376,
12,
1991,
67,
350,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
1991,
67,
2019,
12,
1991,
67,
350,
16,
425,
4672,
2552,
314,
67,
2972,
67,
1991,
9039,
273,
2395,
67,
84,
2924,
11886,
18,
1991,
67,
588,
67,
1376,
12,
1991,
67,
350,
13,
... |
elif abs(dx)<self.m and abs(dy)<self.m: return AREA_SQUARE | def area_at(self, x,y): dx = x-self.x0 dy = y-self.y0 d = sqrt(dx*dx+dy*dy) sq2 = sqrt(2.0) cmp_M = self.M/2.0 cmp_r = (sq2-1)*cmp_M/(2*sq2) cmp_x0 = self.x0+cmp_M-cmp_r cmp_y0 = self.y0+cmp_M-cmp_r cmp_dx = x - cmp_x0 cmp_dy = y - cmp_y0 if cmp_r > sqrt(cmp_dx*cmp_dx + cmp_dy*cmp_dy): return AREA_COMPARE elif d > self.r3: return AREA_OUTSIDE elif self.r2 < d < self.r3: return AREA_CIRCLE elif self.rd < d < self.r2: return AREA_SAMPLE elif abs(dx)<self.m and abs(dy)<self.m: return AREA_SQUARE else: return AREA_INSIDE | 69bd95301f9911d8a91470bca7826e2868d822c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7129/69bd95301f9911d8a91470bca7826e2868d822c0/colorsamplerwindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5091,
67,
270,
12,
2890,
16,
619,
16,
93,
4672,
6633,
273,
619,
17,
2890,
18,
92,
20,
7732,
273,
677,
17,
2890,
18,
93,
20,
302,
273,
5700,
12,
13437,
14,
13437,
15,
15680,
14,
156... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5091,
67,
270,
12,
2890,
16,
619,
16,
93,
4672,
6633,
273,
619,
17,
2890,
18,
92,
20,
7732,
273,
677,
17,
2890,
18,
93,
20,
302,
273,
5700,
12,
13437,
14,
13437,
15,
15680,
14,
156... | |
//var jsolait = importModule("jsolait"); //jsolait.baseURL = "%(lib)s"; //jsolait.libURL = "%(jsolaitURL)s"; | jsolait.baseURL = "%(lib)s"; jsolait.libURL = "%(jsolaitURL)s"; | def jsonjs(self): env = self.servlet().request().environ() jsolaitURL = self.jsolaitURL lib = self.libURL here = wsgilib.construct_url(env, False) here += '?_action_=jsonaction'; if self.baseConfig: app_base = env['%s.base_url' % self.baseConfig] if not jsolaitURL.startswith('/'): jsolaitURL = app_base + '/' + jsolaitURL if not lib.startswith('/'): lib = app_base + '/' + lib text = (r''' <script type="text/javascript" src="%(jsolaitURL)s/init.js"></script> <script type="text/javascript"> //var jsolait = importModule("jsolait"); //jsolait.baseURL = "%(lib)s"; //jsolait.libURL = "%(jsolaitURL)s"; </script> <script type="text/javascript" src="%(jsolaitURL)s/lib/urllib.js"></script> <script type="text/javascript" src="%(jsolaitURL)s/lib/jsonrpc.js"></script> <script type="text/javascript" src="%(jsolaitURL)s/lib/lang.js"></script> <script type="text/javascript"> jsonrpc = importModule("jsonrpc"); var servlet = new jsonrpc.ServiceProxy(%(here)r, %(methods)r); </script> ''' % {'jsolaitURL': jsolaitURL, 'lib': lib, 'here': here, 'methods': self.jsonMethods()}) return text | b94d4ce797a382ff96d383b7c8dfcd7593992f68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11400/b94d4ce797a382ff96d383b7c8dfcd7593992f68/jsoncomponent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1163,
2924,
12,
2890,
4672,
1550,
273,
365,
18,
23231,
7675,
2293,
7675,
28684,
1435,
3828,
355,
1540,
1785,
273,
365,
18,
2924,
355,
1540,
1785,
2561,
273,
365,
18,
2941,
1785,
2674,
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,
1163,
2924,
12,
2890,
4672,
1550,
273,
365,
18,
23231,
7675,
2293,
7675,
28684,
1435,
3828,
355,
1540,
1785,
273,
365,
18,
2924,
355,
1540,
1785,
2561,
273,
365,
18,
2941,
1785,
2674,
27... |
qty_discounts = self.price_set.exclude(expires__isnull=False, expires__lt=datetime.date.today()).filter(quantity__lte=1) | qty_discounts = Price.objects.filter(product__id=self.product.id).exclude(expires__isnull=False, expires__lt=datetime.date.today()) | def _get_fullPrice(self): """ Get price based on parent ConfigurableProduct """ if not self.parent.product.unit_price: return None # allow explicit setting of prices. try: qty_discounts = self.price_set.exclude(expires__isnull=False, expires__lt=datetime.date.today()).filter(quantity__lte=1) if qty_discounts.count() > 0: # Get the price with the quantity closest to the one specified without going over return qty_discounts.order_by('-quantity')[0].price except AttributeError: # otherwise calculate from options price_delta = Decimal("0.00") for option in self.options.all(): if option.price_change: price_delta += option.price_change return self.parent.product.unit_price + price_delta | 576ac094785af52b86a13b29704dfd1a9802279e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/171/576ac094785af52b86a13b29704dfd1a9802279e/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
2854,
5147,
12,
2890,
4672,
3536,
968,
6205,
2511,
603,
982,
29312,
4133,
3536,
309,
486,
365,
18,
2938,
18,
5896,
18,
4873,
67,
8694,
30,
327,
599,
225,
468,
1699,
5515,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2854,
5147,
12,
2890,
4672,
3536,
968,
6205,
2511,
603,
982,
29312,
4133,
3536,
309,
486,
365,
18,
2938,
18,
5896,
18,
4873,
67,
8694,
30,
327,
599,
225,
468,
1699,
5515,... |
self.terminator.groupsend = value | if value in self.terminator.groupsend_type: self.terminator.groupsend = value | def set_groupsend(self, widget, value): """Set the groupsend mode""" # FIXME: Can we think of a smarter way of doing this than poking? self.terminator.groupsend = value | c647948a7fe81768afb7a383769e16ee7aac44bc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6502/c647948a7fe81768afb7a383769e16ee7aac44bc/terminal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
4650,
409,
12,
2890,
16,
3604,
16,
460,
4672,
3536,
694,
326,
3252,
409,
1965,
8395,
468,
9852,
30,
4480,
732,
15507,
434,
279,
3029,
14153,
4031,
434,
9957,
333,
2353,
293,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
4650,
409,
12,
2890,
16,
3604,
16,
460,
4672,
3536,
694,
326,
3252,
409,
1965,
8395,
468,
9852,
30,
4480,
732,
15507,
434,
279,
3029,
14153,
4031,
434,
9957,
333,
2353,
293,
6... |
print 'This system is probably returning bit-shifted '+\ 'exit codes. Old value:',res | sys.stderr.write(mess) | def ExecuteCommand(command, timeout, verbose=False): pobj = subprocess.Popen(command, shell=True) # Create a new sub process # end the process after timeout seconds # poll interval is 1 second for simplicity # but for faster processes may want to change # this i=0 while i < timeout: res = pobj.poll() if res is not None: break time.sleep(1) i += 1 if res is None: print 'Process is taking longer than',timeout,'seconds. Ending process' os.kill(pobj.pid, signal.SIGTERM) res = 1024 else: if res > 100: if verbose: print 'This system is probably returning bit-shifted '+\ 'exit codes. Old value:',res res = res >> bitshift if verbose: print 'exit code:',res return 1024 | f2cd5c779583c2f63b6d536dbfab856040b9817b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6617/f2cd5c779583c2f63b6d536dbfab856040b9817b/wl-run.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7903,
2189,
12,
3076,
16,
2021,
16,
3988,
33,
8381,
4672,
293,
2603,
273,
6652,
18,
52,
3190,
12,
3076,
16,
5972,
33,
5510,
13,
225,
468,
1788,
279,
394,
720,
1207,
468,
679,
326,
12... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7903,
2189,
12,
3076,
16,
2021,
16,
3988,
33,
8381,
4672,
293,
2603,
273,
6652,
18,
52,
3190,
12,
3076,
16,
5972,
33,
5510,
13,
225,
468,
1788,
279,
394,
720,
1207,
468,
679,
326,
12... |
newArgs = self._defaultArgs.copy() if "min" in kwargs: if kwargs["min"] < 0: newArgs["allowNegative"] = True newArgs.update(kwargs) | tmp = self._defaultArgs.copy() tmp.update(kwargs) kwargs = tmp if kwargs["min"] < 0: kwargs["allowNegative"] = True if "max" not in kwargs: kwargs["max"] = ( 10 ** kwargs["integerWidth"] - 10 ** -kwargs["fractionWidth"] ) | def __init__( self, parent, id=-1, value = 0.0, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.TE_RIGHT, validator = wx.DefaultValidator, name = "eg.SpinNumCtrl", **kwargs | df3b9e1266ca815063d3aa49390d701b48fc9133 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8076/df3b9e1266ca815063d3aa49390d701b48fc9133/SpinNumCtrl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
982,
16,
612,
29711,
21,
16,
460,
273,
374,
18,
20,
16,
949,
273,
7075,
18,
1868,
2555,
16,
963,
273,
7075,
18,
1868,
1225,
16,
2154,
273,
7075,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
982,
16,
612,
29711,
21,
16,
460,
273,
374,
18,
20,
16,
949,
273,
7075,
18,
1868,
2555,
16,
963,
273,
7075,
18,
1868,
1225,
16,
2154,
273,
7075,
18,
1... |
args = ex.args() | args = ex.operands() | def derivative(self, ex, operator): """ EXAMPLES:: | 1c20e8765c660911d48866b17d4f6715422e7042 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1c20e8765c660911d48866b17d4f6715422e7042/expression_conversions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16417,
12,
2890,
16,
431,
16,
3726,
4672,
3536,
5675,
8900,
11386,
2866,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16417,
12,
2890,
16,
431,
16,
3726,
4672,
3536,
5675,
8900,
11386,
2866,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if self.showSteps: self["step"].setText(self.getTranslation("Step ") + str(self.currStep) + "/" + str(self.numSteps)) if self.showStepSlider: self["stepslider"].setValue(self.currStep) if self.wizard[self.currStep]["timeout"] is not None: self.resetCounter() self.timeoutTimer.start(1000) | if self.showSteps: self["step"].setText(self.getTranslation("Step ") + str(self.currStep) + "/" + str(self.numSteps)) if self.showStepSlider: self["stepslider"].setValue(self.currStep) if self.wizard[self.currStep]["timeout"] is not None: self.resetCounter() self.timeoutTimer.start(1000) | def updateValues(self): print "Updating values in step " + str(self.currStep) # calling a step which doesn't exist can only happen if the condition in the last step is not fulfilled # if a non-existing step is called, end the wizard if self.currStep > len(self.wizard): self.markDone() self.close() return | e4632437dcaf95c92abd3b1fed122a61c97e3a5b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6652/e4632437dcaf95c92abd3b1fed122a61c97e3a5b/Wizard.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
1972,
12,
2890,
4672,
1172,
315,
17858,
924,
316,
2235,
315,
397,
609,
12,
2890,
18,
17016,
4160,
13,
468,
4440,
279,
2235,
1492,
3302,
1404,
1005,
848,
1338,
5865,
309,
326,
2269,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
1972,
12,
2890,
4672,
1172,
315,
17858,
924,
316,
2235,
315,
397,
609,
12,
2890,
18,
17016,
4160,
13,
468,
4440,
279,
2235,
1492,
3302,
1404,
1005,
848,
1338,
5865,
309,
326,
2269,... |
This function uses the algorithm of [Edmonds74] to calculate the | This function uses the algorithm of [Edmonds74]_ to calculate the | 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 | 88e8ded3e4e8fadbc380d719dcf3bdc6eab9d557 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/88e8ded3e4e8fadbc380d719dcf3bdc6eab9d557/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,... |
dependencies = dependencies, | def __init__(self, directory, rcsSubDir, rcsBaseUrl, rcs, dependencies= []): super(Binary, self).__init__(directory = directory, rcsSubDir = rcsSubDir, rcsBaseUrl = rcsBaseUrl, rcs = rcs, dependencies = dependencies, executable = 'bin') | 86d1cb8f56b7616de04a48f2f3921ba30e9ded39 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8259/86d1cb8f56b7616de04a48f2f3921ba30e9ded39/Project.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1867,
16,
436,
2143,
1676,
1621,
16,
436,
2143,
14074,
16,
436,
2143,
16,
5030,
33,
5378,
4672,
2240,
12,
5905,
16,
365,
2934,
972,
2738,
972,
12,
5149,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1867,
16,
436,
2143,
1676,
1621,
16,
436,
2143,
14074,
16,
436,
2143,
16,
5030,
33,
5378,
4672,
2240,
12,
5905,
16,
365,
2934,
972,
2738,
972,
12,
5149,
... | |
path = os.path.join(self.sharespath, name) | path = self.getContent(name, "path") | def getACLOnShare(self, name): """ Return a list with all the groups that have rwx access to the share. | e525f612d26644e9e0afd1ea85c9904e424bf464 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5988/e525f612d26644e9e0afd1ea85c9904e424bf464/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
9486,
1398,
9535,
12,
2890,
16,
508,
4672,
3536,
2000,
279,
666,
598,
777,
326,
3252,
716,
1240,
7985,
92,
2006,
358,
326,
7433,
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,
336,
9486,
1398,
9535,
12,
2890,
16,
508,
4672,
3536,
2000,
279,
666,
598,
777,
326,
3252,
716,
1240,
7985,
92,
2006,
358,
326,
7433,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
print l | print "abnormal lines:", lines | def line2def(self, lines): results = [] for l in lines: if not l: continue ####################### # ctags bug?! it seem that it could not handle two continous # doulbe quota charaecters ("")rightly in Exuberant Ctags 5.6, at least. # so here we resume "\xd3" to "", workaround :( ###### l = l.replace("\xd3", '""') fields = l.split("\t") filename = fields[1] caller = "" lineno = fields[2][:-2] # remove ';"' attrtab = {} for f in fields[3:]: try: k, v = f.split(":", 1) attrtab[k] = v except ValueError: print "abnormal attrtab",f print l continue attrtab["name"] = fields[0] try: results.append((filename, caller, int(lineno), attrtab)) except ValueError: print "bug here #1" print l return results | 758e17892d39e616fa921d975fac43b7923b86b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5753/758e17892d39e616fa921d975fac43b7923b86b5/indexer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
980,
22,
536,
12,
2890,
16,
2362,
4672,
1686,
273,
5378,
364,
328,
316,
2362,
30,
309,
486,
328,
30,
202,
17143,
29570,
1970,
1189,
468,
276,
4156,
7934,
35,
5,
518,
19264,
716,
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,
980,
22,
536,
12,
2890,
16,
2362,
4672,
1686,
273,
5378,
364,
328,
316,
2362,
30,
309,
486,
328,
30,
202,
17143,
29570,
1970,
1189,
468,
276,
4156,
7934,
35,
5,
518,
19264,
716,
518,
... |
if rid.inc_list: print "/".join(rid.index) | if rid.inc_list: if not rid.index: path = "." else: path = "/".join(rid.index) print "%-11s: %s" % (determineChangeType(rid.inc_list), path) | def get_rids_recursive(rid): """Yield all the rids under rid that have inc newer than rest_time""" yield rid for sub_rid in Restore.yield_rids(rid, rest_time, mirror_time): for sub_sub_rid in get_rids_recursive(sub_rid): yield sub_sub_rid | b8d797fa7304f9fce5ee00b2ad1e39e453871141 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/783/b8d797fa7304f9fce5ee00b2ad1e39e453871141/Main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1691,
87,
67,
10543,
12,
1691,
4672,
3536,
16348,
777,
326,
436,
2232,
3613,
10911,
716,
1240,
7290,
16069,
2353,
3127,
67,
957,
8395,
2824,
10911,
364,
720,
67,
1691,
316,
1119... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1691,
87,
67,
10543,
12,
1691,
4672,
3536,
16348,
777,
326,
436,
2232,
3613,
10911,
716,
1240,
7290,
16069,
2353,
3127,
67,
957,
8395,
2824,
10911,
364,
720,
67,
1691,
316,
1119... |
sage: L = K.galois_closure(); L | sage: M = K.galois_closure('b'); M Number Field in b with defining polynomial x^8 + 28*x^4 + 2500 sage: L.<a2> = K.galois_closure(); L | def galois_closure(self, names=None): """ Return number field $K$ that is the Galois closure of self, i.e., is generated by all roots of the defining polynomial of self | 05f3a2a8ba9f83942ded7f49b8c102545c57b7b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/05f3a2a8ba9f83942ded7f49b8c102545c57b7b9/number_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24902,
19606,
67,
20823,
12,
2890,
16,
1257,
33,
7036,
4672,
3536,
2000,
1300,
652,
271,
47,
8,
716,
353,
326,
611,
287,
19606,
7213,
434,
365,
16,
277,
18,
73,
12990,
353,
4374,
635,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24902,
19606,
67,
20823,
12,
2890,
16,
1257,
33,
7036,
4672,
3536,
2000,
1300,
652,
271,
47,
8,
716,
353,
326,
611,
287,
19606,
7213,
434,
365,
16,
277,
18,
73,
12990,
353,
4374,
635,
... |
while (not 'cftp> ' in self.processProtocol.buffer) and (time.time() < timeout): | while (self.processProtocol.buffer.find('cftp> ') == -1) and (time.time() < timeout): | def _getCmdResult(self, cmd): self.processProtocol.clearBuffer() self.processProtocol.transport.write(cmd+'\n') timeout = time.time() + 5 while (not 'cftp> ' in self.processProtocol.buffer) and (time.time() < timeout): reactor.iterate(0.1) self.failIf(time.time() > timeout, "timeout") if self.processProtocol.buffer.startswith('cftp> '): self.processProtocol.buffer = self.processProtocol.buffer[6:] return self.processProtocol.buffer[:-6].strip() | 17ee7fef46f4fb21964daecaab40d87f1435161a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/17ee7fef46f4fb21964daecaab40d87f1435161a/test_sftp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
5931,
1253,
12,
2890,
16,
1797,
4672,
365,
18,
2567,
5752,
18,
8507,
1892,
1435,
365,
18,
2567,
5752,
18,
13049,
18,
2626,
12,
4172,
6797,
64,
82,
6134,
2021,
273,
813,
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,
389,
588,
5931,
1253,
12,
2890,
16,
1797,
4672,
365,
18,
2567,
5752,
18,
8507,
1892,
1435,
365,
18,
2567,
5752,
18,
13049,
18,
2626,
12,
4172,
6797,
64,
82,
6134,
2021,
273,
813,
18,
... |
sql.append("SELECT t1.time,t1.ticket,'','reopened',t2.newvalue,t1.author " | sql.append("SELECT t1.time,t1.ticket,'','reopened',t2.newvalue, " " t1.author,t.summary " | def get_timeline_events(self, req, start, stop, filters): if 'ticket' in filters: absurls = req.args.get('format') == 'rss' # Kludge sql = [] | 002831a283f63c0dbdcd402238fe51d0497fc231 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/002831a283f63c0dbdcd402238fe51d0497fc231/Ticket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
26237,
67,
5989,
12,
2890,
16,
1111,
16,
787,
16,
2132,
16,
3415,
4672,
309,
296,
16282,
11,
316,
3415,
30,
2417,
10518,
273,
1111,
18,
1968,
18,
588,
2668,
2139,
6134,
422,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
26237,
67,
5989,
12,
2890,
16,
1111,
16,
787,
16,
2132,
16,
3415,
4672,
309,
296,
16282,
11,
316,
3415,
30,
2417,
10518,
273,
1111,
18,
1968,
18,
588,
2668,
2139,
6134,
422,
... |
order.state = message.new_fulfillment_order_state order.payment = message.new_financial_order_state | if message.new_fulfillment_order_state != message.previous_financial_order_state: order.state = message.new_fulfillment_order_state if message.new_financial_order_state != message.previous_financial_order_state: order.payment = message.new_financial_order_state | def handle_order_state_change(self, message, order_id, order, context): """ React to the order state change. """ assert order is not None order.state = message.new_fulfillment_order_state order.payment = message.new_financial_order_state order.save() | ec3da862e4a678b71b132591354314c93edc0835 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10801/ec3da862e4a678b71b132591354314c93edc0835/controller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1019,
67,
2019,
67,
3427,
12,
2890,
16,
883,
16,
1353,
67,
350,
16,
1353,
16,
819,
4672,
3536,
13732,
358,
326,
1353,
919,
2549,
18,
3536,
1815,
1353,
353,
486,
599,
309,
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,
1640,
67,
1019,
67,
2019,
67,
3427,
12,
2890,
16,
883,
16,
1353,
67,
350,
16,
1353,
16,
819,
4672,
3536,
13732,
358,
326,
1353,
919,
2549,
18,
3536,
1815,
1353,
353,
486,
599,
309,
8... |
slow = ["exp", "log", "sin", "tan", "cos"] | slow = ["power", "exp", "log", "sin", "tan", "cos"] | def testit(prec, N): from time import clock RF = round_half_even prec = setprec('TYPE', prec) xs, ys, xys = rndnums('TYPE', N) t = 1e100 for i in range(3): t1 = clock() for x, y in xys: OP; OP; OP; OP; OP; OP; OP; OP; OP; OP; t2 = clock() t = min(t, (t2-t1)/10) return t | d5a90d60c049eeabdd5e7376035aab8a2e766e05 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11851/d5a90d60c049eeabdd5e7376035aab8a2e766e05/benchmark.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
305,
12,
4036,
16,
423,
4672,
628,
813,
1930,
7268,
534,
42,
273,
3643,
67,
20222,
67,
16728,
13382,
273,
444,
4036,
2668,
2399,
2187,
13382,
13,
9280,
16,
16036,
16,
619,
1900,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
305,
12,
4036,
16,
423,
4672,
628,
813,
1930,
7268,
534,
42,
273,
3643,
67,
20222,
67,
16728,
13382,
273,
444,
4036,
2668,
2399,
2187,
13382,
13,
9280,
16,
16036,
16,
619,
1900,
... |
if hdlr in self.handlers: hdlr.acquire() try: | _acquireLock() try: if hdlr in self.handlers: | def removeHandler(self, hdlr): """ Remove the specified handler from this logger. """ if hdlr in self.handlers: hdlr.acquire() try: self.handlers.remove(hdlr) finally: hdlr.release() | d6c7f6e9712f47df735b68eab12814caa2ab4346 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/d6c7f6e9712f47df735b68eab12814caa2ab4346/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
1503,
12,
2890,
16,
366,
5761,
86,
4672,
3536,
3581,
326,
1269,
1838,
628,
333,
1194,
18,
3536,
389,
1077,
1039,
2531,
1435,
775,
30,
309,
366,
5761,
86,
316,
365,
18,
11046,
30,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
1503,
12,
2890,
16,
366,
5761,
86,
4672,
3536,
3581,
326,
1269,
1838,
628,
333,
1194,
18,
3536,
389,
1077,
1039,
2531,
1435,
775,
30,
309,
366,
5761,
86,
316,
365,
18,
11046,
30,... |
This function returns the dimension of the space of modular forms of weight 2 and level equal to the level associated to self. | Return the dimension of the space of modular forms of weight 2 and level equal to the level associated to self. | def dimension(self): r""" This function returns the dimension of the space of modular forms of weight 2 and level equal to the level associated to self. | bb85062365ca3248bcd33fb2f5430e7bc6e09dce /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/bb85062365ca3248bcd33fb2f5430e7bc6e09dce/ssmod.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4968,
12,
2890,
4672,
436,
8395,
1220,
445,
1135,
326,
4968,
434,
326,
3476,
434,
681,
2490,
10138,
434,
3119,
576,
471,
1801,
3959,
358,
326,
1801,
3627,
358,
365,
18,
2,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4968,
12,
2890,
4672,
436,
8395,
1220,
445,
1135,
326,
4968,
434,
326,
3476,
434,
681,
2490,
10138,
434,
3119,
576,
471,
1801,
3959,
358,
326,
1801,
3627,
358,
365,
18,
2,
-100,
-100,
... |
sage: B.det() 11 + 484*t^2 + 451*t^3 + O(t^4) | sage: B.det() 11 + 484*t^2 + 451*t^3 + O(t^4) | def matrix_of_frobenius(Q, p, M, trace=None, compute_exact_forms=False): """ Computes the matrix of Frobenius on Monsky-Washnitzer cohomology, with respect to the basis $(dx/y, x dx/y)$. INPUT: Q -- cubic polynomial $Q(x) = x^3 + ax + b$ defining an elliptic curve E by $y^2 = Q(x)$. The coefficient ring of Q should be a $\Z/(p^M)\Z$-algebra in which the matrix of frobenius will be constructed. p -- prime >= 5 for which E has good reduction M -- integer >= 2; $p$-adic precision of the coefficient ring trace -- (optional) the trace of the matrix, if known in advance. This is easy to compute because it's just the $a_p$ of the curve. If the trace is supplied, matrix_of_frobenius will use it to speed the computation (i.e. we know the determinant is $p$, so we have two conditions, so really only column of the matrix needs to be computed. It's actually a little more complicated than that, but that's the basic idea.) If trace=None, then both columns will be computed independently, and you can get a strong indication of correctness by verifying the trace afterwards. WARNING: -- THE RESULT WILL NOT NECESSARILY BE CORRECT TO M p-ADIC DIGITS. If you want prec digits of precision, you need to use the function adjusted_prec(), and then you need to reduce the answer mod p^prec at the end. OUTPUT: 2x2 matrix of frobenius on Monsky-Washnitzer cohomology, with entries in the coefficient ring of Q. EXAMPLES: A simple example: sage: p = 5 sage: prec = 3 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: M 5 sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), p, M) sage: A [3090 187] [2945 408] But the result is only accurate to prec digits: sage: B = A.change_ring(Integers(p**prec)) sage: B [90 62] [70 33] Check trace (123 = -2 mod 125) and determinant: sage: B.det() 5 sage: B.trace() 123 sage: EllipticCurve([-1, 1/4]).ap(5) -2 Try using the trace to speed up the calculation: sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), ... p, M, -2) sage: A [2715 187] [1445 408] Hmmm... it looks different, but that's because the trace of our first answer was only -2 modulo $5^3$, not -2 modulo $5^5$. So the right answer is: sage: A.change_ring(Integers(p**prec)) [90 62] [70 33] Check it works with only one digit of precision: sage: p = 5 sage: prec = 1 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), p, M) sage: A.change_ring(Integers(p)) [0 2] [0 3] Here's an example that's particularly badly conditioned for using the trace trick: sage: p = 11 sage: prec = 3 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 + 7*x + 8, p, M) sage: A.change_ring(Integers(p**prec)) [1144 176] [ 847 185] The problem here is that the top-right entry is divisible by 11, and the bottom-left entry is divisible by $11^2$. So when you apply the trace trick, neither $F(dx/y)$ nor $F(x dx/y)$ is enough to compute the whole matrix to the desired precision, even if you try increasing the target precision by one. Nevertheless, \code{matrix_of_frobenius} knows how to get the right answer by evaluating $F((x+1) dx/y)$ instead: sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 + 7*x + 8, p, M, -2) sage: A.change_ring(Integers(p**prec)) [1144 176] [ 847 185] The running time is about \code{O(p * prec**2)} (times some logarithmic factors), so it's feasible to run on fairly large primes, or precision (or both?!?!): sage: p = 10007 sage: prec = 2 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius( # long time ... x^3 - x + R(1/4), p, M) # long time sage: B = A.change_ring(Integers(p**prec)); B # long time [74311982 57996908] [95877067 25828133] sage: B.det() # long time 10007 sage: B.trace() # long time 66 sage: EllipticCurve([-1, 1/4]).ap(10007) # long time 66 sage: p = 5 sage: prec = 300 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius( # long time ... x^3 - x + R(1/4), p, M) # long time sage: B = A.change_ring(Integers(p**prec)) # long time sage: B.det() # long time 5 sage: -B.trace() # long time 2 sage: EllipticCurve([-1, 1/4]).ap(5) # long time -2 Let's check consistency of the results for a range of precisions: sage: p = 5 sage: max_prec = 60 sage: M = monsky_washnitzer.adjusted_prec(p, max_prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), p, M) # long time sage: A = A.change_ring(Integers(p**max_prec)) # long time sage: result = [] # long time sage: for prec in range(1, max_prec): # long time ... M = monsky_washnitzer.adjusted_prec(p, prec) # long time ... R.<x> = PolynomialRing(Integers(p^M),'x') # long time ... B = monsky_washnitzer.matrix_of_frobenius( # long time ... x^3 - x + R(1/4), p, M) # long time ... B = B.change_ring(Integers(p**prec)) # long time ... result.append(B == A.change_ring( # long time ... Integers(p**prec))) # long time sage: result == [True] * (max_prec - 1) # long time True The remaining examples discuss what happens when you take the coefficient ring to be a power series ring; i.e. in effect you're looking at a family of curves. The code does in fact work... sage: p = 11 sage: prec = 3 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: S.<t> = PowerSeriesRing(Integers(p**M), default_prec=4) sage: a = 7 + t + 3*t^2 sage: b = 8 - 6*t + 17*t^2 sage: R.<x> = PolynomialRing(S) sage: Q = x**3 + a*x + b sage: A = monsky_washnitzer.matrix_of_frobenius(Q, p, M) # long time sage: B = A.change_ring(PowerSeriesRing(Integers(p**prec), 't', default_prec=4)) # long time sage: B # long time [1144 + 264*t + 841*t^2 + 1025*t^3 + O(t^4) 176 + 1052*t + 216*t^2 + 523*t^3 + O(t^4)] [ 847 + 668*t + 81*t^2 + 424*t^3 + O(t^4) 185 + 341*t + 171*t^2 + 642*t^3 + O(t^4)] The trace trick should work for power series rings too, even in the badly- conditioned case. Unfortunately I don't know how to compute the trace in advance, so I'm not sure exactly how this would help. Also, I suspect the running time will be dominated by the expansion, so the trace trick won't really speed things up anyway. Another problem is that the determinant is not always p: sage: B.det() # long time 11 + 484*t^2 + 451*t^3 + O(t^4) However, it appears that the determinant always has the property that if you substitute t -> 11t, you do get the constant series p (mod p**prec). Similarly for the trace. And since the parameter only really makes sense when it's divisible by p anyway, perhaps this isn't a problem after all. """ M = int(M) if M < 2: raise ValueError, "M (=%s) must be at least 2" % M base_ring = Q.base_ring() # Expand out frobenius of dx/y and x dx/y. # (You can substitute frobenius_expansion_by_series here, that will work # as well. See its docstring for some performance notes.) F0, F1, offset = frobenius_expansion_by_newton(Q, p, M) #F0, F1, offset = frobenius_expansion_by_series(Q, p, M) if compute_exact_forms: # we need to do all the work to get the exact expressions f such that F(x^i dx/y) = df + \sum a_i x^i dx/y F0_coeffs = transpose_list(F0.coeffs()) F0_reduced, f_0 = reduce_all(Q, p, F0_coeffs, offset, True) F1_coeffs = transpose_list(F1.coeffs()) F1_reduced, f_1 = reduce_all(Q, p, F1_coeffs, offset, True) elif M == 2: # This implies that only one digit of precision is valid, so we only need # to reduce the second column. Also, the trace doesn't help at all. F0_reduced = [ base_ring(0), base_ring(0) ] F1_coeffs = transpose_list(F1.coeffs()) F1_reduced = reduce_all(Q, p, F1_coeffs, offset) elif trace is None: # No trace provided, just reduce F(dx/y) and F(x dx/y) separately. F0_coeffs = transpose_list(F0.coeffs()) F0_reduced = reduce_all(Q, p, F0_coeffs, offset) F1_coeffs = transpose_list(F1.coeffs()) F1_reduced = reduce_all(Q, p, F1_coeffs, offset) else: # Trace has been provided. # In most cases this can be used to quickly compute F(dx/y) from # F(x dx/y). However, if we're unlucky, the (dx/y)-component of # F(x dx/y) (i.e. the top-right corner of the matrix) may be divisible # by p, in which case there isn't enough information to get the # (x dx/y)-component of F(dx/y) to the desired precision. When this # happens, it turns out that F((x+1) dx/y) always *does* give enough # information (together with the trace) to get both columns to the # desired precision. # First however we need a quick way of telling whether the top-right # corner is divisible by p, i.e. we want to compute the second column # of the matrix mod p. We could do this by just running the entire # algorithm with M = 2 (which assures precision 1). Luckily, we've # already done most of the work by computing F1 to high precision; so # all we need to do is extract the coefficients that would correspond # to the first term of the series, and run the reduction on them. # todo: actually we only need to do this reduction step mod p^2, not # mod p^M, which is what the code currently does. If the base ring # is Integers(p^M), then it's easy. Otherwise it's tricky to construct # the right ring, I don't know how to do it. F1_coeffs = transpose_list(F1.coeffs()) F1_modp_coeffs = F1_coeffs[int((M-2)*p):] # make a copy, because reduce_all will destroy the coefficients: F1_modp_coeffs = [[cell for cell in row] for row in F1_modp_coeffs] F1_modp_offset = offset - (M-2)*p F1_modp_reduced = reduce_all(Q, p, F1_modp_coeffs, F1_modp_offset) if F1_modp_reduced[0].is_unit(): # If the first entry is invertible mod p, then F(x dx/y) is sufficient # to get the whole matrix. F1_reduced = reduce_all(Q, p, F1_coeffs, offset) F0_reduced = [ base_ring(trace) - F1_reduced[1], None ] # using that the determinant is p: F0_reduced[1] = (F0_reduced[0] * F1_reduced[1] - base_ring(p)) \ / F1_reduced[0] else: # If the first entry is zero mod p, then F((x+1) dx/y) will be sufficient # to get the whole matrix. (Here we are using the fact that the second # entry *cannot* be zero mod p. This is guaranteed by some results in # section 3.2 of ``Computation of p-adic Heights and Log Convergence'' # by Mazur, Stein, Tate. But let's quickly check it anyway :-)) assert F1_modp_reduced[1].is_unit(), \ "Hey that's impossible! The second entry in the second column " \ "should be invertible mod p!" G0_coeffs = transpose_list( (F0 + F1).coeffs()) G0_reduced = reduce_all(Q, p, G0_coeffs, offset) # Now G0_reduced expresses F((x+1) dx/y) in terms of dx/y and x dx/y. # Re-express this in terms of (x+1) dx/y and x dx/y. H0_reduced = [ G0_reduced[0], G0_reduced[1] - G0_reduced[0] ] # The thing we're about to divide by better be a unit. assert H0_reduced[1].is_unit(), \ "Hey that's impossible! The second entry in this column " \ "should be invertible mod p!" # Figure out the second column using the trace... H1_reduced = [ None, base_ring(trace) - H0_reduced[0] ] # ... and using that the determinant is p: H1_reduced[0] = (H0_reduced[0] * H1_reduced[1] - base_ring(p)) \ / H0_reduced[1] # Finally, change back to the usual basis (dx/y, x dx/y) F1_reduced = [ H1_reduced[0], \ H1_reduced[0] + H1_reduced[1] ] F0_reduced = [ H0_reduced[0] - F1_reduced[0], H0_reduced[0] + H0_reduced[1] - F1_reduced[1] ] # One more sanity check: our final result should be congruent mod p # to the approximation we used earlier. assert not ( (F1_reduced[0] - F1_modp_reduced[0]).is_unit() or \ (F1_reduced[1] - F1_modp_reduced[1]).is_unit() or \ F0_reduced[0].is_unit() or F0_reduced[1].is_unit()), \ "Hey that's impossible! The output matrix is not congruent mod p " \ "to the approximation found earlier!" if compute_exact_forms: return matrix(base_ring, 2, 2, [F0_reduced[0], F1_reduced[0], F0_reduced[1], F1_reduced[1]]), f_0, f_1 else: return matrix(base_ring, 2, 2, [F0_reduced[0], F1_reduced[0], F0_reduced[1], F1_reduced[1]]) | e8c5dfe629aabf0303b396e56733ea0c7032d92a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/e8c5dfe629aabf0303b396e56733ea0c7032d92a/monsky_washnitzer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3148,
67,
792,
67,
74,
303,
19425,
8384,
12,
53,
16,
293,
16,
490,
16,
2606,
33,
7036,
16,
3671,
67,
17165,
67,
9741,
33,
8381,
4672,
3536,
14169,
281,
326,
3148,
434,
478,
303,
1942... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3148,
67,
792,
67,
74,
303,
19425,
8384,
12,
53,
16,
293,
16,
490,
16,
2606,
33,
7036,
16,
3671,
67,
17165,
67,
9741,
33,
8381,
4672,
3536,
14169,
281,
326,
3148,
434,
478,
303,
1942... |
""" % tuple(fields) | """ % tuple(max_jobs_per_min, fields) | def __format_results(self, results): out = open(self.resultsdir + '/keyval', 'w') r = re.compile(r"^[0-9\. ]+$") for line in results.split('\n'): if not r.match(line): continue fields = line.split() print >> out, """num_forked=%s | 96e7d25bd983d99a8fe9c85b4cda8db3aad7d1a7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10349/96e7d25bd983d99a8fe9c85b4cda8db3aad7d1a7/reaim.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2139,
67,
4717,
12,
2890,
16,
1686,
4672,
596,
273,
1696,
12,
2890,
18,
4717,
1214,
397,
1173,
856,
1125,
2187,
296,
91,
6134,
436,
273,
283,
18,
11100,
12,
86,
6,
66,
63,
20,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2139,
67,
4717,
12,
2890,
16,
1686,
4672,
596,
273,
1696,
12,
2890,
18,
4717,
1214,
397,
1173,
856,
1125,
2187,
296,
91,
6134,
436,
273,
283,
18,
11100,
12,
86,
6,
66,
63,
20,
... |
raise SyntaxError("Invalid for each..in loop") | raise SyntaxError("Invalid for each..in loop", tokenizer) | def Statement(tokenizer, staticContext): """Parses a Statement.""" tokenType = tokenizer.get(True) builder = staticContext.builder # Cases for statements ending in a right curly return early, avoiding the # common semicolon insertion magic after this switch. if tokenType == "function": # "declared_form" extends functions of staticContext, "statement_form" doesn'tokenizer. if len(staticContext.statementStack) > 1: kind = "statement_form" else: kind = "declared_form" return FunctionDefinition(tokenizer, staticContext, True, kind) elif tokenType == "left_curly": node = Statements(tokenizer, staticContext) tokenizer.mustMatch("right_curly") return node elif tokenType == "if": node = builder.IF_build(tokenizer) builder.IF_setCondition(node, ParenExpression(tokenizer, staticContext)) staticContext.statementStack.append(node) builder.IF_setThenPart(node, Statement(tokenizer, staticContext)) if tokenizer.match("else"): comments = tokenizer.getComments() elsePart = Statement(tokenizer, staticContext) builder.COMMENTS_add(elsePart, node, comments) builder.IF_setElsePart(node, elsePart) staticContext.statementStack.pop() builder.IF_finish(node) return node elif tokenType == "switch": # This allows CASEs after a "default", which is in the standard. node = builder.SWITCH_build(tokenizer) builder.SWITCH_setDiscriminant(node, ParenExpression(tokenizer, staticContext)) staticContext.statementStack.append(node) tokenizer.mustMatch("left_curly") tokenType = tokenizer.get() while tokenType != "right_curly": if tokenType == "default": if node.defaultIndex >= 0: raise SyntaxError("More than one switch default", tokenizer) childNode = builder.DEFAULT_build(tokenizer) builder.SWITCH_setDefaultIndex(node, len(node)-1) tokenizer.mustMatch("colon") builder.DEFAULT_initializeStatements(childNode, tokenizer) while True: tokenType=tokenizer.peek(True) if tokenType == "case" or tokenType == "default" or tokenType == "right_curly": break builder.DEFAULT_addStatement(childNode, Statement(tokenizer, staticContext)) builder.DEFAULT_finish(childNode) elif tokenType == "case": childNode = builder.CASE_build(tokenizer) builder.CASE_setLabel(childNode, Expression(tokenizer, staticContext)) tokenizer.mustMatch("colon") builder.CASE_initializeStatements(childNode, tokenizer) while True: tokenType=tokenizer.peek(True) if tokenType == "case" or tokenType == "default" or tokenType == "right_curly": break builder.CASE_addStatement(childNode, Statement(tokenizer, staticContext)) builder.CASE_finish(childNode) else: raise SyntaxError("Invalid switch case", tokenizer) builder.SWITCH_addCase(node, childNode) tokenType = tokenizer.get() staticContext.statementStack.pop() builder.SWITCH_finish(node) return node elif tokenType == "for": node = builder.FOR_build(tokenizer) forBlock = None if tokenizer.match("identifier") and tokenizer.token.value == "each": builder.FOR_rebuildForEach(node) tokenizer.mustMatch("left_paren") tokenType = tokenizer.peek() childNode = None if tokenType != "semicolon": staticContext.inForLoopInit = True if tokenType == "var" or tokenType == "const": tokenizer.get() childNode = Variables(tokenizer, staticContext) elif tokenType == "let": tokenizer.get() if tokenizer.peek() == "left_paren": childNode = LetBlock(tokenizer, staticContext, False) else: # Let in for head, we need to add an implicit block # around the rest of the for. forBlock = builder.BLOCK_build(tokenizer, staticContext.blockId) staticContext.blockId += 1 staticContext.statementStack.append(forBlock) childNode = Variables(tokenizer, staticContext, forBlock) else: childNode = Expression(tokenizer, staticContext) staticContext.inForLoopInit = False if childNode and tokenizer.match("in"): builder.FOR_rebuildForIn(node) builder.FOR_setObject(node, Expression(tokenizer, staticContext), forBlock) if childNode.type == "var" or childNode.type == "let": if len(childNode) != 1: raise SyntaxError("Invalid for..in left-hand side", tokenizer) builder.FOR_setIterator(node, childNode, forBlock) else: builder.FOR_setIterator(node, childNode, forBlock) else: builder.FOR_setSetup(node, childNode) tokenizer.mustMatch("semicolon") if node.isEach: raise SyntaxError("Invalid for each..in loop") if tokenizer.peek() == "semicolon": builder.FOR_setCondition(node, None) else: builder.FOR_setCondition(node, Expression(tokenizer, staticContext)) tokenizer.mustMatch("semicolon") if tokenizer.peek() == "right_paren": builder.FOR_setUpdate(node, None) else: builder.FOR_setUpdate(node, Expression(tokenizer, staticContext)) tokenizer.mustMatch("right_paren") builder.FOR_setBody(node, nest(tokenizer, staticContext, node, Statement)) if forBlock: builder.BLOCK_finish(forBlock) staticContext.statementStack.pop() builder.FOR_finish(node) return node elif tokenType == "while": node = builder.WHILE_build(tokenizer) builder.WHILE_setCondition(node, ParenExpression(tokenizer, staticContext)) builder.WHILE_setBody(node, nest(tokenizer, staticContext, node, Statement)) builder.WHILE_finish(node) return node elif tokenType == "do": node = builder.DO_build(tokenizer) builder.DO_setBody(node, nest(tokenizer, staticContext, node, Statement, "while")) builder.DO_setCondition(node, ParenExpression(tokenizer, staticContext)) builder.DO_finish(node) if not staticContext.ecma3OnlyMode: # <script language="JavaScript"> (without version hints) may need # automatic semicolon insertion without a newline after do-while. # See http://bugzilla.mozilla.org/show_bug.cgi?id=238945. tokenizer.match("semicolon") return node # NO RETURN elif tokenType == "break" or tokenType == "continue": if tokenType == "break": node = builder.BREAK_build(tokenizer) else: node = builder.CONTINUE_build(tokenizer) if tokenizer.peekOnSameLine() == "identifier": tokenizer.get() if tokenType == "break": builder.BREAK_setLabel(node, tokenizer.token.value) else: builder.CONTINUE_setLabel(node, tokenizer.token.value) statementStack = staticContext.statementStack i = len(statementStack) label = node.label if hasattr(node, "label") else None if label: while True: i -= 1 if i < 0: raise SyntaxError("Label not found", tokenizer) if getattr(statementStack[i], "label", None) == label: break # # Both break and continue to label need to be handled specially # within a labeled loop, so that they target that loop. If not in # a loop, then break targets its labeled statement. Labels can be # nested so we skip all labels immediately enclosing the nearest # non-label statement. # while i < len(statementStack) - 1 and statementStack[i+1].type == "label": i += 1 if i < len(statementStack) - 1 and getattr(statementStack[i+1], "isLoop", False): i += 1 elif tokenType == "continue": raise SyntaxError("Invalid continue", tokenizer) else: while True: i -= 1 if i < 0: if tokenType == "break": raise SyntaxError("Invalid break") else: raise SyntaxError("Invalid continue") if getattr(statementStack[i], "isLoop", False) or (tokenType == "break" and statementStack[i].type == "switch"): break if tokenType == "break": builder.BREAK_setTarget(node, statementStack[i]) builder.BREAK_finish(node) else: builder.CONTINUE_setTarget(node, statementStack[i]) builder.CONTINUE_finish(node) # NO RETURN elif tokenType == "try": node = builder.TRY_build(tokenizer) builder.TRY_setTryBlock(node, Block(tokenizer, staticContext)) while tokenizer.match("catch"): childNode = builder.CATCH_build(tokenizer) tokenizer.mustMatch("left_paren") nextTokenType = tokenizer.get() if nextTokenType == "left_bracket" or nextTokenType == "left_curly": # Destructured catch identifiers. tokenizer.unget() exception = DestructuringExpression(tokenizer, staticContext, True) for exceptionChild in exception: staticContext.exceptions.add(exceptionChild.value) elif nextTokenType == "identifier": exception = builder.CATCH_wrapException(tokenizer) staticContext.exceptions.add(exception.value) else: raise SyntaxError("Missing identifier in catch", tokenizer) builder.CATCH_setException(childNode, exception) if tokenizer.match("if"): if staticContext.ecma3OnlyMode: raise SyntaxError("Illegal catch guard", tokenizer) if node.getChildrenLength() > 0 and not node.getUnrelatedChildren()[0].guard: raise SyntaxError("Guarded catch after unguarded", tokenizer) builder.CATCH_setGuard(childNode, Expression(tokenizer, staticContext)) else: builder.CATCH_setGuard(childNode, None) tokenizer.mustMatch("right_paren") builder.CATCH_setBlock(childNode, Block(tokenizer, staticContext)) builder.CATCH_finish(childNode) builder.TRY_addCatch(node, childNode) builder.TRY_finishCatches(node) if tokenizer.match("finally"): builder.TRY_setFinallyBlock(node, Block(tokenizer, staticContext)) if node.getChildrenLength() == 0 and not hasattr(node, "finallyBlock"): raise SyntaxError("Invalid try statement", tokenizer) builder.TRY_finish(node) return node elif tokenType == "catch" or tokenType == "finally": raise SyntaxError(tokens[tokenType] + " without preceding try") elif tokenType == "throw": node = builder.THROW_build(tokenizer) builder.THROW_setException(node, Expression(tokenizer, staticContext)) builder.THROW_finish(node) # NO RETURN elif tokenType == "return": node = returnOrYield(tokenizer, staticContext) # NO RETURN elif tokenType == "with": node = builder.WITH_build(tokenizer) builder.WITH_setObject(node, ParenExpression(tokenizer, staticContext)) builder.WITH_setBody(node, nest(tokenizer, staticContext, node, Statement)) builder.WITH_finish(node) return node elif tokenType == "var" or tokenType == "const": node = Variables(tokenizer, staticContext) # NO RETURN elif tokenType == "let": if tokenizer.peek() == "left_paren": node = LetBlock(tokenizer, staticContext, True) else: node = Variables(tokenizer, staticContext) # NO RETURN elif tokenType == "debugger": node = builder.DEBUGGER_build(tokenizer) # NO RETURN elif tokenType == "newline" or tokenType == "semicolon": node = builder.SEMICOLON_build(tokenizer) builder.SEMICOLON_setExpression(node, None) builder.SEMICOLON_finish(tokenizer) return node else: if tokenType == "identifier": tokenType = tokenizer.peek() # Labeled statement. if tokenType == "colon": label = tokenizer.token.value statementStack = staticContext.statementStack i = len(statementStack)-1 while i >= 0: if getattr(statementStack[i], "label", None) == label: raise SyntaxError("Duplicate label") i -= 1 tokenizer.get() node = builder.LABEL_build(tokenizer) builder.LABEL_setLabel(node, label) builder.LABEL_setStatement(node, nest(tokenizer, staticContext, node, Statement)) builder.LABEL_finish(node) return node # Expression statement. # We unget the current token to parse the expression as a whole. node = builder.SEMICOLON_build(tokenizer) tokenizer.unget() builder.SEMICOLON_setExpression(node, Expression(tokenizer, staticContext)) node.end = node.expression.end builder.SEMICOLON_finish(node) # NO RETURN MagicalSemicolon(tokenizer) return node | bdc507c93397dfb45618391af4f8ad06736bfaf9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/bdc507c93397dfb45618391af4f8ad06736bfaf9/Parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8056,
12,
2316,
1824,
16,
760,
1042,
4672,
3536,
6656,
279,
8056,
12123,
225,
22302,
273,
10123,
18,
588,
12,
5510,
13,
2089,
273,
760,
1042,
18,
9574,
225,
468,
385,
3304,
364,
6317,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8056,
12,
2316,
1824,
16,
760,
1042,
4672,
3536,
6656,
279,
8056,
12123,
225,
22302,
273,
10123,
18,
588,
12,
5510,
13,
2089,
273,
760,
1042,
18,
9574,
225,
468,
385,
3304,
364,
6317,
... |
try: if self.execing: self.checkNotifications() except: print "******************************* A SEVERE ERROR HAPPENED... Someone who understands the code... please fix :) *******" | if self.execing: self.checkNotifications() | def checkNotificationsIfExecing(self): try: if self.execing: self.checkNotifications() except: print "******************************* A SEVERE ERROR HAPPENED... Someone who understands the code... please fix :) *******" | cc183e5e7f1f433c859999e651b60d2954c5f356 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/cc183e5e7f1f433c859999e651b60d2954c5f356/InfoBarGenerics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
14111,
2047,
1905,
310,
12,
2890,
4672,
775,
30,
309,
365,
18,
4177,
310,
30,
365,
18,
1893,
14111,
1435,
1335,
30,
1172,
315,
19482,
27243,
432,
17412,
5475,
670,
7215,
1157,
2056,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
14111,
2047,
1905,
310,
12,
2890,
4672,
775,
30,
309,
365,
18,
4177,
310,
30,
365,
18,
1893,
14111,
1435,
1335,
30,
1172,
315,
19482,
27243,
432,
17412,
5475,
670,
7215,
1157,
2056,... |
self.log("HB after operation avoyance %s"% self.HB, color="yellow") | self.log("HB after operation avoidance %s"% self.HB, color="yellow") | def delete_text(self, startpos, length, op={}): """ Some one delete text on the actual node. Should delete text in non "to_send" locations. Delete only remote solicitations, local text was already deleted. """ if op.get("avoid"): self.log( "AutoDeletion is avoiyed", color="yellow") # for debugging del op["avoid"] # I hope this will edit the operation stored in the HB self.log("HB after operation avoyance %s"% self.HB, color="yellow") # just for debugging return text_widget = self.text_widget # convert the starting and end points, considering the "to_send" elements ranges = text_widget.tag_ranges("to_send") # return a list of index tuples for i in xrange(0, len(ranges), 2): # convert text indexes to numerical values start = len(text_widget.get("1.0", ranges[i] )) stop = start + len(text_widget.get(ranges[i], ranges[i+1])) if start < startpos: startpos += (stop - start) # make the startpos include the unsent local text. if start >= startpos: ranges = ranges[i:] # store the rest (including actual pos) break # else: continue self.log( "Deleting text at %s len %s"%(startpos, length), color="yellow" ) # for debugging # delete the text avoiying the "to_send" elements. deleted_text = "" offset = 0 for i in xrange(0, len(ranges), 2): #ranges contain the indexes of the rest of the "to_send" elements # convert text indexes to numerical values range_start = len(text_widget.get("1.0", "%s - %i chars"%(ranges[i], offset) )) range_stop = range_start + len(text_widget.get( "%s - %i chars"%(ranges[i], offset), "%s - %i chars"%(ranges[i+1], offset))) if startpos + length >= range_start: # there is an overlapping t_start = "1.0 + %i chars"%(startpos) t_stop = "1.0 + %i chars"%(range_start) deleted_text += text_widget.get(t_start, t_stop) # necessary for algorithm internal undo/redo operations text_widget.delete(t_start, t_stop) length -= range_start - startpos offset += range_start - startpos startpos = range_stop - (range_start - startpos) # <<<<<<<<< this line is wrong # continue self.log( "continuing deletion at %s len %s"%(startpos, length), color="yellow" ) # for debugging else: break # end of for # the last one is direct (or the only one if no ranges==[]) if length > 0: t_start = "1.0 + %i chars"%(startpos) t_stop = "1.0 + %i chars"%(startpos + length) deleted_text += text_widget.get(t_start, t_stop) # necessary for algorithm internal undo/redo operations text_widget.delete(t_start, t_stop) #end of last deletion # keep the deleted text for future operation undo op["deleted_text"] = deleted_text return | fcf05c46a9212ed4ae8a7bcf04cadb37e222d315 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2639/fcf05c46a9212ed4ae8a7bcf04cadb37e222d315/Chalks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
955,
12,
2890,
16,
787,
917,
16,
769,
16,
1061,
12938,
4672,
3536,
10548,
1245,
1430,
977,
603,
326,
3214,
756,
18,
9363,
1430,
977,
316,
225,
1661,
315,
869,
67,
4661,
6,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
955,
12,
2890,
16,
787,
917,
16,
769,
16,
1061,
12938,
4672,
3536,
10548,
1245,
1430,
977,
603,
326,
3214,
756,
18,
9363,
1430,
977,
316,
225,
1661,
315,
869,
67,
4661,
6,
... |
while True: | while 1: | def vonmisesvariate(self, mu, kappa): """Circular data distribution. | 4aa9408036856a9acf52e0804055e17317b4e3e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4aa9408036856a9acf52e0804055e17317b4e3e6/random.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
265,
81,
6141,
1401,
3840,
12,
2890,
16,
4129,
16,
23125,
4672,
3536,
25858,
501,
7006,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
265,
81,
6141,
1401,
3840,
12,
2890,
16,
4129,
16,
23125,
4672,
3536,
25858,
501,
7006,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
_("""Policies concerning concerning the content of list traffic. | _("""Policies concerning the content of list traffic. | def GetConfigInfo(self, mlist, category, subcat=None): if category <> 'contentfilter': return None WIDTH = mm_cfg.TEXTFIELDWIDTH | cde38c8145cc519e74b7b3e4ee239b59a87798f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/cde38c8145cc519e74b7b3e4ee239b59a87798f2/ContentFilter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26666,
966,
12,
2890,
16,
312,
1098,
16,
3150,
16,
720,
2574,
33,
7036,
4672,
309,
3150,
2813,
296,
1745,
2188,
4278,
327,
599,
22631,
273,
9740,
67,
7066,
18,
5151,
6776,
10023,
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,
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,
26666,
966,
12,
2890,
16,
312,
1098,
16,
3150,
16,
720,
2574,
33,
7036,
4672,
309,
3150,
2813,
296,
1745,
2188,
4278,
327,
599,
22631,
273,
9740,
67,
7066,
18,
5151,
6776,
10023,
2,
-1... |
handler.schema = {'name': Unicode(index=True), 'date': Date(index=True)} | handler.schema = {'name': Unicode(index=True), 'date': Date(index=True)} | def test_index_del_row(self): data = 'house,2005-10-10\nwindow,2005-05-10\ncomputer,2005-10-10' resource = memory.File(data) handler = itools_csv.CSV() handler.columns = ['name', 'date'] handler.schema = {'name': Unicode(index=True), 'date': Date(index=True)} handler.load_state(resource) self.assertEqual(handler.search([('name', 'window')]), [1]) handler.del_row(1) self.assertEqual(handler.search([('name', 'window')]), []) self.assertEqual(handler.search([('name', 'computer')]), [1]) handler.del_row(1) self.assertEqual(handler.search([('name', 'computer')]), []) | d1c92817f2412181e68be715a2a81901cf1a83ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d1c92817f2412181e68be715a2a81901cf1a83ed/test_itools_csv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1615,
67,
3771,
67,
492,
12,
2890,
4672,
501,
273,
296,
13028,
16,
6976,
25,
17,
2163,
17,
2163,
64,
82,
5668,
16,
6976,
25,
17,
6260,
17,
2163,
64,
82,
13406,
264,
16,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1615,
67,
3771,
67,
492,
12,
2890,
4672,
501,
273,
296,
13028,
16,
6976,
25,
17,
2163,
17,
2163,
64,
82,
5668,
16,
6976,
25,
17,
6260,
17,
2163,
64,
82,
13406,
264,
16,
6... |
if self.__creating: | if self.__updating: print "Reading slices:", | def __read_slices(self): ''' Read all the slices and organize them in the hdf5 file I assume that format is native, and not an oldfile format ''' if self.__creating: fvid=file(self.workdir+'video.in','r') names=[] while 1: tmp=fvid.readline().strip() if tmp=='': break names+=[tmp] fvid.close() self.data.create_dataset('slices_names',data=names) self.nbslices=len(names) createtime=True for i in range(self.nbslices): for j in range(self.param['dim/nproc'][0]): createtime=self.__read_slice(timeslice=createtime,field=i,extension='xy',proc=j) createtime=self.__read_slice(timeslice=createtime,field=i,extension='xy2',proc=j) createtime=self.__read_slice(timeslice=createtime,field=i,extension='xz',proc=j) createtime=self.__read_slice(timeslice=createtime,field=i,extension='yz',proc=j) | bf1a599ad9cde581f4679533ab3c54c55f5e9732 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1377/bf1a599ad9cde581f4679533ab3c54c55f5e9732/hdf5.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
896,
67,
21562,
12,
2890,
4672,
9163,
2720,
777,
326,
12390,
471,
15501,
554,
2182,
316,
326,
24217,
25,
585,
467,
6750,
716,
740,
353,
6448,
16,
471,
486,
392,
1592,
768,
740,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
896,
67,
21562,
12,
2890,
4672,
9163,
2720,
777,
326,
12390,
471,
15501,
554,
2182,
316,
326,
24217,
25,
585,
467,
6750,
716,
740,
353,
6448,
16,
471,
486,
392,
1592,
768,
740,
9... |
print "Magnitude Minimum Estimation Pick deleted" | msg = "Magnitude Minimum Estimation Pick deleted" appendTextview(self.textviewStdOut, msg) | def delMagMin1(self): try: del self.dicts[self.stPt]['MagMin1'] del self.dicts[self.stPt]['MagMin1T'] print "Magnitude Minimum Estimation Pick deleted" except: pass | 4e8f536428831ce605c623aa5fc17a6b33b5b712 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10346/4e8f536428831ce605c623aa5fc17a6b33b5b712/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1464,
11372,
2930,
21,
12,
2890,
4672,
775,
30,
1464,
365,
18,
16287,
63,
2890,
18,
334,
16484,
23962,
11372,
2930,
21,
3546,
1464,
365,
18,
16287,
63,
2890,
18,
334,
16484,
23962,
11372... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1464,
11372,
2930,
21,
12,
2890,
4672,
775,
30,
1464,
365,
18,
16287,
63,
2890,
18,
334,
16484,
23962,
11372,
2930,
21,
3546,
1464,
365,
18,
16287,
63,
2890,
18,
334,
16484,
23962,
11372... |
self.assertEqual(['A1', 'A2', 'B1', 'B2', 'A3'], depends('A3', lambda n: graph[n])) | self.assertEqual( ['B1', 'B2', 'A1', 'A2', 'A3'], depends('A3', lambda n: graph[n]), ) | def test_depends(self): graph = {'A1': []} self.assertEqual(['A1'], depends('A1', lambda n: graph[n])) graph = {'A1': [], 'A2': ['A1'], 'A3': ['A2']} self.assertEqual(['A1', 'A2', 'A3'], depends('A3', lambda n: graph[n])) graph = {'A1': [], 'A2': ['A1'], 'A3': ['A2', 'A1']} self.assertEqual(['A1', 'A2', 'A3'], depends('A3', lambda n: graph[n])) graph = {'A1': [], 'A2': ['A1'], 'A3': ['A2', 'A1', 'B1'], 'B1': []} self.assertEqual(['A1', 'A2', 'B1', 'A3'], depends('A3', lambda n: graph[n])) graph = {'A1': [], 'A2': ['A1'], 'A3': ['A2', 'A1', 'B2'], 'B1': [], 'B2': ['B1']} self.assertEqual(['A1', 'A2', 'B1', 'B2', 'A3'], depends('A3', lambda n: graph[n])) graph = {'A1': [], 'A2': ['A1', 'B1'], 'A3': ['A2'], 'B1': ['A1']} self.assertEqual(['A1', 'B1', 'A2', 'A3'], depends('A3', lambda n: graph[n])) graph = {'A1': [], 'A2': ['A1'], 'A3': ['A2', 'A1', 'B2'], 'B1': [], 'B2': ['B1', 'C1'], 'C1': ['B1']} self.assertEqual(['A1', 'A2', 'B1', 'C1', 'B2', 'A3'], depends('A3', lambda n: graph[n])) graph = {'A1': [], 'A2': ['A1'], 'A3': ['A2', 'B2', 'A1', 'C1'], 'B1': ['A1'], 'B2': ['B1', 'C2', 'A1'], 'C1': ['B1'], 'C2': ['C1', 'A1'], 'C3': ['C2']} self.assertEqual(['A1', 'A2', 'B1', 'C1', 'C2', 'B2', 'A3'], depends('A3', lambda n: graph[n])) | 0c0f340bc8be175e12f8ac3631b51f8ab31c3f45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13142/0c0f340bc8be175e12f8ac3631b51f8ab31c3f45/logic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
27360,
12,
2890,
4672,
2667,
273,
13666,
37,
21,
4278,
5378,
97,
365,
18,
11231,
5812,
12,
3292,
37,
21,
17337,
10935,
2668,
37,
21,
2187,
3195,
290,
30,
2667,
63,
82,
22643,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
27360,
12,
2890,
4672,
2667,
273,
13666,
37,
21,
4278,
5378,
97,
365,
18,
11231,
5812,
12,
3292,
37,
21,
17337,
10935,
2668,
37,
21,
2187,
3195,
290,
30,
2667,
63,
82,
22643,... |
result = event1.wait() except ValueError: X = object() result = with_timeout(DELAY, event2.wait, timeout_value=X) assert result is X, 'Nobody sent anything to event2 yet it received %r' % (result, ) | try: result = event1.wait() except ValueError: X = object() result = gevent.with_timeout(DELAY, event2.wait, timeout_value=X) assert result is X, 'Nobody sent anything to event2 yet it received %r' % (result, ) finally: t.cancel() gevent.kill(g, wait=True) | def test_send(self): event1 = event() event2 = event() | 6fcac4536d1dde591716b50e8f283932991072e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10423/6fcac4536d1dde591716b50e8f283932991072e6/test__event.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4661,
12,
2890,
4672,
871,
21,
273,
871,
1435,
871,
22,
273,
871,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4661,
12,
2890,
4672,
871,
21,
273,
871,
1435,
871,
22,
273,
871,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if sys.maxint > 0x7fffffff: self.assertRaises(ValueError, len, r) else: self.assertEqual(len(r), sys.maxint) | self.assertEqual(len(r), sys.maxint) | def test_xrange(self): self.assertEqual(list(xrange(3)), [0, 1, 2]) self.assertEqual(list(xrange(1, 5)), [1, 2, 3, 4]) self.assertEqual(list(xrange(0)), []) self.assertEqual(list(xrange(-3)), []) self.assertEqual(list(xrange(1, 10, 3)), [1, 4, 7]) self.assertEqual(list(xrange(5, -5, -3)), [5, 2, -1, -4]) | fe9dc6239b7d0b33e0f5ff9b17a0db6b5af6d0fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fe9dc6239b7d0b33e0f5ff9b17a0db6b5af6d0fd/test_xrange.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
92,
3676,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
1098,
12,
92,
3676,
12,
23,
13,
3631,
306,
20,
16,
404,
16,
576,
5717,
365,
18,
11231,
5812,
12,
1098,
12,
92,
3676,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
92,
3676,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
1098,
12,
92,
3676,
12,
23,
13,
3631,
306,
20,
16,
404,
16,
576,
5717,
365,
18,
11231,
5812,
12,
1098,
12,
92,
3676,
1... |
if any([type(arg).__module__ == 'numpy' for arg in args]): | if any([type(arg).__module__ == 'numpy' and type(arg).__name__ == "ndarray" for arg in args]): | def _call_element_(self, _the_element, *args, **kwds): """ Calling a callable symbolic expression returns a symbolic expression with the appropriate arguments substituted. | d713a2ee3a2614cc5cb1f9d9a674fd9ca17ae722 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/d713a2ee3a2614cc5cb1f9d9a674fd9ca17ae722/callable.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1991,
67,
2956,
67,
12,
2890,
16,
389,
5787,
67,
2956,
16,
380,
1968,
16,
2826,
25577,
4672,
3536,
21020,
279,
4140,
16754,
2652,
1135,
279,
16754,
2652,
598,
326,
5505,
1775,
7461,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
1991,
67,
2956,
67,
12,
2890,
16,
389,
5787,
67,
2956,
16,
380,
1968,
16,
2826,
25577,
4672,
3536,
21020,
279,
4140,
16754,
2652,
1135,
279,
16754,
2652,
598,
326,
5505,
1775,
7461,... |
self._cnx = pool.borrow(dsn(dbname)) self._obj = self._cnx.cursor(cursor_factory=psycopg1cursor) | self._cnx, self._obj = pool.borrow(dsn(dbname), True) | def __init__(self, pool, dbname, serialized=False): self.sql_from_log = {} self.sql_into_log = {} | 59895822466e8427faea27b40725d120b2a17283 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/59895822466e8427faea27b40725d120b2a17283/sql_db.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2845,
16,
18448,
16,
5343,
33,
8381,
4672,
365,
18,
4669,
67,
2080,
67,
1330,
273,
2618,
365,
18,
4669,
67,
18591,
67,
1330,
273,
2618,
2,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2845,
16,
18448,
16,
5343,
33,
8381,
4672,
365,
18,
4669,
67,
2080,
67,
1330,
273,
2618,
365,
18,
4669,
67,
18591,
67,
1330,
273,
2618,
2,
-100,
-100,
... |
c = Cookie.Cookie(os.environ['HTTP_COOKIE']) | keylen = len(key) if cookiedata[keylen+1] <> '"' and cookiedata[-1] <> '"': cookiedata = key + '="' + cookiedata[keylen+1:] + '"' c = Cookie.Cookie(cookiedata) | def CheckCookie(self, key): if not os.environ.has_key('HTTP_COOKIE'): return 0 c = Cookie.Cookie(os.environ['HTTP_COOKIE']) if not c.has_key(key): return 0 cookie = c[key].value if (type(cookie) <> type([]) or len(cookie) <> 4): raise Errors.MMInvalidCookieError client_ip = os.environ.get('REMOTE_ADDR') or '0.0.0.0' now = time.time() [for_ip, issued, expires, received_mac] = cookie if (for_ip <> client_ip or now < issued): raise Errors.MMInvalidCookieError if now > expires: raise Errors.MMExpiredCookieError secret = self.password mac = hash(secret + client_ip + `issued` + `expires`) if mac <> received_mac: raise Errors.MMInvalidCookieError return 1 | b0578286f8cadbaa1a7ecc2ea81d2b899230341c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/b0578286f8cadbaa1a7ecc2ea81d2b899230341c/SecurityManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2073,
6151,
12,
2890,
16,
498,
4672,
309,
486,
1140,
18,
28684,
18,
5332,
67,
856,
2668,
3693,
67,
13584,
11,
4672,
327,
374,
6647,
498,
1897,
273,
562,
12,
856,
13,
309,
15860,
2092,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2073,
6151,
12,
2890,
16,
498,
4672,
309,
486,
1140,
18,
28684,
18,
5332,
67,
856,
2668,
3693,
67,
13584,
11,
4672,
327,
374,
6647,
498,
1897,
273,
562,
12,
856,
13,
309,
15860,
2092,
... |
Example:: >>> class Session: ... state = 'clean' ... >>> with patched_context(Session, "state", "dirty"): ... print Session.state ... dirty >>> print Session.state clean | >>> from fudge import patched_context >>> class Session: ... state = 'clean' ... >>> with patched_context(Session, "state", "dirty"): ... print Session.state ... dirty >>> print Session.state clean .. _with statement: http://www.python.org/dev/peps/pep-0343/ | def patched_context(obj, attr_name, patched_value): """A context manager to execute :func:`fudge.patch_object` in a `with statement`_ Example:: >>> class Session: ... state = 'clean' ... >>> with patched_context(Session, "state", "dirty"): ... print Session.state ... dirty >>> print Session.state clean .. _with statement: http://www.python.org/dev/peps/pep-0343/ """ patched_object = patch_object(obj, attr_name, patched_value) try: yield patched_object finally: patched_object.restore() | 9a740bb4749be7d6f445c21f49829eaaf2f23971 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3602/9a740bb4749be7d6f445c21f49829eaaf2f23971/patcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25786,
67,
2472,
12,
2603,
16,
1604,
67,
529,
16,
25786,
67,
1132,
4672,
3536,
37,
819,
3301,
358,
1836,
294,
644,
28288,
74,
27110,
18,
2272,
67,
1612,
68,
316,
279,
1375,
1918,
3021,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25786,
67,
2472,
12,
2603,
16,
1604,
67,
529,
16,
25786,
67,
1132,
4672,
3536,
37,
819,
3301,
358,
1836,
294,
644,
28288,
74,
27110,
18,
2272,
67,
1612,
68,
316,
279,
1375,
1918,
3021,... |
if data.has_key("file"): file = data["file"] | if data.has_key("file"): file = data["file"] | def log(self, data): level, file = log.LOG_LEVEL, log.LOG_FILE if data.has_key("level"): level = data["level"] if data.has_key("file"): file = data["file"] return {"level": level, "file": file} | 5e7e6b2526f905ee92fcea8307b72333978ef05b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11809/5e7e6b2526f905ee92fcea8307b72333978ef05b/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
12,
2890,
16,
501,
4672,
1801,
16,
585,
273,
613,
18,
4842,
67,
10398,
16,
613,
18,
4842,
67,
3776,
309,
501,
18,
5332,
67,
856,
2932,
2815,
6,
4672,
1801,
273,
501,
9614,
2815,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
12,
2890,
16,
501,
4672,
1801,
16,
585,
273,
613,
18,
4842,
67,
10398,
16,
613,
18,
4842,
67,
3776,
309,
501,
18,
5332,
67,
856,
2932,
2815,
6,
4672,
1801,
273,
501,
9614,
2815,... |
_type_ = "?" | _type_ = '?' | def POINTER(ctype): # If a pointer class for the C type has been created, re-use it if _pointer_type_cache.has_key(ctype): return _pointer_type_cache[ctype] # Create a new class for this particular C type dict = { '_jffi_type': jffi.Type.Pointer(ctype) } # Look back up the stack frame to find out the module this new type is declared in import inspect mod = inspect.getmodule(inspect.stack()[1][0]) if mod is None: name = "__main__" else: name = mod.__name__ dict["__module__"] = name ptype = type("LP_%s" % (ctype.__name__,), (jffi.PointerCData, _CData), dict) _pointer_type_cache[ctype] = ptype return ptype | 0cd5ba7bd6bee8b611bc30a6e20b96451b87a927 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6753/0cd5ba7bd6bee8b611bc30a6e20b96451b87a927/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23320,
12,
12387,
4672,
468,
971,
279,
4407,
667,
364,
326,
385,
618,
711,
2118,
2522,
16,
283,
17,
1202,
518,
309,
389,
10437,
67,
723,
67,
2493,
18,
5332,
67,
856,
12,
12387,
4672,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23320,
12,
12387,
4672,
468,
971,
279,
4407,
667,
364,
326,
385,
618,
711,
2118,
2522,
16,
283,
17,
1202,
518,
309,
389,
10437,
67,
723,
67,
2493,
18,
5332,
67,
856,
12,
12387,
4672,
... |
self.populateDetails(self.track) | def onResetScore(self, e): try: self.db.setUnscored(self.track) self.refreshSelectedTrack() self.populateDetails(self.track) ## poss superfluous except AttributeError as err: if str(err) != "'MainWindow' object has no attribute 'track'": raise err print "No track selected." return | ec11d1d131d519f3265d41a5748dce8e32f8256e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8545/ec11d1d131d519f3265d41a5748dce8e32f8256e/GUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
7013,
7295,
12,
2890,
16,
425,
4672,
775,
30,
365,
18,
1966,
18,
542,
984,
6355,
72,
12,
2890,
18,
4101,
13,
365,
18,
9144,
7416,
4402,
1435,
7541,
949,
87,
2240,
2242,
89,
1481... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7013,
7295,
12,
2890,
16,
425,
4672,
775,
30,
365,
18,
1966,
18,
542,
984,
6355,
72,
12,
2890,
18,
4101,
13,
365,
18,
9144,
7416,
4402,
1435,
7541,
949,
87,
2240,
2242,
89,
1481... | |
"TestSharing.py", | def run_tests(tests): for filename in tests: try: execfile(os.path.join(functional_dir, filename)) except: import traceback print "%s failed due to exception" % fileName type, value, stack = sys.exc_info() traceback.print_exception(type, value, stack, None, sys.stderr) | 866288cf62a7acc68f7ebb34a99d362e80c35183 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/866288cf62a7acc68f7ebb34a99d362e80c35183/FunctionalTestSuite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
12,
16341,
4672,
364,
1544,
316,
7434,
30,
775,
30,
1196,
768,
12,
538,
18,
803,
18,
5701,
12,
915,
287,
67,
1214,
16,
1544,
3719,
1335,
30,
1930,
10820,
1172,
2213,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
16341,
12,
16341,
4672,
364,
1544,
316,
7434,
30,
775,
30,
1196,
768,
12,
538,
18,
803,
18,
5701,
12,
915,
287,
67,
1214,
16,
1544,
3719,
1335,
30,
1930,
10820,
1172,
2213,
... | |
search_locations.append(src_dir + "/sconsbuild/Debug/test_shell") search_locations.append(src_dir + "/out/Debug/test_shell") | def FindTestShell(): # This is hacky. It is used to guess the location of the test_shell chrome_dir = os.path.normpath(_base_dir + "/../../../") src_dir = os.path.normpath(chrome_dir + "/../") search_locations = [] if (sys.platform in ('cygwin', 'win32')): home_dir = os.path.normpath(os.getenv("HOMEDRIVE") + os.getenv("HOMEPATH")) search_locations.append(chrome_dir + "/Release/test_shell.exe") search_locations.append(chrome_dir + "/Debug/test_shell.exe") search_locations.append(home_dir + "/bin/test_shell/" + "test_shell.exe") if (sys.platform in ('linux', 'linux2')): search_locations.append(src_dir + "/sconsbuild/Release/test_shell") search_locations.append(src_dir + "/out/Release/test_shell") search_locations.append(src_dir + "/sconsbuild/Debug/test_shell") search_locations.append(src_dir + "/out/Debug/test_shell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/test_shell") if (sys.platform == 'darwin'): search_locations.append(src_dir + "/xcodebuild/Release/TestShell.app/Contents/MacOS/TestShell") search_locations.append(src_dir + "/xcodebuild/Debug/TestShell.app/Contents/MacOS/TestShell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/" + "TestShell.app/Contents/MacOS/TestShell") for loc in search_locations: if os.path.isfile(loc): return loc raise Exception("Could not find test_shell executable\n" + "**test_shell may need to be built**\n" + "Searched: \n" + "\n".join(search_locations) + "\n" + "To specify a path to test_shell use --test-shell-path") | 890a7e0412d44722ded596dbde2d11923542d26f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/890a7e0412d44722ded596dbde2d11923542d26f/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4163,
4709,
13220,
13332,
468,
1220,
353,
11769,
93,
18,
2597,
353,
1399,
358,
7274,
326,
2117,
434,
326,
1842,
67,
10304,
18167,
67,
1214,
273,
1140,
18,
803,
18,
7959,
803,
24899,
1969... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4163,
4709,
13220,
13332,
468,
1220,
353,
11769,
93,
18,
2597,
353,
1399,
358,
7274,
326,
2117,
434,
326,
1842,
67,
10304,
18167,
67,
1214,
273,
1140,
18,
803,
18,
7959,
803,
24899,
1969... | |
if tile.status == STATUS_END: neighbour2mark = False for k in range(i-1,i+2): for l in range(j-1,j+2): if (k>-1) and (l>-1): try: if field[k][l].status == STATUS_2MARK: neighbour2mark = True except: pass if neighbour2mark: tile.status = STATUS_MARKED else: tile.status = STATUS_NONE tile.textnode.setTextColor(1,1,1,1) for line in field: for tile in line: if tile.status == STATUS_2MARK: tile.status = STATUS_END print "new word: "+word | tile.textnode.setTextColor(1,1,1,1) for path in paths: if (i,j) in path: tile.textnode.setTextColor(1,0,0,1) | def gotKeypress(letter): global word letterFound = False for i in range(FIELD_SIZE): for j in range(FIELD_SIZE): tile = field[i][j] if tile.letter==letter: if tile.status == STATUS_NONE and (tile.owner == 0 or tile.owner == CURRENT_PLAYER): if len(word) == 0: neighbourOwned = False for k in range(i-1,i+2): for l in range(j-1,j+2): if (k>-1) and (l>-1): #lists wrap around at index < 0 try: if field[k][l].owner == CURRENT_PLAYER: neighbourOwned = True except: pass if neighbourOwned: tile.status = STATUS_2MARK tile.textnode.setTextColor(1,0,0,1) # or 1,0,0,1? - adapt for P2 letterFound = True else: neighbourEnd = False for k in range(i-1,i+2): for l in range(j-1,j+2): if (k>-1) and (l>-1): #lists wrap around at index < 0 try: if field[k][l].status == STATUS_END: neighbourEnd = True except: pass if neighbourEnd: tile.status = STATUS_2MARK tile.textnode.setTextColor(1,0,0,1) #adapt for P2 letterFound = True if letterFound: word += letter for i in range(FIELD_SIZE): for j in range(FIELD_SIZE): tile = field[i][j] if tile.status == STATUS_END: neighbour2mark = False for k in range(i-1,i+2): for l in range(j-1,j+2): if (k>-1) and (l>-1): #lists wrap around at index < 0 try: if field[k][l].status == STATUS_2MARK: neighbour2mark = True except: pass if neighbour2mark: tile.status = STATUS_MARKED else: tile.status = STATUS_NONE tile.textnode.setTextColor(1,1,1,1) for line in field: for tile in line: if tile.status == STATUS_2MARK: tile.status = STATUS_END print "new word: "+word | 58586681c5e85af9356c764a285816a780afd191 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12835/58586681c5e85af9356c764a285816a780afd191/tffw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2363,
653,
1028,
12,
13449,
4672,
2552,
2076,
225,
9471,
2043,
273,
1083,
364,
277,
316,
1048,
12,
6776,
67,
4574,
4672,
364,
525,
316,
1048,
12,
6776,
67,
4574,
4672,
4769,
273,
652,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2363,
653,
1028,
12,
13449,
4672,
2552,
2076,
225,
9471,
2043,
273,
1083,
364,
277,
316,
1048,
12,
6776,
67,
4574,
4672,
364,
525,
316,
1048,
12,
6776,
67,
4574,
4672,
4769,
273,
652,
... |
def split_sentences(text): | def _split_sentences(text): | def split_sentences(text): """ Splits a piece of text into sentences, separated by periods, question marks and exclamation marks. """ sentence_split = '' for delimiter in DELIMITERS_SENTENCES: sentence_split += '\\' + delimiter sentence_split = '[' + sentence_split + ']' sentences = re.split(sentence_split, text) return sentences | bc9d5a1d58b676e7cc6dcf78f4cef02419954da2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3480/bc9d5a1d58b676e7cc6dcf78f4cef02419954da2/lipsum.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4939,
67,
27393,
12,
955,
4672,
3536,
5385,
87,
279,
11151,
434,
977,
1368,
14951,
16,
8936,
635,
12777,
16,
5073,
13999,
471,
4687,
301,
367,
13999,
18,
3536,
7515,
67,
4939,
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,
4939,
67,
27393,
12,
955,
4672,
3536,
5385,
87,
279,
11151,
434,
977,
1368,
14951,
16,
8936,
635,
12777,
16,
5073,
13999,
471,
4687,
301,
367,
13999,
18,
3536,
7515,
67,
4939,
273,
... |
image_list = page.image_glob(base_name+'*_rho_*.png') | image_list = page.image_glob(base_name+'_rho_*.png') | def parse_command_line(): parser = OptionParser(version = "%prog CVS $Id$", usage = "%prog [options] [file ...]", description = "%prog computes mass/mass upperlimit") parser.add_option("--webserver", help = "Set the webserver path. Required. Example https://ldas-jobs.ligo.caltech.edu/~channa/highmass_months_23-24_summary_page") parser.add_option("--open-box", action = "store_true", help = "Produce open box page") parser.add_option("--output-name-tag", default = "", metavar = "name", help = "Set the basename for image search") opts, filenames = parser.parse_args() if opts.instruments: opts.instruments = lsctables.instrument_set_from_ifos(opts.instruments) if not opts.webserver: print >>sys.stderr, "must specify a webserver" sys.exit(1) return opts, filenames | 40b28754ab291edb3c64dfe0c60823f7bd0fb6c5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/40b28754ab291edb3c64dfe0c60823f7bd0fb6c5/make_summary_page.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
3076,
67,
1369,
13332,
2082,
273,
18862,
12,
1589,
273,
2213,
14654,
385,
14640,
271,
548,
8,
3113,
4084,
273,
2213,
14654,
306,
2116,
65,
306,
768,
1372,
65,
3113,
2477,
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,
1109,
67,
3076,
67,
1369,
13332,
2082,
273,
18862,
12,
1589,
273,
2213,
14654,
385,
14640,
271,
548,
8,
3113,
4084,
273,
2213,
14654,
306,
2116,
65,
306,
768,
1372,
65,
3113,
2477,
273,
... |
os.umask(0022) | os.umask(0002) | def main(): # before we go on, make sure the user is a member of the 'mock' group. member = False for item in os.getgroups(): try: grptup = grp.getgrgid(item) except KeyError, e: continue if grptup[0] == 'mock': member = True if not member: print "You need to be a member of the mock group for this to work" sys.exit(1) # and make sure they're not root if os.geteuid() == 0: error("Don't try to run mock as root!") sys.exit(1) # defaults config_opts = {} setup_default_config_opts(config_opts) # cli option parsing (options, args) = command_parse() if len(args) < 1: error("No srpm or command specified - nothing to do") sys.exit(50) # config path -- can be overridden on cmdline config_path='/etc/mock' if options.configdir: config_path = options.configdir # Read in the default values which can be overwritten # with the more specific config being loaded below. cfg = os.path.join(config_path, 'defaults.cfg') if os.path.exists(cfg): execfile(cfg) else: if config_path != "/etc/mock" and os.path.exists("/etc/mock/defaults.cfg"): execfile("/etc/mock/defaults.cfg") # read in the config file by chroot name if options.chroot.endswith('.cfg'): cfg = '%s/%s' % (config_path, options.chroot) else: cfg = '%s/%s.cfg' % (config_path, options.chroot) if os.path.exists(cfg): execfile(cfg) else: error("Could not find config file %s for chroot %s" % (cfg, options.chroot)) sys.exit(1) # cmdline options override config options set_config_opts_per_cmdline(config_opts, options) # do whatever we're here to do if args[0] == 'clean': # unset a --no-clean config_opts['clean'] = True do_clean(config_opts, init=0) elif args[0] == 'init': do_clean(config_opts, init=1) elif args[0] == 'chroot': # catch-all for executing arbitrary commands in the chroot config_opts['clean'] = False cmd = ' '.join(args[1:]) do_run_cmd(config_opts, cmd, raw_chroot=0) elif args[0] == 'shell': # debugging tool for interactive poking around in the chroot config_opts['clean'] = False do_run_cmd(config_opts, "/bin/bash", env='PS1="mock-chroot> "', raw_chroot=1) elif args[0] == 'installdeps': if len(args) > 1: srpm = args[1] else: error("No package specified to installdeps command.") sys.exit(50) config_opts['clean'] = False ts = rpmUtils.transaction.initReadOnlyTransaction() try: hdr = rpmUtils.miscutils.hdrFromPackage(ts, srpm) except rpmUtils.RpmUtilsError, e: error("Specified srpm %s cannot be found/opened" % srpm) sys.exit(50) if hdr[rpm.RPMTAG_SOURCEPACKAGE] != 1: error("Specified srpm isn't a srpm! Can't go on") sys.exit(50) try: my = None # if Root() fails, my will be undefined so we force it to None my = Root(config_opts) os.umask(0022) # set a umask- protects from paranoid whackjobs with an 002 umask my.prep() my.installdeps(srpm) except Error, e: error(e) if my: my.close() sys.exit(e.resultcode) except KeyboardInterrupt, e: if my: my.close() raise my.close() print "Logs in: %s" % my.resultdir else: if args[0] == 'rebuild': if len(args) > 1: srpms = args[1:] else: error("No package specified to rebuild command.") sys.exit(50) else: srpms = args[0:] # exit here if everything isn't kosher ensure_filetype_srpm(srpms) do_rebuild(config_opts, srpms) | 6533774ebda67addfb6e701246f3a96c5e62bcd9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7328/6533774ebda67addfb6e701246f3a96c5e62bcd9/mock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
1865,
732,
1960,
603,
16,
1221,
3071,
326,
729,
353,
279,
3140,
434,
326,
296,
22851,
11,
1041,
18,
3140,
273,
1083,
364,
761,
316,
1140,
18,
588,
4650,
13332,
775,
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,
13332,
468,
1865,
732,
1960,
603,
16,
1221,
3071,
326,
729,
353,
279,
3140,
434,
326,
296,
22851,
11,
1041,
18,
3140,
273,
1083,
364,
761,
316,
1140,
18,
588,
4650,
13332,
775,
3... |
elif data == u"<": self.stream.queue.append(data) self.tokenQueue.append({"type": "ParseError", "data": _("Unexpected < character. Expected = or end of tag.")}) self.emitCurrentToken() | def afterAttributeNameState(self): data = self.stream.char() if data in spaceCharacters: self.stream.charsUntil(spaceCharacters, True) elif data == u"=": self.state = self.states["beforeAttributeValue"] elif data == u">": self.emitCurrentToken() elif data in asciiLetters: self.currentToken["data"].append([data, ""]) self.state = self.states["attributeName"] elif data == u"/": self.processSolidusInTag() self.state = self.states["beforeAttributeName"] elif data == u"<": self.stream.queue.append(data) self.tokenQueue.append({"type": "ParseError", "data": _("Unexpected < character. Expected = or end of tag.")}) self.emitCurrentToken() elif data == EOF: self.tokenQueue.append({"type": "ParseError", "data": _("Unexpected end of file. Expected = or end of tag.")}) self.emitCurrentToken() else: self.currentToken["data"].append([data, ""]) self.state = self.states["attributeName"] return True | 0d6a68f609e8d639a9efe7338b523d5dbd611bf2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4487/0d6a68f609e8d639a9efe7338b523d5dbd611bf2/tokenizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1839,
19240,
1119,
12,
2890,
4672,
501,
273,
365,
18,
3256,
18,
3001,
1435,
309,
501,
316,
3476,
11600,
30,
365,
18,
3256,
18,
7549,
9716,
12,
2981,
11600,
16,
1053,
13,
1327,
501,
422... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1839,
19240,
1119,
12,
2890,
4672,
501,
273,
365,
18,
3256,
18,
3001,
1435,
309,
501,
316,
3476,
11600,
30,
365,
18,
3256,
18,
7549,
9716,
12,
2981,
11600,
16,
1053,
13,
1327,
501,
422... | |
reg_info = ioreg_info_dict[name] reg_desc = reg_info.getElements ('DESCRIPTION')[0].getData () | try: reg_info = ioreg_info_dict[name] try: reg_desc = reg_info.getElements ('DESCRIPTION')[0].getData () except IndexError: reg_desc = '' except KeyError: reg_info = None | def dump_ioregs (root): path = ['AVRPART', 'MEMORY', 'IO_MEMORY'] io_mem = root.getSubTree (path) ioregs = io_mem.getElements () ioreg_info_dict = gather_io_info (root) print ' <ioregisters>' # Skip the first 6 elements since they are just give start and stop # addresses. for ioreg in ioregs[6:]: name = ioreg.name reg_info = ioreg_info_dict[name] reg_desc = reg_info.getElements ('DESCRIPTION')[0].getData () addr = ioreg.getElements ('IO_ADDR')[0].getData () if addr[0] == '$': addr = '0x' + addr[1:] if addr == "NA": addr = ioreg.getElements ('MEM_ADDR')[0].getData () else: # Add 0x20 so all addresses are memory mapped. addr = '0x%02x' % (int (addr, 16) + 0x20) print ' <ioreg name="%s" addr="%s">' % (name, addr) print_wrapped (' ','<description>%s</description>' % (reg_desc)) print ' <alt_name></alt_name>' for i in range (8): bit = 'BIT%d' % (i) bit_el = reg_info.getSubTree ([name, bit]) if bit_el is None: continue bit_name = bit_el.getElements ('NAME')[0].getData () bit_desc = bit_el.getElements ('DESCRIPTION')[0].getData () bit_access = bit_el.getElements ('ACCESS')[0].getData () bit_init_val = bit_el.getElements ('INIT_VAL')[0].getData () print ' <bit_field name="%s"' % (bit_name), print 'bit="%d"' % (i), print 'access="%s"' % (bit_access), print 'init="%s">' % (bit_init_val) if bit_desc: print_wrapped (' ', '<description>%s</description>' % (bit_desc)) print ' <alt_name></alt_name>' print ' </bit_field>' print ' </ioreg>' print ' </ioregisters>' | cfd2a3e7d4b18217073422afbbf32437f59a1161 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/598/cfd2a3e7d4b18217073422afbbf32437f59a1161/Atmel2libc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
67,
77,
479,
564,
261,
3085,
4672,
589,
273,
10228,
5856,
54,
15055,
2187,
296,
24329,
2187,
296,
4294,
67,
24329,
3546,
2527,
67,
3917,
273,
1365,
18,
588,
1676,
2471,
261,
803,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
67,
77,
479,
564,
261,
3085,
4672,
589,
273,
10228,
5856,
54,
15055,
2187,
296,
24329,
2187,
296,
4294,
67,
24329,
3546,
2527,
67,
3917,
273,
1365,
18,
588,
1676,
2471,
261,
803,
... |
using this prefix and some letters (default: ``'C'``). | using this prefix and some letters (default: ``'PY'``). | @Can[def ]@Cax[foo](bar): @Can[pass] | ebc861ce01aa5ebdbefb67409092fe222e9922b7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2885/ebc861ce01aa5ebdbefb67409092fe222e9922b7/latex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
632,
2568,
63,
536,
308,
36,
39,
651,
63,
11351,
29955,
3215,
4672,
632,
2568,
63,
5466,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
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,
632,
2568,
63,
536,
308,
36,
39,
651,
63,
11351,
29955,
3215,
4672,
632,
2568,
63,
5466,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print 'avant', result | def _result_get(x, keys): if x[1] in keys: return False keys.append(x[1]) if x[3]: model,id = x[2].split(',') id = int(id) fields = self.pool.get(model).fields_get_keys(cr, uid) pos = 0 while pos<len(fields): if fields[pos] in ('report_sxw_content', 'report_rml_content', 'report_sxw', 'report_rml', 'report_sxw_content_data', 'report_rml_content_data'): del fields[pos] else: pos+=1 try: datas = self.pool.get(model).read(cr, uid, [id], fields, context) except except_orm, e: print 'false 1',model,fields,e return False datas= datas and datas[0] or None if not datas: #ir_del(cr, uid, x[0]) print 'false 2' return False else: datas = pickle.loads(str(x[2].encode('utf-8'))) if meta: meta2 = pickle.loads(x[4]) return (x[0],x[1],datas,meta2) return (x[0],x[1],datas) | d716dd6bb6ed3586cc83747e569c654cfc6d0f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d716dd6bb6ed3586cc83747e569c654cfc6d0f08/ir_values.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2088,
67,
588,
12,
92,
16,
1311,
4672,
309,
619,
63,
21,
65,
316,
1311,
30,
327,
1083,
1311,
18,
6923,
12,
92,
63,
21,
5717,
309,
619,
63,
23,
14542,
938,
16,
350,
273,
619,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2088,
67,
588,
12,
92,
16,
1311,
4672,
309,
619,
63,
21,
65,
316,
1311,
30,
327,
1083,
1311,
18,
6923,
12,
92,
63,
21,
5717,
309,
619,
63,
23,
14542,
938,
16,
350,
273,
619,
... | |
cmd = "\"googlecode_upload.py -s \"New Version" + verStr + "\"" | cmd = "\"googlecode_upload.py -s \"New Version " + verStr + "\"" | def completelyRemoveDirectory(top): # Delete everything reachable from the directory named in 'top', # assuming there are no symbolic links. # CAUTION: This is dangerous! For example, if top == '/', it # could delete all your disk files. for root, dirs, files in os.walk(top, topdown=False): for name in files: os.remove(os.path.join(root, name)) for name in dirs: os.rmdir(os.path.join(root, name)) | 17dfd57332f5424e3ce5c42e32d0597a3ae1517e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1952/17dfd57332f5424e3ce5c42e32d0597a3ae1517e/buildAndReleaseM2DC.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14416,
3288,
2853,
12,
3669,
4672,
468,
2504,
7756,
19234,
628,
326,
1867,
4141,
316,
296,
3669,
2187,
468,
15144,
1915,
854,
1158,
16754,
4716,
18,
468,
6425,
13269,
30,
225,
1220,
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,
14416,
3288,
2853,
12,
3669,
4672,
468,
2504,
7756,
19234,
628,
326,
1867,
4141,
316,
296,
3669,
2187,
468,
15144,
1915,
854,
1158,
16754,
4716,
18,
468,
6425,
13269,
30,
225,
1220,
353,
... |
option = string.lower(option) | option = self.optionxform(option) | def get(self, section, option, raw=0, vars=None): """Get an option value for a given section. | d6761bd364b149bd1d9494a595fc8a0ee489cfbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/d6761bd364b149bd1d9494a595fc8a0ee489cfbe/ConfigParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
2442,
16,
1456,
16,
1831,
33,
20,
16,
4153,
33,
7036,
4672,
3536,
967,
392,
1456,
460,
364,
279,
864,
2442,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
2442,
16,
1456,
16,
1831,
33,
20,
16,
4153,
33,
7036,
4672,
3536,
967,
392,
1456,
460,
364,
279,
864,
2442,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def supercall(self, node, parent): | def supercall(self, orig, parent): node = orig.node | def supercall(self, node, parent): while isinstance(parent, function): parent = parent.parent if (isinstance(node.expr, CallFunc) and \ node.attrname not in ('__getattr__', '__setattr__') and \ isinstance(node.expr.node, Name) and \ node.expr.node.name == 'super'): if (len(node.expr.args) >= 2 and \ isinstance(node.expr.args[1], Name) and node.expr.args[1].name=='self'): cl = lookupclass(node.expr.args[0], getmv()) if cl.node.bases: return cl.node.bases[0] error("unsupported usage of 'super'", node) | 1d2e66a4fd565969867f2d2f295bec347147771b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6661/1d2e66a4fd565969867f2d2f295bec347147771b/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2240,
1991,
12,
2890,
16,
1647,
16,
982,
4672,
756,
273,
1647,
18,
2159,
1323,
1549,
12,
2938,
16,
445,
4672,
982,
273,
982,
18,
2938,
309,
261,
291,
1336,
12,
2159,
18,
8638,
16,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2240,
1991,
12,
2890,
16,
1647,
16,
982,
4672,
756,
273,
1647,
18,
2159,
1323,
1549,
12,
2938,
16,
445,
4672,
982,
273,
982,
18,
2938,
309,
261,
291,
1336,
12,
2159,
18,
8638,
16,
30... |
board.boardVariant = FRCBoard | board.variant = FISCHERRANDOMCHESS | def go (): """ Finds and prints the best move from the current position """ # TODO: Length info should be put in the book. # Btw. 10 is not enough. Try 20 if len(board.history) < 14: movestr = getBestOpening(board) if movestr: mvs = [parseSAN(board, movestr)] if len(board.history) >= 14 or not movestr: global mytime, increment, scr lsearch.skipPruneChance = skipPruneChance lsearch.searching = True if mytime == None: lsearch.endtime = sys.maxint print "Searching to depth %d without timelimit" % sd mvs, scr = alphaBeta (board, sd) else: usetime = mytime / remainingMovesA(len(board.history)) if mytime < 6*60+increment*40: # If game is blitz, we assume 40 moves rather than 80 usetime *= 2 # The increment is a constant. We'll use this allways usetime += increment if usetime < 0.5: # We don't wan't to search for e.g. 0 secs usetime = 0.5 starttime = time() lsearch.endtime = starttime + usetime prevtime = 0 print "Time left: %3.2f seconds; Planing to thinking for %3.2f seconds" % \ (mytime, usetime) for depth in range(1, sd+1): # Heuristic time saving # Don't waste time, if the estimated isn't enough to complete next depth if usetime > prevtime*4 or usetime <= 1: lsearch.timecheck_counter = lsearch.TIMECHECK_FREQ search_result = alphaBeta(board, depth) if lsearch.searching: mvs, scr = search_result if time() > lsearch.endtime: # Endtime occured after depth print "Endtime occured after depth" break print "got moves", " ".join(listToSan(board, mvs)), "from depth", depth else: # We were interrupted print "We were interrupted while searching depth %d" % depth break prevtime = time()-starttime - prevtime else: print "I don't have enough time to go into depth %d" % depth # Not enough time for depth break else: print "I searched through depths [1, %d]" % (sd+1) mytime -= time() - starttime mytime += increment if not mvs: if not lsearch.searching: # We were interupted lsearch.movesearches = 0 lsearch.nodes = 0 searchLock.release() return #if lsearch.last == 4: # print "resign" #else: if scr == 0: print "result", reprResult[DRAW] elif scr < 0: if board.color == WHITE: print "result", reprResult[BLACKWON] else: print "result", reprResult[WHITEWON] else: if board.color == WHITE: print "result", reprResult[WHITEWON] else: print "result", reprResult[BLACKWON] print "last:", lsearch.last, scr return print "moves were:", " ".join(listToSan(board, mvs)), scr lsearch.movesearches = 0 lsearch.nodes = 0 lsearch.searching = False move = mvs[0] print "move", toSAN(board, move) board.applyMove(move) | f0707c4155b04cfda2608f183cd90f33ceda1838 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5339/f0707c4155b04cfda2608f183cd90f33ceda1838/PyChess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1960,
1832,
30,
3536,
4163,
87,
471,
14971,
326,
3796,
3635,
628,
326,
783,
1754,
3536,
225,
468,
2660,
30,
11311,
1123,
1410,
506,
1378,
316,
326,
6978,
18,
468,
605,
11246,
18,
1728,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1960,
1832,
30,
3536,
4163,
87,
471,
14971,
326,
3796,
3635,
628,
326,
783,
1754,
3536,
225,
468,
2660,
30,
11311,
1123,
1410,
506,
1378,
316,
326,
6978,
18,
468,
605,
11246,
18,
1728,
... |
Return the discriminance index if the tag, that is, the minimum | Return the discriminance index if the tag. Th discriminance index of the tag is defined as the minimum | def discriminance(self, tag): """ Return the discriminance index if the tag, that is, the minimum number of packages that would be eliminated by selecting only those tagged with this tag or only those not tagged with this tag. """ n = self.card(tag) tot = self.packageCount() return min(n, tot - n) | 55f3271a0bf3343d2b7648ad8877e803ce38b83d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12282/55f3271a0bf3343d2b7648ad8877e803ce38b83d/debtags.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29649,
267,
1359,
12,
2890,
16,
1047,
4672,
3536,
2000,
326,
29649,
267,
1359,
770,
309,
326,
1047,
18,
225,
935,
29649,
267,
1359,
770,
434,
326,
1047,
353,
2553,
487,
326,
5224,
1300,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29649,
267,
1359,
12,
2890,
16,
1047,
4672,
3536,
2000,
326,
29649,
267,
1359,
770,
309,
326,
1047,
18,
225,
935,
29649,
267,
1359,
770,
434,
326,
1047,
353,
2553,
487,
326,
5224,
1300,
... |
s[0].lstrip('*') argnames.append(s[0]) | argname.lstrip('*') argnames.append(argname) | defpos = source.find('def ') | 0fa8bcbffe94f9046338ade3a247b8136b2e2b87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/0fa8bcbffe94f9046338ade3a247b8136b2e2b87/sageinspect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
917,
273,
1084,
18,
4720,
2668,
536,
8624,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
917,
273,
1084,
18,
4720,
2668,
536,
8624,
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... |
@needs_radix_and_thousands | def test_lc_numeric_nl_langinfo(self): # Test nl_langinfo against known values for loc in candidate_locales: try: setlocale(LC_NUMERIC, loc) setlocale(LC_CTYPE, loc) except Error: continue for li, lc in ((_locale.RADIXCHAR, "decimal_point"), (_locale.THOUSEP, "thousands_sep")): self.numeric_tester('nl_langinfo', nl_langinfo(li), lc, loc) | 6743602a791b61017d143b1cc5d78b6b328d9d47 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/6743602a791b61017d143b1cc5d78b6b328d9d47/test__locale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
17704,
67,
5246,
67,
14039,
67,
4936,
1376,
12,
2890,
4672,
468,
7766,
7741,
67,
4936,
1376,
5314,
4846,
924,
364,
1515,
316,
5500,
67,
22638,
30,
775,
30,
444,
6339,
12,
133... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
17704,
67,
5246,
67,
14039,
67,
4936,
1376,
12,
2890,
4672,
468,
7766,
7741,
67,
4936,
1376,
5314,
4846,
924,
364,
1515,
316,
5500,
67,
22638,
30,
775,
30,
444,
6339,
12,
133... | |
- ``u`` - vertex at which to start search - ``ignore_direction`` - (default False) only applies to directed graphs. If True, searches across edges in either direction. EXAMPLES:: sage: G = Graph( { 0: {1: 1}, 1: {2: 1}, 2: {3: 1}, 3: {4: 2}, 4: {0: 2} } ) | - ``start`` - vertex or list of vertices from which to start the traversal - ``ignore_direction`` - (default False) only applies to directed graphs. If True, searches across edges in either direction. - ``distance`` - the maximum distance from the ``start`` nodes to traverse. The ``start`` nodes are distance zero from themselves. - ``neighbors`` - a function giving the neighbors of a vertex. The function should take a vertex and return a list of vertices. For a graph, ``neighbors`` is by default the :meth:`.neighbors` function of the graph. For a digraph, the ``neighbors`` function defaults to the :meth:`.successors` function of the graph. EXAMPLES:: sage: G = Graph( { 0: [1], 1: [2], 2: [3], 3: [4], 4: [0]} ) | def breadth_first_search(self, u, ignore_direction=False): """ Returns an iterator over vertices in a breadth-first ordering. INPUT: - ``u`` - vertex at which to start search - ``ignore_direction`` - (default False) only applies to directed graphs. If True, searches across edges in either direction. EXAMPLES:: sage: G = Graph( { 0: {1: 1}, 1: {2: 1}, 2: {3: 1}, 3: {4: 2}, 4: {0: 2} } ) sage: list(G.breadth_first_search(0)) [0, 1, 4, 2, 3] sage: list(G.depth_first_search(0)) [0, 4, 3, 2, 1] :: sage: D = DiGraph( { 0: {1: 1}, 1: {2: 1}, 2: {3: 1}, 3: {4: 2}, 4: {0: 2} } ) sage: list(D.breadth_first_search(0)) [0, 1, 2, 3, 4] sage: list(D.depth_first_search(0)) [0, 1, 2, 3, 4] :: sage: D = DiGraph({1:[0], 2:[0]}) sage: list(D.breadth_first_search(0)) [0] sage: list(D.breadth_first_search(0, ignore_direction=True)) [0, 1, 2] """ # This function is straight from an old version of networkx if not self._directed or ignore_direction: neighbors=self.neighbor_iterator else: neighbors=self.successor_iterator # nlist=[u] # list of nodes in a BFS order yield u seen={} # nodes seen queue=[u] # FIFO queue seen[u]=True while queue: v=queue.pop(0) # this is expensive, should use a faster FIFO queue for w in neighbors(v): if w not in seen: seen[w]=True queue.append(w) # nlist.append(w) yield w # return nlist | c8bfb483048a8a540eb440247e6b469e9aaf39b0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/c8bfb483048a8a540eb440247e6b469e9aaf39b0/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
25254,
67,
3645,
67,
3072,
12,
2890,
16,
582,
16,
2305,
67,
9855,
33,
8381,
4672,
3536,
2860,
392,
2775,
1879,
6928,
316,
279,
324,
25254,
17,
3645,
9543,
18,
225,
12943,
30,
282,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
25254,
67,
3645,
67,
3072,
12,
2890,
16,
582,
16,
2305,
67,
9855,
33,
8381,
4672,
3536,
2860,
392,
2775,
1879,
6928,
316,
279,
324,
25254,
17,
3645,
9543,
18,
225,
12943,
30,
282,... |
s = ' / '.join(v) + ' ' + share | s = ' / '.join([str(w) for w in v]) + ' ' + share | def html_owner_collab_view(self, worksheet, user, typ): v = [] owner = worksheet.owner() pub = False if owner == 'pub': pub = True owner = worksheet.worksheet_that_was_published().owner() | bd9004444f778ef99cdea95fb8e90dc7350c67c8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/bd9004444f778ef99cdea95fb8e90dc7350c67c8/notebook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
67,
8443,
67,
1293,
7411,
67,
1945,
12,
2890,
16,
13622,
16,
729,
16,
3815,
4672,
331,
273,
5378,
225,
3410,
273,
13622,
18,
8443,
1435,
5634,
273,
1083,
309,
3410,
422,
296,
101... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
67,
8443,
67,
1293,
7411,
67,
1945,
12,
2890,
16,
13622,
16,
729,
16,
3815,
4672,
331,
273,
5378,
225,
3410,
273,
13622,
18,
8443,
1435,
5634,
273,
1083,
309,
3410,
422,
296,
101... |
i = len(self) - l | i = len(self) - L | def rfind(self, sub, start=0, end=None): r""" Returns the index of the last occurrence of sub in self, such that sub is contained within self[start:end]. Returns -1 on failure. INPUT: | 8314ed5b4ce69ce94781be7db152ca2a9dc9a334 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8314ed5b4ce69ce94781be7db152ca2a9dc9a334/word.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31257,
12,
2890,
16,
720,
16,
787,
33,
20,
16,
679,
33,
7036,
4672,
436,
8395,
2860,
326,
770,
434,
326,
1142,
13083,
434,
720,
316,
365,
16,
4123,
716,
720,
353,
7542,
3470,
365,
63... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31257,
12,
2890,
16,
720,
16,
787,
33,
20,
16,
679,
33,
7036,
4672,
436,
8395,
2860,
326,
770,
434,
326,
1142,
13083,
434,
720,
316,
365,
16,
4123,
716,
720,
353,
7542,
3470,
365,
63... |
def extensions (self, auth, node_id, arch): | def extensions (self, auth, node_id, fcdistro, arch): | def extensions (self, auth, node_id, arch): try: return [ "%s-%s"%(e,arch) for e in GetNodeExtensions(self.api).call(auth,node_id).split() ] except: return [] | b62dd6ca4b3e9d6702aae5c5c6a32cff7d39baac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7598/b62dd6ca4b3e9d6702aae5c5c6a32cff7d39baac/GetNodeFlavour.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4418,
261,
2890,
16,
1357,
16,
756,
67,
350,
16,
284,
4315,
376,
303,
16,
6637,
4672,
775,
30,
327,
306,
2213,
87,
6456,
87,
6,
17105,
73,
16,
991,
13,
364,
425,
316,
968,
907,
751... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4418,
261,
2890,
16,
1357,
16,
756,
67,
350,
16,
284,
4315,
376,
303,
16,
6637,
4672,
775,
30,
327,
306,
2213,
87,
6456,
87,
6,
17105,
73,
16,
991,
13,
364,
425,
316,
968,
907,
751... |
O3D_PLUGIN_MIME_TYPE = FLAGS.set_mimetype | O3D_PLUGIN_NPAPI_FILENAME = FLAGS.set_npapi_filename O3D_PLUGIN_NPAPI_MIMETYPE = FLAGS.set_npapi_mimetype O3D_PLUGIN_ACTIVEX_HOSTCONTROL_CLSID = FLAGS.set_activex_hostcontrol_clsid O3D_PLUGIN_ACTIVEX_TYPELIB_CLSID = FLAGS.set_activex_typelib_clsid O3D_PLUGIN_ACTIVEX_HOSTCONTROL_NAME = FLAGS.set_activex_hostcontrol_name O3D_PLUGIN_ACTIVEX_TYPELIB_NAME = FLAGS.set_activex_typelib_name | def main(argv): try: files = FLAGS(argv) # Parse flags except gflags.FlagsError, e: print '%s.\nUsage: %s [<options>] [<input_file> <output_file>]\n%s' % \ (e, sys.argv[0], FLAGS) sys.exit(1) # Strip off argv[0] files = files[1:] # Get version string from o3d_version.py o3d_version_vars = {} if FLAGS.kill_switch: execfile(os.path.join(script_dir, '..', 'installer', 'win', 'o3d_kill_version.py'), o3d_version_vars) else: execfile(os.path.join(script_dir, '..', 'installer', 'win', 'o3d_version.py'), o3d_version_vars) plugin_version = o3d_version_vars['plugin_version'] sdk_version = o3d_version_vars['sdk_version'] # This name is used by Javascript to find the plugin therefore it must # not change. If you change this you must change the name in # samples/o3djs/util.js but be aware, changing the name # will break all apps that use o3d on the web. O3D_PLUGIN_NAME = FLAGS.set_name O3D_PLUGIN_VERSION = GetDotVersion(plugin_version) O3D_PLUGIN_VERSION_COMMAS = GetCommaVersion(plugin_version) O3D_SDK_VERSION = GetDotVersion(sdk_version) O3D_SDK_VERSION_COMMAS = GetCommaVersion(sdk_version) O3D_PLUGIN_DESCRIPTION = '%s version: %s' % (O3D_PLUGIN_NAME, O3D_PLUGIN_VERSION) O3D_PLUGIN_MIME_TYPE = FLAGS.set_mimetype if FLAGS.description: print '%s' % O3D_PLUGIN_DESCRIPTION sys.exit(0) if FLAGS.version: print '%s' % O3D_PLUGIN_VERSION sys.exit(0) if FLAGS.commaversion: print '%s' % O3D_PLUGIN_VERSION_COMMAS sys.exit(0) plugin_replace_strings = [ ('@@@PluginName@@@', O3D_PLUGIN_NAME), ('@@@ProductVersionCommas@@@', O3D_PLUGIN_VERSION_COMMAS), ('@@@ProductVersion@@@', O3D_PLUGIN_VERSION), ('@@@PluginDescription@@@', O3D_PLUGIN_DESCRIPTION), ('@@@PluginMimeType@@@', O3D_PLUGIN_MIME_TYPE), ] if len(files) == 2: DoReplace(files[0], files[1], plugin_replace_strings) elif len(files) > 0: raise Exception(r'You must supply and input and output filename for ' r'replacement.') | 73661f60b5e1eb10c6889f2ba0692166bcf83269 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/73661f60b5e1eb10c6889f2ba0692166bcf83269/version_info.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
775,
30,
1390,
273,
16993,
12,
19485,
13,
225,
468,
2884,
2943,
1335,
314,
7133,
18,
5094,
668,
16,
425,
30,
1172,
1995,
87,
8403,
82,
5357,
30,
738,
87,
306,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19485,
4672,
775,
30,
1390,
273,
16993,
12,
19485,
13,
225,
468,
2884,
2943,
1335,
314,
7133,
18,
5094,
668,
16,
425,
30,
1172,
1995,
87,
8403,
82,
5357,
30,
738,
87,
306,
... |
muta = mutagen.File(item.filename) | muta = mutagen.File(item.get_filename()) | def read_metadata(self, item): VIDEO_EXTENSIONS = ('.m4v','.mp4') mediatype = None duration = -1 tags = {} info = {} data = {} | 50cb2cdfac864bc0bfe6bf7aff4425ce03ec26ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/50cb2cdfac864bc0bfe6bf7aff4425ce03ec26ec/moviedata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
4165,
12,
2890,
16,
761,
4672,
776,
27242,
67,
12796,
55,
273,
7707,
18,
81,
24,
90,
2187,
10332,
1291,
24,
6134,
25381,
273,
599,
3734,
273,
300,
21,
2342,
273,
2618,
1123,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
855,
67,
4165,
12,
2890,
16,
761,
4672,
776,
27242,
67,
12796,
55,
273,
7707,
18,
81,
24,
90,
2187,
10332,
1291,
24,
6134,
25381,
273,
599,
3734,
273,
300,
21,
2342,
273,
2618,
1123,
... |
pow2=1 | pow2 = 1 | def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' for i in range(-100, 100): if (pow(type(i),3)!=i*i*i): raise ValueError, 'pow('+str(i)+',3) != '+str(i*i*i) pow2=1 for i in range(0,31): if (pow(2,i)!=pow2): raise ValueError, 'pow(2,'+str(i)+') != '+str(pow2) if (i!=30): pow2=pow2*2 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 71ad688d0e5dc7c63a0b38f3c28dcef6dff55a39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/71ad688d0e5dc7c63a0b38f3c28dcef6dff55a39/test_pow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7602,
3813,
12,
723,
4672,
309,
261,
723,
5,
33,
5659,
4672,
1172,
315,
565,
7766,
310,
576,
17,
3446,
7602,
1435,
445,
7070,
364,
277,
316,
1048,
19236,
18088,
16,
4336,
4672,
309,
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,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7602,
3813,
12,
723,
4672,
309,
261,
723,
5,
33,
5659,
4672,
1172,
315,
565,
7766,
310,
576,
17,
3446,
7602,
1435,
445,
7070,
364,
277,
316,
1048,
19236,
18088,
16,
4336,
4672,
309,
26... |
return [(u, self.decode(father+id)+' : '+(father+id))] | return [(u, "".join([self.decode(s), ": ", s]))] | def _generate_edges(self, tree, father='', id=''): if father=='': u = 'root' else: u = father try: return self._generate_edges(tree[0], father=father+id, id='0') + \ self._generate_edges(tree[1], father=father+id, id='1') + \ ([(u, father+id)] if (father+id) != '' else []) | 0aa5d0e07206199e4e64708c13056046cecfe083 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0aa5d0e07206199e4e64708c13056046cecfe083/huffman.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7163,
67,
8746,
12,
2890,
16,
2151,
16,
284,
4806,
2218,
2187,
612,
2218,
11,
4672,
309,
284,
4806,
18920,
4278,
582,
273,
296,
3085,
11,
469,
30,
582,
273,
284,
4806,
775,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7163,
67,
8746,
12,
2890,
16,
2151,
16,
284,
4806,
2218,
2187,
612,
2218,
11,
4672,
309,
284,
4806,
18920,
4278,
582,
273,
296,
3085,
11,
469,
30,
582,
273,
284,
4806,
775,
30,
... |
class TestSegmenter(NumpyTestCase): def test_1(self): | class TestSegment(NumpyTestCase): def test1(self): | def save_slice(mySlice, filename='junk.raw', bytes=4): # just save the slice to a fixed file slice = mySlice.astype('u%d' % bytes) slice.tofile(filename) | 022612825bd5290729c6835e8ce3fc13c2522206 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/022612825bd5290729c6835e8ce3fc13c2522206/test_segment.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
6665,
12,
4811,
5959,
16,
1544,
2218,
78,
1683,
18,
1899,
2187,
1731,
33,
24,
4672,
468,
2537,
1923,
326,
2788,
358,
279,
5499,
585,
2788,
273,
3399,
5959,
18,
689,
388,
2668... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
6665,
12,
4811,
5959,
16,
1544,
2218,
78,
1683,
18,
1899,
2187,
1731,
33,
24,
4672,
468,
2537,
1923,
326,
2788,
358,
279,
5499,
585,
2788,
273,
3399,
5959,
18,
689,
388,
2668... |
path = os.path.join(config['here'], 'data', 'cache', 'call_timing') | path = os.path.join(config['pylons.cache_dir'], 'call_timing') | def _get_timing_cache_path(self): path = os.path.join(config['here'], 'data', 'cache', 'call_timing') if not os.path.exists(path): os.makedirs(path) return path | 9cb023075d5ecf57eb7c80b9aa01d94ed091b5ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/265/9cb023075d5ecf57eb7c80b9aa01d94ed091b5ac/base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
8584,
310,
67,
2493,
67,
803,
12,
2890,
4672,
589,
273,
1140,
18,
803,
18,
5701,
12,
1425,
3292,
2074,
80,
7008,
18,
2493,
67,
1214,
17337,
296,
1991,
67,
8584,
310,
61... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
8584,
310,
67,
2493,
67,
803,
12,
2890,
4672,
589,
273,
1140,
18,
803,
18,
5701,
12,
1425,
3292,
2074,
80,
7008,
18,
2493,
67,
1214,
17337,
296,
1991,
67,
8584,
310,
61... |
os.environ[k] = (v + ':' + e).strip(':') else: os.environ[k] = (e + ':' + v).strip(':') debug("%s=%s" % (k, os.environ[k])) | os.environ[varname] = (val + ':' + e).strip(':') else: os.environ[varname] = (e + ':' + val).strip(':') debug("%s=%s" % (varname, os.environ[varname])) | def fix_path(k, v, prepend, unload): if unload: s1 = "remove" s2 = "from" else: s2 = "to" if prepend: s1 = "prepend" else: s1 = "append" debug("%s '%s' %s %s" % (s1, v, s2, k)) try: e = os.environ[k] except KeyError: e = '' if unload: p = e.split(':') p.remove(v) os.environ[k] = ':'.join(p) else: if prepend: os.environ[k] = (v + ':' + e).strip(':') else: os.environ[k] = (e + ':' + v).strip(':') debug("%s=%s" % (k, os.environ[k])) | 5b9f92737b361bc1ba3adc34361d05066de7689a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5963/5b9f92737b361bc1ba3adc34361d05066de7689a/build_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
803,
12,
79,
16,
331,
16,
8254,
16,
27060,
4672,
309,
27060,
30,
272,
21,
273,
315,
4479,
6,
272,
22,
273,
315,
2080,
6,
469,
30,
272,
22,
273,
315,
869,
6,
309,
8254,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
803,
12,
79,
16,
331,
16,
8254,
16,
27060,
4672,
309,
27060,
30,
272,
21,
273,
315,
4479,
6,
272,
22,
273,
315,
2080,
6,
469,
30,
272,
22,
273,
315,
869,
6,
309,
8254,
... |
tag_table = self.get_buffer().get_tag_table() | tag_table = self.buff.get_tag_table() | def _motion(self, view, ev): window = ev.window x, y, _ = window.get_pointer() x, y = view.window_to_buffer_coords(gtk.TEXT_WINDOW_TEXT, x, y) tags = view.get_iter_at_location(x, y).get_tags() for tag in tags: if tag.get_data('is_anchor'): for t in set(self.__tags) - set([tag]): self.__tag_reset(t, window) self.__set_anchor(window, tag, gtk.gdk.Cursor(gtk.gdk.HAND2), self.get_property('hover')) break else: tag_table = self.get_buffer().get_tag_table() tag_table.foreach(self.__tag_reset, window) | 9c837e632b1769361485c52946c71db0349823a7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7036/9c837e632b1769361485c52946c71db0349823a7/taskview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
81,
8240,
12,
2890,
16,
1476,
16,
2113,
4672,
2742,
273,
2113,
18,
5668,
619,
16,
677,
16,
389,
273,
2742,
18,
588,
67,
10437,
1435,
619,
16,
677,
273,
1476,
18,
5668,
67,
869,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
81,
8240,
12,
2890,
16,
1476,
16,
2113,
4672,
2742,
273,
2113,
18,
5668,
619,
16,
677,
16,
389,
273,
2742,
18,
588,
67,
10437,
1435,
619,
16,
677,
273,
1476,
18,
5668,
67,
869,
... |
QtCore.QObject.connect = _wrapConnect(connectCall or (lambda *args: None)) QtCore.QObject.disconnect = _wrapDisconnect(disconnectCall or (lambda *args: None)) | QtCore.QObject.connect = _wrapConnect(connectCall) QtCore.QObject.disconnect = _wrapDisconnect(disconnectCall) def new_emit(self, *args): emitCall(self, *args) _oldEmit(self, *args) QtCore.QObject.emit = new_emit | def call(*args): print msg, args | cb1b2f373d67845e3464fbe761371ba6e861fca9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6341/cb1b2f373d67845e3464fbe761371ba6e861fca9/qt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
30857,
1968,
4672,
1172,
1234,
16,
833,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
30857,
1968,
4672,
1172,
1234,
16,
833,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
elif stdin == PIPE: | if p2cread is not None: pass elif stdin is None or stdin == PIPE: | def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ if stdin is None and stdout is None and stderr is None: return (None, None, None, None, None, None) | 5956a5682fe2b2e5da7743d1f9669487eb12ddf1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/5956a5682fe2b2e5da7743d1f9669487eb12ddf1/subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
24111,
12,
2890,
16,
8801,
16,
3909,
16,
4514,
4672,
3536,
7249,
471,
327,
15822,
292,
598,
1665,
2184,
30,
293,
22,
71,
896,
16,
293,
22,
71,
2626,
16,
276,
22,
84,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
24111,
12,
2890,
16,
8801,
16,
3909,
16,
4514,
4672,
3536,
7249,
471,
327,
15822,
292,
598,
1665,
2184,
30,
293,
22,
71,
896,
16,
293,
22,
71,
2626,
16,
276,
22,
84,
... |
self.prefixlen = 32 | self._prefixlen = 32 | def __init__(self, ipaddr): """Instantiate a new IPv4 object. | b8f0b0f0cd36be4aaa5572bcb2e15f37636253a2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4528/b8f0b0f0cd36be4aaa5572bcb2e15f37636253a2/ipaddr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2359,
4793,
4672,
3536,
22438,
279,
394,
7853,
24,
733,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
2738,
972,
12,
2890,
16,
2359,
4793,
4672,
3536,
22438,
279,
394,
7853,
24,
733,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
index : integer -1 Not used in this implementation | index: integer -1 Not used in this implementation. | def read_exciting(fileobj, index=-1): """Reads structure from exiting xml file and returns atoms object in a list Parameters ---------- fileobj : File object Filehandle from which data should be read Other parameters ---------------- index : integer -1 Not used in this implementation """ from lxml import etree as ET #parse file into element tree doc = ET.parse(fileobj) root = doc.getroot() speciesnodes = root.find('structure').getiterator('species') symbols = [] positions = [] basevects = [] atoms = None #collect data from tree for speciesnode in speciesnodes: symbol = speciesnode.get('speciesfile').split('.')[0] natoms = speciesnode.getiterator('atom') for atom in natoms: x, y, z = atom.get('coord').split() positions.append([float(x), float(y), float(z)]) symbols.append(symbol) basevectsn = doc.xpath('//basevect/text()') for basevect in basevectsn: x, y, z = basevect.split() basevects.append([float(x) * Bohr, float(y) * Bohr, float(z) * Bohr]) atoms = Atoms(symbols=symbols, cell=basevects) atoms.set_scaled_positions(positions) if 'molecule' in root.find('structure').attrib.keys(): if root.find('structure').attrib['molecule']: atoms.set_pbc(False) else: atoms.set_pbc(True) return atoms | 20963dc015ba791833f02b068b8017fc17b7bb73 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5572/20963dc015ba791833f02b068b8017fc17b7bb73/exciting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
10075,
305,
310,
12,
768,
2603,
16,
770,
29711,
21,
4672,
3536,
7483,
3695,
628,
15702,
2025,
585,
471,
1135,
9006,
733,
316,
279,
666,
225,
7012,
12181,
17041,
294,
1387,
733,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
10075,
305,
310,
12,
768,
2603,
16,
770,
29711,
21,
4672,
3536,
7483,
3695,
628,
15702,
2025,
585,
471,
1135,
9006,
733,
316,
279,
666,
225,
7012,
12181,
17041,
294,
1387,
733,
... |
find the users actuall session object. """ cookie = request.headers.getHeader('cookie') if cookie: cookie = cookie[0].value session = self.sessionManager.getSession(cookie) | find the users actual session object. """ cookie = get_our_cookie(request) session = self.sessionManager.getSession(sid_cookie) | def getSession(self, request): """Get a user's session defined by the requests cookie. | c896ba3316fafeafc85b99c6bd90243951a3a35d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/c896ba3316fafeafc85b99c6bd90243951a3a35d/guard.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7183,
12,
2890,
16,
590,
4672,
3536,
967,
279,
729,
1807,
1339,
2553,
635,
326,
3285,
3878,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7183,
12,
2890,
16,
590,
4672,
3536,
967,
279,
729,
1807,
1339,
2553,
635,
326,
3285,
3878,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
if self.ctx_filter != "<b>All Contexts</b>": | if self.ctx_filter != "All Contexts": | def make_query( self, term ): if term != "": qterm = "\"%" + term + "%\"" query = "SELECT * FROM theme WHERE name LIKE %s" % qterm if self.standard_only: query += " AND standard" if self.inherited_only: query += " AND inherited" if self.ctx_filter != "<b>All Contexts</b>": query += " AND context=\"%s\" ORDER BY name" % self.ctx_filter else: query += " ORDER BY context, name" else: query = "SELECT * FROM theme" if self.standard_only: query += " WHERE standard" if self.inherited_only: if self.standard_only: query += " AND inherited" else: query += " WHERE inherited" if self.ctx_filter != "<b>All Contexts</b>": if self.standard_only or self.inherited_only: query += " AND context=\"%s\" ORDER BY name" % self.ctx_filter else: query += " WHERE context=\"%s\" ORDER BY name" % self.ctx_filter else: query += " ORDER BY context, name" return query | 909e2d27cd647297ed01c6063320cd5d3e29148c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3955/909e2d27cd647297ed01c6063320cd5d3e29148c/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
2271,
12,
365,
16,
2481,
262,
30,
309,
2481,
480,
1408,
30,
1043,
6408,
273,
7023,
16407,
397,
2481,
397,
2213,
8530,
843,
273,
315,
4803,
380,
4571,
5006,
4852,
508,
13161,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
2271,
12,
365,
16,
2481,
262,
30,
309,
2481,
480,
1408,
30,
1043,
6408,
273,
7023,
16407,
397,
2481,
397,
2213,
8530,
843,
273,
315,
4803,
380,
4571,
5006,
4852,
508,
13161,
... |
print 'PLOP: %r' % name | def registered_wizard(name): """ Register dynamicaly the wizard """ gname = 'wizard.%s' % name if netsvc.service_exist(gname): if isinstance(netsvc.SERVICES[gname], format_choice): return del netsvc.SERVICES[name] print 'PLOP: %r' % name format_choice(name) | 6b0a61adf9a36da79e80b4495dd4a77abfaf67e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6641/6b0a61adf9a36da79e80b4495dd4a77abfaf67e0/format_choice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4104,
67,
31837,
12,
529,
4672,
3536,
5433,
19468,
1706,
93,
326,
24204,
3536,
314,
529,
273,
296,
31837,
7866,
87,
11,
738,
508,
309,
21954,
4227,
18,
3278,
67,
7398,
12,
75,
529,
467... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4104,
67,
31837,
12,
529,
4672,
3536,
5433,
19468,
1706,
93,
326,
24204,
3536,
314,
529,
273,
296,
31837,
7866,
87,
11,
738,
508,
309,
21954,
4227,
18,
3278,
67,
7398,
12,
75,
529,
467... | |
def handle_connect(self): | def handle_connect(self): """Called when connection is established.""" | def handle_connect(self): debug("ActiveDTP.handle_connect()") self.cmd_channel.respond('200 PORT command successful.') # delegate such connection to DTP handler handler = DTPHandler(self.socket, self.cmd_channel) self.cmd_channel.data_channel = handler self.cmd_channel.on_dtp_connection() # self.close() --> (done automatically) | e1763c9db15d5d6d781646fb0678f3c70d95867a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7236/e1763c9db15d5d6d781646fb0678f3c70d95867a/FTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
3612,
12,
2890,
4672,
3536,
8185,
1347,
1459,
353,
19703,
12123,
1198,
2932,
3896,
9081,
52,
18,
4110,
67,
3612,
1435,
7923,
365,
18,
4172,
67,
4327,
18,
17863,
2668,
6976,
209... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
3612,
12,
2890,
4672,
3536,
8185,
1347,
1459,
353,
19703,
12123,
1198,
2932,
3896,
9081,
52,
18,
4110,
67,
3612,
1435,
7923,
365,
18,
4172,
67,
4327,
18,
17863,
2668,
6976,
209... |
minimumSize=SizeType(30, 17)) | minimumSize=SizeType(30, 18)) | def makeMarkupBar(parcel, oldVersion): """ Build the markup bar. """ # Each button just sends this event to itself. buttonPressed = BlockEvent.template('ButtonPressed', 'SendToSender').install(parcel) # The buttons. mailMessageButton = \ MailMessageButtonBlock.template('MailMessageButton', title=messages.STAMP_MAIL, buttonKind="Stamp", icon="MarkupMail", helpString=messages.STAMP_MAIL_HELP, event=buttonPressed, stretchFactor=0.0, minimumSize=SizeType(30, 17)) taskStamp = \ TaskStampBlock.template('TaskStamp', title=messages.STAMP_TASK, buttonKind="Stamp", icon="MarkupTask", helpString=messages.STAMP_TASK_HELP, event=buttonPressed, stretchFactor=0.0, minimumSize=SizeType(30, 17)) markupSpacer1 = ControlBlocks.StaticText.template('MarkupSpacer1', title=u'', stretchFactor=0.0, minimumSize=SizeType(30, 17)) calendarStamp = \ CalendarStampBlock.template('CalendarStamp', title=messages.STAMP_CALENDAR, buttonKind="Stamp", icon="MarkupEvent", helpString=messages.STAMP_CALENDAR_HELP, event=buttonPressed, stretchFactor=0.0, minimumSize=SizeType(30, 17)) markupSpacer2 = ControlBlocks.StaticText.template('MarkupSpacer2', title=u'', stretchFactor=1.0) privateSwitchButton = \ PrivateSwitchButtonBlock.template('PrivateSwitchButton', title=messages.PRIVATE, buttonKind="Stamp", icon="MarkupPrivate", helpString=messages.PRIVATE, event=buttonPressed, stretchFactor=0.0, minimumSize=SizeType(30, 17)) readOnlyIcon = \ ReadOnlyIconBlock.template('ReadOnlyIcon', title=messages.READONLY, buttonKind="Stamp", icon="MarkupReadOnly", helpString=messages.READONLY, event=buttonPressed, stretchFactor=0.0, minimumSize=SizeType(30, 17)) markupBar = ControlBlocks.ContentItemDetail.template('MarkupBar', childrenBlocks=[mailMessageButton, taskStamp, calendarStamp, markupSpacer1, privateSwitchButton, markupSpacer2, readOnlyIcon], position=0.0, toolSize=SizeType(30, 17), separatorWidth=16, stretchFactor=0.0).install(parcel) | c583de0f688a1fe9b66ec33de19d8ab9b84e99d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/c583de0f688a1fe9b66ec33de19d8ab9b84e99d1/detailblocks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
13111,
5190,
12,
1065,
2183,
16,
1592,
1444,
4672,
3536,
3998,
326,
9813,
4653,
18,
3536,
225,
468,
8315,
3568,
2537,
9573,
333,
871,
358,
6174,
18,
3568,
24624,
273,
3914,
1133,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13111,
5190,
12,
1065,
2183,
16,
1592,
1444,
4672,
3536,
3998,
326,
9813,
4653,
18,
3536,
225,
468,
8315,
3568,
2537,
9573,
333,
871,
358,
6174,
18,
3568,
24624,
273,
3914,
1133,
1... |
try: print "%s(%d): %s" % (bname, lineno, context[lineindex],), except IndexError: pass | if context is not None: try: print "%s(%d): %s" % (bname, lineno, context[lineindex],), except IndexError: pass else: print "%s(???): ???" % bname | def localtrace_trace(self, frame, why, arg): if why == 'line': # XXX shouldn't do the count increment when arg is exception? But be careful to return self.localtrace when arg is exception! ? --Zooko 2001-10-14 # record the file name and line number of every trace # XXX I wish inspect offered me an optimized `getfilename(frame)' to use in place of the presumably heavier `getframeinfo()'. --Zooko 2001-10-14 (filename, lineno, funcname, context, lineindex,) = inspect.getframeinfo(frame) # if DEBUG_MODE: # print "%s.localtrace_trace(frame: %s, why: %s, arg: %s); filename: %s, lineno: %s, funcname: %s, context: %s, lineindex: %s\n" % (self, frame, why, arg, filename, lineno, funcname, context, lineindex,) # XXX not convinced that this memoizing is a performance win -- I don't know enough about Python guts to tell. --Zooko 2001-10-14 bname = self.pathtobasename.get(filename) if bname is None: # Using setdefault faster than two separate lines? --Zooko 2001-10-14 bname = self.pathtobasename.setdefault(filename, os.path.basename(filename)) try: print "%s(%d): %s" % (bname, lineno, context[lineindex],), except IndexError: # Uh.. sometimes getframeinfo gives me a context of length 1 and a lineindex of -2. Oh well. pass return self.localtrace | 11d6242ee8b30c5a8f3639283522c47d378dc063 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/11d6242ee8b30c5a8f3639283522c47d378dc063/trace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
5129,
67,
5129,
12,
2890,
16,
2623,
16,
11598,
16,
1501,
4672,
309,
11598,
422,
296,
1369,
4278,
468,
11329,
12044,
1404,
741,
326,
1056,
5504,
1347,
1501,
353,
1520,
35,
225,
1248... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
5129,
67,
5129,
12,
2890,
16,
2623,
16,
11598,
16,
1501,
4672,
309,
11598,
422,
296,
1369,
4278,
468,
11329,
12044,
1404,
741,
326,
1056,
5504,
1347,
1501,
353,
1520,
35,
225,
1248... |
while CutBy > 0.0001: pH1=pH+CutBy pH2=pH-CutBy Charge1 = self._chargeR(pH1, pos_pKs, neg_pKs) Charge2 = self._chargeR(pH2, pos_pKs, neg_pKs) | if Charge > 0.0: pH1 = pH Charge1 = Charge while Charge1 > 0.0: pH = pH1 + 1.0 Charge = self._chargeR(pH, pos_pKs, neg_pKs) if Charge > 0.0: pH1 = pH Charge1 = Charge else: pH2 = pH Charge2 = Charge break else: pH2 = pH Charge2 = Charge while Charge2 < 0.0: pH = pH2 - 1.0 Charge = self._chargeR(pH, pos_pKs, neg_pKs) if Charge < 0.0: pH2 = pH Charge2 = Charge else: pH1 = pH Charge1 = Charge break | def pi(self): pos_pKs = dict(positive_pKs) neg_pKs = dict(negative_pKs) nterm = self.sequence[0] cterm = self.sequence[-1] if nterm in pKnterminal.keys(): pos_pKs['Nterm'] = pKnterminal[nterm] if cterm in pKcterminal.keys(): neg_pKs['Cterm'] = pKcterminal[cterm] | 440b37b8c1f04cc79daacc1f5875506a33dc8654 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/440b37b8c1f04cc79daacc1f5875506a33dc8654/IsoelectricPoint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4790,
12,
2890,
4672,
949,
67,
84,
47,
87,
273,
2065,
12,
21094,
67,
84,
47,
87,
13,
4251,
67,
84,
47,
87,
273,
2065,
12,
13258,
67,
84,
47,
87,
13,
290,
6408,
273,
365,
18,
6178... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4790,
12,
2890,
4672,
949,
67,
84,
47,
87,
273,
2065,
12,
21094,
67,
84,
47,
87,
13,
4251,
67,
84,
47,
87,
273,
2065,
12,
13258,
67,
84,
47,
87,
13,
290,
6408,
273,
365,
18,
6178... |
iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)></iframe>", self.html) for iframe in iframes: self.req.load("http://relink.us/"+iframe[0], cookies=True) | iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)></iframe>", self.html) for iframe in iframes: self.req.load("http://relink.us/"+iframe[0], cookies=True) | def proceed(self, url, location): container_id = self.parent.url.split("/")[-1].split("id=")[-1] url = "http://relink.us/view.php?id="+container_id self.html = self.req.load(url, cookies=True) temp_links = [] | 737345718371b5faae703b7ed3f4e9725abf5158 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9838/737345718371b5faae703b7ed3f4e9725abf5158/RelinkUs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11247,
12,
2890,
16,
880,
16,
2117,
4672,
1478,
67,
350,
273,
365,
18,
2938,
18,
718,
18,
4939,
2932,
4898,
13,
18919,
21,
8009,
4939,
2932,
350,
1546,
13,
18919,
21,
65,
880,
273,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11247,
12,
2890,
16,
880,
16,
2117,
4672,
1478,
67,
350,
273,
365,
18,
2938,
18,
718,
18,
4939,
2932,
4898,
13,
18919,
21,
8009,
4939,
2932,
350,
1546,
13,
18919,
21,
65,
880,
273,
3... |
"ceil", "rint", "trunc", "sqrt", "log10", "log", "exp", "expm1", "asin", "acos", "atan", "asinh", "acosh", "atanh", "hypot", "atan2", "pow", "fmod", "modf", 'frexp', 'ldexp'] | "ceil", "rint", "trunc", "sqrt", "log10", "log", "exp", "expm1", "asin", "acos", "atan", "asinh", "acosh", "atanh", "hypot", "atan2", "pow", "fmod", "modf", 'frexp', 'ldexp'] | def name_to_defsymb(name): return "HAVE_%s" % name.upper() | 5b25ac3de6ea0e12a04eb9382111db0132f1b4dc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14925/5b25ac3de6ea0e12a04eb9382111db0132f1b4dc/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
508,
67,
869,
67,
536,
9009,
1627,
12,
529,
4672,
327,
315,
19191,
3412,
10185,
87,
6,
738,
508,
18,
5797,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
508,
67,
869,
67,
536,
9009,
1627,
12,
529,
4672,
327,
315,
19191,
3412,
10185,
87,
6,
738,
508,
18,
5797,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.