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 |
|---|---|---|---|---|---|---|
"setparameters%r: returned %r" % (config + result)) | "setparameters%r: returned %r" % (config, result)) | def test_setparameters(dsp): # Two configurations for testing: # config1 (8-bit, mono, 8 kHz) should work on even the most # ancient and crufty sound card, but maybe not on special- # purpose high-end hardware # config2 (16-bit, stereo, 44.1kHz) should work on all but the # most ancient and crufty hardware config1 = (ossaudiodev.AFMT_U8, 1, 8000) config2 = (AFMT_S16_NE, 2, 44100) for config in [config1, config2]: (fmt, channels, rate) = config if (dsp.setfmt(fmt) == fmt and dsp.channels(channels) == channels and dsp.speed(rate) == rate): break else: raise RuntimeError("unable to set audio sampling parameters: " "you must have really weird audio hardware") # setparameters() should be able to set this configuration in # either strict or non-strict mode. result = dsp.setparameters(fmt, channels, rate, False) _assert(result == (fmt, channels, rate), "setparameters%r: returned %r" % (config + result)) result = dsp.setparameters(fmt, channels, rate, True) _assert(result == (fmt, channels, rate), "setparameters%r: returned %r" % (config + result)) | 1caede4dcc9d545c626817689e8985ddb2c0be2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/1caede4dcc9d545c626817689e8985ddb2c0be2b/test_ossaudiodev.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
542,
3977,
12,
72,
1752,
4672,
468,
16896,
10459,
364,
7769,
30,
468,
282,
642,
21,
261,
28,
17,
3682,
16,
6921,
83,
16,
1725,
417,
25688,
13,
1410,
1440,
603,
5456,
326,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
542,
3977,
12,
72,
1752,
4672,
468,
16896,
10459,
364,
7769,
30,
468,
282,
642,
21,
261,
28,
17,
3682,
16,
6921,
83,
16,
1725,
417,
25688,
13,
1410,
1440,
603,
5456,
326,
4... |
def opening(self, node): s = u'' | def opening(s, node): r = u'' | def opening(self, node): s = u'' # Additional new line before each switch/try if not node.isFirstChild(True) and not node.getChild("commentsBefore", False): prev = node.getPreviousSibling(False, True) # No separation after case statements if prev != None and prev.type in ["case", "default"]: pass else: sep() if node.get("switchType") == "catch": s += write("try") elif node.get("switchType") == "case": s += write("switch") return s | 01a99d0db0499777506f7fbf9ecf7a7e70c7a9e2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/01a99d0db0499777506f7fbf9ecf7a7e70c7a9e2/Packer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10890,
12,
87,
16,
756,
4672,
436,
273,
582,
6309,
468,
15119,
394,
980,
1865,
1517,
1620,
19,
698,
309,
486,
756,
18,
291,
3759,
1763,
12,
5510,
13,
471,
486,
756,
18,
588,
1763,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10890,
12,
87,
16,
756,
4672,
436,
273,
582,
6309,
468,
15119,
394,
980,
1865,
1517,
1620,
19,
698,
309,
486,
756,
18,
291,
3759,
1763,
12,
5510,
13,
471,
486,
756,
18,
588,
1763,
29... |
if check: | if check and self.base_ring().is_exact(): | def __call__(self, x, coerce=True, copy=True, check=True): """ Create an element of this free module. | 30ec3f0d7dcc276fdc1c2af733b22b72e64ffd36 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/30ec3f0d7dcc276fdc1c2af733b22b72e64ffd36/free_module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
619,
16,
12270,
33,
5510,
16,
1610,
33,
5510,
16,
866,
33,
5510,
4672,
3536,
1788,
392,
930,
434,
333,
4843,
1605,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
619,
16,
12270,
33,
5510,
16,
1610,
33,
5510,
16,
866,
33,
5510,
4672,
3536,
1788,
392,
930,
434,
333,
4843,
1605,
18,
2,
-100,
-100,
-100,
-100,
-100,
... |
for l in self._windows.values(): l.do_idle() | if self.active: self.active.do_idle() | def idle(self, *args): for l in self._windows.values(): l.do_idle() | 4e0726f4da81ce97d19f5ddb53c6fb214d6c77fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/4e0726f4da81ce97d19f5ddb53c6fb214d6c77fd/ped.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12088,
12,
2890,
16,
380,
1968,
4672,
364,
328,
316,
365,
6315,
13226,
18,
2372,
13332,
328,
18,
2896,
67,
20390,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12088,
12,
2890,
16,
380,
1968,
4672,
364,
328,
316,
365,
6315,
13226,
18,
2372,
13332,
328,
18,
2896,
67,
20390,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
with open(os.path.join(__dir__, "bookmarks","a")) as f: | with open(os.path.join(__dir__, "bookmarks"), "a") as f: | def bookmark(self): '''Put the current url in a file named bookmarks''' with open(os.path.join(__dir__, "bookmarks","a")) as f: f.write(self.web_view.get_main_frame().get_uri() + "\n") | ce21729f26c3274212696ba339405d54734ae04e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6734/ce21729f26c3274212696ba339405d54734ae04e/ulr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13696,
12,
2890,
4672,
9163,
6426,
326,
783,
880,
316,
279,
585,
4141,
13696,
87,
26418,
598,
1696,
12,
538,
18,
803,
18,
5701,
12,
972,
1214,
972,
16,
315,
3618,
17439,
6,
3631,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13696,
12,
2890,
4672,
9163,
6426,
326,
783,
880,
316,
279,
585,
4141,
13696,
87,
26418,
598,
1696,
12,
538,
18,
803,
18,
5701,
12,
972,
1214,
972,
16,
315,
3618,
17439,
6,
3631,
315,
... |
raise ValueError(msg) | raise BadIdError(msg) | def extractNodeInformation(self): """ For the mathematician in this object, extract the list of advisor ids, the mathematician name, the mathematician institution, and the year of the mathematician's degree. """ if self.pagestr is None: self.getPage() self.advisors = [] self.descendants = [] | 359dd305c1cb8223726e8230d141ef8221ca0034 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12348/359dd305c1cb8223726e8230d141ef8221ca0034/grab.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
907,
5369,
12,
2890,
4672,
3536,
2457,
326,
4233,
351,
2126,
2779,
316,
333,
733,
16,
2608,
326,
666,
434,
1261,
10227,
3258,
16,
326,
4233,
351,
2126,
2779,
508,
16,
326,
4233,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
907,
5369,
12,
2890,
4672,
3536,
2457,
326,
4233,
351,
2126,
2779,
316,
333,
733,
16,
2608,
326,
666,
434,
1261,
10227,
3258,
16,
326,
4233,
351,
2126,
2779,
508,
16,
326,
4233,
... |
self.expanders = sender.SenderMapper() | def __init__(self, parent, id=-1, pos=wxDefaultPosition, size=wxDefaultSize, style=wxHSCROLL | wxVSCROLL, name='scrolledWindow'): NameValueEditorScrollWin.__init__(self, parent, id, pos, size, style, name) | 2acebc2691912dd4b702b7c73f43f549de770335 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/2acebc2691912dd4b702b7c73f43f549de770335/Inspector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
612,
29711,
21,
16,
949,
33,
27226,
1868,
2555,
16,
963,
33,
27226,
1868,
1225,
16,
2154,
33,
27226,
44,
2312,
14555,
571,
7075,
58,
2312,
14555... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
612,
29711,
21,
16,
949,
33,
27226,
1868,
2555,
16,
963,
33,
27226,
1868,
1225,
16,
2154,
33,
27226,
44,
2312,
14555,
571,
7075,
58,
2312,
14555... | |
deltah=deltah-3.61 deltas=deltas-1.5 | deltah -= 3.61 deltas -= 1.5 | def tercorr(stri): deltah=0 deltas=0 if rna==0: #DNA/DNA #Allawi and SantaLucia (1997). Biochemistry 36 : 10581-10594 if stri.startswith('G') or stri.startswith('C'): deltah=deltah-0.1 deltas=deltas+2.8 elif stri.startswith('A') or stri.startswith('T'): deltah=deltah-2.3 deltas=deltas-4.1 if stri.endswith('G') or stri.endswith('C'): deltah=deltah-0.1 deltas=deltas+2.8 elif stri.endswith('A') or stri.endswith('T'): deltah=deltah-2.3 deltas=deltas-4.1 dhL=dh+deltah dsL=ds+deltas return dsL,dhL elif rna==1: #RNA if stri.startswith('G') or stri.startswith('C'): deltah=deltah-3.61 deltas=deltas-1.5 elif stri.startswith('A') or stri.startswith('T') or \ stri.startswith('U'): deltah=deltah-3.72 deltas=deltas+10.5 if stri.endswith('G') or stri.endswith('C'): deltah=deltah-3.61 deltas=deltas-1.5 elif stri.endswith('A') or stri.endswith('T') or \ stri.endswith('U'): deltah=deltah-3.72 deltas=deltas+10.5 dhL=dh+deltah dsL=ds+deltas # print "delta h=",dhL return dsL,dhL | 9d20501f87a48e7d08b8c8ab193dd1ec8b75d714 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7167/9d20501f87a48e7d08b8c8ab193dd1ec8b75d714/MeltingTemp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19272,
17515,
12,
701,
77,
4672,
3622,
76,
33,
20,
20113,
33,
20,
309,
436,
6582,
631,
20,
30,
468,
8609,
37,
19,
8609,
37,
468,
1595,
2219,
77,
471,
348,
27677,
48,
5286,
1155,
261,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19272,
17515,
12,
701,
77,
4672,
3622,
76,
33,
20,
20113,
33,
20,
309,
436,
6582,
631,
20,
30,
468,
8609,
37,
19,
8609,
37,
468,
1595,
2219,
77,
471,
348,
27677,
48,
5286,
1155,
261,... |
locator = VistrailLocator(VistrailLocator.ORIGIN.DB, name) if config != None: locator.host = config['host'] locator.port = config['port'] locator.db = config['db'] if config.has_key('id'): locator.conn_id = config['id'] vistrailView.controller.writeVistrailDB(locator) vistrailView.locator = locator | if vistrailView.locator is None or \ vistrailView.locator.origin != VistrailLocator.ORIGIN.DB: locator = VistrailLocator(VistrailLocator.ORIGIN.DB, name) if config != None: locator.host = config['host'] locator.port = config['port'] locator.db = config['db'] if config.has_key('id'): locator.conn_id = config['id'] vistrailView.locator = locator vistrailView.controller.writeVistrailDB(vistrailView.locator) | def saveVistrailDB(self, vistrailView=None, name='', config=None): """saveVistrailDB(vistrailView: QVistrailView) -> Boolean Save vistrailView or the current active vistrail to the database It returns True if the operation was successful """ if not vistrailView: vistrailView = self.currentWidget() if vistrailView: if name == '': name = vistrailView.controller.fileName if name == '': ok = False name = QtGui.QInputDialog.getText(self, "Save Vistrail...", "Vistrail name:", QtGui.QLineEdit.Normal, "", ok) if name != '' and name != None: locator = VistrailLocator(VistrailLocator.ORIGIN.DB, name) if config != None: locator.host = config['host'] locator.port = config['port'] locator.db = config['db'] if config.has_key('id'): locator.conn_id = config['id'] vistrailView.controller.writeVistrailDB(locator) vistrailView.locator = locator return True else: return False | 57907f9d9c321b9cf4a1daef1995115016e2938b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6341/57907f9d9c321b9cf4a1daef1995115016e2938b/view_manager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
3282,
15565,
2290,
12,
2890,
16,
2281,
15565,
1767,
33,
7036,
16,
508,
2218,
2187,
642,
33,
7036,
4672,
3536,
5688,
3282,
15565,
2290,
12,
90,
3337,
671,
1767,
30,
2238,
3282,
1556... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
3282,
15565,
2290,
12,
2890,
16,
2281,
15565,
1767,
33,
7036,
16,
508,
2218,
2187,
642,
33,
7036,
4672,
3536,
5688,
3282,
15565,
2290,
12,
90,
3337,
671,
1767,
30,
2238,
3282,
1556... |
return True | return None | def validate(self, value, instance, errors={}, **kwargs): """ Validate passed-in value using all field validators. Return None if all validations pass; otherwise, return failed result returned by validator """ name = self.getName() if errors and errors.has_key(name): return 1 | ea5de49765c91d305bd4df36c6d1fc27054c9528 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/ea5de49765c91d305bd4df36c6d1fc27054c9528/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
12,
2890,
16,
460,
16,
791,
16,
1334,
28793,
2826,
4333,
4672,
3536,
3554,
2275,
17,
267,
460,
1450,
777,
652,
11632,
18,
2000,
599,
309,
777,
20808,
1342,
31,
3541,
16,
327,
253... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
460,
16,
791,
16,
1334,
28793,
2826,
4333,
4672,
3536,
3554,
2275,
17,
267,
460,
1450,
777,
652,
11632,
18,
2000,
599,
309,
777,
20808,
1342,
31,
3541,
16,
327,
253... |
home = os.environ['HOME'] | home = os.environ.get('HOME') | def addpackage(sitedir, name): global _dirs_in_sys_path if _dirs_in_sys_path is None: _init_pathinfo() reset = 1 else: reset = 0 fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exec dir continue if dir[-1] == '\n': dir = dir[:-1] dir, dircase = makepath(sitedir, dir) if not dircase in _dirs_in_sys_path and os.path.exists(dir): sys.path.append(dir) _dirs_in_sys_path[dircase] = 1 if reset: _dirs_in_sys_path = None | 470b0c0e1f7247539210cb5c13f8cb0f28894714 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/470b0c0e1f7247539210cb5c13f8cb0f28894714/site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
5610,
12,
87,
16261,
481,
16,
508,
4672,
2552,
389,
8291,
67,
267,
67,
9499,
67,
803,
309,
389,
8291,
67,
267,
67,
9499,
67,
803,
353,
599,
30,
389,
2738,
67,
803,
1376,
1435,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
5610,
12,
87,
16261,
481,
16,
508,
4672,
2552,
389,
8291,
67,
267,
67,
9499,
67,
803,
309,
389,
8291,
67,
267,
67,
9499,
67,
803,
353,
599,
30,
389,
2738,
67,
803,
1376,
1435,
... |
self.actualScore = self.actualScore - int((100 * globalClock.getDt())) self.thisScore.setText('Score: '+str(self.actualScore)) | global actualScore actualScore = actualScore - int((100 * globalClock.getDt())) self.thisScore.setText('Score: '+str(actualScore)) | def moveUpdateTask(self,task): #Function that update players position # move where the keys set it self.node.setPos(self.node,Vec3(0,1.0*globalClock.getDt()*self.speed,0)) # update scoring system self.actualScore = self.actualScore - int((100 * globalClock.getDt())) self.thisScore.setText('Score: '+str(self.actualScore)) return task.cont | bd2cf555f80d535aa25511a61d82267027e3adb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4878/bd2cf555f80d535aa25511a61d82267027e3adb4/Gaivota.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
1891,
2174,
12,
2890,
16,
4146,
4672,
468,
2083,
716,
1089,
18115,
1754,
468,
3635,
1625,
326,
1311,
444,
518,
365,
18,
2159,
18,
542,
1616,
12,
2890,
18,
2159,
16,
12991,
23,
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,
3635,
1891,
2174,
12,
2890,
16,
4146,
4672,
468,
2083,
716,
1089,
18115,
1754,
468,
3635,
1625,
326,
1311,
444,
518,
365,
18,
2159,
18,
542,
1616,
12,
2890,
18,
2159,
16,
12991,
23,
12... |
self.__add_document(document) self.__view_document(document) | def cmd_open_file(self, filename, quiet=False): if (len(filename) and (self.__currentdocument is None or filename != self.__currentdocument.filename)): filename = os.path.abspath(filename) if filename in self.__documents: document = self.__documents[filename] self.__view_document(document) else: try: document = self.__open_file(filename) self.__add_document(document) self.__view_document(document) except: if not quiet: raise | 7d13316998ca63a65624ff9dd5e7d7ddf50d40af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2233/7d13316998ca63a65624ff9dd5e7d7ddf50d40af/buffermanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1797,
67,
3190,
67,
768,
12,
2890,
16,
1544,
16,
10902,
33,
8381,
4672,
309,
261,
1897,
12,
3459,
13,
471,
261,
2890,
16186,
2972,
5457,
353,
599,
578,
1544,
480,
365,
16186,
2972,
545... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1797,
67,
3190,
67,
768,
12,
2890,
16,
1544,
16,
10902,
33,
8381,
4672,
309,
261,
1897,
12,
3459,
13,
471,
261,
2890,
16186,
2972,
5457,
353,
599,
578,
1544,
480,
365,
16186,
2972,
545... | |
return self.checkout(module, revision, checkoutdir) | return self.checkout(buildscript, module, revision, checkoutdir) | def update(self, buildscript, module, revision=None, checkoutdir=None): '''Perform a "cvs update" (or possibly a checkout)''' dir = self.getcheckoutdir(module, checkoutdir) if not os.path.exists(dir): return self.checkout(module, revision, checkoutdir) os.chdir(dir) cmd = 'cvs -z3 -q -d %s update -dP ' % self.cvsroot | 0d63709816442efd5f418b82e90c2534f6c72c3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4596/0d63709816442efd5f418b82e90c2534f6c72c3f/cvs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
1361,
4263,
16,
1605,
16,
6350,
33,
7036,
16,
13926,
1214,
33,
7036,
4672,
9163,
4990,
279,
315,
71,
6904,
1089,
6,
261,
280,
10016,
279,
13926,
2506,
6309,
1577,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
1361,
4263,
16,
1605,
16,
6350,
33,
7036,
16,
13926,
1214,
33,
7036,
4672,
9163,
4990,
279,
315,
71,
6904,
1089,
6,
261,
280,
10016,
279,
13926,
2506,
6309,
1577,
2... |
Create a temporary directory, and return its name. | Create a temporary directory, and return its name. | def setup_temp (): """ Create a temporary directory, and return its name. """ global temp_dir if not keep_temp_dir_p: temp_dir = tempfile.mktemp (program_name) try: os.mkdir (temp_dir, 0700) except OSError: pass return temp_dir | d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
67,
5814,
1832,
30,
3536,
1788,
279,
6269,
1867,
16,
471,
327,
2097,
508,
18,
3536,
2552,
1906,
67,
1214,
309,
486,
3455,
67,
5814,
67,
1214,
67,
84,
30,
1906,
67,
1214,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
67,
5814,
1832,
30,
3536,
1788,
279,
6269,
1867,
16,
471,
327,
2097,
508,
18,
3536,
2552,
1906,
67,
1214,
309,
486,
3455,
67,
5814,
67,
1214,
67,
84,
30,
1906,
67,
1214,
273,
1... |
unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) | unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | ed891e5784edd8a5e4d544f1ef837edc82b93924 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ed891e5784edd8a5e4d544f1ef837edc82b93924/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5302,
4873,
1576,
13332,
3536,
6910,
777,
326,
533,
924,
434,
326,
2836,
1576,
2190,
635,
3675,
12697,
10138,
16,
471,
10736,
2690,
1308,
4606,
364,
28769,
434,
999,
18,
1220,
445,
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,
5302,
4873,
1576,
13332,
3536,
6910,
777,
326,
533,
924,
434,
326,
2836,
1576,
2190,
635,
3675,
12697,
10138,
16,
471,
10736,
2690,
1308,
4606,
364,
28769,
434,
999,
18,
1220,
445,
353,
... |
if not (start + (count+1) * step)*sign > end*sign: | if not (start + count * step)*sign > end*sign: | def srange(start, end=None, step=1, universe=None, check=True, include_endpoint=False): """ Return list of numbers \code{a, a+step, ..., a+k*step}, where \code{a+k*step < b} and \code{a+(k+1)*step > b}. This is the best way to get an iterator over SAGE integers as opposed to Python int's. It also allows you to specify step sizes to iterate. It is potentially much slower than the Python range statement, depending on your application. INPUT: a -- number b -- number (default: None) step -- number (default: 1) include_endpoint -- whether or not to include the endpoint (default: False) OUTPUT: list If b is None, then b is set equal to a and a is set equal to the 0 in the parent of b. Unlike range, a and b can be any type of numbers, and the resulting list involves numbers of that type. NOTE: This function is called \code{srange} to distinguish it from the builtin Python \code{range} command. The s at the beginning of the name stands for ``SAGE''. SEE ALSO: xsrange -- iterator version EXAMPLES: sage: v = srange(5); v [0, 1, 2, 3, 4] sage: type(v[2]) <type 'sage.rings.integer.Integer'> sage: srange(1, 10) [1, 2, 3, 4, 5, 6, 7, 8, 9] sage: srange(10, 1, -1) [10, 9, 8, 7, 6, 5, 4, 3, 2] sage: srange(10,1,-1, include_endpoint=True) [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] sage: Q = RationalField() sage: srange(1,10,Q('1/2')) [1, 3/2, 2, 5/2, 3, 7/2, 4, 9/2, 5, 11/2, 6, 13/2, 7, 15/2, 8, 17/2, 9, 19/2] sage: R = RealField() sage: srange(1,5,R('0.5')) [1.00000000000000, 1.50000000000000, 2.00000000000000, 2.50000000000000, 3.00000000000000, 3.50000000000000, 4.00000000000000, 4.50000000000000] sage: srange(0,1,R('0.4')) [0.000000000000000, 0.400000000000000, 0.800000000000000] sage: srange(1.0, 5.0, include_endpoint=True) [1.00000000000000, 2.00000000000000, 3.00000000000000, 4.00000000000000, 5.00000000000000] sage: V = VectorSpace(QQ, 2) sage: srange(V([0,0]), V([5,5]), step=V([2,2])) [(0, 0), (2, 2), (4, 4)] """ from sage.structure.sequence import Sequence from sage.rings.all import ZZ if end is None: end = start start = 0 if check: if universe is None: universe = Sequence([start, end, step]).universe() start, end, step = universe(start), universe(end), universe(step) if include_endpoint: if universe in [int, long, ZZ]: if (end-start) % step == 0: end += step else: count = (end-start)/step if count == int(float(count)): end += step if universe is int or universe is long: return range(start, end, step) elif universe is ZZ: return ZZ.range(start, end, step) else: L = [] sign = 1 if step > 0 else -1 # In order for range to make sense, start, end, and step must lie in a 1-dim real subspace... count = int(float((end-start)/step)) if count <= 0: return L # we assume that a+b*c = a + b + ... + b if not (start + (count+1) * step)*sign > end*sign: # we won't get there by adding, perhaps comparison in the ring is bad # rather than enter an infinite loop, do something sensible # the 'not' is hear because incomparable items return False L = [start + k*step for k in range(count)] # this is slower due to coercion and mult elif step > 0: while start < end: L.append(start) start += step elif step < 0: while start > end: L.append(start) start += step else: raise ValueError, "step must not be 0" return L | b0407bebdcafbc7357b33c8faa600978ff6cc467 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/b0407bebdcafbc7357b33c8faa600978ff6cc467/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
3676,
12,
1937,
16,
679,
33,
7036,
16,
2235,
33,
21,
16,
29235,
33,
7036,
16,
866,
33,
5510,
16,
2341,
67,
8003,
33,
8381,
4672,
3536,
2000,
666,
434,
5600,
521,
710,
95,
69,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
3676,
12,
1937,
16,
679,
33,
7036,
16,
2235,
33,
21,
16,
29235,
33,
7036,
16,
866,
33,
5510,
16,
2341,
67,
8003,
33,
8381,
4672,
3536,
2000,
666,
434,
5600,
521,
710,
95,
69,
... |
return hangul_decompose[c] | return hangul_decompose(c) | def decompose(c): s=ord(c) if s>=SBase and s-SBase<SCount: return hangul_decompose[c] d=decompositions_3_2_0.get(c,unicodedata.decomposition(c)) if not d: return [c] if d.startswith("<"): d=d[d.index(">")+1:] print "Compatibility decomposition: %r -> %r" % (c,d) else: print "Canonical decomposition: %r -> %r" % (c,d) ret=[] for c in d.split(): ret+=decompose(unichr(string.atoi(c,16))) return ret | 4b799685143d171cbd6a55572a7a3267581b90a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12769/4b799685143d171cbd6a55572a7a3267581b90a6/nfkc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24476,
12,
71,
4672,
272,
33,
517,
12,
71,
13,
309,
272,
34,
33,
55,
2171,
471,
272,
17,
55,
2171,
32,
55,
1380,
30,
327,
25733,
332,
67,
323,
23658,
12,
71,
13,
225,
302,
33,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24476,
12,
71,
4672,
272,
33,
517,
12,
71,
13,
309,
272,
34,
33,
55,
2171,
471,
272,
17,
55,
2171,
32,
55,
1380,
30,
327,
25733,
332,
67,
323,
23658,
12,
71,
13,
225,
302,
33,
32... |
value += self._safe_read(chunk_left) | value.append(self._safe_read(chunk_left)) | def _read_chunked(self, amt): assert self.chunked != _UNKNOWN chunk_left = self.chunk_left value = '' | baf4101b94fbd3dfe0f2e79f9e4d6a402a0b5cb6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/baf4101b94fbd3dfe0f2e79f9e4d6a402a0b5cb6/httplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
67,
6551,
329,
12,
2890,
16,
25123,
4672,
1815,
365,
18,
6551,
329,
480,
389,
14737,
2441,
67,
4482,
273,
365,
18,
6551,
67,
4482,
460,
273,
875,
2,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
67,
6551,
329,
12,
2890,
16,
25123,
4672,
1815,
365,
18,
6551,
329,
480,
389,
14737,
2441,
67,
4482,
273,
365,
18,
6551,
67,
4482,
460,
273,
875,
2,
-100,
-100,
-100,
-100,
... |
fmt = 'cbxxxxxxhhhhiillffd' fmt3 = '3c3b18x12h6i6l6f3d' | fmt = 'cbxxxxxxhhhhiillffdt' fmt3 = '3c3b18x12h6i6l6f3d3t' | def deprecated_err(func, *args): try: func(*args) except (struct.error, TypeError): pass except DeprecationWarning: if not PY_STRUCT_OVERFLOW_MASKING: raise TestFailed, "%s%s expected to raise struct.error" % ( func.__name__, args) else: raise TestFailed, "%s%s did not raise error" % ( func.__name__, args) | 0e4d150e0dd1cf02df4aaa31696fdb3863442f8e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/0e4d150e0dd1cf02df4aaa31696fdb3863442f8e/test_struct.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6849,
67,
370,
12,
644,
16,
380,
1968,
4672,
775,
30,
1326,
30857,
1968,
13,
1335,
261,
1697,
18,
1636,
16,
3580,
4672,
1342,
1335,
24041,
30,
309,
486,
12191,
67,
13915,
67,
12959,
17... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6849,
67,
370,
12,
644,
16,
380,
1968,
4672,
775,
30,
1326,
30857,
1968,
13,
1335,
261,
1697,
18,
1636,
16,
3580,
4672,
1342,
1335,
24041,
30,
309,
486,
12191,
67,
13915,
67,
12959,
17... |
default='/usr') | default='/usr', odesc='</path>') | def parse(self, argv, do_getopt=True): '''Parse options''' ret = {} if do_getopt: try: opts, args = getopt.getopt(argv, self.buildGetopt(), []) except getopt.GetoptError, err: self.helpExit(err) if '-h' in argv: self.helpExit('', 0) self['args'] = args for key in self.keys(): if key == 'args': continue option = self[key] if do_getopt: option.parse(opts, []) else: option.parse([], argv) if hasattr(option, '_value'): val = option.value self[key] = val | 6ec2e7a30c30d6a8cd96c9ffa4fc4d1f484596a5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11867/6ec2e7a30c30d6a8cd96c9ffa4fc4d1f484596a5/Options.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
5261,
16,
741,
67,
588,
3838,
33,
5510,
4672,
9163,
3201,
702,
26418,
325,
273,
2618,
309,
741,
67,
588,
3838,
30,
775,
30,
1500,
16,
833,
273,
336,
3838,
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,
1109,
12,
2890,
16,
5261,
16,
741,
67,
588,
3838,
33,
5510,
4672,
9163,
3201,
702,
26418,
325,
273,
2618,
309,
741,
67,
588,
3838,
30,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588... |
form = DataForm(title = 'Enter the radius', data=['Enter the radius of the circle (numbers only)',DataField(label='Radius',name='radius',typ='text-single')]) | form = DataForm(title = 'Enter the radius', data=['Enter the radius of the circle (numbers only)',DataField(desc='Radius',name='radius',typ='text-single')]) | def cmdSecondStageReply(self,conn,request): reply = request.buildReply('result') form = DataForm(title = 'Enter the radius', data=['Enter the radius of the circle (numbers only)',DataField(label='Radius',name='radius',typ='text-single')]) replypayload = [Node('actions',attrs={'execute':'complete'},payload=[Node('complete'),Node('prev')]),form] reply.addChild(name='command',namespace=NS_COMMAND,attrs={'node':request.getTagAttr('command','node'),'sessionid':request.getTagAttr('command','sessionid'),'status':'executing'},payload=replypayload) self._owner.send(reply) raise NodeProcessed | 20e0ee4d2947d3c87389d11c8d269bbcd3037b2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7194/20e0ee4d2947d3c87389d11c8d269bbcd3037b2e/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1797,
8211,
8755,
7817,
12,
2890,
16,
4646,
16,
2293,
4672,
4332,
273,
590,
18,
3510,
7817,
2668,
2088,
6134,
646,
273,
1910,
1204,
12,
2649,
273,
296,
10237,
326,
5725,
2187,
501,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1797,
8211,
8755,
7817,
12,
2890,
16,
4646,
16,
2293,
4672,
4332,
273,
590,
18,
3510,
7817,
2668,
2088,
6134,
646,
273,
1910,
1204,
12,
2649,
273,
296,
10237,
326,
5725,
2187,
501,
33,
... |
self._saveCSV(fname) | self._saveCSV(fileName) | def save(self,fname): ''' Dump the class data into a csv or pickle file The encoding is determined by the filename's extension: 'csv' : When the filename ends in '.csv' the routine tries to interpret the file as comma seperated values. The variable names must be in the first row Any other extension is considered to mean a file in Python's pickle format. Arguments: fname : filename; string Returns: None ''' fext = self._getExtension(fname) if fext == 'csv': self._saveCSV(fname) else: #elif fext == 'pickle': self._savePickle(fname) | 45268ff49ddb4f963530947d7202a5e0642e2fda /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2720/45268ff49ddb4f963530947d7202a5e0642e2fda/storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
12749,
4672,
9163,
18242,
326,
667,
501,
1368,
279,
6101,
578,
13379,
585,
225,
1021,
2688,
353,
11383,
635,
326,
1544,
1807,
2710,
30,
296,
6715,
11,
294,
5203,
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,
1923,
12,
2890,
16,
12749,
4672,
9163,
18242,
326,
667,
501,
1368,
279,
6101,
578,
13379,
585,
225,
1021,
2688,
353,
11383,
635,
326,
1544,
1807,
2710,
30,
296,
6715,
11,
294,
5203,
326,... |
bt.clicked = (my_pager_pop, (pg,info)) | bt.callback_clicked_add(my_pager_pop, pg,info) | def pager_clicked(obj, it, *args, **kwargs): win = elementary.Window("pager", elementary.ELM_WIN_BASIC) win.autodel_set(True) win.title_set("Pager") bg = elementary.Background(win) win.resize_object_add(bg) bg.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) bg.show() pg = elementary.Pager(win) win.resize_object_add(pg) pg.show() info = dict() bx = elementary.Box(win) bx.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) bx.show() lb = elementary.Label(win) lb.label_set("This is page 1 in a pager stack.<br>" "<br>" "So what is a pager stack? It is a stack<br>" "of pages that hold widgets in it. The<br>" "pages can be pushed and popped on and<br>" "off the stack, activated and otherwise<br>" "activated if already in the stack<br>" "(activated means promoted to the top of<br>" "the stack).<br>" "<br>" "The theme may define the animation how<br>" "show and hide of pages.") bx.pack_end(lb) lb.show() bt = elementary.Button(win) bt.label_set("Flip to 2") bt.clicked = (my_pager_1, (pg, info)) bx.pack_end(bt) bt.show() bt = elementary.Button(win) bt.label_set("Popme") bt.clicked = (my_pager_pop, (pg, info)) bx.pack_end(bt) bt.show() pg.content_push(bx) info["pg1"] = bx; bx = elementary.Box(win) bx.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) bx.show() lb = elementary.Label(win) lb.label_set("This is page 2 in a pager stack.<br>" "<br>" "This is just like the previous page in<br>" "the pager stack.") bx.pack_end(lb) lb.show() bt = elementary.Button(win) bt.label_set("Flip to 3") bt.clicked = (my_pager_2, (pg, info)) bx.pack_end(bt) bt.show() bt = elementary.Button(win) bt.label_set("Popme") bt.clicked = (my_pager_pop, (pg,info)) bx.pack_end(bt) bt.show() pg.content_push(bx) info["pg2"] = bx bx = elementary.Box(win) bx.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) bx.show() lb = elementary.Label(win) lb.label_set("This is page 3 in a pager stack.<br>" "<br>" "This is just like the previous page in<br>" "the pager stack.") bx.pack_end(lb) lb.show() bt = elementary.Button(win) bt.label_set("Flip to 1") bt.clicked = (my_pager_3, (pg,info)) bx.pack_end(bt) bt.show() bt = elementary.Button(win) bt.label_set("Popme") bt.clicked = (my_pager_pop, (pg,info)) bx.pack_end(bt) bt.show() pg.content_push(bx) info["pg3"] = bx win.resize(320, 320) win.show() | ef127faaba8fc06ebbb7bd48a4185405cdfc6a4e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12343/ef127faaba8fc06ebbb7bd48a4185405cdfc6a4e/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12679,
67,
7475,
329,
12,
2603,
16,
518,
16,
380,
1968,
16,
2826,
4333,
4672,
5657,
273,
930,
814,
18,
3829,
2932,
24081,
3113,
930,
814,
18,
2247,
49,
67,
24572,
67,
25642,
13,
5657,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12679,
67,
7475,
329,
12,
2603,
16,
518,
16,
380,
1968,
16,
2826,
4333,
4672,
5657,
273,
930,
814,
18,
3829,
2932,
24081,
3113,
930,
814,
18,
2247,
49,
67,
24572,
67,
25642,
13,
5657,
... |
self.fp.write('\nclass %s(aetools.ComponentItem):\n' % pname) self.fp.write('\t"""%s - %s """\n' % (name, desc)) self.fp.write('\twant = %s\n' % `code`) self.classnames[pname] = code self.classcodes[code] = pname | if self.fp: self.fp.write('\nclass %s(aetools.ComponentItem):\n' % pname) self.fp.write('\t"""%s - %s """\n' % (name, desc)) self.fp.write('\twant = %s\n' % `code`) self.namemappers[0].addnamecode('class', pname, code) | def compileclass(self, cls): [name, code, desc, properties, elements] = cls pname = identify(name) if self.classcodes.has_key(code): # plural forms and such self.fp.write("\n%s = %s\n"%(pname, self.classcodes[code])) self.classnames[pname] = code else: self.fp.write('\nclass %s(aetools.ComponentItem):\n' % pname) self.fp.write('\t"""%s - %s """\n' % (name, desc)) self.fp.write('\twant = %s\n' % `code`) self.classnames[pname] = code self.classcodes[code] = pname for prop in properties: self.compileproperty(prop) for elem in elements: self.compileelement(elem) | 42eee53a968a82394c0e1946ffbb8abc26471a5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/42eee53a968a82394c0e1946ffbb8abc26471a5d/gensuitemodule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
1106,
12,
2890,
16,
2028,
4672,
306,
529,
16,
981,
16,
3044,
16,
1790,
16,
2186,
65,
273,
2028,
19952,
273,
9786,
12,
529,
13,
309,
365,
18,
1106,
7000,
18,
5332,
67,
856,
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,
4074,
1106,
12,
2890,
16,
2028,
4672,
306,
529,
16,
981,
16,
3044,
16,
1790,
16,
2186,
65,
273,
2028,
19952,
273,
9786,
12,
529,
13,
309,
365,
18,
1106,
7000,
18,
5332,
67,
856,
12,
... |
class ContourPlotFactory(GraphicPrimitiveFactory_contour_plot): | class ContourPlotFactory(GraphicPrimitiveFactory): | def _from_xdata_ydata(self, point, r, options): g = Graphics() g._circle(float(point[0]), float(point[1]), float(r), options) return g | 04a6df69dc4131eb63863357d3630867f997c0b8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/04a6df69dc4131eb63863357d3630867f997c0b8/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2080,
67,
92,
892,
67,
93,
892,
12,
2890,
16,
1634,
16,
436,
16,
702,
4672,
314,
273,
16830,
1435,
314,
6315,
18970,
12,
5659,
12,
1153,
63,
20,
65,
3631,
1431,
12,
1153,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2080,
67,
92,
892,
67,
93,
892,
12,
2890,
16,
1634,
16,
436,
16,
702,
4672,
314,
273,
16830,
1435,
314,
6315,
18970,
12,
5659,
12,
1153,
63,
20,
65,
3631,
1431,
12,
1153,
63,
... |
time.sleep(0.01) | def server(evt, buf): try: serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) serv.settimeout(3) serv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) serv.bind(("", 0)) global PORT PORT = serv.getsockname()[1] serv.listen(5) conn, addr = serv.accept() except socket.timeout: pass else: n = 500 while buf and n > 0: r, w, e = select.select([], [conn], []) if w: sent = conn.send(buf) buf = buf[sent:] n -= 1 time.sleep(0.01) conn.close() finally: serv.close() PORT = None evt.set() | 75992edfaebbe08966746c7179b5c8ff8da8caeb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/75992edfaebbe08966746c7179b5c8ff8da8caeb/test_smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1438,
12,
73,
11734,
16,
1681,
4672,
775,
30,
13515,
273,
2987,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
16,
2987,
18,
3584,
3507,
67,
13693,
13,
13515,
18,
542,
4538,
12,
23,
13,
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,
1438,
12,
73,
11734,
16,
1681,
4672,
775,
30,
13515,
273,
2987,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
16,
2987,
18,
3584,
3507,
67,
13693,
13,
13515,
18,
542,
4538,
12,
23,
13,
13... | |
vasp = os.environ['VASP_SCRIPT'] locals={} execfile(vasp, {}, locals) exitcode = locals['exitcode'] | if os.environ.has_key('VASP_COMMAND'): vasp = os.environ['VASP_COMMAND'] exitcode = os.system(vasp) elif os.environ.has_key('VASP_SCRIPT'): vasp = os.environ['VASP_SCRIPT'] locals={} execfile(vasp, {}, locals) exitcode = locals['exitcode'] else: raise RuntimeError('Please set either VASP_COMMAND or VASP_SCRIPT environment variable') | def calculate(self, atoms): """Generate necessary files in the working directory. If the directory does not exist it will be created. | 3f6573d59a6a06e07a56ebb8cf2b4a43a2725223 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1380/3f6573d59a6a06e07a56ebb8cf2b4a43a2725223/vasp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4604,
12,
2890,
16,
9006,
4672,
3536,
4625,
4573,
1390,
316,
326,
5960,
1867,
18,
225,
971,
326,
1867,
1552,
486,
1005,
518,
903,
506,
2522,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4604,
12,
2890,
16,
9006,
4672,
3536,
4625,
4573,
1390,
316,
326,
5960,
1867,
18,
225,
971,
326,
1867,
1552,
486,
1005,
518,
903,
506,
2522,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.assertNotEqual(True, self.ag.has([]) | self.assertNotEqual(True, self.ag.has([])) | def test_has( self ): " See if AbstractGroup.has() works as expected. " | a1fa875821a09dd15812ee16a73b26455943cd74 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1298/a1fa875821a09dd15812ee16a73b26455943cd74/sprite_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5332,
12,
365,
262,
30,
315,
2164,
309,
4115,
1114,
18,
5332,
1435,
6330,
487,
2665,
18,
315,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5332,
12,
365,
262,
30,
315,
2164,
309,
4115,
1114,
18,
5332,
1435,
6330,
487,
2665,
18,
315,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.verbose_logger.log(yum.logginglevels.INFO_2, msg) | self.verbose_logger.log(yum.logginglevels.INFO_2, to_unicode(msg)) | def _maybeYouMeant(self, arg): """ If install argument doesn't match with case, tell the user. """ matches = self.doPackageLists(patterns=[arg], ignore_case=True) matches = matches.installed + matches.available matches = set(map(lambda x: x.name, matches)) if matches: msg = self.fmtKeyValFill(_(' * Maybe you meant: '), ", ".join(matches)) self.verbose_logger.log(yum.logginglevels.INFO_2, msg) | 7e418ff40a374215d52e53ec33412a23f3a26c50 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/7e418ff40a374215d52e53ec33412a23f3a26c50/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
19133,
6225,
4667,
970,
12,
2890,
16,
1501,
4672,
3536,
971,
3799,
1237,
3302,
1404,
845,
598,
648,
16,
9276,
326,
729,
18,
3536,
1885,
273,
365,
18,
2896,
2261,
7432,
12,
13317,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19133,
6225,
4667,
970,
12,
2890,
16,
1501,
4672,
3536,
971,
3799,
1237,
3302,
1404,
845,
598,
648,
16,
9276,
326,
729,
18,
3536,
1885,
273,
365,
18,
2896,
2261,
7432,
12,
13317,
... |
if code == errno.ECONNABORTED or \ code == errno.ECONNRESET: | if code in (errno.ECONNABORTED, errno.ECONNRESET, errno.WSAENOTSOCK): | def runChunkPump(self): self.cond.acquire() try: while True: while len(self.chunkQueue) == 0: self.cond.wait() (mimeType, body) = self.chunkQueue[0] self.chunkQueue = self.chunkQueue[1:] | 6d97d27a8bfe15febfa2b361b037463a41ba58fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12354/6d97d27a8bfe15febfa2b361b037463a41ba58fa/HTMLDisplay.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
5579,
52,
2801,
12,
2890,
4672,
365,
18,
10013,
18,
1077,
1039,
1435,
775,
30,
1323,
1053,
30,
1323,
562,
12,
2890,
18,
6551,
3183,
13,
422,
374,
30,
365,
18,
10013,
18,
7048,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5579,
52,
2801,
12,
2890,
4672,
365,
18,
10013,
18,
1077,
1039,
1435,
775,
30,
1323,
1053,
30,
1323,
562,
12,
2890,
18,
6551,
3183,
13,
422,
374,
30,
365,
18,
10013,
18,
7048,
... |
if isinstance(right, basestring): | def _get_expression(field_obj,cr, uid, left, right, operator, context=None): if context is None: context = {} | def _rec_convert(ids): if field_obj == table: return ids return self.__execute_recursive_in(cr, field._id1, field._rel, field._id2, ids, operator, field._type) | c9dcc96cd979cd9aa5f9d8a61e0f77de894bbde6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c9dcc96cd979cd9aa5f9d8a61e0f77de894bbde6/expression.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3927,
67,
6283,
12,
2232,
4672,
309,
652,
67,
2603,
422,
1014,
30,
327,
3258,
327,
365,
16186,
8837,
67,
10543,
67,
267,
12,
3353,
16,
652,
6315,
350,
21,
16,
652,
6315,
2878,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3927,
67,
6283,
12,
2232,
4672,
309,
652,
67,
2603,
422,
1014,
30,
327,
3258,
327,
365,
16186,
8837,
67,
10543,
67,
267,
12,
3353,
16,
652,
6315,
350,
21,
16,
652,
6315,
2878,
1... |
self._step += self.growStep() | self.growStep() | def grow(self, maxCost = None): oldStep = self._step if maxCost: while self._queue and self._queue.top()[1] <= maxCost: self._step += self.growStep() else: while self._queue: self._step += self.growStep() return self._step - oldStep | 43fa35262c81565391129ff8b1d3eee04166fe34 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10394/43fa35262c81565391129ff8b1d3eee04166fe34/maputils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13334,
12,
2890,
16,
943,
8018,
273,
599,
4672,
1592,
4160,
273,
365,
6315,
4119,
309,
943,
8018,
30,
1323,
365,
6315,
4000,
471,
365,
6315,
4000,
18,
3669,
1435,
63,
21,
65,
1648,
943... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13334,
12,
2890,
16,
943,
8018,
273,
599,
4672,
1592,
4160,
273,
365,
6315,
4119,
309,
943,
8018,
30,
1323,
365,
6315,
4000,
471,
365,
6315,
4000,
18,
3669,
1435,
63,
21,
65,
1648,
943... |
GEARS_DBG_PATH = r'src\gears\bin-dbg\win32-i386\npapi' GEARS_OPT_PATH = r'src\gears\bin-opt\win32-i386\npapi' | GEARS_DBG_PATH = r'src\gears\gears\bin-dbg\win32-i386\npapi' GEARS_OPT_PATH = r'src\gears\gears\bin-opt\win32-i386\npapi' | def _buildPath(self, directory): return self._findBuildPath('chrome', directory) | 5e9395001ba7d1e66539d595c6ca596797bfe2f8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1918/5e9395001ba7d1e66539d595c6ca596797bfe2f8/installer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3510,
743,
12,
2890,
16,
1867,
4672,
327,
365,
6315,
4720,
3116,
743,
2668,
343,
10896,
2187,
1867,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3510,
743,
12,
2890,
16,
1867,
4672,
327,
365,
6315,
4720,
3116,
743,
2668,
343,
10896,
2187,
1867,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
print init() | init() | def Init(self,component_name): rospy.loginfo("Waiting for %s_controller init...", component_name) service_name = component_name + "_controller/Init" try: rospy.wait_for_service(service_name,rospy.get_param('server_timeout',1)) except rospy.ROSException, e: print "Service not available: %s"%e return False try: init = rospy.ServiceProxy(service_name,Trigger) print init() except rospy.ServiceException, e: print "Service call failed: %s"%e return False return True | 98bbf3e9216af2935a0c25f6d3523b8683f9c0c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12032/98bbf3e9216af2935a0c25f6d3523b8683f9c0c6/simple_script_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4378,
12,
2890,
16,
4652,
67,
529,
4672,
721,
30884,
18,
1330,
1376,
2932,
15946,
364,
738,
87,
67,
5723,
1208,
7070,
16,
1794,
67,
529,
13,
1156,
67,
529,
273,
1794,
67,
529,
397,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4378,
12,
2890,
16,
4652,
67,
529,
4672,
721,
30884,
18,
1330,
1376,
2932,
15946,
364,
738,
87,
67,
5723,
1208,
7070,
16,
1794,
67,
529,
13,
1156,
67,
529,
273,
1794,
67,
529,
397,
4... |
"if ((([ENTRY]->data[[ENTRY]->offset_opcode] >> 3) & 0x7) == 2) msg.cpu->actv_state |= 2", | "if ((([ENTRY]->data[[ENTRY]->offset_opcode] >> 3) & 0x7) == 2) msg.cpu->intr_state |= 2", | def add_helper(l, flags, params): if "[ENTRY]" in params: flags.append("ENTRY") for x in l: name = reduce(lambda x,y: x.replace(y, "_"), "% ,", x.upper()) if "NO_OS" not in flags: name += "<[os]>" opcodes.append((x, flags, ["helper_%s(msg %s)"%(name, params and "," + params or "")])) | 1f09433d9a30eb861d5fedbd3de488778deb51ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6150/1f09433d9a30eb861d5fedbd3de488778deb51ba/build_instructions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
4759,
12,
80,
16,
2943,
16,
859,
4672,
309,
5158,
19083,
4279,
316,
859,
30,
2943,
18,
6923,
2932,
19083,
7923,
364,
619,
316,
328,
30,
508,
273,
5459,
12,
14661,
619,
16,
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,
527,
67,
4759,
12,
80,
16,
2943,
16,
859,
4672,
309,
5158,
19083,
4279,
316,
859,
30,
2943,
18,
6923,
2932,
19083,
7923,
364,
619,
316,
328,
30,
508,
273,
5459,
12,
14661,
619,
16,
9... |
"--title='C-H bond length distribution'", "--xlabel=C-H Distance", "--xunit=A", "--yunit=1", "--ylabel=Frequency", | "--title=C-H bond length distribution", "--xlabel=C-H Distance", "--xunit=A", "--yunit=1", "--ylabel=Frequency", | def test_df(self): self.from_xyz("thf01", "pos") self.from_cp2k_ener("thf01") self.execute("tr-ic-psf", ['tracks/atom.pos', 'bond', '1,2,3,4', '5,6,7,8,9,10,11,12', os.path.join(input_dir, "thf01/init.psf")]) # ordinary df, no error bars self.execute("tr-df", glob.glob("tracks/atom.pos.bond.???????.???????") + ["1.0*A", "1.2*A", "20", "tracks/atom.pos.bond.df"]) df_hist = load_track("tracks/atom.pos.bond.df.hist") self.assertAlmostEqual(df_hist.sum(), 1.0, 2) self.execute("tr-plot", [ "--title='C-H bond length distribution'", "--xlabel='C-H Distance", "--xunit=A", "--yunit=1", "--ylabel=Frequency", ":bar", "tracks/atom.pos.bond.df.bins", "tracks/atom.pos.bond.df.hist", os.path.join(output_dir, "df_noerror.png"), ]) # cumulative df, no error bars self.execute("tr-df", glob.glob("tracks/atom.pos.bond.???????.???????") + ["-c", "1.0*A", "1.2*A", "20", "tracks/atom.pos.bond.cdf"]) cdf_hist = load_track("tracks/atom.pos.bond.cdf.hist") self.assertAlmostEqual(cdf_hist[-1], 1.0, 2) self.execute("tr-plot", [ "--title='Cumulative C-H bond length distribution'", "--xlabel='C-H Distance", "--xunit=A", "--yunit=1", "--ylabel=Frequency", ":bar", "tracks/atom.pos.bond.cdf.bins", "tracks/atom.pos.bond.cdf.hist", os.path.join(output_dir, "df_cumul_noerror.png"), ]) # ordinary df, with error bars self.execute("tr-df", glob.glob("tracks/atom.pos.bond.???????.???????") + ["--bin-tracks", "1.0*A", "1.2*A", "20", "tracks/atom.pos.bond.df"]) lines = [] for bin_filename in sorted(glob.glob("tracks/atom.pos.bond.df.bin.???????")): output = self.execute("tr-blav", [bin_filename, "tracks/time", "-b10"]) lines.append(output[0]) self.execute("tr-write", ["tracks/atom.pos.bond.df.hist", "tracks/atom.pos.bond.df.hist.error"], stdin=lines) df_hist_bis = load_track("tracks/atom.pos.bond.df.hist") self.assertAlmostEqual(df_hist_bis.sum(), 1.0, 2) self.assertArraysAlmostEqual(df_hist, df_hist_bis, 1e-5) self.execute("tr-plot", [ "--title='C-H bond length distribution'", "--xlabel=C-H Distance", "--xunit=A", "--yunit=1", "--ylabel=Frequency", ":bar", "tracks/atom.pos.bond.df.bins", "tracks/atom.pos.bond.df.hist", "tracks/atom.pos.bond.df.hist.error", os.path.join(output_dir, "df_error.png"), ]) # cumulative df, with error bars self.execute("tr-df", glob.glob("tracks/atom.pos.bond.???????.???????") + ["-c", "--bin-tracks", "1.0*A", "1.2*A", "20", "tracks/atom.pos.bond.cdf"]) lines = [] for bin_filename in sorted(glob.glob("tracks/atom.pos.bond.cdf.bin.???????")): output = self.execute("tr-blav", [bin_filename, "tracks/time", "-b10"]) lines.append(output[0]) self.execute("tr-write", ["tracks/atom.pos.bond.cdf.hist", "tracks/atom.pos.bond.cdf.hist.error"], stdin=lines) cdf_hist_bis = load_track("tracks/atom.pos.bond.cdf.hist") self.assertAlmostEqual(cdf_hist_bis[-1], 1.0, 2) self.assertArraysAlmostEqual(cdf_hist, cdf_hist_bis, 1e-5) self.execute("tr-plot", [ "--title='C-H bond length distribution'", "--xlabel=C-H Distance", "--xunit=A", "--yunit=1", "--ylabel=Frequency", ":bar", "tracks/atom.pos.bond.cdf.bins", "tracks/atom.pos.bond.cdf.hist", "tracks/atom.pos.bond.cdf.hist.error", os.path.join(output_dir, "df_cumul_error.png"), ]) | d5a077734d4b0c5a3fbddf6c66de01cad46658ff /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11050/d5a077734d4b0c5a3fbddf6c66de01cad46658ff/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2180,
12,
2890,
4672,
365,
18,
2080,
67,
17177,
2932,
451,
74,
1611,
3113,
315,
917,
7923,
365,
18,
2080,
67,
4057,
22,
79,
67,
708,
2932,
451,
74,
1611,
7923,
365,
18,
883... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2180,
12,
2890,
4672,
365,
18,
2080,
67,
17177,
2932,
451,
74,
1611,
3113,
315,
917,
7923,
365,
18,
2080,
67,
4057,
22,
79,
67,
708,
2932,
451,
74,
1611,
7923,
365,
18,
883... |
util.wait(defer.DeferredList(L, consumeErrors=True)) | return defer.DeferredList(L, consumeErrors=True) | def tearDown(self): if self.serverPort is not None: self.serverPort.stopListening() if self.clientConn is not None: self.clientConn.disconnect() | 6305a011c61d2e3075143d6d1aac62b453e35f67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8962/6305a011c61d2e3075143d6d1aac62b453e35f67/test_sslverify.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
2890,
4672,
309,
365,
18,
3567,
2617,
353,
486,
599,
30,
365,
18,
3567,
2617,
18,
5681,
31594,
1435,
309,
365,
18,
2625,
3543,
353,
486,
599,
30,
365,
18,
2625,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
2890,
4672,
309,
365,
18,
3567,
2617,
353,
486,
599,
30,
365,
18,
3567,
2617,
18,
5681,
31594,
1435,
309,
365,
18,
2625,
3543,
353,
486,
599,
30,
365,
18,
2625,
... |
miller_array = miller_array.f_sq_as_f() | miller_array = miller_array.enforce_positive_amplitudes() | def run(args, command_name="phenix.xtriage"): command_line = (option_parser( usage=command_name+" [options] reflection_file parameters [...]", description="Example: %s data1.mtz" % command_name) .option(None, "--long_help", action="store_true", help="show more help and exit") .enable_show_defaults() .enable_symmetry_comprehensive() .option(None, "--weak_symmetry", action="store_true", default=False, help="symmetry on command line is weaker than symmetry found in files") .option(None, "--quiet", action="store_true", help="suppress output") ).process(args=args) co = command_line.options if (len(command_line.args) == 0): command_line.parser.show_help() elif (co.long_help): print_help(appl=command_name) elif (command_line.expert_level is not None): master_params.show( expert_level=command_line.expert_level, attributes_level=command_line.attributes_level) else: log = multi_out() if (not co.quiet): log.register(label="stdout", file_object=sys.stdout) string_buffer = StringIO() string_buffer_plots = StringIO() log.register(label="log_buffer", file_object=string_buffer) print_banner(appl=command_name, out=log) print >> log, "#phil __OFF__" print >> log print >> log, date_and_time() print >> log print >> log phil_objects = [] argument_interpreter = libtbx.phil.command_line.argument_interpreter( master_phil=master_params) reflection_file = None for arg in command_line.args: command_line_params = None arg_is_processed = False if (os.path.isfile(arg)): ## is this a file name? ## Check if this is a phil file try: command_line_params = iotbx.phil.parse(file_name=arg) except KeyboardInterrupt: raise except : pass if command_line_params is not None: phil_objects.append(command_line_params) arg_is_processed = True if (not arg_is_processed): ## Check if this file is a reflection file if command_line_params is None: reflection_file = reflection_file_reader.any_reflection_file( file_name=arg, ensure_read_access=False) if (reflection_file is not None): reflection_file = arg arg_is_processed = True ## If it is not a file, it must be a phil command else: command_line_params = argument_interpreter.process(arg=arg) phil_objects.append(command_line_params) arg_is_processed = True if not arg_is_processed: print >> log, "##--------------------------------------------------------------------##" print >> log, "## Unknown phil-file or phil-command:", arg print >> log, "##--------------------------------------------------------------------##" print >> log raise Sorry("Unknown file format or phil command: %s" % arg) effective_params = master_params.fetch(sources=phil_objects) params = effective_params.extract() if reflection_file is not None: params.scaling.input.xray_data.file_name=reflection_file verbose = params.scaling.input.parameters.reporting.verbose scope = params.scaling.input.xray_data if (scope.unit_cell is None or not co.weak_symmetry): if command_line.symmetry.unit_cell() is not None: scope.unit_cell = command_line.symmetry.unit_cell() if (scope.space_group is None or not co.weak_symmetry): if command_line.symmetry.space_group_info() is not None: scope.space_group = command_line.symmetry.space_group_info() ## Check for number of residues reset_space_group = False reset_unit_cell = False if params.scaling.input.parameters.asu_contents.n_residues is None: print >> log, "##-------------------------------------------##" print >> log, "## WARNING: ##" print >> log, "## Number of residues unspecified ##" print >> log, "##-------------------------------------------##" if params.scaling.input.xray_data.file_name is None: print >> log,"##-------------------------------------------##" print >> log,"## No reflection name is defined. ##" print >> log,"##-------------------------------------------##" raise Sorry("No reflection file defined") crystal_symmetry = crystal_symmetry_from_any.extract_from( file_name=params.scaling.input.xray_data.file_name) if crystal_symmetry is None: print >> log, "Cell and symmetry not specified in reflection file" if params.scaling.input.xray_data.space_group is None: raise Sorry("""No space group info available. Use keyword 'xray_data.space_group' to specify space group""" ) if (params.scaling.input.xray_data.unit_cell is None) : raise Sorry(""" | 13a75370045bada02375005fee407a091a9f9fdf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/696/13a75370045bada02375005fee407a091a9f9fdf/xtriage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
1968,
16,
1296,
67,
529,
1546,
13819,
697,
18,
92,
16857,
410,
6,
4672,
1296,
67,
1369,
273,
261,
3482,
67,
4288,
12,
4084,
33,
3076,
67,
529,
9078,
306,
2116,
65,
5463,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
1968,
16,
1296,
67,
529,
1546,
13819,
697,
18,
92,
16857,
410,
6,
4672,
1296,
67,
1369,
273,
261,
3482,
67,
4288,
12,
4084,
33,
3076,
67,
529,
9078,
306,
2116,
65,
5463,
67... |
return generators[self.generator_index] | return generators[self.generator_id] | def get_generator_from_config(self): if self.generator_index: generators = self.get_generators() return generators[self.generator_index] else: config = ConfigParser.RawConfigParser() config.read(self.config_filepath()) return config.get('cmake', 'generator') | 2fc53db7d8cb3d5e734c94335c9edc43f1b1a9fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7412/2fc53db7d8cb3d5e734c94335c9edc43f1b1a9fd/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
8812,
67,
2080,
67,
1425,
12,
2890,
4672,
309,
365,
18,
8812,
67,
1615,
30,
13327,
273,
365,
18,
588,
67,
25959,
1435,
327,
13327,
63,
2890,
18,
8812,
67,
350,
65,
469,
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,
336,
67,
8812,
67,
2080,
67,
1425,
12,
2890,
4672,
309,
365,
18,
8812,
67,
1615,
30,
13327,
273,
365,
18,
588,
67,
25959,
1435,
327,
13327,
63,
2890,
18,
8812,
67,
350,
65,
469,
30,
... |
for (int i = 0; i < dim_zz[0]*dim_zz[1]; ++i) | for (int i = 0; i < dim_zz[0]*dim_zz[1]; ++i) | def c_code(self, node, name, (img2d, filtersflipped), (z, ), sub): if node.inputs[0].type.dtype != node.inputs[1].type.dtype: raise NotImplementedError() assert node.inputs[0].type.dtype == node.inputs[1].type.dtype d=locals() d.update(sub) | aaea1d322c657ba643c240526cb3f00d5d2d997d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/aaea1d322c657ba643c240526cb3f00d5d2d997d/conv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
67,
710,
12,
2890,
16,
756,
16,
508,
16,
261,
6081,
22,
72,
16,
3415,
12357,
1845,
3631,
261,
94,
16,
262,
16,
720,
4672,
309,
756,
18,
10029,
63,
20,
8009,
723,
18,
8972,
480... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
67,
710,
12,
2890,
16,
756,
16,
508,
16,
261,
6081,
22,
72,
16,
3415,
12357,
1845,
3631,
261,
94,
16,
262,
16,
720,
4672,
309,
756,
18,
10029,
63,
20,
8009,
723,
18,
8972,
480... |
id = self.pool.get('ir.model.data')._update(cr, uid, self._name, current_module, res, xml_id=data_id, mode=mode, noupdate=noupdate) | try: id = self.pool.get('ir.model.data')._update(cr, uid, self._name, current_module, res, xml_id=data_id, mode=mode, noupdate=noupdate) except Exception, e: import psycopg2 if isinstance(e,psycopg2.IntegrityError): msg= 'Insertion Failed!' for key in self.pool._sql_error.keys(): if key in e[0]: msg = self.pool._sql_error[key] break return (-1, res,msg,'' ) | fields_def = self.fields_get(cr, uid, context=context) | e6f4c4fb2b2f868f757719077690cf3bf15a343b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/e6f4c4fb2b2f868f757719077690cf3bf15a343b/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1466,
67,
536,
273,
365,
18,
2821,
67,
588,
12,
3353,
16,
4555,
16,
819,
33,
2472,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
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,
1466,
67,
536,
273,
365,
18,
2821,
67,
588,
12,
3353,
16,
4555,
16,
819,
33,
2472,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
url = "http://pypi.python.org/pypi/ZODB3", packages = packages, | packages = find_packages(), | def read_file(*path): base_dir = os.path.dirname(__file__) file_path = (base_dir, ) + tuple(path) return file(os.path.join(*file_path)).read() | 16d64841c93a69cae03b19fca5c30829be71f6db /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10048/16d64841c93a69cae03b19fca5c30829be71f6db/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
768,
30857,
803,
4672,
1026,
67,
1214,
273,
1140,
18,
803,
18,
12287,
12,
972,
768,
972,
13,
585,
67,
803,
273,
261,
1969,
67,
1214,
16,
262,
397,
3193,
12,
803,
13,
327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
768,
30857,
803,
4672,
1026,
67,
1214,
273,
1140,
18,
803,
18,
12287,
12,
972,
768,
972,
13,
585,
67,
803,
273,
261,
1969,
67,
1214,
16,
262,
397,
3193,
12,
803,
13,
327,
... |
'MODIFIED': date.Date(self.item.modified).format(DATES_FORMAT, sLang), | 'MODIFIED': modified.format(DATES_FORMAT, sLang), | def setParams(self): sLang = self.request.getLang() self.params = { 'ICON': self.item.__image__, 'NAME': self.item.originalName, 'LOC': self.item.originalLocation, 'MODIFIED': date.Date(self.item.modified).format(DATES_FORMAT, sLang), 'MODIFIED_BY': self.item.modifiedBy, 'CONTENTCLASS': self.item.getDeletedItem().contentclass } | 9a2f8b99a4794ca66a515bfe9ca832718bd20756 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2504/9a2f8b99a4794ca66a515bfe9ca832718bd20756/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31705,
12,
2890,
4672,
272,
7275,
273,
365,
18,
2293,
18,
588,
7275,
1435,
365,
18,
2010,
273,
288,
296,
21745,
4278,
365,
18,
1726,
16186,
2730,
972,
16,
296,
1985,
4278,
365,
18,
172... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31705,
12,
2890,
4672,
272,
7275,
273,
365,
18,
2293,
18,
588,
7275,
1435,
365,
18,
2010,
273,
288,
296,
21745,
4278,
365,
18,
1726,
16186,
2730,
972,
16,
296,
1985,
4278,
365,
18,
172... |
request = urllib2.Request(self.baseURL, body, headers) | request = urllib2.Request(self.baseURL + "?" + urllib.urlencode({'actionType': 'importExport', 'export': ' Import Configuration ', 'passwordIn': configPassword}), body, headers) | def importConfig(self, gsaConfig, configPassword): fields = [("actionType", "importExport"), ("passwordIn", configPassword), ("import", " Import Configuration ")] | 6708e57e50c6e607b1ada5f205796225a601a166 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6393/6708e57e50c6e607b1ada5f205796225a601a166/gsa_admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
809,
12,
2890,
16,
10763,
69,
809,
16,
642,
3913,
4672,
1466,
273,
306,
2932,
1128,
559,
3113,
315,
5666,
6144,
6,
3631,
7566,
3664,
382,
3113,
642,
3913,
3631,
7566,
5666,
3113,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
809,
12,
2890,
16,
10763,
69,
809,
16,
642,
3913,
4672,
1466,
273,
306,
2932,
1128,
559,
3113,
315,
5666,
6144,
6,
3631,
7566,
3664,
382,
3113,
642,
3913,
3631,
7566,
5666,
3113,
... |
self.log_event(event) | logger.log_event(event) | def wow64_breakpoint(self, event): event.continueStatus = win32.DBG_EXCEPTION_HANDLED self.log_event(event) | 6d6079c7bcc0ba519b666a5d46e251aede9525d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7261/6d6079c7bcc0ba519b666a5d46e251aede9525d0/sehtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
543,
1105,
67,
8820,
1153,
12,
2890,
16,
871,
4672,
871,
18,
17143,
1482,
273,
5657,
1578,
18,
2290,
43,
67,
12658,
67,
12346,
6687,
365,
18,
1330,
67,
2575,
12,
2575,
13,
2,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
341,
543,
1105,
67,
8820,
1153,
12,
2890,
16,
871,
4672,
871,
18,
17143,
1482,
273,
5657,
1578,
18,
2290,
43,
67,
12658,
67,
12346,
6687,
365,
18,
1330,
67,
2575,
12,
2575,
13,
2,
-1... |
runQueueRunInit = 3 runQueueRunning = 4 runQueueFailed = 6 runQueueCleanUp = 7 runQueueComplete = 8 runQueueChildProcess = 9 | runQueueSceneInit = 3 runQueueSceneRun = 4 runQueueRunInit = 5 runQueueRunning = 6 runQueueFailed = 7 runQueueCleanUp = 8 runQueueComplete = 9 runQueueChildProcess = 10 | def taskActive(self): self.active = self.active + 1 | 787c1cf81195e97dda5fdab3a0a5d8bda97f6770 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8123/787c1cf81195e97dda5fdab3a0a5d8bda97f6770/runqueue.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1562,
3896,
12,
2890,
4672,
365,
18,
3535,
273,
365,
18,
3535,
397,
404,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1562,
3896,
12,
2890,
4672,
365,
18,
3535,
273,
365,
18,
3535,
397,
404,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.ui.warn(_("applying %s\n") % patchname) | self.ui.status(_("applying %s\n") % patchname) | def _apply(self, repo, series, list=False, update_status=True, strict=False, patchdir=None, merge=None, all_files={}): '''returns (error, hash) error = 1 for unable to read, 2 for patch failed, 3 for patch fuzz''' # TODO unify with commands.py if not patchdir: patchdir = self.path err = 0 n = None for patchname in series: pushable, reason = self.pushable(patchname) if not pushable: self.explain_pushable(patchname, all_patches=True) continue self.ui.warn(_("applying %s\n") % patchname) pf = os.path.join(patchdir, patchname) | d1ee4df7c6a8e10cbc5b223fb0de0d1ccd030845 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/d1ee4df7c6a8e10cbc5b223fb0de0d1ccd030845/mq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9010,
12,
2890,
16,
3538,
16,
4166,
16,
666,
33,
8381,
16,
1089,
67,
2327,
33,
5510,
16,
5490,
33,
8381,
16,
4729,
1214,
33,
7036,
16,
2691,
33,
7036,
16,
777,
67,
2354,
12938,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9010,
12,
2890,
16,
3538,
16,
4166,
16,
666,
33,
8381,
16,
1089,
67,
2327,
33,
5510,
16,
5490,
33,
8381,
16,
4729,
1214,
33,
7036,
16,
2691,
33,
7036,
16,
777,
67,
2354,
12938,
... |
direction : {'x', 'y', 'z'} | direction: {'x', 'y', 'z'} | def truncate_along_axis(h, s, direction, centers_ic, cutoff): """Truncate h and s such along a cartesian axis. Parameters ========== h : (N, N) ndarray Hamiltonian matrix. s : (N, N) ndarray Overlap matrix. direction : {'x', 'y', 'z'} Truncate allong a cartesian axis. centers_ic : (N, 3) ndarray Centers of the basis functions. cutoff : float The (direction-axis projected) cutoff distance. """ dtype = h.dtype ni = len(centers_ic) d = 'xyz'.index(direction) pos_i = centers_ic[:, d] for i in range(ni): dpos_i = abs(pos_i - pos_i[i]) mask_i = (dpos_i < cutoff).astype(dtype) h[i, :] *= mask_i h[:, i] *= mask_i s[i, :] *= mask_i s[:, i] *= mask_i | d236dc8ff1ca61edf48f028c90c09247da820194 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1380/d236dc8ff1ca61edf48f028c90c09247da820194/siesta.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10310,
67,
287,
932,
67,
4890,
12,
76,
16,
272,
16,
4068,
16,
17723,
67,
335,
16,
13383,
4672,
3536,
25871,
366,
471,
272,
4123,
7563,
279,
24549,
2654,
18,
7012,
422,
1432,
366,
294,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10310,
67,
287,
932,
67,
4890,
12,
76,
16,
272,
16,
4068,
16,
17723,
67,
335,
16,
13383,
4672,
3536,
25871,
366,
471,
272,
4123,
7563,
279,
24549,
2654,
18,
7012,
422,
1432,
366,
294,
... |
"""Launch an application.""" foseButtons = [] def __init__(self,exePathArgs,image,tip,foseTip=None,foseArg=None): """Initialize exePathArgs (string): exePath exePathArgs (tuple): (exePath,*exeArgs)""" Link.__init__(self) self.gButton = None if isinstance(exePathArgs,tuple): self.exePath = exePathArgs[0] self.exeArgs = exePathArgs[1:] else: self.exePath = exePathArgs self.exeArgs = tuple() self.image = image self.tip = tip self.foseTip = foseTip self.foseArg = foseArg exeFose = bosh.dirs['app'].join('fose_loader.exe') def IsPresent(self): return self.exePath.exists() def GetBitmapButton(self,window,style=0): if self.IsPresent(): self.gButton = bitmapButton(window,self.image.GetBitmap(),style=style, onClick=self.Execute,tip=self.tip) if self.foseArg != None: App_Button.foseButtons.append(self) exeFose = bosh.dirs['app'].join('fose_loader.exe') if settings.get('bash.fose.on',False) and exeFose.exists(): self.gButton.SetToolTip(tooltip(self.foseTip)) return self.gButton else: return None def Execute(self,event,extraArgs=None): exeFose = bosh.dirs['app'].join('fose_loader.exe') exeArgs = self.exeArgs if self.foseArg != None and settings.get('bash.fose.on',False) and exeFose.exists(): exePath = exeFose if self.foseArg != '': exeArgs += (self.foseArg,) else: exePath = self.exePath exeArgs = (exePath.stail,)+exeArgs if extraArgs: exeArgs += extraArgs statusBar.SetStatusText(' '.join(exeArgs),1) cwd = bolt.Path.getcwd() exePath.head.setcwd() os.spawnv(os.P_NOWAIT,exePath.s,exeArgs) cwd.setcwd() | """Launch an application.""" foseButtons = [] def __init__(self,exePathArgs,image,tip,foseTip=None,foseArg=None): """Initialize exePathArgs (string): exePath exePathArgs (tuple): (exePath,*exeArgs)""" Link.__init__(self) self.gButton = None if isinstance(exePathArgs,tuple): self.exePath = exePathArgs[0] self.exeArgs = exePathArgs[1:] else: self.exePath = exePathArgs self.exeArgs = tuple() self.image = image self.tip = tip self.foseTip = foseTip self.foseArg = foseArg exeFose = bosh.dirs['app'].join('fose_loader.exe') def IsPresent(self): return self.exePath.exists() def GetBitmapButton(self,window,style=0): if self.IsPresent(): self.gButton = bitmapButton(window,self.image.GetBitmap(),style=style, onClick=self.Execute,tip=self.tip) if self.foseArg != None: App_Button.foseButtons.append(self) exeFose = bosh.dirs['app'].join('fose_loader.exe') if settings.get('bash.fose.on',False) and exeFose.exists(): self.gButton.SetToolTip(tooltip(self.foseTip)) return self.gButton else: return None def Execute(self,event,extraArgs=None): exeFose = bosh.dirs['app'].join('fose_loader.exe') exeArgs = self.exeArgs if self.foseArg != None and settings.get('bash.fose.on',False) and exeFose.exists(): exePath = exeFose if self.foseArg != '': exeArgs += (self.foseArg,) else: exePath = self.exePath exeArgs = (exePath.stail,)+exeArgs if extraArgs: exeArgs += extraArgs statusBar.SetStatusText(' '.join(exeArgs),1) cwd = bolt.Path.getcwd() exePath.head.setcwd() os.spawnv(os.P_NOWAIT,exePath.s,exeArgs) cwd.setcwd() | def Execute(self,event): itemId = self.data[0] masterInfo = self.window.data[itemId] masterName = masterInfo.name newName = GPath(re.sub('[mM]$','p','XX'+masterName.s)) #--Save Name masterInfo.setName(newName) self.window.ReList() self.window.PopulateItems() | 3ac43907fa076fea1e8d682219e2b28fc7419f7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/3ac43907fa076fea1e8d682219e2b28fc7419f7b/basher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7903,
12,
2890,
16,
2575,
4672,
18424,
273,
365,
18,
892,
63,
20,
65,
4171,
966,
273,
365,
18,
5668,
18,
892,
63,
1726,
548,
65,
4171,
461,
273,
4171,
966,
18,
529,
13253,
273,
611,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7903,
12,
2890,
16,
2575,
4672,
18424,
273,
365,
18,
892,
63,
20,
65,
4171,
966,
273,
365,
18,
5668,
18,
892,
63,
1726,
548,
65,
4171,
461,
273,
4171,
966,
18,
529,
13253,
273,
611,
... |
Gives the images the page shows, as a list of Page objects. | Gives the images the page shows, as a list of ImagePage objects. | def imagelinks(self, followRedirects = False, loose = False): """ Gives the images the page shows, as a list of Page objects. This includes images in galleries. If loose is set to true, this will find anything that looks like it could be an image. This is useful for finding, say, images that are passed as parameters to templates. """ results = [] # Find normal images for page in self.linkedPages(): if page.isImage(): results.append(page) # Find images in galleries pageText = self.get() galleryR = re.compile('<gallery>.*?</gallery>', re.DOTALL) galleryEntryR = re.compile('(?P<title>(%s|%s):.+?)(\|.+)?\n' % (self.site().image_namespace(), self.site().family.image_namespace(code = '_default'))) for gallery in galleryR.findall(pageText): for match in galleryEntryR.finditer(gallery): page = ImagePage(self.site(), match.group('title')) results.append(page) if loose: ns = getSite().image_namespace() imageR = re.compile('\w\w\w+\.(?:gif|png|jpg|jpeg|svg)', re.IGNORECASE) for imageName in imageR.findall(pageText): results.append(ImagePage(self.site(), ns + ':' + imageName)) return set(results) | 4533a666d4a7cc618f4769355db41503436a4951 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/4533a666d4a7cc618f4769355db41503436a4951/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8902,
27269,
87,
12,
2890,
16,
2805,
21978,
273,
1083,
16,
28393,
273,
1083,
4672,
3536,
611,
3606,
326,
4602,
326,
1363,
17975,
16,
487,
279,
666,
434,
3421,
1964,
2184,
18,
1220,
6104,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8902,
27269,
87,
12,
2890,
16,
2805,
21978,
273,
1083,
16,
28393,
273,
1083,
4672,
3536,
611,
3606,
326,
4602,
326,
1363,
17975,
16,
487,
279,
666,
434,
3421,
1964,
2184,
18,
1220,
6104,... |
print 'Garbage collecting %r' % self | def __del__(self): print 'Garbage collecting %r' % self self.stderr = self.tempTables = None try: self.dbh.close() except: pass self.dbh = self.database = None self.closed = True | aed605c8138b6549463d0064429311607ccf2b63 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8747/aed605c8138b6549463d0064429311607ccf2b63/base_drv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
12,
2890,
4672,
365,
18,
11241,
273,
365,
18,
5814,
6905,
273,
599,
775,
30,
365,
18,
1966,
76,
18,
4412,
1435,
1335,
30,
1342,
365,
18,
1966,
76,
273,
365,
18,
6231... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
12,
2890,
4672,
365,
18,
11241,
273,
365,
18,
5814,
6905,
273,
599,
775,
30,
365,
18,
1966,
76,
18,
4412,
1435,
1335,
30,
1342,
365,
18,
1966,
76,
273,
365,
18,
6231... | |
'text:style-name': self.rststyle(style_name), | def make_field_element(self, parent, text, style_name, automatic_styles): if text == 'p': el1 = SubElement(parent, 'text:page-number', attrib={ 'text:style-name': self.rststyle(style_name), 'text:select-page': 'current', }) elif text == 'P': el1 = SubElement(parent, 'text:page-count', attrib={ 'text:style-name': self.rststyle(style_name), }) elif text == 't1': self.style_index += 1 el1 = SubElement(parent, 'text:time', attrib={ 'text:style-name': self.rststyle(style_name), 'text:fixed': 'true', 'style:data-style-name': 'rst-time-style-%d' % self.style_index, }) el2 = SubElement(automatic_styles, 'number:time-style', attrib={ 'style:name': 'rst-time-style-%d' % self.style_index, 'xmlns:number': SNSD['number'], 'xmlns:style': SNSD['style'], }) el3 = SubElement(el2, 'number:hours', attrib={ 'number:style': 'long', }) el3 = SubElement(el2, 'number:text') el3.text = ':' el3 = SubElement(el2, 'number:minutes', attrib={ 'number:style': 'long', }) elif text == 't2': self.style_index += 1 el1 = SubElement(parent, 'text:time', attrib={ 'text:style-name': self.rststyle(style_name), 'text:fixed': 'true', 'style:data-style-name': 'rst-time-style-%d' % self.style_index, }) el2 = SubElement(automatic_styles, 'number:time-style', attrib={ 'style:name': 'rst-time-style-%d' % self.style_index, 'xmlns:number': SNSD['number'], 'xmlns:style': SNSD['style'], }) el3 = SubElement(el2, 'number:hours', attrib={ 'number:style': 'long', }) el3 = SubElement(el2, 'number:text') el3.text = ':' el3 = SubElement(el2, 'number:minutes', attrib={ 'number:style': 'long', }) el3 = SubElement(el2, 'number:text') el3.text = ':' el3 = SubElement(el2, 'number:seconds', attrib={ 'number:style': 'long', }) elif text == 't3': self.style_index += 1 el1 = SubElement(parent, 'text:time', attrib={ 'text:style-name': self.rststyle(style_name), 'text:fixed': 'true', 'style:data-style-name': 'rst-time-style-%d' % self.style_index, }) el2 = SubElement(automatic_styles, 'number:time-style', attrib={ 'style:name': 'rst-time-style-%d' % self.style_index, 'xmlns:number': SNSD['number'], 'xmlns:style': SNSD['style'], }) el3 = SubElement(el2, 'number:hours', attrib={ 'number:style': 'long', }) el3 = SubElement(el2, 'number:text') el3.text = ':' el3 = SubElement(el2, 'number:minutes', attrib={ 'number:style': 'long', }) el3 = SubElement(el2, 'number:text') el3.text = ' ' el3 = SubElement(el2, 'number:am-pm') elif text == 't4': self.style_index += 1 el1 = SubElement(parent, 'text:time', attrib={ 'text:style-name': self.rststyle(style_name), 'text:fixed': 'true', 'style:data-style-name': 'rst-time-style-%d' % self.style_index, }) el2 = SubElement(automatic_styles, 'number:time-style', attrib={ 'style:name': 'rst-time-style-%d' % self.style_index, 'xmlns:number': SNSD['number'], 'xmlns:style': SNSD['style'], }) el3 = SubElement(el2, 'number:hours', attrib={ 'number:style': 'long', }) el3 = SubElement(el2, 'number:text') el3.text = ':' el3 = SubElement(el2, 'number:minutes', attrib={ 'number:style': 'long', }) el3 = SubElement(el2, 'number:text') el3.text = ':' el3 = SubElement(el2, 'number:seconds', attrib={ 'number:style': 'long', }) el3 = SubElement(el2, 'number:text') el3.text = ' ' el3 = SubElement(el2, 'number:am-pm') elif text == 'd1': self.style_index += 1 el1 = SubElement(parent, 'text:date', attrib={ 'text:style-name': self.rststyle(style_name), 'style:data-style-name': 'rst-date-style-%d' % self.style_index, }) el2 = SubElement(automatic_styles, 'number:date-style', attrib={ 'style:name': 'rst-date-style-%d' % self.style_index, 'number:automatic-order': 'true', 'xmlns:number': SNSD['number'], 'xmlns:style': SNSD['style'], }) el3 = SubElement(el2, 'number:month', attrib={ 'number:style': 'long', }) el3 = SubElement(el2, 'number:text') el3.text = '/' el3 = SubElement(el2, 'number:day', attrib={ 'number:style': 'long', }) el3 = SubElement(el2, 'number:text') el3.text = '/' el3 = SubElement(el2, 'number:year') elif text == 'd2': self.style_index += 1 el1 = SubElement(parent, 'text:date', attrib={ 'text:style-name': self.rststyle(style_name), 'style:data-style-name': 'rst-date-style-%d' % self.style_index, }) el2 = SubElement(automatic_styles, 'number:date-style', attrib={ 'style:name': 'rst-date-style-%d' % self.style_index, 'number:automatic-order': 'true', 'xmlns:number': SNSD['number'], 'xmlns:style': SNSD['style'], }) el3 = SubElement(el2, 'number:month', attrib={ 'number:style': 'long', }) el3 = SubElement(el2, 'number:text') el3.text = '/' el3 = SubElement(el2, 'number:day', attrib={ 'number:style': 'long', }) el3 = SubElement(el2, 'number:text') el3.text = '/' el3 = SubElement(el2, 'number:year', attrib={ 'number:style': 'long', }) elif text == 'd3': self.style_index += 1 el1 = SubElement(parent, 'text:date', attrib={ 'text:style-name': self.rststyle(style_name), 'style:data-style-name': 'rst-date-style-%d' % self.style_index, }) el2 = SubElement(automatic_styles, 'number:date-style', attrib={ 'style:name': 'rst-date-style-%d' % self.style_index, 'number:automatic-order': 'true', 'xmlns:number': SNSD['number'], 'xmlns:style': SNSD['style'], }) el3 = SubElement(el2, 'number:month', attrib={ 'number:textual': 'true', }) el3 = SubElement(el2, 'number:text') el3.text = ' ' el3 = SubElement(el2, 'number:day', attrib={ }) el3 = SubElement(el2, 'number:text') el3.text = ', ' el3 = SubElement(el2, 'number:year', attrib={ 'number:style': 'long', }) elif text == 'd4': self.style_index += 1 el1 = SubElement(parent, 'text:date', attrib={ 'text:style-name': self.rststyle(style_name), 'style:data-style-name': 'rst-date-style-%d' % self.style_index, }) el2 = SubElement(automatic_styles, 'number:date-style', attrib={ 'style:name': 'rst-date-style-%d' % self.style_index, 'number:automatic-order': 'true', 'xmlns:number': SNSD['number'], 'xmlns:style': SNSD['style'], }) el3 = SubElement(el2, 'number:month', attrib={ 'number:textual': 'true', 'number:style': 'long', }) el3 = SubElement(el2, 'number:text') el3.text = ' ' el3 = SubElement(el2, 'number:day', attrib={ }) el3 = SubElement(el2, 'number:text') el3.text = ', ' el3 = SubElement(el2, 'number:year', attrib={ 'number:style': 'long', }) elif text == 'd5': self.style_index += 1 el1 = SubElement(parent, 'text:date', attrib={ 'text:style-name': self.rststyle(style_name), 'style:data-style-name': 'rst-date-style-%d' % self.style_index, }) el2 = SubElement(automatic_styles, 'number:date-style', attrib={ 'style:name': 'rst-date-style-%d' % self.style_index, 'xmlns:number': SNSD['number'], 'xmlns:style': SNSD['style'], }) el3 = SubElement(el2, 'number:year', attrib={ 'number:style': 'long', }) el3 = SubElement(el2, 'number:text') el3.text = '-' el3 = SubElement(el2, 'number:month', attrib={ 'number:style': 'long', }) el3 = SubElement(el2, 'number:text') el3.text = '-' el3 = SubElement(el2, 'number:day', attrib={ 'number:style': 'long', }) elif text == 's': el1 = SubElement(parent, 'text:subject', attrib={ 'text:style-name': self.rststyle(style_name), }) elif text == 't': el1 = SubElement(parent, 'text:title', attrib={ 'text:style-name': self.rststyle(style_name), }) elif text == 'a': el1 = SubElement(parent, 'text:author-name', attrib={ 'text:fixed': 'false', }) else: el1 = None return el1 | 8028253043bbb345d2ed582302a80f5c5aee5de2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1278/8028253043bbb345d2ed582302a80f5c5aee5de2/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
1518,
67,
2956,
12,
2890,
16,
982,
16,
977,
16,
2154,
67,
529,
16,
5859,
67,
10218,
4672,
309,
977,
422,
296,
84,
4278,
415,
21,
273,
5479,
12,
2938,
16,
296,
955,
30,
24... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1518,
67,
2956,
12,
2890,
16,
982,
16,
977,
16,
2154,
67,
529,
16,
5859,
67,
10218,
4672,
309,
977,
422,
296,
84,
4278,
415,
21,
273,
5479,
12,
2938,
16,
296,
955,
30,
24... | |
if self.debug > 0: print 'getting ', key | log.debug('getting key: %s' % key) | def update_input_parameters(self): '''read in all the input parameters from the netcdfile''' for key in self.valid_input: getf = 'self.get_%s()' % key if self.debug > 0: print 'getting ', key self.pars[key] = eval(getf) self.pars_uptodate[key] = True return self.pars | e111e7f7da49e775bf6f578ffb8369e435e7a68c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5735/e111e7f7da49e775bf6f578ffb8369e435e7a68c/jacapo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
2630,
67,
3977,
12,
2890,
4672,
9163,
896,
316,
777,
326,
810,
1472,
628,
326,
2901,
4315,
768,
26418,
364,
498,
316,
365,
18,
877,
67,
2630,
30,
336,
74,
273,
296,
2890,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
2630,
67,
3977,
12,
2890,
4672,
9163,
896,
316,
777,
326,
810,
1472,
628,
326,
2901,
4315,
768,
26418,
364,
498,
316,
365,
18,
877,
67,
2630,
30,
336,
74,
273,
296,
2890,
1... |
break else: if not create_new: raise KeyError, table_names id = coincdeftable.sync_ids().next() for name in table_names: row = lsctables.CoincDef() row.coinc_def_id = id row.table_name = name coincdeftable.append(row) | return id if not create_new: raise KeyError, table_names id = coincdeftable.sync_ids().next() for name in table_names: row = lsctables.CoincDef() row.coinc_def_id = id row.table_name = name coincdeftable.append(row) | def get_coinc_def_id(xmldoc, table_names, create_new = True): """ Return the coinc_def_id corresponding to coincidences consisting exclusively of events from the given table names. If no matching coinc_def_id is found, then a new one is created and the ID returned. If the document does not contain a coinc_definer table, then one is added, a new coind_def_id created, and the ID returned. If, however, create_new is False, and for any reason the ID isn't found then KeyError is raised. """ try: coincdeftable = table.get_table(xmldoc, lsctables.CoincDefTable.tableName) except ValueError: # table not found if not create_new: raise KeyError, table_names coincdeftable = lsctables.New(lsctables.CoincDefTable) xmldoc.childNodes[0].appendChild(coincdeftable) table_names.sort() for id in coincdeftable.dict.iterkeys(): if coincdeftable.get_contributors(id) == table_names: break else: # contributor list not found in table if not create_new: raise KeyError, table_names id = coincdeftable.sync_ids().next() for name in table_names: row = lsctables.CoincDef() row.coinc_def_id = id row.table_name = name coincdeftable.append(row) return id | 746dc24fef0e7b9b0196c6c520b606157fa47211 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3592/746dc24fef0e7b9b0196c6c520b606157fa47211/llwapp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
12645,
71,
67,
536,
67,
350,
12,
2902,
2434,
16,
1014,
67,
1973,
16,
752,
67,
2704,
273,
1053,
4672,
3536,
2000,
326,
13170,
71,
67,
536,
67,
350,
4656,
358,
13170,
13478,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
12645,
71,
67,
536,
67,
350,
12,
2902,
2434,
16,
1014,
67,
1973,
16,
752,
67,
2704,
273,
1053,
4672,
3536,
2000,
326,
13170,
71,
67,
536,
67,
350,
4656,
358,
13170,
13478,
2... |
merge_base = self._Run(['merge-base', 'HEAD', 'origin']) | merge_base = self._Capture(['merge-base', 'HEAD', 'origin']) | def pack(self, options, args, file_list): """Generates a patch file which can be applied to the root of the repository. | 9ee5d919647ed29a24b35149e866c885fd04b9bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/9ee5d919647ed29a24b35149e866c885fd04b9bd/gclient_scm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2298,
12,
2890,
16,
702,
16,
833,
16,
585,
67,
1098,
4672,
3536,
6653,
279,
4729,
585,
1492,
848,
506,
6754,
358,
326,
1365,
434,
326,
3352,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2298,
12,
2890,
16,
702,
16,
833,
16,
585,
67,
1098,
4672,
3536,
6653,
279,
4729,
585,
1492,
848,
506,
6754,
358,
326,
1365,
434,
326,
3352,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
tar.add(file) | tar.add(file, arcname=prefix) | def tarzip_image(self, prefix, file, path): print 'Tarring image' tar_file = '%s.tar.gz' % (path + '/' + prefix) tar = tarfile.open(tar_file, "w|gz") tar.add(file) tar.close() return tar_file | 4626c80707c4f952d795b45391f8bc8f8ed7bdc1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12707/4626c80707c4f952d795b45391f8bc8f8ed7bdc1/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8232,
4450,
67,
2730,
12,
2890,
16,
1633,
16,
585,
16,
589,
4672,
1172,
296,
56,
5399,
310,
1316,
11,
8232,
67,
768,
273,
1995,
87,
18,
11718,
18,
9764,
11,
738,
261,
803,
397,
2023,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8232,
4450,
67,
2730,
12,
2890,
16,
1633,
16,
585,
16,
589,
4672,
1172,
296,
56,
5399,
310,
1316,
11,
8232,
67,
768,
273,
1995,
87,
18,
11718,
18,
9764,
11,
738,
261,
803,
397,
2023,... |
shortopts = 'c:fh:n:o:pt:u:Vvq?:' | shortopts = 'c:fh:n:o:t:u:Vvq?:' | def _parse_args(): """ Process the command line arguments; return a dictionary containing the relevant info. @return: A dictionary mapping from configuration parameters to values. If a parameter is specified on the command line, then that value is used; otherwise, a default value is used. Currently, the following configuration parameters are set: C{target}, C{modules}, C{verbosity}, C{prj_name}, C{output}, C{show_imports}, C{frames}, C{private}, C{debug}, C{top}, C{list_classes_separately}, C{docformat}, C{inheritance}, C{autogen_vars}, and C{test}. @rtype: C{None} """ # Default values. options = {'target':None, 'modules':[], 'verbosity':1, 'prj_name':'', 'action':'html', 'show_imports':0, 'frames':1, 'private':None, 'list_classes_separately': 0, 'debug':0, 'docformat':None, 'top':None, 'inheritance': 'grouped', 'autogen_vars': 1, 'tests':{}} # Get the command-line arguments, using getopts. shortopts = 'c:fh:n:o:pt:u:Vvq?:' longopts = ('check frames help= usage= helpfile= help-file= '+ 'help_file= output= target= url= version verbose ' + 'private-css= private_css= quiet show-imports '+ 'show_imports css= no_private no-private name= '+ 'builtins no-frames no_frames noframes debug '+ 'docformat= doc-format= doc_format= top= navlink= '+ 'nav_link= nav-link= latex html dvi ps pdf '+ 'separate-classes separate_classes '+ 'inheritance= inheritence= '+ 'test= tests= checks= private'+ 'no-autogen-vars no_autogen_vars').split() try: (opts, modules) = getopt.getopt(sys.argv[1:], shortopts, longopts) except getopt.GetoptError, e: if e.opt in ('h', '?', 'help', 'usage'): _usage(0) print >>sys.stderr, ('%s; run "%s -h" for usage' % (e,os.path.basename(sys.argv[0]))) sys.exit(1) # Parse the arguments. for (opt, val) in opts: if opt in ('--check',): options['action'] = 'check' elif opt in ('--css', '-c'): options['css'] = val elif opt in ('--debug',): options['debug']=1 elif opt in ('--dvi',): options['action'] = 'dvi' elif opt in ('--docformat', '--doc-format', '--doc_format'): from epydoc.objdoc import set_default_docformat set_default_docformat(val) elif opt in ('--frames', '-f'): print ('Warning: the "--frames" argument is depreciated; '+ 'frames are now\n generated by default.') elif opt in ('--no-frames', '--no_frames', '--noframes'): options['frames'] = 0 elif opt in ('--help', '-?', '--usage', '-h'): _help(val) elif opt in ('--helpfile', '--help-file', '--help_file'): options['help'] = val elif opt in ('--html',): options['action'] = 'html' elif opt in ('--inheritance', '--inheritence'): options['inheritance']=val.lower() elif opt in ('--latex',): options['action']='latex' elif opt in ('--name', '-n'): options['prj_name']=val elif opt in ('--navlink', '--nav-link', '--nav_link'): options['prj_link'] = val elif opt in ('--no-autogen-vars', '--no_autogen_vars'): options['autogen_vars'] = 0 elif opt in ('--no-private', '--no_private'): options['private']=0 elif opt in ('--output', '--target', '-o'): options['target']=val elif opt in ('--pdf',): options['action'] = 'pdf' elif opt in ('-p', '--private', '--private'): options['private']=1 elif opt in ('--private-css', '--private_css'): options['private_css'] = val elif opt in ('--ps',): options['action'] = 'ps' elif opt in ('--quiet', '-q'): options['verbosity'] -= 1 elif opt in ('--separate-classes', '--separate_classes'): options['list_classes_separately'] = 1 elif opt in ('--show-imports', '--show_imports'): options['show_imports'] = 1 elif opt in ('-t', '--top'): options['top'] = val elif opt in ('--url', '-u'): options['prj_url']=val elif opt in ('--verbose', '-v'): options['verbosity'] += 1 elif opt in ('--version', '-V'): _version() elif opt in ('--builtins',): modules += sys.builtin_module_names modules.remove('__main__') elif opt in ('--test', '--tests', '--checks'): for test in re.split('\s*[,\s]\s*', val.lower()): options['tests'][test] = 1 else: _usage() # Make sure inheritance has a valid value if options['inheritance'] not in ('grouped', 'listed', 'included'): estr = 'Bad inheritance style. Valid options are ' estr += 'grouped, listed, included' print >>sys.stderr, ('%s;\nrun "%s -h" for usage.' % (estr,os.path.basename(sys.argv[0]))) sys.exit(1) # Make sure tests has a valid value. for test in options['tests']: if test not in TESTS: estr = 'Bad epydoc test %r. Valid options are:' % test for t in TESTS: estr += '\n - %r' % t print >>sys.stderr, ('%s\nrun "%s -h" for usage.' % (estr,os.path.basename(sys.argv[0]))) sys.exit(1) # Pick a default target directory, if none was specified. if options['target'] is None: if options['action'] == 'html': options['target'] = 'html' elif options['action'] in ('latex', 'dvi', 'ps', 'pdf'): options['target'] = 'latex' # Default for private depends on action. if options['private'] is None: if options['action'] == 'html': options['private'] = 1 else: options['private'] = 0 # Check that the options all preceed the filenames. for m in modules: if m == '-': break elif m[0:1] == '-': estr = 'options must preceed modules' print >>sys.stderr, ('%s; run "%s -h" for usage.' % (estr,os.path.basename(sys.argv[0]))) sys.exit(1) # Make sure we got some modules. modules = [m for m in modules if m != '-'] if len(modules) == 0: print >>sys.stderr, ('no modules specified; run "%s -h" for usage.' % os.path.basename(sys.argv[0])) sys.exit(1) options['modules'] = modules return options | 55668059b93c1d811a0940669739c36e1bda8a13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/55668059b93c1d811a0940669739c36e1bda8a13/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
1968,
13332,
3536,
4389,
326,
1296,
980,
1775,
31,
327,
279,
3880,
4191,
326,
9368,
1123,
18,
225,
632,
2463,
30,
432,
3880,
2874,
628,
1664,
1472,
358,
924,
18,
225,
97... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
1968,
13332,
3536,
4389,
326,
1296,
980,
1775,
31,
327,
279,
3880,
4191,
326,
9368,
1123,
18,
225,
632,
2463,
30,
432,
3880,
2874,
628,
1664,
1472,
358,
924,
18,
225,
97... |
elif axisname=='y' and not dat.get('tight',True): | elif axisname=='y': | def update(self): """Update the figure. Everything happens here. The current set of customized properties is interpreted, data slice are obtained from the data sources, default figure properties are set based on properties of the obtained data, and the figure is built and shown. """ # We are called whenever figure properties change. If we do not want to update now, # just register that an update is needed and exit. if not self.updating: self.dirty = True return | 5225d332b35d0704078cf3882da381a95f7ad9ad /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/381/5225d332b35d0704078cf3882da381a95f7ad9ad/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
4672,
3536,
1891,
326,
7837,
18,
225,
26553,
10555,
2674,
18,
1021,
783,
444,
434,
29063,
1790,
353,
19898,
16,
501,
2788,
854,
12700,
628,
326,
501,
5550,
16,
805,
7837,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
4672,
3536,
1891,
326,
7837,
18,
225,
26553,
10555,
2674,
18,
1021,
783,
444,
434,
29063,
1790,
353,
19898,
16,
501,
2788,
854,
12700,
628,
326,
501,
5550,
16,
805,
7837,... |
elif re.match(r'[a-zA-Z\])]', code[start-1]): | elif re.match(r'[a-zA-Z0-9_\])]', code[start-1]): | def extract_numeric_literals(code): """ To eliminate the re-parsing and creation of numeric literals (e.g. during every iteration of a loop) we wish to pull them out and assign them to global variables. This function takes a block of code and returns a new block of code with literals replaced by variable names, as well as a dictionary of what variables need to be created. EXAMPLES: sage: from sage.misc.preparser import extract_numeric_literals sage: code, nums = extract_numeric_literals("1.2 + 5") sage: print code _sage_const_1p2 + _sage_const_5 sage: print nums {'_sage_const_1p2': "RealNumber('1.2')", '_sage_const_5': 'Integer(5)'} sage: extract_numeric_literals("[1, 1.1, 1e1, -1e-1, 1.]")[0] '[_sage_const_1 , _sage_const_1p1 , _sage_const_1e1 , -_sage_const_1en1 , _sage_const_1p ]' sage: extract_numeric_literals("[1.sqrt(), 1.2.sqrt(), 1r, 1.2r, R.1, (1..5)]")[0] '[_sage_const_1 .sqrt(), _sage_const_1p2 .sqrt(), 1r, 1.2r, R.1, (_sage_const_1 .._sage_const_5 )]' """ literals = {} last = 0 new_code = [] dec_num = r"\b\d+\b" hex_num = r"\b0x[0-9a-fA-F]\b" # This is slightly annoying as floating point numbers may start # with a decimal point, but if they do the \b will not match. float_num = r"((\b\d+([.]\d*)?)|([.]\d+))([eE][-+]?\d+)?\b" all_num = r"(%s)|(%s)|(%s)" % (float_num, dec_num, hex_num) for m in re.finditer(all_num, code): num, start, end = m.group(), m.start(), m.end() # The Sage preparser does extra things with numbers, which we need to handle here. if '.' in num: if start > 0 and num[0] == '.': if code[start-1] == '.': # handle Ellipsis start += 1 num = num[1:] elif re.match(r'[a-zA-Z\])]', code[start-1]): # handle R.0 continue elif end < len(code) and num[-1] == '.': if re.match('[a-zA-Z]', code[end]): # handle 4.sqrt() end -= 1 num = num[:-1] elif re.match(r'\d', code[end]): # handle 4.0r continue elif end < len(code) and code[end] == '.': # \b does not match after the . # two dots in a row would be an ellipsis if end+1 == len(code) or code[end+1] != '.': end += 1 num += '.' if '.' in num or 'e' in num or 'E' in num: num_name = numeric_literal_prefix + num.replace('.', 'p').replace('-', 'n').replace('+', '') num_make = "RealNumber('%s')" % num else: num_name = numeric_literal_prefix + num num_make = "Integer(%s)" % num literals[num_name] = num_make new_code.append(code[last:start]) new_code.append(num_name+' ') last = end new_code.append(code[last:]) return ''.join(new_code), literals | 2ad14cdfab4d14103fa42cfdf8aa85a475090d79 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/2ad14cdfab4d14103fa42cfdf8aa85a475090d79/preparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
5246,
67,
80,
11235,
12,
710,
4672,
3536,
2974,
29529,
326,
283,
17,
24979,
471,
6710,
434,
6389,
18228,
261,
73,
18,
75,
18,
4982,
3614,
6532,
434,
279,
2798,
13,
732,
14302... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
5246,
67,
80,
11235,
12,
710,
4672,
3536,
2974,
29529,
326,
283,
17,
24979,
471,
6710,
434,
6389,
18228,
261,
73,
18,
75,
18,
4982,
3614,
6532,
434,
279,
2798,
13,
732,
14302... |
def __show_context_menu(self): | def __show_context_menu(self, button=None, activate_time=None): | def __show_context_menu(self): if self.app.blocked == False: # show context menu self.get_widget('status_menu').popup(None, None, None, button, activate_time) else: # when blocked, don't show context menu but a notification self.popup("OTR-Verwaltung arbeitet gerade...", self.app.get_notify_text(), 3) | 67ae3691eb4b368f280e474a6e85459e42379973 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11048/67ae3691eb4b368f280e474a6e85459e42379973/notify.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4500,
67,
2472,
67,
5414,
12,
2890,
16,
3568,
33,
7036,
16,
10235,
67,
957,
33,
7036,
4672,
309,
365,
18,
2910,
18,
23156,
422,
1083,
30,
468,
2405,
819,
3824,
365,
18,
588,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4500,
67,
2472,
67,
5414,
12,
2890,
16,
3568,
33,
7036,
16,
10235,
67,
957,
33,
7036,
4672,
309,
365,
18,
2910,
18,
23156,
422,
1083,
30,
468,
2405,
819,
3824,
365,
18,
588,
67... |
py = py - textHeight - textGap | py = py - textHeight | def makeSplitViewFigure(session, pixelIds, zStart, zEnd, splitIndexes, channelNames, colourChannels, mergedIndexes, mergedColours, mergedNames, width, height, imageLabels = None, algorithm = None, stepping = 1, scalebar=None, overlayColour=(255,255,255)): """ This method makes a figure of a number of images, arranged in rows with each row being the split-view of a single image. The channels are arranged left to right, with the combined image added on the right. The combined image is rendered according to current settings on the server, but it's channels will be turned on/off according to @mergedIndexes. The colour of each channel turned white if colourChannels is false or the channel is not in the merged image. Otherwise channel is changed to mergedColours[i] Text is added at the top of the figure, to display channel names above each column, and the combined image may have it's various channels named in coloured text. The optional imageLabels is a list of string lists for naming the images at the left of the figure (Each image may have 0 or multiple labels). The figure is returned as a PIL 'Image' @ session session for server access @ pixelIds a list of the Ids for the pixels we want to display @ zStart the start of Z-range for projection @ zEnd the end of Z-range for projection @ splitIndexes a list of the channel indexes to display. Same channels for each image/row @ channelNames map of index:name to go above the columns for each split channel @ colourChannels true if split channels are @ mergedIndexes list (or set) of channels in the merged image @ mergedColours index: colour map of channels in the merged image @ mergedNames if true, label with merged panel with channel names (otherwise, label "Merged") @ width the width of primary image (all images zoomed to this height) @ height the height of primary image @ imageLabels optional list of string lists. @ algorithm for projection MAXIMUMINTENSITY or MEANINTENSITY @ stepping projection increment """ fontsize = 12 if width > 500: fontsize = 48 elif width > 400: fontsize = 36 elif width > 300: fontsize = 24 elif width > 200: fontsize = 16 spacer = (width/25) + 2 textGap = 5 # gap between text and image panels leftTextWidth = 0 textHeight = 0 # get the rendered splitview, with images surrounded on all sides by spacer sv = getSplitView(session, pixelIds, zStart, zEnd, splitIndexes, channelNames, colourChannels, mergedIndexes, mergedColours, width, height, spacer, algorithm, stepping, scalebar, overlayColour) font = imgUtil.getFont(fontsize) mode = "RGB" white = (255, 255, 255) textHeight = font.getsize("Textq")[1] topSpacer = spacer + textHeight + textGap #textCanvas = Image.new(mode, (1,1), white) #textdraw = ImageDraw.Draw(textCanvas) #h = textdraw.textsize("Textq", font=font) [1] # if adding text to the left, write the text on horizontal canvas, then rotate to vertical (below) if imageLabels: # find max number of labels maxCount = 0 rowHeights = [] for row in imageLabels: maxCount = max(maxCount, len(row)) leftTextWidth = (textHeight + textGap) * maxCount size = (sv.size[1], leftTextWidth) # make the canvas as wide as the panels height textCanvas = Image.new(mode, size, white) textdraw = ImageDraw.Draw(textCanvas) px = spacer imageLabels.reverse() for row in imageLabels: py = leftTextWidth - textGap # start at bottom for l, label in enumerate(row): py = py - textHeight # find the top of this row w = textdraw.textsize(label, font=font) [0] inset = int((height - w) / 2) textdraw.text((px+inset, py), label, font=font, fill=(0,0,0)) py = py - textGap # add space between rows px = px + spacer + height # spacer between each row topTextHeight = textHeight + textGap if (mergedNames): topTextHeight = ((textHeight + textGap) * len(mergedIndexes)) # make a canvas big-enough to add text to the images. canvasWidth = leftTextWidth + sv.size[0] canvasHeight = topTextHeight + sv.size[1] size = (canvasWidth, canvasHeight) canvas = Image.new(mode, size, white) # create a canvas of appropriate width, height # add the split-view panel pasteX = leftTextWidth pasteY = topTextHeight imgUtil.pasteImage(sv, canvas, pasteX, pasteY) draw = ImageDraw.Draw(canvas) # add text to rows # want it to be vertical. Rotate and paste the text canvas from above if imageLabels: textV = textCanvas.rotate(90) imgUtil.pasteImage(textV, canvas, spacer, topTextHeight) # add text to columns px = spacer + leftTextWidth py = topTextHeight + spacer - (textHeight + textGap) # edges of panels - rowHeight for index in splitIndexes: # calculate the position of the text, centered above the image w = font.getsize(channelNames[index]) [0] inset = int((width - w) / 2) # text is coloured if channel is grey AND in the merged image rgb = (0,0,0) if index in mergedIndexes: if not colourChannels: rgb = tuple(mergedColours[index]) if rgb == (255,255,255): # if white (unreadable), needs to be black! rgb = (0,0,0) draw.text((px+inset, py), channelNames[index], font=font, fill=rgb) px = px + width + spacer # add text for combined image if (mergedNames): for index in mergedIndexes: rgb = tuple(mergedColours[index]) name = channelNames[index] combTextWidth = font.getsize(name)[0] inset = int((width - combTextWidth) / 2) draw.text((px + inset, py), name, font=font, fill=rgb) py = py - textHeight - textGap else: combTextWidth = font.getsize("Merged")[0] inset = int((width - combTextWidth) / 2) px = px + inset draw.text((px, py), "Merged", font=font, fill=(0,0,0)) return canvas | 534d67c39c43fe52be30a75f3ce5a83b11ea6ade /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/534d67c39c43fe52be30a75f3ce5a83b11ea6ade/splitViewFigure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
5521,
1767,
42,
15906,
12,
3184,
16,
4957,
2673,
16,
998,
1685,
16,
998,
1638,
16,
1416,
8639,
16,
1904,
1557,
16,
15046,
10585,
16,
5384,
8639,
16,
5384,
914,
4390,
16,
5384,
15... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5521,
1767,
42,
15906,
12,
3184,
16,
4957,
2673,
16,
998,
1685,
16,
998,
1638,
16,
1416,
8639,
16,
1904,
1557,
16,
15046,
10585,
16,
5384,
8639,
16,
5384,
914,
4390,
16,
5384,
15... |
table.StripTableName(CoincDefTable.tableName): CoincDefTable, table.StripTableName(CoincTable.tableName): CoincTable, table.StripTableName(CoincMapTable.tableName): CoincMapTable, table.StripTableName(MultiBurstTable.tableName): MultiBurstTable | table.StripTableName(CoincDefTable.tableName): CoincDefTable | def build_indexes(verbose = False): """ Using the how_to_index annotations in the table class definitions, construct a set of indexes for the database at the current connection. """ cursor = DBTable_get_connection().cursor() for table_name in DBTable_table_names(): try: # FIXME: figure out how to do this extensibly how_to_index = TableByName[table_name].how_to_index except KeyError: continue if how_to_index: if verbose: print >>sys.stderr, "indexing %s table ..." % table_name for index_name, cols in how_to_index.iteritems(): cursor.execute("CREATE INDEX IF NOT EXISTS %s ON %s (%s)" % (index_name, table_name, ",".join(cols))) | 8994913ae6ac57e8ee70b7fa9d9dde61fc8f3bb8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5758/8994913ae6ac57e8ee70b7fa9d9dde61fc8f3bb8/dbtables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
11265,
12,
11369,
273,
1083,
4672,
3536,
11637,
326,
3661,
67,
869,
67,
1615,
5617,
316,
326,
1014,
667,
6377,
16,
4872,
279,
444,
434,
5596,
364,
326,
2063,
622,
326,
783,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11265,
12,
11369,
273,
1083,
4672,
3536,
11637,
326,
3661,
67,
869,
67,
1615,
5617,
316,
326,
1014,
667,
6377,
16,
4872,
279,
444,
434,
5596,
364,
326,
2063,
622,
326,
783,
1... |
tcolor = "yellow" if status == 'A': tcolor = "green" | tcolor = '' if status == 'U': tcolor = 'orange' tag_end += '<img src="/site_media/images/orange_flag.png" width="16" height="16" alt="orange_flag.png">' | def flag_policy_issue(value, status): # to highlight the issues tag_start = '<span class="' tag_mid = '">' tag_end = '</span>' tcolor = "yellow" if status == 'A': tcolor = "green" if status == 'D': tcolor = "red" tag_end += '<img src="/site_media/images/red_flag.png" width="16" height="16" alt="red_flag.png">' value = tag_start + tcolor + tag_mid + value + tag_end return value | 415573da1155cf94fc2dd3395f825ce2161d45e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/415573da1155cf94fc2dd3395f825ce2161d45e4/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2982,
67,
5086,
67,
13882,
12,
1132,
16,
1267,
4672,
468,
358,
8839,
326,
8296,
1047,
67,
1937,
273,
2368,
3969,
667,
5300,
1047,
67,
13138,
273,
13192,
1047,
67,
409,
273,
4357,
3969,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2982,
67,
5086,
67,
13882,
12,
1132,
16,
1267,
4672,
468,
358,
8839,
326,
8296,
1047,
67,
1937,
273,
2368,
3969,
667,
5300,
1047,
67,
13138,
273,
13192,
1047,
67,
409,
273,
4357,
3969,
... |
p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid) | if sys.platform[:3] == 'win': p = subprocess.Popen(cmdline) else: setsid = getattr(os, 'setsid', None) if not setsid: setsid = getattr(os, 'setpgrp', None) p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid) | def open(self, url, new=0, autoraise=1): cmdline = [self.name] + [arg.replace("%s", url) for arg in self.args] setsid = getattr(os, 'setsid', None) if not setsid: setsid = getattr(os, 'setpgrp', None) try: p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid) return (p.poll() is None) except OSError: return False | 2347074bf78cc5fc84022389f87d6a7159ca9649 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/2347074bf78cc5fc84022389f87d6a7159ca9649/webbrowser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
880,
16,
394,
33,
20,
16,
2059,
10610,
784,
33,
21,
4672,
22877,
273,
306,
2890,
18,
529,
65,
397,
306,
3175,
18,
2079,
27188,
87,
3113,
880,
13,
364,
1501,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
880,
16,
394,
33,
20,
16,
2059,
10610,
784,
33,
21,
4672,
22877,
273,
306,
2890,
18,
529,
65,
397,
306,
3175,
18,
2079,
27188,
87,
3113,
880,
13,
364,
1501,
316,
... |
return "%s (%s)" % (self.__class__, self.__testFunc.__name__) | return "%s (%s)" % (_strclass(self.__class__), self.__testFunc.__name__) | def __str__(self): return "%s (%s)" % (self.__class__, self.__testFunc.__name__) | dc391a67e39df5f23d62d50b4cdb74728c24684e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc391a67e39df5f23d62d50b4cdb74728c24684e/unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
2213,
87,
6142,
87,
2225,
738,
261,
2890,
16186,
1106,
972,
16,
365,
16186,
3813,
2622,
16186,
529,
972,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
2213,
87,
6142,
87,
2225,
738,
261,
2890,
16186,
1106,
972,
16,
365,
16186,
3813,
2622,
16186,
529,
972,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self._w_send_header(k,v) | self._w_send_header(k,v) | def _w_turn_header(self,resp): self.ContentType = 'text/plain' # default if hasattr(resp.msg, 'headers'): for header in resp.msg.headers: k,v = header.split(':',1) k,v = k.strip(),v.strip() self._w_send_header(k,v) if header.lower().startswith('content-type'): self.ContentType = v | 8802315bb56da7d2c792725a7959c936a23d59b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5854/8802315bb56da7d2c792725a7959c936a23d59b9/ApacheHandler_wrap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
91,
67,
20922,
67,
3374,
12,
2890,
16,
12243,
4672,
365,
18,
8046,
273,
296,
955,
19,
7446,
11,
468,
805,
309,
3859,
12,
12243,
18,
3576,
16,
296,
2485,
11,
4672,
364,
1446,
316... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
91,
67,
20922,
67,
3374,
12,
2890,
16,
12243,
4672,
365,
18,
8046,
273,
296,
955,
19,
7446,
11,
468,
805,
309,
3859,
12,
12243,
18,
3576,
16,
296,
2485,
11,
4672,
364,
1446,
316... |
self.addView(('objects',), self.session.ObjectView, treeView = objectTreeView) | def __init__(self, methodTreeView = None, objectTreeView = None, location = None, methodInteraction = None, relatedMethods = None, **kw): super(ClientView, self).__init__(**kw) if not (methodTreeView and objectTreeView and location and methodInteraction and relatedMethods): self.client = self.session.Client(view = self, showMethodTree = True, showObjectTree = True, showMethodInteraction = True) methodTreeView = self.client.methodTreeView objectTreeView = self.client.objectTreeView location = self.client.location methodInteraction = self.client.methodInteraction relatedMethods = self.client.relatedMethods self.addView(('tree',), self.session.CombinationView, methodTreeView = methodTreeView, objectTreeView = objectTreeView) self.addView(('objects',), self.session.ObjectView, treeView = objectTreeView) self.addView(('selection',), self.session.Selection, location = location, methodInteraction = methodInteraction, relatedMethods = relatedMethods) | 4fadf73203be069e1abb0745e50de808e949d82c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9377/4fadf73203be069e1abb0745e50de808e949d82c/gnomoire.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
707,
2471,
1767,
273,
599,
16,
733,
2471,
1767,
273,
599,
16,
2117,
273,
599,
16,
707,
17419,
273,
599,
16,
3746,
4712,
273,
599,
16,
2826,
9987,
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,
1001,
2738,
972,
12,
2890,
16,
707,
2471,
1767,
273,
599,
16,
733,
2471,
1767,
273,
599,
16,
2117,
273,
599,
16,
707,
17419,
273,
599,
16,
3746,
4712,
273,
599,
16,
2826,
9987,
4672,
... | |
context['textinput']['name'] = value | context['name'] = value | def _end_name(self): value = self.pop('name') if self.inpublisher: self._save_author('name', value, 'publisher') elif self.inauthor: self._save_author('name', value) elif self.incontributor: self._save_contributor('name', value) elif self.intextinput: context = self._getContext() context['textinput']['name'] = value | 44482af2baebba8741223b8967e4efeaf8365c45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/44482af2baebba8741223b8967e4efeaf8365c45/feedparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
409,
67,
529,
12,
2890,
4672,
460,
273,
365,
18,
5120,
2668,
529,
6134,
309,
365,
18,
267,
26018,
30,
365,
6315,
5688,
67,
4161,
2668,
529,
2187,
460,
16,
296,
26018,
6134,
1327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
409,
67,
529,
12,
2890,
4672,
460,
273,
365,
18,
5120,
2668,
529,
6134,
309,
365,
18,
267,
26018,
30,
365,
6315,
5688,
67,
4161,
2668,
529,
2187,
460,
16,
296,
26018,
6134,
1327,
... |
for p in self.phases: if(p[0] != phase[0]): continue list = data.dmesg[p]['list'] for devname in list: if devname in devlist: idlist.append(list[devname]['id']) | list = self.dmesg[phase]['list'] for devname in list: if devname in devlist: idlist.append(list[devname]['id']) | def deviceIDs(self, devlist, phase): idlist = [] for p in self.phases: if(p[0] != phase[0]): continue list = data.dmesg[p]['list'] for devname in list: if devname in devlist: idlist.append(list[devname]['id']) return idlist | 0c52bda8f6c5785b5982bc3636b627b4ccd59c3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5327/0c52bda8f6c5785b5982bc3636b627b4ccd59c3f/analyze_suspend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2346,
5103,
12,
2890,
16,
4461,
1098,
16,
6855,
4672,
612,
1098,
273,
5378,
666,
273,
365,
18,
10956,
281,
75,
63,
13961,
23962,
1098,
3546,
364,
4461,
529,
316,
666,
30,
309,
4461,
52... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2346,
5103,
12,
2890,
16,
4461,
1098,
16,
6855,
4672,
612,
1098,
273,
5378,
666,
273,
365,
18,
10956,
281,
75,
63,
13961,
23962,
1098,
3546,
364,
4461,
529,
316,
666,
30,
309,
4461,
52... |
r.nameservers = [_resolve_name(server)] | r.nameservers = [_resolve_name(server, None)] | def _resolve_name(name, server): """ Resolve the given name to an IP address. """ if is_ip_addr(name): return name r = dns.resolver.Resolver() if server: r.nameservers = [_resolve_name(server)] answers = r.query(name) answer = None for answer in answers: # @CTB !? break assert answer return str(answer) | 7598ed2bc981d258c3e5fff90c4ec8ae8f5bf22b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8598/7598ed2bc981d258c3e5fff90c4ec8ae8f5bf22b/dns_check.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10828,
67,
529,
12,
529,
16,
1438,
4672,
3536,
9910,
326,
864,
508,
358,
392,
2971,
1758,
18,
3536,
309,
353,
67,
625,
67,
4793,
12,
529,
4672,
327,
508,
225,
436,
273,
6605,
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,
10828,
67,
529,
12,
529,
16,
1438,
4672,
3536,
9910,
326,
864,
508,
358,
392,
2971,
1758,
18,
3536,
309,
353,
67,
625,
67,
4793,
12,
529,
4672,
327,
508,
225,
436,
273,
6605,
18... |
logging.debug("telepathy-theonering %s-%s" % (constants.__version__, constants.__build__)) | logging.info("telepathy-theonering %s-%s" % (constants.__version__, constants.__build__)) | def main(logToFile): try: os.makedirs(constants._data_path_) except OSError, e: if e.errno != 17: raise telepathy_utils.debug_divert_messages(os.getenv('THEONERING_LOGFILE')) if logToFile: logging.basicConfig( level=logging.DEBUG, filename=constants._user_logpath_, format='(%(asctime)s) %(levelname)s:%(name)s:%(message)s', datefmt='%H:%M:%S', ) else: logging.basicConfig( level=logging.INFO, format='(%(asctime)s) %(levelname)s:%(name)s:%(message)s', datefmt='%H:%M:%S', ) logging.debug("telepathy-theonering %s-%s" % (constants.__version__, constants.__build__)) logging.debug("OS: %s" % (os.uname()[0], )) logging.debug("Kernel: %s (%s) for %s" % os.uname()[2:]) logging.debug("Hostname: %s" % os.uname()[1]) persist = 'THEONERING_PERSIST' in os.environ try: run_theonering(persist) finally: logging.shutdown() | 407d5b467c28c20f2073833001ed871766a68bc5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13096/407d5b467c28c20f2073833001ed871766a68bc5/theonering.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
1330,
15450,
4672,
775,
30,
1140,
18,
81,
9477,
10539,
12,
13358,
6315,
892,
67,
803,
67,
13,
1335,
10002,
16,
425,
30,
309,
425,
18,
19088,
480,
8043,
30,
1002,
225,
268,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1330,
15450,
4672,
775,
30,
1140,
18,
81,
9477,
10539,
12,
13358,
6315,
892,
67,
803,
67,
13,
1335,
10002,
16,
425,
30,
309,
425,
18,
19088,
480,
8043,
30,
1002,
225,
268,
... |
ICUDATA_DAT = ICUDATA + ".dat" | def main(): global ANDROID_BUILD_TOP # $ANDROID_BUILD_TOP global ICU4C_DIR # $ANDROID_BUILD_TOP/external/icu4c global ICU_VERSION # ICU version number global ICUDATA # e.g. "icudt42l" global ICUDATA_DAT # e.g. "icudt42l.dat" global CLDR_VERSION # CLDR version. The value can be vary upon ICU release. global TMP_DAT_PATH # temp directory to store all resource files and # intermediate dat files. global VERBOSE VERBOSE = False show_help = False try: opts, args = getopt.getopt(sys.argv[1:], 'hv', ['help', 'verbose']) except getopt.error: PrintHelpAndExit() for opt, arg in opts: if opt in ('-h', '--help'): show_help = True elif opt in ('-v', '--verbose'): VERBOSE = True if len(args) < 1: show_help = True if show_help: PrintHelpAndExit() # TODO: is there any advantage to requiring this as an argument? couldn't we just glob it from # the file system, looking for "icudt\d+l.*\.txt"? ICU_VERSION = args[0] if re.search(r'[0-9]+\.[0-9]+', ICU_VERSION) == None: print "'%s' is not a valid icu version number!" % (ICU_VERSION) sys.exit(1) ICUDATA = "icudt" + re.sub(r'([^0-9])', "", ICU_VERSION) + "l" CLDR_VERSION = "1.8" ANDROID_BUILD_TOP = os.environ.get("ANDROID_BUILD_TOP") if not ANDROID_BUILD_TOP: print "$ANDROID_BUILD_TOP not set! Run 'env_setup.sh'." sys.exit(1) ICU4C_DIR = os.path.join(ANDROID_BUILD_TOP, "external", "icu4c") ICUDATA_DAT = ICUDATA + ".dat" # Check for required source files. stubdata_dir = os.path.join(ICU4C_DIR, "stubdata") full_data_filename = os.path.join(stubdata_dir, ICUDATA + "-all.dat") if not os.path.isfile(full_data_filename): print "%s not present." % full_data_filename sys.exit(1) # Create a temporary working directory. TMP_DAT_PATH = os.path.join(ICU4C_DIR, "tmp") if os.path.exists(TMP_DAT_PATH): shutil.rmtree(TMP_DAT_PATH) os.mkdir(TMP_DAT_PATH) # Extract resource files from icudtxxl-all.dat to TMP_DAT_PATH. ExtractAllResourceToTempDir() # TODO: is there any advantage to hard-coding this? couldn't we just glob it from the file system? datlist = ["us", "us-euro", "default", "us-japan", "zh", "medium", "large"] for dat_subtag in datlist: output_filename = os.path.join(stubdata_dir, ICUDATA + "-" + dat_subtag + ".dat") MakeDat(stubdata_dir, dat_subtag) # Copy icudtxxl.dat to stubdata directory with corresponding subtag. shutil.copyfile(os.path.join(TMP_DAT_PATH, ICUDATA_DAT), output_filename) print "Generated ICU data: %s" % (output_filename) # Cleanup temporary working directory and icudtxxl.dat shutil.rmtree(TMP_DAT_PATH) os.remove(os.path.join(stubdata_dir, ICUDATA_DAT)) | 7173c2a35d19fbdcad4e894b17842fdc2b6dfa81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10672/7173c2a35d19fbdcad4e894b17842fdc2b6dfa81/icu_dat_generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2552,
4116,
1457,
734,
67,
20215,
67,
10462,
225,
468,
271,
4307,
1457,
734,
67,
20215,
67,
10462,
2552,
28009,
24,
39,
67,
4537,
377,
468,
271,
4307,
1457,
734,
67,
20215,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2552,
4116,
1457,
734,
67,
20215,
67,
10462,
225,
468,
271,
4307,
1457,
734,
67,
20215,
67,
10462,
2552,
28009,
24,
39,
67,
4537,
377,
468,
271,
4307,
1457,
734,
67,
20215,
... | |
allowed_files = [ | allowed_files = set([ | def UploadFile(file_name, data, mode, uid, gid, atime, mtime): """Write a file to the filesystem. This allows the master to overwrite(!) a file. It will only perform the operation if the file belongs to a list of configuration files. @type file_name: str @param file_name: the target file name @type data: str @param data: the new contents of the file @type mode: int @param mode: the mode to give the file (can be None) @type uid: int @param uid: the owner of the file (can be -1 for default) @type gid: int @param gid: the group of the file (can be -1 for default) @type atime: float @param atime: the atime to set on the file (can be None) @type mtime: float @param mtime: the mtime to set on the file (can be None) @rtype: boolean @return: the success of the operation; errors are logged in the node daemon log """ if not os.path.isabs(file_name): logging.error("Filename passed to UploadFile is not absolute: '%s'", file_name) return False allowed_files = [ constants.CLUSTER_CONF_FILE, constants.ETC_HOSTS, constants.SSH_KNOWN_HOSTS_FILE, constants.VNC_PASSWORD_FILE, ] if file_name not in allowed_files: logging.error("Filename passed to UploadFile not in allowed" " upload targets: '%s'", file_name) return False raw_data = _Decompress(data) utils.WriteFile(file_name, data=raw_data, mode=mode, uid=uid, gid=gid, atime=atime, mtime=mtime) return True | 4501a443735a9948276db4aeb6752226a37770c7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/4501a443735a9948276db4aeb6752226a37770c7/backend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9414,
812,
12,
768,
67,
529,
16,
501,
16,
1965,
16,
4555,
16,
11399,
16,
622,
494,
16,
13158,
4672,
3536,
3067,
279,
585,
358,
326,
6496,
18,
225,
1220,
5360,
326,
4171,
358,
6156,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9414,
812,
12,
768,
67,
529,
16,
501,
16,
1965,
16,
4555,
16,
11399,
16,
622,
494,
16,
13158,
4672,
3536,
3067,
279,
585,
358,
326,
6496,
18,
225,
1220,
5360,
326,
4171,
358,
6156,
1... |
defaultName = 'wx.Wizard' | defaultName = 'wx.wizard.Wizard' | def getSimpleRunnerSrc(self): return '' | b69356508054fc9760f797ebed8c2603130041bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/b69356508054fc9760f797ebed8c2603130041bb/wxPythonEditorModels.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8120,
9709,
7740,
12,
2890,
4672,
327,
875,
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,
8120,
9709,
7740,
12,
2890,
4672,
327,
875,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.stop() | if self.is_playing: self.stop() | def _try_select_current(self): self.cancel_update_timer() self.cancel_mark_as_watched() if self.is_playing: self.video_display.stop() if 0 <= self.position < len(self.playlist): item_info = self.playlist[self.position] if not self._item_is_playable(item_info): self.position += 1 return self._try_select_current() else: self.stop() return False return True | 44fe4bef4daed6413ec675979afdfa4aa436fc6b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/44fe4bef4daed6413ec675979afdfa4aa436fc6b/playback.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
698,
67,
4025,
67,
2972,
12,
2890,
4672,
365,
18,
10996,
67,
2725,
67,
12542,
1435,
365,
18,
10996,
67,
3355,
67,
345,
67,
7585,
329,
1435,
309,
365,
18,
291,
67,
1601,
310,
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,
698,
67,
4025,
67,
2972,
12,
2890,
4672,
365,
18,
10996,
67,
2725,
67,
12542,
1435,
365,
18,
10996,
67,
3355,
67,
345,
67,
7585,
329,
1435,
309,
365,
18,
291,
67,
1601,
310,
30,... |
shapes="a,b", extradoc=""" | shapes="a, b", extradoc=""" | def _stats(self, a, b): nA, nB = self.na, self.nb d = nB - nA pA, pB = norm._pdf(a), norm._pdf(b) mu = (pA - pB) / d #correction sign mu2 = 1 + (a*pA - b*pB) / d - mu*mu return mu, mu2, None, None | 48ba19baad4689b1adfc686887dc76e1a520ab52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12971/48ba19baad4689b1adfc686887dc76e1a520ab52/distributions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5296,
12,
2890,
16,
279,
16,
324,
4672,
290,
37,
16,
290,
38,
273,
365,
18,
6582,
16,
365,
18,
6423,
302,
273,
290,
38,
300,
290,
37,
293,
37,
16,
293,
38,
273,
4651,
6315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5296,
12,
2890,
16,
279,
16,
324,
4672,
290,
37,
16,
290,
38,
273,
365,
18,
6582,
16,
365,
18,
6423,
302,
273,
290,
38,
300,
290,
37,
293,
37,
16,
293,
38,
273,
4651,
6315,
... |
print 'Forcing DISTUTILS_USE_SDK=1' | print('Forcing DISTUTILS_USE_SDK=1') | def msvc_on_amd64(): if not (sys.platform=='win32' or os.name=='nt'): return if get_build_architecture() != 'AMD64': return if 'DISTUTILS_USE_SDK' in os.environ: return # try to avoid _MSVCCompiler__root attribute error print 'Forcing DISTUTILS_USE_SDK=1' os.environ['DISTUTILS_USE_SDK']='1' return | c85421c3b85e794d07e8de0304136c068c7f2e17 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/c85421c3b85e794d07e8de0304136c068c7f2e17/misc_util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4086,
4227,
67,
265,
67,
301,
72,
1105,
13332,
309,
486,
261,
9499,
18,
9898,
18920,
8082,
1578,
11,
578,
1140,
18,
529,
18920,
496,
11,
4672,
327,
309,
336,
67,
3510,
67,
991,
18123,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4086,
4227,
67,
265,
67,
301,
72,
1105,
13332,
309,
486,
261,
9499,
18,
9898,
18920,
8082,
1578,
11,
578,
1140,
18,
529,
18920,
496,
11,
4672,
327,
309,
336,
67,
3510,
67,
991,
18123,
... |
self.stats.add(line) | if self.stats: self.stats.add(line) else: print("No statistics object is loaded.", file=self.stream) | def do_add(self, line): self.stats.add(line) return 0 | 3e4f2ec7047dfec4ced9ec1ee791eaa837655b8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/3e4f2ec7047dfec4ced9ec1ee791eaa837655b8e/pstats.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
1289,
12,
2890,
16,
980,
4672,
309,
365,
18,
5296,
30,
365,
18,
5296,
18,
1289,
12,
1369,
13,
469,
30,
1172,
2932,
2279,
7691,
733,
353,
4203,
1199,
16,
585,
33,
2890,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
1289,
12,
2890,
16,
980,
4672,
309,
365,
18,
5296,
30,
365,
18,
5296,
18,
1289,
12,
1369,
13,
469,
30,
1172,
2932,
2279,
7691,
733,
353,
4203,
1199,
16,
585,
33,
2890,
18,
... |
<html>... | <html... | def consume_digest(self): digest = list(self.digest) del self.digest[:] return digest | f0b04506a5c04612b3f8b659e09d5165d893bbef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12308/f0b04506a5c04612b3f8b659e09d5165d893bbef/digest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7865,
67,
10171,
12,
2890,
4672,
5403,
273,
666,
12,
2890,
18,
10171,
13,
1464,
365,
18,
10171,
10531,
65,
327,
5403,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7865,
67,
10171,
12,
2890,
4672,
5403,
273,
666,
12,
2890,
18,
10171,
13,
1464,
365,
18,
10171,
10531,
65,
327,
5403,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
filter_compiler = libpath + sep + 'gateway-compile2' | filter_compiler = libpath + sep + 'filter-compile2' | def compileFilters(config): sep = config.get('system','sep') projectname = config.get('system','projectname') tmppath = config.get('system','tmppath') libpath = config.get('system','libpath') projpath = config.get('system','projpath') filter = projpath + sep + config.get('system','filter') reject = tmppath + sep + projectname + '-filter-reject' accept = tmppath + sep + projectname + '-filter-accept' config.set('system','filter_reject',reject) config.set('system','filter_accept',accept) # compile filters here filter_compiler = libpath + sep + 'gateway-compile1' transform(config,filter_compiler,filter,accept + '.xsl','version="2.0"') filter_compiler = libpath + sep + 'gateway-compile2' transform(config,filter_compiler,filter,reject + '.xsl','version="2.0"') return config | d9c4d437ea936d86348887855fe0ae45f9227eee /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8937/d9c4d437ea936d86348887855fe0ae45f9227eee/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
5422,
12,
1425,
4672,
5478,
273,
642,
18,
588,
2668,
4299,
17023,
10814,
6134,
1984,
529,
273,
642,
18,
588,
2668,
4299,
17023,
4406,
529,
6134,
1853,
803,
273,
642,
18,
588,
2668,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
5422,
12,
1425,
4672,
5478,
273,
642,
18,
588,
2668,
4299,
17023,
10814,
6134,
1984,
529,
273,
642,
18,
588,
2668,
4299,
17023,
4406,
529,
6134,
1853,
803,
273,
642,
18,
588,
2668,... |
msg = "*** THIS MESSAGE WAS SENT IN DEBUG MODE, DON'T TAKE IT INTO ACCOUNT ***\n\n" | msg = "*** THIS MESSAGE WAS SENT IN DEBUG MODE ***\n\n" | def email_notify(alert, records, argstr): global FROMADDR global ALERTURL global DEBUGLEVEL global DEVELOPERADDR if len(records) == 0: return msg = "" if DEBUGLEVEL > 0: msg = "*** THIS MESSAGE WAS SENT IN DEBUG MODE, DON'T TAKE IT INTO ACCOUNT ***\n\n" msg += "Hello\n\n" msg += wrap("Below are the results of the email alert that you set up with the CERN Document Server. This is an automatic message, please don't reply to its address. For any question, use <%s> instead." % supportemail) email = get_email(alert[0]) url = weburl + "/search.py?" + argstr pattern = get_pattern(argstr) catalogue = get_catalogue(argstr) catword = 'collection' if get_catalogue_num(argstr) > 1: catword += 's' time = strftime("%d-%m-%Y") msg += '\n' + wrap('alert name: %s' % alert[5]) if pattern: msg += wrap('pattern: %s' % pattern) if catalogue: msg += wrap('%s: %s' % (catword, catalogue)) msg += wrap('frequency: %s ' % format_frequency(alert[3])) msg += wrap('run time: %s ' % strftime("%a %d-%m-%Y %H:%M:%S")) recword = 'record' if len(records) > 1: recword += 's' msg += wrap('found: %s %s' % (len(records), recword)) msg += "url: <%s/search.py?%s>\n" % (weburl, argstr) msg += wrap_records(print_records(records)) msg += "\n-- \nCERN Document Server Alert Service <%s>\nUnsubscribe? See <%s>\nNeed human intervention? Contact <%s>" % (weburl, ALERTURL, supportemail) subject = 'Alert %s run on %s' % (alert[5], time) body = forge_email(FROMADDR, email, subject, msg) if DEBUGLEVEL > 0: print "********************************************************************************" print body print "********************************************************************************" if DEBUGLEVEL < 2: send_email(FROMADDR, email, body) if DEBUGLEVEL == 4: for a in DEVELOPERADDR: send_email(FROMADDR, a, body) | 7525d89c310ce7dc2bf057b2e30e62a621ab091c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/7525d89c310ce7dc2bf057b2e30e62a621ab091c/alert_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2699,
67,
12336,
12,
11798,
16,
3853,
16,
833,
313,
4672,
2552,
4571,
14142,
2552,
7981,
11539,
1785,
2552,
6369,
10398,
2552,
2030,
24397,
3194,
14142,
225,
309,
562,
12,
7094,
13,
422,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2699,
67,
12336,
12,
11798,
16,
3853,
16,
833,
313,
4672,
2552,
4571,
14142,
2552,
7981,
11539,
1785,
2552,
6369,
10398,
2552,
2030,
24397,
3194,
14142,
225,
309,
562,
12,
7094,
13,
422,
... |
raise ValidationError(_('You have to select the user that ' 'gets the posts assigned.')) | raise ValidationError(_('You have to select a user to reassign ' 'the posts to.')) | def context_validate(self, data): if data['action'] == 'reassign' and not data['reassign_to']: # XXX: Bad wording raise ValidationError(_('You have to select the user that ' 'gets the posts assigned.')) | bcd14320601435d7b7d798dfcd075eea5bed6090 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12815/bcd14320601435d7b7d798dfcd075eea5bed6090/forms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
819,
67,
5662,
12,
2890,
16,
501,
4672,
309,
501,
3292,
1128,
3546,
422,
296,
266,
6145,
11,
471,
486,
501,
3292,
266,
6145,
67,
869,
3546,
30,
468,
11329,
30,
6107,
2076,
310,
1002,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
819,
67,
5662,
12,
2890,
16,
501,
4672,
309,
501,
3292,
1128,
3546,
422,
296,
266,
6145,
11,
471,
486,
501,
3292,
266,
6145,
67,
869,
3546,
30,
468,
11329,
30,
6107,
2076,
310,
1002,
... |
nodelist.append(nodes.literal_block(data, data)) | literal_block = nodes.literal_block(data, data) literal_block.line = offset + 1 nodelist = [literal_block] | def literal_block(self): """Return a list of nodes.""" indented, indent, offset, blank_finish = \ self.state_machine.get_indented() while indented and not indented[-1].strip(): indented.trim_end() if not indented: return self.quoted_literal_block() nodelist = [] data = '\n'.join(indented) nodelist.append(nodes.literal_block(data, data)) if not blank_finish: nodelist.append(self.unindent_warning('Literal block')) return nodelist | e55bfbc04bc47e7ceb1130fcd5507ee1539002a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1532/e55bfbc04bc47e7ceb1130fcd5507ee1539002a3/states.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7158,
67,
2629,
12,
2890,
4672,
3536,
990,
279,
666,
434,
2199,
12123,
23786,
16,
3504,
16,
1384,
16,
7052,
67,
13749,
273,
521,
365,
18,
2019,
67,
9149,
18,
588,
67,
9355,
329,
1435,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7158,
67,
2629,
12,
2890,
4672,
3536,
990,
279,
666,
434,
2199,
12123,
23786,
16,
3504,
16,
1384,
16,
7052,
67,
13749,
273,
521,
365,
18,
2019,
67,
9149,
18,
588,
67,
9355,
329,
1435,
... |
result = wikiutil.normalize_pagename(test) | result = wikiutil.normalize_pagename(test, self.request.cfg) | def testUnderscoreTestCase(self): """ request: normalize pagename: underscore convert to spaces and normalized | 5371901b400ada61e194af162d1330dcd4fce34c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/5371901b400ada61e194af162d1330dcd4fce34c/test_wikiutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
31489,
4709,
2449,
12,
2890,
4672,
3536,
590,
30,
3883,
4262,
1069,
30,
13677,
1765,
358,
7292,
471,
5640,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
31489,
4709,
2449,
12,
2890,
4672,
3536,
590,
30,
3883,
4262,
1069,
30,
13677,
1765,
358,
7292,
471,
5640,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
_introspecting[oid] = routine_doc | def introspect_routine(routine): """Add API documentation information about the function C{routine} to C{routine_doc} (specializing it to C{Routine_doc}).""" oid = id(routine) if oid in _introspecting: return _introspecting[oid] # Create the RoutineDoc. routine_doc = RoutineDoc(pyval=routine, repr=value_repr(routine), canonical_name = get_canonical_name(routine)) _introspecting[oid] = routine_doc # Extract the underying function if isinstance(routine, MethodType): func = routine.im_func elif isinstance(routine, staticmethod): func = routine.__get__(0) elif isinstance(routine, classmethod): func = routine.__get__(0).im_func else: func = routine # Record the function's docstring. routine_doc.docstring = get_docstring(func) # Record the function's signature. if isinstance(func, FunctionType): (args, vararg, kwarg, defaults) = inspect.getargspec(func) # Add the arguments. routine_doc.posargs = args routine_doc.vararg = vararg routine_doc.kwarg = kwarg # Set default values for positional arguments. routine_doc.posarg_defaults = [None]*len(args) if defaults is not None: offset = len(args)-len(defaults) for i in range(len(defaults)): default_val = introspect_docs(defaults[i]) routine_doc.posarg_defaults[i+offset] = default_val # If it's a bound method, then strip off the first argument. if isinstance(routine, MethodType) and routine.im_self is not None: routine_doc.posargs = routine_doc.posargs[1:] routine_doc.posarg_defaults = routine_doc.posarg_defaults[1:] else: # [XX] I should probably use UNKNOWN here?? routine_doc.posargs = ['...'] routine_doc.posarg_defaults = [None] routine_doc.kwarg = None routine_doc.vararg = None # Change type, if appropriate. if isinstance(routine, staticmethod): routine_doc.specialize_to(StaticMethodDoc) if isinstance(routine, classmethod): routine_doc.specialize_to(ClassMethodDoc) return routine_doc | 8306498614e7db9ddd2c5e78aa700eded3f33a2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/8306498614e7db9ddd2c5e78aa700eded3f33a2e/docintrospecter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30165,
67,
22640,
12,
22640,
4672,
3536,
986,
1491,
7323,
1779,
2973,
326,
445,
385,
95,
22640,
97,
358,
385,
95,
22640,
67,
2434,
97,
261,
9371,
6894,
518,
358,
385,
95,
4583,
558,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30165,
67,
22640,
12,
22640,
4672,
3536,
986,
1491,
7323,
1779,
2973,
326,
445,
385,
95,
22640,
97,
358,
385,
95,
22640,
67,
2434,
97,
261,
9371,
6894,
518,
358,
385,
95,
4583,
558,
67... | |
('TCP', (80, self.f), {'interface':'', 'backlog':5})) | ('TCP', (80, self.f), {'interface':'', 'backlog':50})) | def testAllKeywords(self): self.assertEqual(strports.parse('port=80', self.f), ('TCP', (80, self.f), {'interface':'', 'backlog':5})) | 67b1d6b02f0fa3aad8d8e3b6f4a7ba811c22853e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/67b1d6b02f0fa3aad8d8e3b6f4a7ba811c22853e/test_strports.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1595,
14149,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
701,
4363,
18,
2670,
2668,
655,
33,
3672,
2187,
365,
18,
74,
3631,
7707,
13891,
2187,
261,
3672,
16,
365,
18,
74,
3631,
136... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1842,
1595,
14149,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
701,
4363,
18,
2670,
2668,
655,
33,
3672,
2187,
365,
18,
74,
3631,
7707,
13891,
2187,
261,
3672,
16,
365,
18,
74,
3631,
136... |
'base_url': urlparse.urlunsplit((scheme, host, '', '', '')).rstrip('/') + '/', | 'base_url': base_url, | def open(self, *args, **kwargs): """Takes the same arguments as the :class:`EnvironBuilder` class with some additions: You can provide a :class:`EnvironBuilder` or a WSGI environment as only argument instead of the :class:`EnvironBuilder` arguments and two optional keyword arguments (`as_tuple`, `buffered`) that change the type of the return value or the way the application is executed. | ee081ac62ddf6504d206ff518279243d6899744b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14437/ee081ac62ddf6504d206ff518279243d6899744b/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
11524,
326,
1967,
1775,
487,
326,
294,
1106,
28288,
28248,
1263,
68,
667,
598,
2690,
26260,
30,
225,
4554,
848,
5615,
279,
294,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
11524,
326,
1967,
1775,
487,
326,
294,
1106,
28288,
28248,
1263,
68,
667,
598,
2690,
26260,
30,
225,
4554,
848,
5615,
279,
294,... |
self.push("250 OK\r\n") | self.push("354 Enter data ending with a . on a line by itself\r\n") | def onData(self, command, args): self.inData = True if self.train_as_ham == True or self.train_as_spam == True: self.push("250 OK\r\n") return None rv = command for arg in args: rv += ' ' + arg return rv | b130ca2c1f692ee7a831ee6420d6a35372d8b1f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/b130ca2c1f692ee7a831ee6420d6a35372d8b1f9/smtpproxy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
751,
12,
2890,
16,
1296,
16,
833,
4672,
365,
18,
267,
751,
273,
1053,
309,
365,
18,
9754,
67,
345,
67,
31698,
422,
1053,
578,
365,
18,
9754,
67,
345,
67,
1752,
301,
422,
1053,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
751,
12,
2890,
16,
1296,
16,
833,
4672,
365,
18,
267,
751,
273,
1053,
309,
365,
18,
9754,
67,
345,
67,
31698,
422,
1053,
578,
365,
18,
9754,
67,
345,
67,
1752,
301,
422,
1053,
... |
def print_control_parameters(self, simulatorCP, optimiserCP) : """Print all the optimisation procedure control parameters. The control parameters are printed as comments. """ self.nf.write(str(simulatorCP)) self.nf.write(str(optimiserCP)) self.tf.write(str(simulatorCP)) self.tf.write(str(optimiserCP)) | def print_control_parameters(self, simulatorCP, optimiserCP) : """Print all the optimisation procedure control parameters. | b33dea50d1aabad247006bfd73e621d2e0f236fd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1770/b33dea50d1aabad247006bfd73e621d2e0f236fd/randomLocalSearch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
7098,
67,
3977,
12,
2890,
16,
3142,
11775,
4258,
16,
5213,
15914,
4258,
13,
294,
3536,
5108,
777,
326,
5213,
10742,
12131,
3325,
1472,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
7098,
67,
3977,
12,
2890,
16,
3142,
11775,
4258,
16,
5213,
15914,
4258,
13,
294,
3536,
5108,
777,
326,
5213,
10742,
12131,
3325,
1472,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100... | |
output = self.proc.read(timeout) output = output.replace(chr(0), '') if output == '': return if not update_buffer: return output logging.debug('read *********************************************************************') debug_profile_start = time.time() chunks = CONQUE_SEQ_REGEX.split(output) logging.debug('ouput chunking took ' + str((time.time() - debug_profile_start) * 1000) + ' ms') logging.debug(str(chunks)) debug_profile_start = time.time() if len(chunks) == 1: logging.debug('short circuit') self.plain_text(chunks[0]) else: for s in chunks: if s == '': continue logging.debug('chgs ' + str(self.color_changes)) logging.debug('at line ' + str(self.l) + ' column ' + str(self.c)) if CONQUE_SEQ_REGEX_CTL.match(s[0]): logging.debug('control match') nr = ord(s[0]) if nr in CONQUE_CTL: getattr(self, 'ctl_' + CONQUE_CTL[nr])() | output = '' try: output = self.proc.read(timeout) output = output.replace(chr(0), '') if output == '': return if not update_buffer: return output logging.debug('read *********************************************************************') debug_profile_start = time.time() chunks = CONQUE_SEQ_REGEX.split(output) logging.debug('ouput chunking took ' + str((time.time() - debug_profile_start) * 1000) + ' ms') logging.debug(str(chunks)) debug_profile_start = time.time() if len(chunks) == 1: logging.debug('short circuit') self.plain_text(chunks[0]) else: for s in chunks: if s == '': continue logging.debug('chgs ' + str(self.color_changes)) logging.debug('at line ' + str(self.l) + ' column ' + str(self.c)) if CONQUE_SEQ_REGEX_CTL.match(s[0]): logging.debug('control match') nr = ord(s[0]) if nr in CONQUE_CTL: getattr(self, 'ctl_' + CONQUE_CTL[nr])() else: logging.info('escape not found for ' + str(s)) pass elif CONQUE_SEQ_REGEX_CSI.match(s): logging.debug('csi match') if s[-1] in CONQUE_ESCAPE: csi = self.parse_csi(s[2:]) logging.debug(str(csi)) getattr(self, 'csi_' + CONQUE_ESCAPE[s[-1]])(csi) else: logging.info('escape not found for ' + str(s)) pass elif CONQUE_SEQ_REGEX_TITLE.match(s): logging.debug('title match') self.change_title(s[2], s[4:-1]) elif CONQUE_SEQ_REGEX_HASH.match(s): logging.debug('hash match') if s[-1] in CONQUE_ESCAPE_HASH: getattr(self, 'hash_' + CONQUE_ESCAPE_HASH[s[-1]])() else: logging.info('escape not found for ' + str(s)) pass elif CONQUE_SEQ_REGEX_CHAR.match(s): logging.debug('char match') if s[-1] in CONQUE_ESCAPE_CHARSET: getattr(self, 'charset_' + CONQUE_ESCAPE_CHARSET[s[-1]])() else: logging.info('escape not found for ' + str(s)) pass elif CONQUE_SEQ_REGEX_ESC.match(s): logging.debug('escape match') if s[-1] in CONQUE_ESCAPE_PLAIN: getattr(self, 'esc_' + CONQUE_ESCAPE_PLAIN[s[-1]])() else: logging.info('escape not found for ' + str(s)) pass | def read(self, timeout=1, set_cursor=True, return_output=False, update_buffer=True): # {{{ # read from subprocess output = self.proc.read(timeout) # and strip null chars output = output.replace(chr(0), '') | c3a8ddb8ecf948c8319c57662c32f39da3a1b603 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8972/c3a8ddb8ecf948c8319c57662c32f39da3a1b603/conque.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
2021,
33,
21,
16,
444,
67,
9216,
33,
5510,
16,
327,
67,
2844,
33,
8381,
16,
1089,
67,
4106,
33,
5510,
4672,
468,
10179,
95,
468,
855,
628,
6652,
876,
273,
365,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
2021,
33,
21,
16,
444,
67,
9216,
33,
5510,
16,
327,
67,
2844,
33,
8381,
16,
1089,
67,
4106,
33,
5510,
4672,
468,
10179,
95,
468,
855,
628,
6652,
876,
273,
365,
1... |
else: Output(" self.prefix, self.typename) | def generate(self): # XXX This should use long strings and %(varname)s substitution! | a54aa7d6b2b6af5d0207815044cd26f6dbd35b79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a54aa7d6b2b6af5d0207815044cd26f6dbd35b79/bgenObjectDefinition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
12,
2890,
4672,
468,
11329,
1220,
1410,
999,
1525,
2064,
471,
8975,
1401,
529,
13,
87,
12785,
5,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
12,
2890,
4672,
468,
11329,
1220,
1410,
999,
1525,
2064,
471,
8975,
1401,
529,
13,
87,
12785,
5,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
return """ drwxr-xr-x 2 root wheel 1024 1 sty 14:59 bin/\r | return """drwxr-xr-x 2 root wheel 1024 1 sty 14:59 bin/\r | def ls(shell, args): if shell.cwd == '/': return """ | b72e321c09bf83de3ea500686e67aaff3b09ea6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2252/b72e321c09bf83de3ea500686e67aaff3b09ea6c/shell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7180,
12,
10304,
16,
833,
4672,
309,
5972,
18,
11089,
422,
2023,
30,
327,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7180,
12,
10304,
16,
833,
4672,
309,
5972,
18,
11089,
422,
2023,
30,
327,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
suffixes_map). | suffix_map). | def guess_type(url): """Guess the type of a file based on its URL. Return value is a tuple (type, encoding) where type is None if the type can't be guessed (no or unknown suffix) or a string of the form type/subtype, usable for a MIME Content-type header; and encoding is None for no encoding or the name of the program used to encode (e.g. compress or gzip). The mappings are table driven. Encoding suffixes are case sensitive; type suffixes are first tried case sensitive, then case insensitive. The suffixes .tgz, .taz and .tz (case sensitive!) are all mapped to ".tar.gz". (This is table-driven too, using the dictionary suffixes_map). """ if not inited: init() base, ext = posixpath.splitext(url) while suffix_map.has_key(ext): base, ext = posixpath.splitext(base + suffix_map[ext]) if encodings_map.has_key(ext): encoding = encodings_map[ext] base, ext = posixpath.splitext(base) else: encoding = None if types_map.has_key(ext): return types_map[ext], encoding elif types_map.has_key(string.lower(ext)): return types_map[string.lower(ext)], encoding else: return None, encoding | 3130b7a2a97dbb322342b248cb9d9fae5b89b8f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3130b7a2a97dbb322342b248cb9d9fae5b89b8f5/mimetypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7274,
67,
723,
12,
718,
4672,
3536,
15977,
326,
618,
434,
279,
585,
2511,
603,
2097,
1976,
18,
225,
2000,
460,
353,
279,
3193,
261,
723,
16,
2688,
13,
1625,
618,
353,
599,
309,
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,
7274,
67,
723,
12,
718,
4672,
3536,
15977,
326,
618,
434,
279,
585,
2511,
603,
2097,
1976,
18,
225,
2000,
460,
353,
279,
3193,
261,
723,
16,
2688,
13,
1625,
618,
353,
599,
309,
326,
... |
svnlook_cmd = "svnlook" | dprint ("process_main() start \n") svnlook_cmd = "/usr/bin/svnlook" | def process_main(): svnlook_cmd = "svnlook" logfile = '' revision = '' repository = '' argc = len (sys.argv) i = 1 while i < argc: arg = sys.argv[i] i = i + 1 if arg == '-rev' : revision = sys.argv[i] i = i + 1 elif arg == '-svnrepo' : repository = sys.argv[i] i = i + 1 elif arg == '-l' : logfile = sys.argv[i] i = i + 1 #else : #nop #print "? Ignored : [%s] ?" %(arg) if logfile == '': sys.stderr.write ("You must specify at least the logfile\n") sys.stderr.write (usage ()) sys.exit (2) sys.stderr.write ("You must specify at least the logfile\n") ### Let's get the message content (from CVS) text = '' #date = strftime ("%A %B %d, %Y @ %H:%M:%S", localtime(time())) date = output_of ("%s date %s -r %s" % (svnlook_cmd, repository, revision)) text_dirchanged = output_of ("%s dirs-changed %s -r %s" %(svnlook_cmd, repository, revision)) text_changed = output_of ("%s changed %s -r %s" %(svnlook_cmd, repository, revision)) text_logs = output_of ("%s log %s -r %s" %(svnlook_cmd, repository, revision)) login = output_of ("%s author %s -r %s" % (svnlook_cmd, repository, revision)) if len (login) == 0: login = os.environ['USER'] + "?" text = "%s\n" % (text) ### Build the log text text = "------------------------------------------------------------------------\n" text = "%sDate:\t%s\n" % (text, date) text = "%sAuthor:\t%s\n" % (text, login) text = "%sRevision:\t%s\n" % (text, revision) text = "%sDirChanged:%d\n%s\n" % (text, 1 + string.count (text_dirchanged,"\n"), text_dirchanged) text = "%sChanged:%d\n%s\n" % (text, 1 + string.count (text_changed,"\n"), text_changed) text = "%sLogs:%d\n%s\n" % (text, string.count (text_logs, "\n"), text_logs) text = "%s\n" % (text) ### Save the log text in the log file z_logfile = open (logfile, 'a'); z_logfile.write (text) z_logfile.close (); sys.exit(); | 9383527daf5bf4c90a7b329dc9ac5fa4c7a98820 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2574/9383527daf5bf4c90a7b329dc9ac5fa4c7a98820/svn_log.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
5254,
13332,
302,
1188,
7566,
2567,
67,
5254,
1435,
787,
521,
82,
7923,
5893,
82,
7330,
67,
4172,
273,
2206,
13640,
19,
4757,
19,
31505,
7330,
6,
15204,
273,
875,
6350,
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,
1207,
67,
5254,
13332,
302,
1188,
7566,
2567,
67,
5254,
1435,
787,
521,
82,
7923,
5893,
82,
7330,
67,
4172,
273,
2206,
13640,
19,
4757,
19,
31505,
7330,
6,
15204,
273,
875,
6350,
273,
... |
self.assertRaises(OverflowError, complex.__eq__, 1+1j, 1<<10000) | self.assertIs(complex.__eq__(1+1j, 1<<10000), False) | def test_richcompare(self): self.assertRaises(OverflowError, complex.__eq__, 1+1j, 1<<10000) self.assertIs(complex.__lt__(1+1j, None), NotImplemented) self.assertIs(complex.__eq__(1+1j, 1+1j), True) self.assertIs(complex.__eq__(1+1j, 2+2j), False) self.assertIs(complex.__ne__(1+1j, 1+1j), False) self.assertIs(complex.__ne__(1+1j, 2+2j), True) self.assertIs(complex.__lt__(1+1j, 2+2j), NotImplemented) self.assertIs(complex.__le__(1+1j, 2+2j), NotImplemented) self.assertIs(complex.__gt__(1+1j, 2+2j), NotImplemented) self.assertIs(complex.__ge__(1+1j, 2+2j), NotImplemented) self.assertRaises(TypeError, operator.lt, 1+1j, 2+2j) self.assertRaises(TypeError, operator.le, 1+1j, 2+2j) self.assertRaises(TypeError, operator.gt, 1+1j, 2+2j) self.assertRaises(TypeError, operator.ge, 1+1j, 2+2j) self.assertIs(operator.eq(1+1j, 1+1j), True) self.assertIs(operator.eq(1+1j, 2+2j), False) self.assertIs(operator.ne(1+1j, 1+1j), False) self.assertIs(operator.ne(1+1j, 2+2j), True) | c3828e6592ac8638d7f022554faa858f414c2b21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/c3828e6592ac8638d7f022554faa858f414c2b21/test_complex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
12761,
9877,
12,
2890,
4672,
365,
18,
11231,
2520,
12,
14259,
16186,
11253,
972,
12,
21,
15,
21,
78,
16,
404,
17685,
23899,
3631,
1083,
13,
365,
18,
11231,
2520,
12,
14259,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12761,
9877,
12,
2890,
4672,
365,
18,
11231,
2520,
12,
14259,
16186,
11253,
972,
12,
21,
15,
21,
78,
16,
404,
17685,
23899,
3631,
1083,
13,
365,
18,
11231,
2520,
12,
14259,
1... |
for res in result['Value']: site = res[0] count = res[1] if site: if not summary_dict.has_key(site): summary_dict[site] = {} summary_dict[site][st] = int(count) | for res in result['Value']: site = res[0] count = res[1] if site: if not summary_dict.has_key(site): summary_dict[site] = {} summary_dict[site][st] = int(count) | def getLCGPilotSummary(self,startdate='',enddate=''): """ Get summary of the pilot jobs status by site """ st_list = ['Aborted','Running','Done','Submitted','Ready','Scheduled','Waiting'] | bdfa23e095823805a4f6a3e95f6692e9c0b8786e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/bdfa23e095823805a4f6a3e95f6692e9c0b8786e/PilotAgentsDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9014,
39,
9681,
22797,
4733,
12,
2890,
16,
1937,
712,
2218,
2187,
409,
712,
2218,
11,
4672,
3536,
968,
4916,
434,
326,
293,
22797,
6550,
1267,
635,
2834,
3536,
384,
67,
1098,
273,
10228,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9014,
39,
9681,
22797,
4733,
12,
2890,
16,
1937,
712,
2218,
2187,
409,
712,
2218,
11,
4672,
3536,
968,
4916,
434,
326,
293,
22797,
6550,
1267,
635,
2834,
3536,
384,
67,
1098,
273,
10228,... |
def translate(self, domain, msgid, mapping=None, default=None): | def translate(self, msgid, domain=None, mapping=None, default=None): | def evaluateMacro(self, expr): macro = Context.evaluateMacro(self, expr) macro = removeAllProxies(macro) return macro | bc1908020050391c5f2e6d27e23cbd13f73c1fe8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9525/bc1908020050391c5f2e6d27e23cbd13f73c1fe8/engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5956,
17392,
12,
2890,
16,
3065,
4672,
11522,
273,
1772,
18,
21024,
17392,
12,
2890,
16,
3065,
13,
11522,
273,
12787,
21488,
12,
26448,
13,
327,
11522,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
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,
5956,
17392,
12,
2890,
16,
3065,
4672,
11522,
273,
1772,
18,
21024,
17392,
12,
2890,
16,
3065,
13,
11522,
273,
12787,
21488,
12,
26448,
13,
327,
11522,
2,
-100,
-100,
-100,
-100,
-100,
-... |
storesemi = semitrans semitrans = {} child = node.children while child: if isFinalNode(child): PlaceHolder += 1 newmsg = doSerialize(child) result = '<placeholder-%d/>' % (PlaceHolder) if mode=='merge': semitrans[PlaceHolder] = getTranslation(newmsg, isSpacePreserveNode(node)) else: result = doSerialize(child) outtxt += result child = child.next if final: outtxt = processFinalTag(node, outtxt) PlaceHolder = storeholder semitrans = storesemi return '<%s>%s</%s>' % (startTagForNode(node), outtxt, node.name) else: if worthOutputting(node): if mode == 'merge': replaceNodeContentsWithText(node,getTranslation(outtxt, isSpacePreserveNode(node))) | submsgs = {} child = node.children while child: if isFinalNode(child): PlaceHolder += 1 (starttag, submsg, endtag) = processElementTag(child) outtxt += '<placeholder-%d/>' % (PlaceHolder) if mode=='merge': submsgs[PlaceHolder] = (starttag, getTranslation(submsg, isSpacePreserveNode(node)), endtag) | def processElementTag(node): """Process node with node.type == 'element'.""" if node.type == 'element': global PlaceHolder global semitrans final = isFinalNode(node) outtxt = '' if final: storeholder = PlaceHolder PlaceHolder = 0 storesemi = semitrans semitrans = {} child = node.children while child: if isFinalNode(child): PlaceHolder += 1 newmsg = doSerialize(child) result = '<placeholder-%d/>' % (PlaceHolder) if mode=='merge': semitrans[PlaceHolder] = getTranslation(newmsg, isSpacePreserveNode(node)) else: result = doSerialize(child) outtxt += result child = child.next if final: outtxt = processFinalTag(node, outtxt) PlaceHolder = storeholder semitrans = storesemi return '<%s>%s</%s>' % (startTagForNode(node), outtxt, node.name) else: if worthOutputting(node): if mode == 'merge': replaceNodeContentsWithText(node,getTranslation(outtxt, isSpacePreserveNode(node))) else: msg.outputMessage(outtxt, node.lineNo(), getCommentForNode(node), isSpacePreserveNode(node)) return '<%s>%s</%s>' % (startTagForNode(node), outtxt, node.name) else: raise Exception("You must pass node with node.type=='element'.") | 7df7f38ebfe0a2ba10334c996b94f4d81999bf11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11802/7df7f38ebfe0a2ba10334c996b94f4d81999bf11/xml2po.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
1046,
1805,
12,
2159,
4672,
3536,
2227,
756,
598,
756,
18,
723,
422,
296,
2956,
11,
12123,
309,
756,
18,
723,
422,
296,
2956,
4278,
2552,
13022,
6064,
2552,
6111,
305,
28001,
727,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
1046,
1805,
12,
2159,
4672,
3536,
2227,
756,
598,
756,
18,
723,
422,
296,
2956,
11,
12123,
309,
756,
18,
723,
422,
296,
2956,
4278,
2552,
13022,
6064,
2552,
6111,
305,
28001,
727,
... |
tr_cls = TranslationModelAdmin | tr_cls = type("%s.Translation" % cls.__name__, (TranslationModelAdmin,), {}) | def get_translation_modeladmin(cls, model): if hasattr(cls, 'Translation'): tr_cls = cls.Translation if not issubclass(tr_cls, TranslationModelAdmin): raise ValueError, ("%s.Translation must be a subclass " + " of multilingual.TranslationModelAdmin.") % cls.name else: tr_cls = TranslationModelAdmin tr_cls.model = model._meta.translation_model tr_cls.fk_name = 'master' tr_cls.extra = get_language_count() tr_cls.max_num = get_language_count() return tr_cls | e4c60cb253faaec824c60c5a528434b5b1ec2a09 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12035/e4c60cb253faaec824c60c5a528434b5b1ec2a09/translation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
10173,
67,
2284,
3666,
12,
6429,
16,
938,
4672,
309,
3859,
12,
6429,
16,
296,
6717,
11,
4672,
433,
67,
6429,
273,
2028,
18,
6717,
309,
486,
14664,
12,
313,
67,
6429,
16,
174... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10173,
67,
2284,
3666,
12,
6429,
16,
938,
4672,
309,
3859,
12,
6429,
16,
296,
6717,
11,
4672,
433,
67,
6429,
273,
2028,
18,
6717,
309,
486,
14664,
12,
313,
67,
6429,
16,
174... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.