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 |
|---|---|---|---|---|---|---|
number=string.atoi(mynewver[0]) | number=string.atof(mynewver[0]) | def relparse(myver): number=0 p1=0 p2=0 mynewver=string.split(myver,"_") if len(mynewver)==2: #alpha,beta or pre number=string.atoi(mynewver[0]) if "beta" == mynewver[1][:4]: p1=-2 try: p2=string.atoi(mynewver[1][4:]) except: p2=0 elif "alpha" == mynewver[1][:5]: p1=-3 try: p2=string.atoi(mynewver[1][5:]) except: p2=0 elif "pre" ==mynewver[1][:3]: p1=-1 try: p2=string.atoi(mynewver[1][3:]) except: p2=0 else: #normal number or number with letter at end divider=len(myver)-1 if myver[divider:] not in "1234567890": #letter at end p1=ord(myver[divider:]) number=string.atoi(myver[0:divider]) else: number=string.atoi(myver) return [number,p1,p2] | bf1d4a46ac17daab2992ead08fc46ba63d2a4baa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2807/bf1d4a46ac17daab2992ead08fc46ba63d2a4baa/portage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1279,
2670,
12,
4811,
502,
4672,
1300,
33,
20,
293,
21,
33,
20,
293,
22,
33,
20,
312,
878,
359,
502,
33,
1080,
18,
4939,
12,
4811,
502,
10837,
67,
7923,
309,
562,
12,
81,
878,
359,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1279,
2670,
12,
4811,
502,
4672,
1300,
33,
20,
293,
21,
33,
20,
293,
22,
33,
20,
312,
878,
359,
502,
33,
1080,
18,
4939,
12,
4811,
502,
10837,
67,
7923,
309,
562,
12,
81,
878,
359,... |
if len(sys.argv) == 2 and sys.argv[1] == "--terminate": | try: opts, args = getopt.getopt(sys.argv[1:], '', ['terminate', 'port=']) except getopt.GetoptError: LOG.error("Usage: %s [--port= sys.exit(0) opts = dict(opts) if '--port' in opts: try: tcp_port = int(opts['--port']) if not (1 <= tcp_port < 65536): raise ValueError except ValueError: LOG.error("Port must be between 1-65535") sys.exit(0) if '--terminate' in opts: | def terminate(): # Terminate another Dtella process on the local machine try: LOG.info("Sending Packet of Death...") sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(('127.0.0.1', tcp_port)) sock.sendall("$KillDtella|") sock.close() except socket.error: return False return True | 669517b0cab2aa0edcbedbcbdf59aaaa8acbafce /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12372/669517b0cab2aa0edcbedbcbdf59aaaa8acbafce/dtella.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10850,
13332,
468,
23945,
4042,
463,
88,
1165,
69,
1207,
603,
326,
1191,
5228,
225,
775,
30,
2018,
18,
1376,
2932,
16322,
11114,
434,
1505,
421,
7070,
13,
7313,
273,
2987,
18,
7814,
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,
10850,
13332,
468,
23945,
4042,
463,
88,
1165,
69,
1207,
603,
326,
1191,
5228,
225,
775,
30,
2018,
18,
1376,
2932,
16322,
11114,
434,
1505,
421,
7070,
13,
7313,
273,
2987,
18,
7814,
12,
... |
self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) gtk.main_iteration() | if self.fullscreen_mode == False and (self.slideshow_mode == False or (self.slideshow_mode == True and action != "ss")): self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) gtk.main_iteration() | def goto_first_image(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) if len(self.image_list) > 1 and self.curr_img_in_list != 0: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_idle2) except: pass cancel = self.autosave_image() if cancel == True: return self.randomlist = [] self.curr_img_in_list = 0 self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) gtk.main_iteration() try: self.load_new_image(False, False, False, True, True) except: self.image_load_failed(True) self.set_go_navigation_sensitivities(False) if self.slideshow_mode == True: if self.curr_slideshow_random == True: self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_random_image, "ss") else: self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_next_image, "ss") self.preload_when_idle = gobject.idle_add(self.preload_next_image, False) self.preload_when_idle2 = gobject.idle_add(self.preload_prev_image, False) | 27d2355de4fb441298280d91b3753c51d39b2607 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/27d2355de4fb441298280d91b3753c51d39b2607/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2897,
67,
3645,
67,
2730,
12,
2890,
16,
1301,
4672,
309,
365,
18,
2069,
4369,
13606,
67,
3188,
422,
1053,
471,
1301,
480,
315,
1049,
6877,
314,
1612,
18,
3168,
67,
4479,
12,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2897,
67,
3645,
67,
2730,
12,
2890,
16,
1301,
4672,
309,
365,
18,
2069,
4369,
13606,
67,
3188,
422,
1053,
471,
1301,
480,
315,
1049,
6877,
314,
1612,
18,
3168,
67,
4479,
12,
2890,
18,
... |
cmd = "/bin/mount -t ext3 " + self.devidex + "part1" res = system(cmd) return (res >> 8) | res = -1 for device in [self.devidex, self.devidex2]: cmd = "/bin/mount -t ext3 " + device + "part1" res = system(cmd) res >>= 8 if not res: break return res | def mount(self): cmd = "/bin/mount -t ext3 " + self.devidex + "part1" res = system(cmd) return (res >> 8) | 6860bccf8a14d5cea270b6bb0823e2f9cf90f060 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/6860bccf8a14d5cea270b6bb0823e2f9cf90f060/Harddisk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5344,
12,
2890,
4672,
1797,
273,
2206,
4757,
19,
4778,
300,
88,
1110,
23,
315,
397,
365,
18,
323,
522,
561,
397,
315,
2680,
21,
6,
400,
273,
2619,
12,
4172,
13,
327,
261,
455,
1671,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5344,
12,
2890,
4672,
1797,
273,
2206,
4757,
19,
4778,
300,
88,
1110,
23,
315,
397,
365,
18,
323,
522,
561,
397,
315,
2680,
21,
6,
400,
273,
2619,
12,
4172,
13,
327,
261,
455,
1671,
... |
(True, [(self._rname(fname), HKR_SKIP, "")])) | [(self._rname(fname), HKR_SKIP, "")]) | def testSkipDir(self): """Test skip directory""" for phase in (constants.HOOKS_PHASE_PRE, constants.HOOKS_PHASE_POST): fname = "%s/testdir" % self.ph_dirs[phase] os.mkdir(fname) self.torm.append((fname, True)) self.failUnlessEqual(self.hr.RunHooks(self.hpath, phase, {}), (True, [(self._rname(fname), HKR_SKIP, "")])) | d019f8bd60a89046f649f012954c96929d036db0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/d019f8bd60a89046f649f012954c96929d036db0/ganeti.hooks_unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
6368,
1621,
12,
2890,
4672,
3536,
4709,
2488,
1867,
8395,
364,
6855,
316,
261,
13358,
18,
7995,
3141,
55,
67,
8939,
4429,
67,
3670,
16,
6810,
18,
7995,
3141,
55,
67,
8939,
4429,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6368,
1621,
12,
2890,
4672,
3536,
4709,
2488,
1867,
8395,
364,
6855,
316,
261,
13358,
18,
7995,
3141,
55,
67,
8939,
4429,
67,
3670,
16,
6810,
18,
7995,
3141,
55,
67,
8939,
4429,
... |
feed = self.doclist.QueryDocumentListFeed(query) | feed = self.client.QueryDocumentListFeed(query) | def testExportDocument(self): query = ('http://docs.google.com/feeds/documents/private/full' '/-/document?max-results=1') feed = self.doclist.QueryDocumentListFeed(query) file_paths = ['./downloadedTest.doc', './downloadedTest.html', './downloadedTest.odt', './downloadedTest.pdf', './downloadedTest.png', './downloadedTest.rtf', './downloadedTest.txt', './downloadedTest.zip'] for path in file_paths: self.doclist.DownloadDocument(feed.entry[0], path) self.assert_(os.path.exists(path)) self.assert_(os.path.getsize(path)) os.remove(path) | dcc46816af19bac967f4b588353a3ee4514dd5d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6580/dcc46816af19bac967f4b588353a3ee4514dd5d2/service_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
6144,
2519,
12,
2890,
4672,
843,
273,
7707,
2505,
2207,
8532,
18,
9536,
18,
832,
19,
7848,
87,
19,
24795,
19,
1152,
19,
2854,
11,
1173,
17,
19,
5457,
35,
1896,
17,
4717,
33,
21... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
6144,
2519,
12,
2890,
4672,
843,
273,
7707,
2505,
2207,
8532,
18,
9536,
18,
832,
19,
7848,
87,
19,
24795,
19,
1152,
19,
2854,
11,
1173,
17,
19,
5457,
35,
1896,
17,
4717,
33,
21... |
""" Compare a value to a LIGOTimeGPS. If the value being compared to the LIGOTimeGPS is not also a LIGOTimeGPS, then an attempt is made to convert it to a LIGOTimeGPS. Example use (all are equivalent): LIGOTimeGPS(100.5) < LIGOTimeGPS(200) LIGOTimeGPS(100.5) < 200 LIGOTimeGPS(100.5) < "200" """ | """ Compare a value to a LIGOTimeGPS. If the value being compared to the LIGOTimeGPS is not also a LIGOTimeGPS, then an attempt is made to convert it to a LIGOTimeGPS. Example use (all are equivalent): LIGOTimeGPS(100.5) < LIGOTimeGPS(200) LIGOTimeGPS(100.5) < 200 LIGOTimeGPS(100.5) < "200" """ | def __cmp__(self, other): | 6bd9b206313336554b64d1ec732fcfdde7d0ad94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3589/6bd9b206313336554b64d1ec732fcfdde7d0ad94/lal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
plain = f.space.is_true(f.space.is_(w_locals, f.w_locals)) | plain = (f.w_locals is not None and f.space.is_true(f.space.is_(w_locals, f.w_locals))) | def EXEC_STMT(f): w_locals = f.valuestack.pop() w_globals = f.valuestack.pop() w_prog = f.valuestack.pop() flags = f.space.getexecutioncontext().compiler.getcodeflags(f.pycode) w_compile_flags = f.space.wrap(flags) w_resulttuple = prepare_exec(f.space, f.space.wrap(f), w_prog, w_globals, w_locals, w_compile_flags, f.space.wrap(f.builtin), f.space.gettypeobject(PyCode.typedef)) w_prog, w_globals, w_locals = f.space.unpacktuple(w_resulttuple, 3) | 56f9eef797b52af24f5072c765a0236c529d4b3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/56f9eef797b52af24f5072c765a0236c529d4b3a/pyopcode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24508,
67,
882,
6152,
12,
74,
4672,
341,
67,
17977,
225,
273,
284,
18,
4531,
395,
484,
18,
5120,
1435,
341,
67,
16227,
273,
284,
18,
4531,
395,
484,
18,
5120,
1435,
341,
67,
14654,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24508,
67,
882,
6152,
12,
74,
4672,
341,
67,
17977,
225,
273,
284,
18,
4531,
395,
484,
18,
5120,
1435,
341,
67,
16227,
273,
284,
18,
4531,
395,
484,
18,
5120,
1435,
341,
67,
14654,
5... |
milestone = Milestone(self.__env, name) | milestone = Milestone(self.env_open(), name) | def _do_milestone_set_due(self, name, t): milestone = Milestone(self.__env, name) milestone.due = self._parse_date(t) milestone.update() | 8bfd000da40b8168bc7c6543227d6aa794adcb52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8bfd000da40b8168bc7c6543227d6aa794adcb52/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
81,
18270,
67,
542,
67,
24334,
12,
2890,
16,
508,
16,
268,
4672,
28664,
273,
490,
18270,
12,
2890,
18,
3074,
67,
3190,
9334,
508,
13,
28664,
18,
24334,
273,
365,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
81,
18270,
67,
542,
67,
24334,
12,
2890,
16,
508,
16,
268,
4672,
28664,
273,
490,
18270,
12,
2890,
18,
3074,
67,
3190,
9334,
508,
13,
28664,
18,
24334,
273,
365,
6315,
... |
if os.path.isdir(fullpath): copyTree(fullpath, os.path.join(destdir, name), patterns) | if os.path.isdir(fullpath) and not name in excludes: copyTree(fullpath, os.path.join(destdir, name), patterns, excludes) | def copyTree(srcdir, destdir, patterns): for pattern in patterns: matches = glob.glob(os.path.join(srcdir, pattern)) for match in matches: if os.path.isfile(match): if not os.path.exists(destdir): _mkdirs(destdir) shutil.copy(match, destdir) for name in os.listdir(srcdir): fullpath = os.path.join(srcdir, name) if os.path.isdir(fullpath): copyTree(fullpath, os.path.join(destdir, name), patterns) | 070b97fa13d1f4398864d1f8193a2166600efbba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/070b97fa13d1f4398864d1f8193a2166600efbba/hardhatlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
2471,
12,
4816,
1214,
16,
1570,
1214,
16,
6884,
4672,
364,
1936,
316,
6884,
30,
1885,
273,
4715,
18,
10581,
12,
538,
18,
803,
18,
5701,
12,
4816,
1214,
16,
1936,
3719,
364,
845,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
2471,
12,
4816,
1214,
16,
1570,
1214,
16,
6884,
4672,
364,
1936,
316,
6884,
30,
1885,
273,
4715,
18,
10581,
12,
538,
18,
803,
18,
5701,
12,
4816,
1214,
16,
1936,
3719,
364,
845,
... |
print ">> Frontpanel LED changed" print ">> FP led:", self.source.value | def changed(self, *args, **kwargs): print ">> Frontpanel LED changed" print ">> FP led:", self.source.value if self.source.value: pattern = 0x55555555 speed = 20 else: pattern = 0 speed = 1 | 040a8d3881183823ac69b86b5549ab8c22707b7e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6652/040a8d3881183823ac69b86b5549ab8c22707b7e/FrontpanelLed.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3550,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
309,
365,
18,
3168,
18,
1132,
30,
1936,
273,
374,
92,
27982,
27982,
8632,
273,
4200,
469,
30,
1936,
273,
374,
8632,
273,
404,
2,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3550,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
309,
365,
18,
3168,
18,
1132,
30,
1936,
273,
374,
92,
27982,
27982,
8632,
273,
4200,
469,
30,
1936,
273,
374,
8632,
273,
404,
2,
... | |
fcntl.fcntl(sys.stdin, fcntl.F_SETFL, os.O_NDELAY) | fcntl.fcntl(sys.stdin, fcntl.F_SETFL, \ fcntl.fcntl(sys.stdin, fcntl.F_GETFL) | os.O_NDELAY) | def bind_stdin(worker): assert not sys.stdin.isatty() # Switch stdin to non blocking mode fcntl.fcntl(sys.stdin, fcntl.F_SETFL, os.O_NDELAY) # Create a simple worker attached to stdin in autoclose mode worker_stdin = WorkerSimple(sys.stdin, None, None, None, handler=StdInputHandler(worker), timeout=-1, autoclose=True) # Add stdin worker to the same task than given worker worker.task.schedule(worker_stdin) | f4146f209c675e624398751cf45810e5a0f8f31a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11479/f4146f209c675e624398751cf45810e5a0f8f31a/clush.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1993,
67,
21772,
12,
10124,
4672,
1815,
486,
2589,
18,
21772,
18,
291,
270,
4098,
1435,
468,
13967,
8801,
358,
1661,
9445,
1965,
30894,
18,
7142,
16681,
12,
9499,
18,
21772,
16,
30894,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1993,
67,
21772,
12,
10124,
4672,
1815,
486,
2589,
18,
21772,
18,
291,
270,
4098,
1435,
468,
13967,
8801,
358,
1661,
9445,
1965,
30894,
18,
7142,
16681,
12,
9499,
18,
21772,
16,
30894,
1... |
self.scheduler.submit( task, requirements ) self.bossLiteSession.updateDB(task) return task def query( self, taskId, jobRange='all', queryType='node', runningAttrs=None, strict=True ): """ query status and eventually other scheduler related information - taskId can be both a Task object or the task id - jobRange can be of the form: 'a,b:c,d,e' ['a',b','c'] 'all' - query type can be 'parent' if the status check is meant to be performed via bulk id - all: if False, only jobs with non closed running instances are loaded """ task = self.bossLiteSession.load( taskId, jobRange, \ runningAttrs=runningAttrs, \ strict=strict )[0] self.scheduler.query( task, queryType ) self.bossLiteSession.updateDB(task) return task def getOutput( self, taskId, jobRange='all', outdir='' ): """ retrieve output or just put it in the destination directory - taskId can be both a Task object or the task id - jobRange can be of the form: 'a,b:c,d,e' ['a',b','c'] 'all' - outdir is the output directory for files retrieved """ task = self.bossLiteSession.load( taskId, jobRange )[0] self.scheduler.getOutput( task, outdir ) self.bossLiteSession.updateDB(task) return task def kill( self, taskId, jobRange='all' ): """ kill the job instance - taskId can be both a Task object or the task id - jobRange can be of the form: 'a,b:c,d,e' ['a',b','c'] 'all' """ task = self.bossLiteSession.load( taskId, jobRange )[0] self.scheduler.kill( task ) self.bossLiteSession.updateDB(task) return task def matchResources( self, taskId, jobRange='all', requirements='', jobAttributes=None ) : """ perform a resources discovery - taskId can be both a Task object or the task id - jobRange can be of the form: 'a,b:c,d,e' ['a',b','c'] 'all' """ task = self.bossLiteSession.load( taskId, jobRange )[0] for job in task.jobs: self.bossLiteSession.getRunningInstance( job, { 'schedulerAttributes' : jobAttributes } ) return self.scheduler.matchResources( task, requirements ) def lcgInfo(self, tags, seList=None, blacklist=None, whitelist=None, vo='cms'): """ execute a resources discovery through bdii returns a list of resulting sites """ return self.scheduler.lcgInfo( tags, seList, blacklist, whitelist, vo ) def jobDescription ( self, taskId, jobRange='all', requirements='', jobAttributes=None ): """ query status and eventually other scheduler related information - taskId can be both a Task object or the task id - jobRange can be of the form: 'a,b:c,d,e' ['a',b','c'] 'all' - requirements are scheduler attributes affecting all jobs - jobAttributes is a map of running attributes to be applyed at the job level """ task = self.bossLiteSession.load( taskId, jobRange )[0] for job in task.jobs: self.bossLiteSession.getRunningInstance( job, { 'schedulerAttributes' : jobAttributes } ) | def resubmit( self, taskId, jobRange='all', requirements='', jobAttributes=None ): """ archive existing submission an create a new entry for the next submission (i.e. duplicate the entry with an incremented submission number) instances and submit to the scheduler - taskId can be both a Task object or the task id - jobRange can be of the form: 'a,b:c,d,e' ['a',b','c'] 'all' - requirements are scheduler attributes affecting all jobs - jobAttributes is a map of running attributes """ | de8cfc5ce6e4611ed35672f02db8e9e238213bf2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/de8cfc5ce6e4611ed35672f02db8e9e238213bf2/BossLiteAPISched.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
400,
373,
1938,
12,
365,
16,
15321,
16,
1719,
2655,
2218,
454,
2187,
8433,
2218,
2187,
1719,
2498,
33,
7036,
262,
30,
3536,
5052,
2062,
8515,
392,
752,
279,
394,
1241,
364,
326,
1024,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
400,
373,
1938,
12,
365,
16,
15321,
16,
1719,
2655,
2218,
454,
2187,
8433,
2218,
2187,
1719,
2498,
33,
7036,
262,
30,
3536,
5052,
2062,
8515,
392,
752,
279,
394,
1241,
364,
326,
1024,
... | |
if __debug__: stderr = re.sub(r"\[\d+ refs\]\r?\n?$", "", stderr) return stderr | return re.sub(r"\[\d+ refs\]\r?\n?$", "", stderr) | def remove_stderr_debug_decorations(stderr): if __debug__: stderr = re.sub(r"\[\d+ refs\]\r?\n?$", "", stderr) return stderr | eafdcd9e81518f8dccc6b6e10c2b91168e7f69f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/eafdcd9e81518f8dccc6b6e10c2b91168e7f69f2/test_subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
11241,
67,
4148,
67,
11880,
1012,
12,
11241,
4672,
327,
283,
18,
1717,
12,
86,
12691,
7438,
72,
15,
9047,
64,
13944,
86,
10936,
82,
35,
8,
3113,
23453,
4514,
13,
225,
2,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1206,
67,
11241,
67,
4148,
67,
11880,
1012,
12,
11241,
4672,
327,
283,
18,
1717,
12,
86,
12691,
7438,
72,
15,
9047,
64,
13944,
86,
10936,
82,
35,
8,
3113,
23453,
4514,
13,
225,
2,
-1... |
if node.nodeType == xml.dom.Node.ELEMENT_NODE and node.tagName == "description": | if node.nodeType != xml.dom.Node.ELEMENT_NODE or node.tagName != "description": continue if node.hasChildNodes() and len(node.childNodes) == 1: if xmlutils.hasChildTextNode(node): return node child = node.firstChild if child.nodeType == xml.dom.Node.ELEMENT_NODE and child.tagName == "para" and xmlutils.hasChildTextNode(child): return node else: | def __get_description_element(self): children = self.__node.childNodes for node in children: # Here I assume that description is a text node; I am not sure # it's a good assumption if node.nodeType == xml.dom.Node.ELEMENT_NODE and node.tagName == "description": return node else: return None return None | 383d1ea09131aceeedbf34d4157defbcc5d937fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3011/383d1ea09131aceeedbf34d4157defbcc5d937fd/Item.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
67,
3384,
67,
2956,
12,
2890,
4672,
2325,
273,
365,
16186,
2159,
18,
3624,
3205,
364,
756,
316,
2325,
30,
468,
13743,
467,
6750,
716,
2477,
353,
279,
977,
756,
31,
467,
2125... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
588,
67,
3384,
67,
2956,
12,
2890,
4672,
2325,
273,
365,
16186,
2159,
18,
3624,
3205,
364,
756,
316,
2325,
30,
468,
13743,
467,
6750,
716,
2477,
353,
279,
977,
756,
31,
467,
2125... |
cmdline = "%s -u %s" % (interp, cmdline) if '=' not in query and '"' not in query: cmdline = '%s "%s"' % (cmdline, query) self.log_message("command: %s", cmdline) | cmdline = [interp, '-u'] + cmdline if '=' not in query: cmdline.append(query) self.log_message("command: %s", subprocess.list2cmdline(cmdline)) | def run_cgi(self): """Execute a CGI script.""" path = self.path dir, rest = self.cgi_info | 6fd181e7964ee35b817e3c8b7b605cd2a3193c8c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/6fd181e7964ee35b817e3c8b7b605cd2a3193c8c/CGIHTTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
19062,
12,
2890,
4672,
3536,
5289,
279,
385,
13797,
2728,
12123,
589,
273,
365,
18,
803,
1577,
16,
3127,
273,
365,
18,
19062,
67,
1376,
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,
1086,
67,
19062,
12,
2890,
4672,
3536,
5289,
279,
385,
13797,
2728,
12123,
589,
273,
365,
18,
803,
1577,
16,
3127,
273,
365,
18,
19062,
67,
1376,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
elif st == '-D' or st == '/D': | elif st == '-D' or (self.env.CXX_NAME == 'msvc' and st == '/D'): | def configure(conf): conf.parse_flags('-O3', uselib_store='FOO') # conf.env.CXXFLAGS_FOO = ['-O3'] # conf.env.CFLAGS_FOO = ['-O3'] | ddc015498e143488260a6f89a8cb42669c657d29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2886/ddc015498e143488260a6f89a8cb42669c657d29/c_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
12,
3923,
4672,
2195,
18,
2670,
67,
7133,
2668,
17,
51,
23,
2187,
584,
30575,
67,
2233,
2218,
3313,
51,
6134,
468,
2195,
18,
3074,
18,
39,
5619,
17836,
67,
3313,
51,
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,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
12,
3923,
4672,
2195,
18,
2670,
67,
7133,
2668,
17,
51,
23,
2187,
584,
30575,
67,
2233,
2218,
3313,
51,
6134,
468,
2195,
18,
3074,
18,
39,
5619,
17836,
67,
3313,
51,
273,
10228,
... |
if os.sep in name: | if os.sep in name or sys.platform == 'OpenVMS': | def find_exe(name, default=None): '''find path of an executable. if name contains a path component, return it as is. otherwise, use normal executable search path.''' if os.sep in name: # don't check the executable bit. if the file isn't # executable, whoever tries to actually run it will give a # much more useful error message. return name return find_in_path(name, os.environ.get('PATH', ''), default=default) | 1b9b4c8c4ab3ad9e7708755a6769376d0a104d56 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/1b9b4c8c4ab3ad9e7708755a6769376d0a104d56/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
14880,
12,
529,
16,
805,
33,
7036,
4672,
9163,
4720,
589,
434,
392,
9070,
18,
309,
508,
1914,
279,
589,
1794,
16,
327,
518,
487,
353,
18,
225,
3541,
16,
999,
2212,
9070,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
14880,
12,
529,
16,
805,
33,
7036,
4672,
9163,
4720,
589,
434,
392,
9070,
18,
309,
508,
1914,
279,
589,
1794,
16,
327,
518,
487,
353,
18,
225,
3541,
16,
999,
2212,
9070,
16... |
self.log.verbose( "Transfer file %s is already registered in %s SE" % ( file, transferDict[ 'OutputSE' ] ) ) | self.log.verbose( "Transfer file %s is already registered in %s SE" % ( file, seName ) ) | def isRegisteredInOutputCatalog( self, file, transferDict ): fc = FileCatalog( [ transferDict[ 'OutputFC' ] ] ) lfn = os.path.join( transferDict['OutputPath'], os.path.basename( file ) ) result = fc.getReplicas( lfn ) if not result[ 'OK' ]: return result if lfn not in result[ 'Value' ][ 'Successful' ]: return S_OK( False ) replicas = result[ 'Value' ][ 'Successful' ][ lfn ] for seName in List.fromChar( transferDict[ 'OutputSE' ], "," ): if seName in replicas: self.log.verbose( "Transfer file %s is already registered in %s SE" % ( file, transferDict[ 'OutputSE' ] ) ) return S_OK( True ) return S_OK( False ) | 0de5792f40cfda1bc4a3815f4b2b59da7d2b0711 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12038/0de5792f40cfda1bc4a3815f4b2b59da7d2b0711/OutputDataExecutor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
10868,
382,
1447,
9769,
12,
365,
16,
585,
16,
7412,
5014,
262,
30,
8036,
273,
1387,
9769,
12,
306,
7412,
5014,
63,
296,
1447,
4488,
11,
308,
308,
262,
328,
4293,
273,
1140,
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,
353,
10868,
382,
1447,
9769,
12,
365,
16,
585,
16,
7412,
5014,
262,
30,
8036,
273,
1387,
9769,
12,
306,
7412,
5014,
63,
296,
1447,
4488,
11,
308,
308,
262,
328,
4293,
273,
1140,
18,
... |
else: net_perms = obj.perm_query( self._uid, self._min_perms, networks = True, required_perms = required_perms, do_subquery=False ).alias('net_perms') host_perms = obj.perm_query( self._uid, self._min_perms, hosts = True, required_perms = required_perms, do_subquery=False ).alias('host_perms') hosts = hosts.outerjoin(host_perms, host_perms.c.mac == obj.hosts.c.mac) hosts = hosts.outerjoin(net_perms, net_perms.c.nid == obj.addresses.c.network) whereclause.append( or_( host_perms.c.permissions != None, net_perms.c.permissions != None ) ) hosts = select(columns, from_obj=hosts, distinct=True) if whereclause: whereclause = self._finalize_whereclause( whereclause ) hosts = hosts.where(whereclause) | def _get_hosts( self, mac=None, hostname=None, ip=None, network=None, uid=None, username=None, gid=None, columns=None, additional_perms=None, expiring=False, namesearch=None, show_expired=True, show_active=True, only_dynamics=False, only_statics=False, funky_ordering=False ): """ Get hosts and DNS records from the DB @param mac: return a list containing the host with this mac @param hostname: hostname (allowing wildcards) on which to filter @param ip: return host associated (statically) with this IP @param network: network on which to filter @param username: a username on which to filter @param gid: return only the hosts in this group ID @param columns: list of columns to select. defaults to [obj.hosts] @param additional_perms: return hosts that meet these additional permission requirements @param expiring: show hosts that are expiring within this many days @param show_expired: default true, will show all hosts that have expired before now. If false, will only show non-expired hosts. @param show_active: default true, will show all hosts that are active now. If false, will not show non-expired hosts. @param only_dynamics: only return dynamic addresses @param only_statics: only return statics addresses @param funky_ordering: if on, hosts are ordered by hostname length ... fixes problems with guest registrations """ | ef8326d939b90cd0f82890e391dfdfffa80315d7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7602/ef8326d939b90cd0f82890e391dfdfffa80315d7/interface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
11588,
12,
365,
16,
5318,
33,
7036,
16,
5199,
33,
7036,
16,
2359,
33,
7036,
16,
2483,
33,
7036,
16,
4555,
33,
7036,
16,
2718,
33,
7036,
16,
11399,
33,
7036,
16,
2168,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
11588,
12,
365,
16,
5318,
33,
7036,
16,
5199,
33,
7036,
16,
2359,
33,
7036,
16,
2483,
33,
7036,
16,
4555,
33,
7036,
16,
2718,
33,
7036,
16,
11399,
33,
7036,
16,
2168,
... | |
err = PyMac_GetFullPathname(&_self->ob_itself, strbuf, sizeof(strbuf)); | err = _PyMac_GetFullPathname(&_self->ob_itself, strbuf, sizeof(strbuf)); | def parseArgumentList(self, args): args0, arg1, argsrest = args[:1], args[1], args[2:] t0, n0, m0 = arg1 args = args0 + argsrest if m0 != InMode: raise ValueError, "method's 'self' must be 'InMode'" self.itself = Variable(t0, "_self->ob_itself", SelfMode) FunctionGenerator.parseArgumentList(self, args) self.argumentList.insert(2, self.itself) | 0f3182fae6733bc04d68c638077bfe33e0583bf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/0f3182fae6733bc04d68c638077bfe33e0583bf0/filesupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
1379,
682,
12,
2890,
16,
833,
4672,
833,
20,
16,
1501,
21,
16,
833,
8792,
273,
833,
10531,
21,
6487,
833,
63,
21,
6487,
833,
63,
22,
26894,
268,
20,
16,
290,
20,
16,
312,
20,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
1379,
682,
12,
2890,
16,
833,
4672,
833,
20,
16,
1501,
21,
16,
833,
8792,
273,
833,
10531,
21,
6487,
833,
63,
21,
6487,
833,
63,
22,
26894,
268,
20,
16,
290,
20,
16,
312,
20,... |
- This function is based on Networkx's implementation of the Bron and Kerbosch Algorithm, [1]. | This function is based on Networkx's implementation of the Bron and Kerbosch Algorithm [BroKer1973]_. | def cliques_maximal(self): """ Returns the list of all maximal cliques, with each clique represented by a list of vertices. A clique is an induced complete subgraph, and a maximal clique is one not contained in a larger one. NOTES: - Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. ALGORITHM: - This function is based on Networkx's implementation of the Bron and Kerbosch Algorithm, [1]. REFERENCE: | 4d21654ae2813492a80b8824b12317601c305bce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/4d21654ae2813492a80b8824b12317601c305bce/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4942,
29896,
67,
1896,
2840,
12,
2890,
4672,
3536,
2860,
326,
666,
434,
777,
943,
2840,
4942,
29896,
16,
598,
1517,
31380,
10584,
635,
279,
666,
434,
6928,
18,
432,
31380,
353,
392,
1547... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4942,
29896,
67,
1896,
2840,
12,
2890,
4672,
3536,
2860,
326,
666,
434,
777,
943,
2840,
4942,
29896,
16,
598,
1517,
31380,
10584,
635,
279,
666,
434,
6928,
18,
432,
31380,
353,
392,
1547... |
print array_value, | if (count == value - 1): sys.stdout.softspace=0 print array_value, else: sys.stdout.softspace=0 print ("%u," % array_value), | def ProcessLine(self, line): fields = line.strip().split(' ') [timestamp, ac_id, msg_id] = fields[0:3] data_fields = map(lambda x: chr(int(x, 16)), fields[4:]) ac_id = int(ac_id) timestamp = float(timestamp) msg_id = int(msg_id) | 80a0b601ac6c873cb3de95b47b56a16ae72899c6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14091/80a0b601ac6c873cb3de95b47b56a16ae72899c6/onboard_log_transform.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4389,
1670,
12,
2890,
16,
980,
4672,
1466,
273,
980,
18,
6406,
7675,
4939,
2668,
8624,
306,
5508,
16,
1721,
67,
350,
16,
1234,
67,
350,
65,
273,
1466,
63,
20,
30,
23,
65,
501,
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,
4389,
1670,
12,
2890,
16,
980,
4672,
1466,
273,
980,
18,
6406,
7675,
4939,
2668,
8624,
306,
5508,
16,
1721,
67,
350,
16,
1234,
67,
350,
65,
273,
1466,
63,
20,
30,
23,
65,
501,
67,
... |
Returns the a-statistic for the Dyck word correspond to the area of the Dyck path. | Returns the a-statistic for the Dyck word corresponding to the area of the Dyck path. | def a_statistic(self): """ Returns the a-statistic for the Dyck word correspond to the area of the Dyck path. One can view a balanced Dyck word as a lattice path from `(0,0)` to `(n,n)` in the first quadrant by letting '1's represent steps in the direction `(1,0)` and '0's represent steps in the direction `(0,1)`. The resulting path will remain weakly above the diagonal `y = x`. The a-statistic, or area statistic, is the number of complete squares in the integer lattice which are below the path and above the line `y = x`. The 'half-squares' directly above the line `y=x` do not contribute to this statistic. EXAMPLES:: sage: dw = DyckWord([1,0,1,0]) sage: dw.a_statistic() # 2 half-squares, 0 complete squares 0 :: sage: dw = DyckWord([1,1,1,0,1,1,1,0,0,0,1,1,0,0,1,0,0,0]) sage: dw.a_statistic() 19 :: sage: DyckWord([1,1,1,1,0,0,0,0]).a_statistic() 6 sage: DyckWord([1,1,1,0,1,0,0,0]).a_statistic() 5 sage: DyckWord([1,1,1,0,0,1,0,0]).a_statistic() 4 sage: DyckWord([1,1,1,0,0,0,1,0]).a_statistic() 3 sage: DyckWord([1,0,1,1,0,1,0,0]).a_statistic() 2 sage: DyckWord([1,1,0,1,1,0,0,0]).a_statistic() 4 sage: DyckWord([1,1,0,0,1,1,0,0]).a_statistic() 2 sage: DyckWord([1,0,1,1,1,0,0,0]).a_statistic() 3 sage: DyckWord([1,0,1,1,0,0,1,0]).a_statistic() 1 sage: DyckWord([1,0,1,0,1,1,0,0]).a_statistic() 1 sage: DyckWord([1,1,0,0,1,0,1,0]).a_statistic() 1 sage: DyckWord([1,1,0,1,0,0,1,0]).a_statistic() 2 sage: DyckWord([1,1,0,1,0,1,0,0]).a_statistic() 3 sage: DyckWord([1,0,1,0,1,0,1,0]).a_statistic() 0 """ above = 0 diagonal = 0 a = 0 for move in self: if move == 1: above += 1 elif move == 0: diagonal += 1 a += above - diagonal return a | 58987736f0b32e9cfa39285a2b0af054cbaf4453 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/58987736f0b32e9cfa39285a2b0af054cbaf4453/dyck_word.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
279,
67,
5642,
5846,
12,
2890,
4672,
3536,
2860,
326,
279,
17,
5642,
5846,
364,
326,
463,
93,
363,
2076,
4656,
358,
326,
5091,
434,
326,
463,
93,
363,
589,
18,
225,
6942,
848,
1476,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
279,
67,
5642,
5846,
12,
2890,
4672,
3536,
2860,
326,
279,
17,
5642,
5846,
364,
326,
463,
93,
363,
2076,
4656,
358,
326,
5091,
434,
326,
463,
93,
363,
589,
18,
225,
6942,
848,
1476,
... |
) | ), | def run(self): this_dir = os.getcwd() | a32484b19755e0306b454037c0a990fae63042be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/a32484b19755e0306b454037c0a990fae63042be/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
333,
67,
1214,
273,
1140,
18,
588,
11089,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
333,
67,
1214,
273,
1140,
18,
588,
11089,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.user_area_path = tmpDir | if self.user_area_path != '': if not os.path.exists(self.user_area_path): logger.warning('user_area_path %s does not exist! Using %s instead.', self.user_area_path, tmpDir ) self.user_area_path = tmpDir else: self.user_area_path = tmpDir | def prepare(self, **options): """Extract Athena job configuration and prepare job for submission""" | 1fa362ef3162af979b36636c9ccbc82d942fb7b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/1fa362ef3162af979b36636c9ccbc82d942fb7b9/Athena.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
12,
2890,
16,
2826,
2116,
4672,
3536,
4976,
432,
15991,
69,
1719,
1664,
471,
2911,
1719,
364,
8515,
8395,
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,
2911,
12,
2890,
16,
2826,
2116,
4672,
3536,
4976,
432,
15991,
69,
1719,
1664,
471,
2911,
1719,
364,
8515,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.assertEqual([('execve', '/p/f', (['-a'], {'spam': 'beans'})), ('execve', '/pp/f', (['-a'], {'spam': 'beans'}))], | self.assertEqual([('execve', os.sep+'p'+os.sep+'f', (['-a'], {'spam': 'beans'})), ('execve', os.sep+'pp'+os.sep+'f', (['-a'], {'spam': 'beans'}))], | def test_internal_execvpe(self): exec_stubbed = self._stub_out_for_execvpe_test() with exec_stubbed: self.assertRaises(RuntimeError, os._execvpe, '/f', ['-a']) self.assertEqual([('execv', '/f', (['-a'],))], exec_stubbed.calls) exec_stubbed.calls = [] self.assertRaises(OSError, os._execvpe, 'f', ['-a'], env={'spam': 'beans'}) self.assertEqual([('execve', '/p/f', (['-a'], {'spam': 'beans'})), ('execve', '/pp/f', (['-a'], {'spam': 'beans'}))], exec_stubbed.calls) | 5da4c030f20854007daad641f452f520bfd455c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/5da4c030f20854007daad641f452f520bfd455c3/test_os.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
7236,
67,
4177,
90,
347,
12,
2890,
4672,
1196,
67,
12847,
2992,
273,
365,
6315,
12847,
67,
659,
67,
1884,
67,
4177,
90,
347,
67,
3813,
1435,
598,
1196,
67,
12847,
2992,
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,
1842,
67,
7236,
67,
4177,
90,
347,
12,
2890,
4672,
1196,
67,
12847,
2992,
273,
365,
6315,
12847,
67,
659,
67,
1884,
67,
4177,
90,
347,
67,
3813,
1435,
598,
1196,
67,
12847,
2992,
30,
... |
code = re.sub(r'\b(\d+\.?\d*)((r\b)|(e[-\d]))', r'\1%s\2' % no_mul_token, code) code = re_no_keyword(r'\b(\d+\.?\d*) *([a-zA-Z_(]\w*)\b', code) | code = re.sub(r'\b(\d+(?:\.\d+)?(?:e\d+)?)([rR]\b)', r'\1%s\2' % no_mul_token, code) code = re.sub(r'\b(\d+(?:\.\d+)?)e([-\d])', r'\1%se%s\2' % (no_mul_token, no_mul_token), code) code = re_no_keyword(r'\b(\d+(?:\.\d+)?) *([a-zA-Z_(]\w*)\b', code) | def re_no_keyword(pattern, code): for _ in range(2): # do it twice in because matches don't overlap for m in reversed(list(re.finditer(pattern, code))): left, right = m.groups() if left not in keywords and right not in keywords: code = "%s%s*%s%s" % (code[:m.start()], left, right, code[m.end():]) return code | 9d30d0028332b58d7baf10d7d9a63c5bcd492181 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/9d30d0028332b58d7baf10d7d9a63c5bcd492181/preparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
67,
2135,
67,
11041,
12,
4951,
16,
981,
4672,
364,
389,
316,
1048,
12,
22,
4672,
468,
741,
518,
13605,
316,
2724,
1885,
2727,
1404,
7227,
364,
312,
316,
9553,
12,
1098,
12,
266,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
67,
2135,
67,
11041,
12,
4951,
16,
981,
4672,
364,
389,
316,
1048,
12,
22,
4672,
468,
741,
518,
13605,
316,
2724,
1885,
2727,
1404,
7227,
364,
312,
316,
9553,
12,
1098,
12,
266,
... |
elif tmp and tmp.adjusted() > context.Emax: | elif tmp and tmp_adjusted > context.Emax: | def _rescale(self, exp, rounding = None, context=None, watchexp = 1): """Rescales so that the exponent is exp. | 1a63da64df2af26e1f050749c19281f1de9084fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1a63da64df2af26e1f050749c19281f1de9084fa/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
455,
1869,
12,
2890,
16,
1329,
16,
13885,
273,
599,
16,
819,
33,
7036,
16,
4267,
2749,
273,
404,
4672,
3536,
607,
21177,
1427,
716,
326,
9100,
353,
1329,
18,
2,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
455,
1869,
12,
2890,
16,
1329,
16,
13885,
273,
599,
16,
819,
33,
7036,
16,
4267,
2749,
273,
404,
4672,
3536,
607,
21177,
1427,
716,
326,
9100,
353,
1329,
18,
2,
-100,
-100,
-100,
... |
vif = [ 'bridge=%s,mac=%s' ] | vif = [ 'bridge=br%s,mac=%s' ] | def createXenConfig(self, vmName, image, macAddr, bridge, memory, cores, hints, id): fn = os.path.join("/tmp", vmName) vmType = hints.get('vmtype', self.defaultVmType) print 'starting vm with type: ', vmType bootstr = '' if vmType == 'pvgrub': # FIXME: untested, requires Xen 3.3 bootstr = ''' | 8b153283125542c8c17a1dca6c5371995beffd61 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5161/8b153283125542c8c17a1dca6c5371995beffd61/xenpv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
60,
275,
809,
12,
2890,
16,
4268,
461,
16,
1316,
16,
5318,
3178,
16,
10105,
16,
3778,
16,
15355,
16,
13442,
16,
612,
4672,
2295,
273,
1140,
18,
803,
18,
5701,
2932,
19,
5645,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
60,
275,
809,
12,
2890,
16,
4268,
461,
16,
1316,
16,
5318,
3178,
16,
10105,
16,
3778,
16,
15355,
16,
13442,
16,
612,
4672,
2295,
273,
1140,
18,
803,
18,
5701,
2932,
19,
5645,
31... |
TixWidget.__init__(self, master, 'tixStdButtonBox', ['orientation', 'options'], cnf, kw) self.subwidget_list['ok'] = _dummyButton(self, 'ok') self.subwidget_list['apply'] = _dummyButton(self, 'apply') self.subwidget_list['cancel'] = _dummyButton(self, 'cancel') self.subwidget_list['help'] = _dummyButton(self, 'help') | TixWidget.__init__(self, master, 'tixStdButtonBox', ['orientation', 'options'], cnf, kw) self.subwidget_list['ok'] = _dummyButton(self, 'ok') self.subwidget_list['apply'] = _dummyButton(self, 'apply') self.subwidget_list['cancel'] = _dummyButton(self, 'cancel') self.subwidget_list['help'] = _dummyButton(self, 'help') | def __init__(self, master=None, cnf={}, **kw): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4171,
33,
7036,
16,
23118,
28793,
2826,
9987,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
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,
1001,
2738,
972,
12,
2890,
16,
4171,
33,
7036,
16,
23118,
28793,
2826,
9987,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
this = apply(_quickfix.new_RepoCollateralSecurityType, args) | this = _quickfix.new_RepoCollateralSecurityType(*args) | def __init__(self, *args): this = apply(_quickfix.new_RepoCollateralSecurityType, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
8791,
13535,
2045,
287,
4368,
559,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
8791,
13535,
2045,
287,
4368,
559,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,... |
dir = os.path.join(*paths) return os.path.normcase(os.path.abspath(dir)) L = sys.modules.values() for m in L: | dir = os.path.abspath(os.path.join(*paths)) return dir, os.path.normcase(dir) for m in sys.modules.values(): | def makepath(*paths): dir = os.path.join(*paths) return os.path.normcase(os.path.abspath(dir)) | 1fb5ce0323926406e6b3db6879152e0dcc40f5ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb5ce0323926406e6b3db6879152e0dcc40f5ec/site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
803,
30857,
4481,
4672,
1577,
273,
1140,
18,
803,
18,
5701,
30857,
4481,
13,
327,
1140,
18,
803,
18,
7959,
3593,
12,
538,
18,
803,
18,
5113,
803,
12,
1214,
3719,
225,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
803,
30857,
4481,
4672,
1577,
273,
1140,
18,
803,
18,
5701,
30857,
4481,
13,
327,
1140,
18,
803,
18,
7959,
3593,
12,
538,
18,
803,
18,
5113,
803,
12,
1214,
3719,
225,
2,
-100,
... |
ks = KeyStatistic(_('Avg Swap Free'), sum(swapFree)/len(swapFree), | ks = KeyStatistic(_('Avg Swap Free'), round(sum(swapFree)/len(swapFree), 2), | def get_graph(self, end_date, report_days, host=None, user=None, email=None): if email or host or user: return None | 76334c6b3cd698e75ba1c275cbedf6be7e3e6aea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/87/76334c6b3cd698e75ba1c275cbedf6be7e3e6aea/untangle_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4660,
12,
2890,
16,
679,
67,
712,
16,
2605,
67,
9810,
16,
1479,
33,
7036,
16,
729,
33,
7036,
16,
2699,
33,
7036,
4672,
309,
2699,
578,
1479,
578,
729,
30,
327,
599,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4660,
12,
2890,
16,
679,
67,
712,
16,
2605,
67,
9810,
16,
1479,
33,
7036,
16,
729,
33,
7036,
16,
2699,
33,
7036,
4672,
309,
2699,
578,
1479,
578,
729,
30,
327,
599,
2,
-10... |
result.addFailure(self, (AssertionError, msg, None)) def assertRaisesCOM_HRESULT(self, hresult, func, *args, **kw): | result.addFailure(self.real_test, (AssertionError, msg, None)) def _do_leak_tests(self, result = None): | def _postTest(self, result): gc.collect() lost_i = _GetInterfaceCount() - self.ni lost_g = _GetGatewayCount() - self.ng if lost_i or lost_g: msg = "%d interface objects and %d gateway objects leaked" \ % (lost_i, lost_g) result.addFailure(self, (AssertionError, msg, None)) | 401af4e5b82d1801963b1a20fd4f8fa0884dc514 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/677/401af4e5b82d1801963b1a20fd4f8fa0884dc514/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2767,
4709,
12,
2890,
16,
563,
4672,
8859,
18,
14676,
1435,
13557,
67,
77,
273,
389,
967,
1358,
1380,
1435,
300,
365,
18,
15834,
13557,
67,
75,
273,
389,
967,
5197,
1380,
1435,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2767,
4709,
12,
2890,
16,
563,
4672,
8859,
18,
14676,
1435,
13557,
67,
77,
273,
389,
967,
1358,
1380,
1435,
300,
365,
18,
15834,
13557,
67,
75,
273,
389,
967,
5197,
1380,
1435,
30... |
class PassiveDTP(asynchat.async_chat): "Base class for passive-DTP backend" | class PassiveDTP(asyncore.dispatcher): """This class is an asyncore.disptacher subclass. It creates a socket listening on a local port, dispatching the resultant connection DTPHandler. """ | def close_all(self, map=None, ignore_all=False): """'clean' shutdown: instead of using the current asyncore.close_all() function which only close sockets, we iterates over all existent channels calling close() method for each one of them, avoiding memory leaks. This is how close_all function will appear in the fixed version of asyncore that will be included into Python 2.6. """ if map is None: map = self._map for x in map.values(): try: x.close() except OSError, x: if x[0] == errno.EBADF: pass elif not ignore_all: raise except (asyncore.ExitNow, KeyboardInterrupt, SystemExit): raise except: if not ignore_all: raise map.clear() | 9823b54e0adb251c778ec0e5e7af765a3a25ec44 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3782/9823b54e0adb251c778ec0e5e7af765a3a25ec44/FTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
454,
12,
2890,
16,
852,
33,
7036,
16,
2305,
67,
454,
33,
8381,
4672,
3536,
11,
6200,
11,
5731,
30,
3560,
434,
1450,
326,
783,
4326,
479,
18,
4412,
67,
454,
1435,
445,
1492,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
454,
12,
2890,
16,
852,
33,
7036,
16,
2305,
67,
454,
33,
8381,
4672,
3536,
11,
6200,
11,
5731,
30,
3560,
434,
1450,
326,
783,
4326,
479,
18,
4412,
67,
454,
1435,
445,
1492,... |
if context and not context.has_key('type') and res.has_key('type'): res['type']['selection'] = [('new','New'),('standart','Standart'),('rewrite','Rewrite'),('as','After-Sale')] | if context and not 'type' in context and 'type' in res: res['type']['selection'] = [('new', 'New'), ('standart', 'Standart'), ('rewrite', 'Rewrite'), ('as', 'After-Sale')] | def fields_get(self, cr, uid, fields=None, context=None): res = super(dm_offer, self).fields_get(cr, uid, fields, context) if context and not context.has_key('type') and res.has_key('type'): res['type']['selection'] = [('new','New'),('standart','Standart'),('rewrite','Rewrite'),('as','After-Sale')] return res | 85a1e7b7da9518beac3cb0935570916534cd57ee /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/85a1e7b7da9518beac3cb0935570916534cd57ee/dm_offer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1466,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1466,
33,
7036,
16,
819,
33,
7036,
4672,
400,
273,
2240,
12,
10956,
67,
23322,
16,
365,
2934,
2821,
67,
588,
12,
3353,
16,
4555,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1466,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1466,
33,
7036,
16,
819,
33,
7036,
4672,
400,
273,
2240,
12,
10956,
67,
23322,
16,
365,
2934,
2821,
67,
588,
12,
3353,
16,
4555,
16,
... |
obj = getattr(portal, id + lang, None) | obj = getattr(portal, (id + lang), None) | def publishImportedContent(context): portal = context.getSite() pwt = getToolByName(portal, 'portal_workflow') for id in imported_content: for lang in ['', '-en', '-fr']: obj = getattr(portal, id + lang, None) if not obj: log.warning('Object %s not found. Please run import step "Recensio initial content"' % id + lang) continue doPublish(obj, pwt) | f2abd3d751b93638d0417fbb150a989d7d79cd82 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/f2abd3d751b93638d0417fbb150a989d7d79cd82/setuphandlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3808,
24934,
1350,
12,
2472,
4672,
11899,
273,
819,
18,
588,
4956,
1435,
293,
6046,
273,
336,
6364,
5911,
12,
24386,
16,
296,
24386,
67,
13815,
6134,
364,
612,
316,
9101,
67,
1745,
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,
3808,
24934,
1350,
12,
2472,
4672,
11899,
273,
819,
18,
588,
4956,
1435,
293,
6046,
273,
336,
6364,
5911,
12,
24386,
16,
296,
24386,
67,
13815,
6134,
364,
612,
316,
9101,
67,
1745,
30,
... |
import tempfile d = tempfile.gettempdir() dummy_name = os.path.join(d,'__dummy.f') dummy = open(dummy_name,'w') | import tempfile dummy_name = tempfile.mktemp()+'__dummy' dummy = open(dummy_name+'.f','w') | def dummy_fortran_files(self): import tempfile d = tempfile.gettempdir() dummy_name = os.path.join(d,'__dummy.f') dummy = open(dummy_name,'w') dummy.write(" subroutine dummy()\n end\n") dummy.close() return (os.path.join(d,'__dummy.f'),os.path.join(d,'__dummy.o')) | 18f6cc54d9a0fe3dd53474858e6dc2fcefb0e657 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/18f6cc54d9a0fe3dd53474858e6dc2fcefb0e657/build_flib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9609,
67,
1884,
13171,
67,
2354,
12,
2890,
4672,
1930,
13275,
9609,
67,
529,
273,
13275,
18,
24816,
5814,
1435,
6797,
972,
21050,
11,
9609,
273,
1696,
12,
21050,
67,
529,
6797,
18,
74,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9609,
67,
1884,
13171,
67,
2354,
12,
2890,
4672,
1930,
13275,
9609,
67,
529,
273,
13275,
18,
24816,
5814,
1435,
6797,
972,
21050,
11,
9609,
273,
1696,
12,
21050,
67,
529,
6797,
18,
74,
... |
obj_i = obj['id'] | obj_id = obj['id'] | def sc_add(self, widget): ids = self.ids_get() if len(ids): try: res = rpc.execute('model', self.model, 'read', ids, ['rec_name'], rpc.CONTEXT) for obj in res: obj_i = obj['id'] name = obj['rec_name'] user = rpc._USER rpc.execute('model', 'ir.ui.view_sc', 'create', { 'resource': self.model, 'user_id': user, 'res_id': obj_id, 'name': name, }, rpc.CONTEXT) except Exception, exception: common.process_exception(exception, self.window) self.tree_sc.update() | da9861b29fef3ade617dc37cc30068a47aae95d2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9151/da9861b29fef3ade617dc37cc30068a47aae95d2/tree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
888,
67,
1289,
12,
2890,
16,
3604,
4672,
3258,
273,
365,
18,
2232,
67,
588,
1435,
309,
562,
12,
2232,
4672,
775,
30,
400,
273,
6724,
18,
8837,
2668,
2284,
2187,
365,
18,
2284,
16,
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,
888,
67,
1289,
12,
2890,
16,
3604,
4672,
3258,
273,
365,
18,
2232,
67,
588,
1435,
309,
562,
12,
2232,
4672,
775,
30,
400,
273,
6724,
18,
8837,
2668,
2284,
2187,
365,
18,
2284,
16,
29... |
LE_MAGIC = 0x950412de BE_MAGIC = 0xde120495 | LE_MAGIC = 0x950412deL BE_MAGIC = 0xde120495L | def install(self, unicode=0): import __builtin__ __builtin__.__dict__['_'] = unicode and self.ugettext or self.gettext | 7a3b359a9f020b1ef6be7965c38475659672909e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/7a3b359a9f020b1ef6be7965c38475659672909e/gettext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
12,
2890,
16,
5252,
33,
20,
4672,
1930,
1001,
24553,
972,
1001,
24553,
972,
16186,
1576,
972,
3292,
67,
3546,
273,
5252,
471,
365,
18,
89,
29967,
578,
365,
18,
29967,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3799,
12,
2890,
16,
5252,
33,
20,
4672,
1930,
1001,
24553,
972,
1001,
24553,
972,
16186,
1576,
972,
3292,
67,
3546,
273,
5252,
471,
365,
18,
89,
29967,
578,
365,
18,
29967,
2,
-100,
-1... |
msg = "Unfullfilled load dependencies of class '%s'[%d]: '%s'" % (classId, packageIdx, depsId) | msg = "Unfullfilled dependency of class '%s'[%d]: '%s'" % (classId, packageIdx, depsId) | def verifyParts(self, partsMap, script): self._console.info("Verifying Parts...") self._console.indent() for part in partsMap.values(): self._console.info("Verifying: %s" % part.name) self._console.indent() # get set of current classes in this part classSet = set() classList = [] classPackage = [] for packageIdx, package in enumerate(part.packages): # TODO: not sure this is sorted #classSet.update(package.classes) #classList.extend(package.classes) for classId in package.classes: classList.append(classId) classPackage.append(packageIdx) # check individual class deps are fullfilled in part # alternative: check part.deps against classSet #for classId in classSet: classIdx = -1 for packageIdx, package in enumerate(part.packages): #for classIdx,classId in enumerate(classList): for classId in package.classes: classIdx += 1 classDeps = self._depLoader.getCombinedDeps(classId, script.variants, script.buildType) loadDeps = set(x.name for x in classDeps['load']) for depsId in loadDeps: try: depsIdx = classList.index(depsId) except ValueError: msg = "Unfullfilled load dependencies of class '%s'[%d]: '%s'" % (classId, packageIdx, depsId) self._console.warn("! " + msg) #raise RuntimeError(msg) continue if classIdx < depsIdx: msg = "Load-dep loaded after using class ('%s'[%d]): '%s'[%d]" % (classId, packageIdx, depsId, classPackage[depsIdx]) self._console.warn("! " + msg) # I should better raise here #raise RuntimeError(msg) #missingDeps = loadDeps.difference(classSet) #if missingDeps: # there is a load dep not in the part # self._console.warn("Unfullfilled load dependencies of class '%s': %r" % (classId, tuple(missingDeps))) self._console.outdent() | db2854a93406b6e9de9a110206a8527ba31207dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/db2854a93406b6e9de9a110206a8527ba31207dd/PartBuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
4305,
12,
2890,
16,
2140,
863,
16,
2728,
4672,
365,
6315,
8698,
18,
1376,
2932,
8097,
310,
28195,
7070,
13,
365,
6315,
8698,
18,
9355,
1435,
364,
1087,
316,
2140,
863,
18,
2372,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
4305,
12,
2890,
16,
2140,
863,
16,
2728,
4672,
365,
6315,
8698,
18,
1376,
2932,
8097,
310,
28195,
7070,
13,
365,
6315,
8698,
18,
9355,
1435,
364,
1087,
316,
2140,
863,
18,
2372,
... |
def _check_ncfdtridfd(self): | def check_ncfdtridfd(self): | def _check_ncfdtridfd(self): cephes.ncfdtridfd(1,0.5,0,1) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
14202,
8313,
313,
350,
8313,
12,
2890,
4672,
5898,
844,
281,
18,
14202,
8313,
313,
350,
8313,
12,
21,
16,
20,
18,
25,
16,
20,
16,
21,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
866,
67,
14202,
8313,
313,
350,
8313,
12,
2890,
4672,
5898,
844,
281,
18,
14202,
8313,
313,
350,
8313,
12,
21,
16,
20,
18,
25,
16,
20,
16,
21,
13,
2,
-100,
-100,
-100,
-100,
-100,
... |
r""" Number of labeled rooted trees on $n$ nodes: $n^{(n-2)}$. INPUT: n -- positive integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A000272;a Number of labeled rooted trees with n nodes: n^(n-2). sage: a(0) Traceback (most recent call last): ... ValueError: input n (=0) must be a positive integer sage: a(1) 1 sage: a(2) 1 sage: a(10) 100000000 sage: a.list(11) [1, 1, 3, 16, 125, 1296, 16807, 262144, 4782969, 100000000, 2357947691] AUTHOR: -- Jaap Spies (2007-01-26) """ def __init__(self): | def __init__(self): r""" Number of labeled rooted trees on $n$ nodes: $n^{(n-2)}$. INPUT: n -- positive integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A000272;a Number of labeled rooted trees with n nodes: n^(n-2). sage: a(0) Traceback (most recent call last): ... ValueError: input n (=0) must be a positive integer sage: a(1) 1 sage: a(2) 1 sage: a(10) 100000000 sage: a.list(11) [1, 1, 3, 16, 125, 1296, 16807, 262144, 4782969, 100000000, 2357947691] AUTHOR: -- Jaap Spies (2007-01-26) """ | def _eval(self, n): return Integer(n**(n-1)) | 8b300fed02e947af57b58146f62dccfc715cf0b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/8b300fed02e947af57b58146f62dccfc715cf0b9/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8622,
12,
2890,
16,
290,
4672,
327,
2144,
12,
82,
636,
12,
82,
17,
21,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8622,
12,
2890,
16,
290,
4672,
327,
2144,
12,
82,
636,
12,
82,
17,
21,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
line = preparser_ipython.preparse_ipython(line) | line = preparser_ipython.preparse_ipython(line, not continuation) | def do_prefilter_paste(line, continuation): """ Alternate prefilter for input. INPUT: line -- a single line; must *not* have any newlines in it continuation -- whether the input line is really part of the previous line, because of open parens or backslash. """ if '\n' in line: raise RuntimeError, "bug in function that calls do_prefilter_paste -- there can be no newlines in the input" global attached # This is so it's OK to have lots of blank space at the # beginning of any non-continuation line. if continuation: # strip ...'s that appear in examples L = line.lstrip() if L[:3] == '...': line = L[3:] else: line = line.lstrip() line = line.rstrip() if not line[:7] == 'attach ' and not line[:5] == 'load ': for F in attached.keys(): tm = attached[F] if os.path.exists(F) and os.path.getmtime(F) > tm: # Reload F. try: if F[-3:] == '.py': ipmagic('run -i "%s"'%F) elif F[-5:] == '.sage': ipmagic('run -i "%s"'%process_file(F)) elif F[-5:] == '.spyx': X = load_sagex(F) __IPYTHON__.push(X) else: print "Loading of '%s' not implemented (load .py, .spyx, and .sage files)"%F line = '' raise IOError t = os.path.getmtime(F) attached[F] = t except IOError: del attached[F] # Get rid of leading sage: so that pasting of examples from the documentation # works. This is like MAGMA's SetLinePrompt(false). for prompt in ['sage:', '>>>']: if not continuation: while True: strip = False if line[:3] == prompt: line = line[3:].lstrip() strip = True elif line[:5] == prompt: line = line[5:].lstrip() strip = True if not strip: break else: line = line.lstrip() # 'quit' alone on a line to quit. if line.lower() in ['quit', 'exit', 'quit;', 'exit;']: line = '%quit' ################################################################# # An interactive load command, like iload in MAGMA. ################################################################# if line[:6] == 'iload ': try: name = str(eval(line[6:])) except: name = line[6:].strip() try: F = open(name) except IOError: raise ImportError, 'Could not open file "%s"'%name print 'Interactively loading "%s"'%name n = len(__IPYTHON__.input_hist) for L in F.readlines(): L = L.rstrip() Llstrip = L.lstrip() raw_input('sage: %s'%L.rstrip()) __IPYTHON__.input_hist_raw.append(L) if Llstrip[:5] == 'load ' or Llstrip[:7] == 'attach ' \ or Llstrip[:6] == 'iload ': log.offset -= 1 L = do_prefilter_paste(L, False) if len(L.strip()) > 0: ipmagic(L) L = '' else: L = preparser_ipython.preparse_ipython(L) __IPYTHON__.input_hist.append(L) __IPYTHON__.push(L) log.offset += 1 return '' ################################################################# # A "load" command, like \r file in PARI or load "file" in MAGMA ################################################################# if line[:5] == 'load ': # The -i so the file is run with the same environment, # e.g., including the "from sage import *" try: name = eval(line[5:]) except: name = line[5:].strip() if isinstance(name, str): if not os.path.exists(name): raise ImportError, "File '%s' not found (be sure to give .sage, .py, or .spyx extension)"%name elif name[-3:] == '.py': try: line = '%run -i "' + name + '"' except IOError, s: print s raise ImportError, "Error loading '%s'"%name elif name[-5:] == '.sage': try: line = '%run -i "' + process_file(name) + '"' except IOError, s: print s raise ImportError, "Error loading '%s'"%name line = "" elif name[-5:] == '.spyx': line = load_sagex(name) else: raise ImportError, "Loading of '%s' not implemented (load .py, .spyx, and .sage files)"%name line = '' elif line[:13] == 'save_session(': line = 'save_session(locals(), %s'%line[13:] elif line[:14] == 'save_session (': line = 'save_session (locals(), %s'%line[14:] elif line[:13] == 'load_session(': line = 'load_session(locals(), %s'%line[13:] elif line[:14] == 'load_session (': line = 'load_session (locals(), %s'%line[14:] elif ''.join(line.split()) == 'show_identifiers()': line = 'show_identifiers(locals())' # This is an attach command like in MAGMA. The file to attach is # any file that could be loaded. At attach time it is loaded as # above. It is put in a list that is a variable with scope this # interpreter.py file. Each time prefilter_paste is called and # continuation is False, check all attached file names and if any # have changed, compile the file, then use %run to load them again # as above. This is like the MAGMA attach, but in some ways # better. It is very nice for interactive code development. if line[:7] == 'attach ': # The -i so the file is run with the same environment, # e.g., including the "from sage import *" try: name = eval(line[7:]) except: name = line[7:].strip() name = os.path.abspath(name) if not os.path.exists(name): raise ImportError, "File '%s' not found (be sure to give .sage, .py, or .spyx extension)."%name elif name[-3:] == '.py': try: line = '%run -i "' + name + '"' attached[name] = os.path.getmtime(name) except IOError, OSError: raise ImportError, "File '%s' not found."%name elif name[-5:] == '.sage': try: line = '%run -i "' + process_file(name) + '"' attached[name] = os.path.getmtime(name) except IOError, OSError: raise ImportError, "File '%s' not found."%name elif name[-5:] == '.spyx': try: line = load_sagex(name) attached[name] = os.path.getmtime(name) except IOError, OSError: raise ImportError, "File '%s' not found."%name line = '' else: raise ImportError, "Attaching of '%s' not implemented (load .py, .spyx, and .sage files)"%name if len(line) > 0: line = preparser_ipython.preparse_ipython(line) return line | b2026ff4859215d96a67205180ff7734be64c9f9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/b2026ff4859215d96a67205180ff7734be64c9f9/interpreter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
1484,
2188,
67,
29795,
12,
1369,
16,
17378,
4672,
3536,
21498,
340,
675,
2188,
364,
810,
18,
225,
12943,
30,
980,
1493,
279,
2202,
980,
31,
1297,
380,
902,
14,
1240,
1281,
191... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
1484,
2188,
67,
29795,
12,
1369,
16,
17378,
4672,
3536,
21498,
340,
675,
2188,
364,
810,
18,
225,
12943,
30,
980,
1493,
279,
2202,
980,
31,
1297,
380,
902,
14,
1240,
1281,
191... |
gateGump.addText( 80, 210, "CANCEL " ) | gateGump.addText( 80, 210, "CANCEL" ) | def sendGump( char, item ): char.soundeffect( 0x58 ) # noclose, nomove gump gateGump = cGump( 1, 1, 0, 30, 30 ) # trammel gateGump.startPage( 1 ) gateGump.addBackground( 9200, 300, 255 ) gateGump.addText( 40, 40, "Pick your destination: (Trammel)" ) gateGump.addButton( 47, 207, 0xFA5, 0xFA7, 0 ) gateGump.addText( 80, 210, "CANCEL" ) # facets gateGump.addText( 70, 70, "Trammel", 12 ) gateGump.addPageButton( 48, 72, 0x4B9, 0x4BA, 1 ) gateGump.addText( 70, 90, "Felucca" ) gateGump.addPageButton( 48, 95, 0x4B9, 0x4BA, 2 ) gateGump.addText( 70, 110, "Ilshenar" ) gateGump.addPageButton( 48, 115, 0x4B9, 0x4BA, 3 ) # gates gateGump.addText( 170, 70, "Britain" ) gateGump.addButton( 150, 75, 0x837, 0x838, 5 ) gateGump.addText( 170, 90, "Magincia" ) gateGump.addButton( 150, 95, 0x837, 0x838, 6 ) gateGump.addText( 170, 110, "Moonglow" ) gateGump.addButton( 150, 115, 0x837, 0x838, 7 ) gateGump.addText( 170, 130, "Skara Brae" ) gateGump.addButton( 150, 135, 0x837, 0x838, 8 ) gateGump.addText( 170, 150, "Trinsic" ) gateGump.addButton( 150, 155, 0x837, 0x838, 9 ) gateGump.addText( 170, 170, "Vesper" ) gateGump.addButton( 150, 175, 0x837, 0x838, 10 ) gateGump.addText( 170, 190, "Yew" ) gateGump.addButton( 150, 195, 0x837, 0x838, 11 ) gateGump.addText( 170, 210, "Jhelom" ) gateGump.addButton( 150, 215, 0x837, 0x838, 12 ) # felucca gateGump.startPage( 2 ) gateGump.addBackground( 9200, 300, 255 ) gateGump.addText( 40, 40, "Pick your destination: (Felucca)" ) gateGump.addButton( 47, 207, 0xFA5, 0xFA7, 0 ) gateGump.addText( 80, 210, "CANCEL " ) # facets gateGump.addText( 70, 70, "Trammel " ) gateGump.addPageButton( 48, 72, 0x4B9, 0x4BA, 1 ) gateGump.addText( 70, 90, "Felucca ", 12 ) gateGump.addPageButton( 48, 95, 0x4B9, 0x4BA, 2 ) gateGump.addText( 70, 110, "Ilshenar " ) gateGump.addPageButton( 48, 115, 0x4B9, 0x4BA, 3 ) # gates gateGump.addText( 170, 70, "Britain " ) gateGump.addButton( 150, 75, 0x837, 0x838, 13 ) gateGump.addText( 170, 90, "Magincia " ) gateGump.addButton( 150, 95, 0x837, 0x838, 14 ) gateGump.addText( 170, 110, "Moonglow " ) gateGump.addButton( 150, 115, 0x837, 0x838, 15 ) gateGump.addText( 170, 130, "Skara Brae " ) gateGump.addButton( 150, 135, 0x837, 0x838, 16 ) gateGump.addText( 170, 150, "Trinsic " ) gateGump.addButton( 150, 155, 0x837, 0x838, 17 ) gateGump.addText( 170, 170, "Vesper " ) gateGump.addButton( 150, 175, 0x837, 0x838, 18 ) gateGump.addText( 170, 190, "Yew " ) gateGump.addButton( 150, 195, 0x837, 0x838, 19 ) gateGump.addText( 170, 210, "Jhelom " ) gateGump.addButton( 150, 215, 0x837, 0x838, 20 ) # ilshenar gateGump.startPage( 3 ) gateGump.addBackground( 9200, 300, 255 ) gateGump.addText( 40, 40, "Pick your destination: (Ilshenar)" ) gateGump.addButton( 47, 207, 0xFA5, 0xFA7, 0 ) gateGump.addText( 80, 210, "CANCEL " ) # facets gateGump.addText( 70, 70, "Trammel " ) gateGump.addPageButton( 48, 72, 0x4B9, 0x4BA, 1 ) gateGump.addText( 70, 90, "Felucca " ) gateGump.addPageButton( 48, 95, 0x4B9, 0x4BA, 2 ) gateGump.addText( 70, 110, "Ilshenar ", 12 ) gateGump.addPageButton( 48, 115, 0x4B9, 0x4BA, 3 ) # #gates gateGump.addText( 170, 70, "Compassion" ) gateGump.addButton( 150, 75, 0x837, 0x838, 21 ) gateGump.addText( 170, 90, "Honesty" ) gateGump.addButton( 150, 95, 0x837, 0x838, 22 ) gateGump.addText( 170, 110, "Honor" ) gateGump.addButton( 150, 115, 0x837, 0x838, 23 ) gateGump.addText( 170, 130, "Humility" ) gateGump.addButton( 150, 135, 0x837, 0x838, 24 ) gateGump.addText( 170, 150, "Justice" ) gateGump.addButton( 150, 155, 0x837, 0x838, 25 ) gateGump.addText( 170, 170, "Sacrifice" ) gateGump.addButton( 150, 175, 0x837, 0x838, 26 ) gateGump.addText( 170, 190, "Spirituality" ) gateGump.addButton( 150, 195, 0x837, 0x838, 27 ) gateGump.addText( 170, 210, "Valor" ) gateGump.addButton( 150, 215, 0x837, 0x838, 28 ) gateGump.addText( 170, 230, "Chaos" ) gateGump.addButton( 150, 235, 0x837, 0x838, 29 ) # set callback function and its arguments gateGump.setCallback( "moongate.gateCallback" ) # send it gateGump.setArgs( [ item ] ) gateGump.send( char ) # attach tag char.settag( "moongate", 1 ) | fa762406a204038e4f2a446679a18b75f632c2ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/fa762406a204038e4f2a446679a18b75f632c2ac/moongate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
43,
2801,
12,
1149,
16,
761,
262,
30,
1149,
18,
87,
465,
536,
74,
386,
12,
374,
92,
8204,
262,
468,
30601,
2061,
16,
12457,
841,
314,
2801,
12611,
43,
2801,
273,
276,
43,
2801,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
43,
2801,
12,
1149,
16,
761,
262,
30,
1149,
18,
87,
465,
536,
74,
386,
12,
374,
92,
8204,
262,
468,
30601,
2061,
16,
12457,
841,
314,
2801,
12611,
43,
2801,
273,
276,
43,
2801,... |
self.transport.write('%d %s\r\n' % (i+1, self.mbox.getUidl(i))) self.transport.write('.\r\n') | self.sendLine('%d %s' % (i+1, self.mbox.getUidl(i))) self.sendLine('.') | def do_UIDL(self, i=None): messages = self.mbox.listMessages() self.successResponse() for i in range(len(messages)): if messages[i]: self.transport.write('%d %s\r\n' % (i+1, self.mbox.getUidl(i))) self.transport.write('.\r\n') | fd0b0ce0b465a197ffb536457183acd135f9d5e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0b0ce0b465a197ffb536457183acd135f9d5e9/pop3.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
3060,
48,
12,
2890,
16,
277,
33,
7036,
4672,
2743,
273,
365,
18,
81,
2147,
18,
1098,
5058,
1435,
365,
18,
4768,
1064,
1435,
364,
277,
316,
1048,
12,
1897,
12,
6833,
3719,
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,
741,
67,
3060,
48,
12,
2890,
16,
277,
33,
7036,
4672,
2743,
273,
365,
18,
81,
2147,
18,
1098,
5058,
1435,
365,
18,
4768,
1064,
1435,
364,
277,
316,
1048,
12,
1897,
12,
6833,
3719,
30... |
del the_dict[included_key] | def ProcessRules(name, the_dict): """Process regular expression and exclusion-based rules on lists. An exclusion list is in a dict key named with a trailing "!", like "sources!". Every item in such a list is removed from the associated main list, which in this example, would be "sources". Removed items are placed into a "sources_excluded" list in the dict. Regular expression (regex) rules are contained in dict keys named with a trailing "/", such as "sources/" to operate on the "sources" list. Regex rules in a dict take the form: 'sources/': [ ['exclude', '_(linux|mac|win)\\.cc$'] ], ['include', '_mac\\.cc$'] ], The first rule says to exclude all files ending in _linux.cc, _mac.cc, and _win.cc. The second rule then includes all files ending in _mac.cc that are now or were once in the "sources" list. Items matching an "exclude" rule are subject to the same processing as would occur if they were listed by name in an exclusion list (ending in "!"). Items matching an "include" rule are brought back into the main list if previously excluded by an exclusion list or exclusion regex rule, and are protected from future removal by such exclusion lists and rules. """ # Look through the dictionary for any lists whose keys end in "!" or "/". # These are lists that will be treated as exclude lists and regular # expression-based exclude/include lists. Collect the lists that are # needed first, looking for the lists that they operate on, and assemble # then into |lists|. This is done in a separate loop up front, because # the _included and _excluded keys need to be added to the_dict, and that # can't be done while iterating through it. lists = [] del_lists = [] for key, value in the_dict.iteritems(): operation = key[-1] if operation != '!' and operation != '/': continue if not isinstance(value, list): raise ValueError, name + ' key ' + key + ' must be list, not ' + \ value.__class__.__name__ list_key = key[:-1] if list_key not in the_dict: # This happens when there's a list like "sources!" but no corresponding # "sources" list. Since there's nothing for it to operate on, queue up # the "sources!" list for deletion now. del_lists.append(key) continue if not isinstance(the_dict[list_key], list): raise ValueError, name + ' key ' + list_key + \ ' must be list, not ' + \ value.__class__.__name__ + ' when applying ' + \ {'!': 'exclusion', '/': 'regex'}[operation] if not list_key in lists: lists.append(list_key) # Delete the lists that are known to be unneeded at this point. for del_list in del_lists: del the_dict[del_list] for list_key in lists: # Initialize the _excluded and _included lists now, so that the code that # needs to use them can perform list operations without needing to do its # own lazy initialization. Lists that are unneeded will be deleted at # the end. excluded_key = list_key + '_excluded' included_key = list_key + '_included' for k in [excluded_key, included_key]: if k in the_dict: raise KeyError, name + ' key ' + k + ' must not be present prior ' + \ ' to applying exclusion/regex rules for ' + list_key the_dict[k] = [] # Note that exclude_key ("sources!") is different from excluded_key # ("sources_excluded"). Since exclude_key is just a very temporary # variable used on the next few lines, this isn't a huge problem, but # be careful! exclude_key = list_key + '!' if exclude_key in the_dict: for exclude_item in the_dict[exclude_key]: if exclude_item in the_dict[included_key]: # The exclude_item was already preserved and is "golden", don't touch # it. continue # The exclude_item may appear in the list more than once, so loop to # remove it. That's "while exclude_item in", not "for exclude_item # in." Crucial difference. removed = False while exclude_item in the_dict[list_key]: removed = True the_dict[list_key].remove(exclude_item) # If anything was removed, add it to the _excluded list. if removed: if not exclude_item in the_dict[excluded_key]: the_dict[excluded_key].append(exclude_item) # The "whatever!" list is no longer needed, dump it. del the_dict[exclude_key] regex_key = list_key + '/' if regex_key in the_dict: for regex_item in the_dict[regex_key]: [action, pattern] = regex_item pattern_re = re.compile(pattern) # Instead of writing "for list_item in the_dict[list_key]", write a # while loop. Iteration with a for loop won't work, because code that # follows manipulates the_dict[list_key]. Be careful with that "index" # variable. index = 0 while index < len(the_dict[list_key]): list_item = the_dict[list_key][index] if pattern_re.search(list_item): # Regular expression match. if action == 'exclude': if list_item in the_dict[included_key]: # regex_item says to remove list_item from the list, but # something else already said to include it, so leave it # alone and proceed to the next item in the list. index = index + 1 continue del the_dict[list_key][index] # Add it to the excluded list if it's not already there. if not list_item in the_dict[excluded_key]: the_dict[excluded_key].append(list_item) # continue without incrementing |index|. The next object to # look at, if any, moved into the index of the object that was # just removed. continue elif action == 'include': # Here's a list_item that's in list and needs to stay there. # Add it to the golden list of happy items to keep, and nothing # will be able to exclude it in the future. if not list_item in the_dict[included_key]: the_dict[included_key].append(list_item) else: # This is an action that doesn't make any sense. raise ValueError, 'Unrecognized action ' + action + ' in ' + \ name + ' key ' + key # Advance to the next list item. index = index + 1 if action == 'include': # Items matching an include pattern may have already been excluded. # Resurrect any that are found. The while loop is needed again # because the excluded list will be manipulated. index = 0 while index < len(the_dict[excluded_key]): excluded_item = the_dict[excluded_key][index] if pattern_re.search(excluded_item): # Yup, this is one. Take it out of the excluded list and put # it back into the main list AND the golden included list, so # that nothing else can touch it. Unfortunately, the best that # can be done at this point is an append, since there's no way # to know where in the list it came from. TODO(mark): There # are possible solutions to this problem, like tracking # include/exclude status in a parallel list and only doing the # deletions after processing all of the rules. del the_dict[excluded_key][index] the_dict[list_key].append(excluded_item) if not excluded_item in the_dict[included_key]: the_dict[included_key].append(excluded_item) else: # Only move to the next index if there was no match. If there # was a match, the item was deleted, and the next item to look # at is at the same index as the item just examined. index = index + 1 # The "whatever/" list is no longer needed, dump it. del the_dict[regex_key] # Dump the "included" list, which is never needed since evertyhing in it # is already in the main list. Dump the "excluded" list if it's empty. del the_dict[included_key] if len(the_dict[excluded_key]) == 0: del the_dict[excluded_key] | 2714baa0e5e914697a52658f5379d08f72dfbd76 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6220/2714baa0e5e914697a52658f5379d08f72dfbd76/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4389,
4478,
12,
529,
16,
326,
67,
1576,
4672,
3536,
2227,
6736,
2652,
471,
21244,
17,
12261,
2931,
603,
6035,
18,
225,
1922,
21244,
666,
353,
316,
279,
2065,
498,
4141,
598,
279,
7341,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4389,
4478,
12,
529,
16,
326,
67,
1576,
4672,
3536,
2227,
6736,
2652,
471,
21244,
17,
12261,
2931,
603,
6035,
18,
225,
1922,
21244,
666,
353,
316,
279,
2065,
498,
4141,
598,
279,
7341,
... | |
addFile('bin'+os.sep+'ffmpeg.exe','bin'+os.sep+'taskkill.exe','bin'+os.sep+'SDL.dll') | addFile('bin' + os.sep + 'ffmpeg.exe','bin' + os.sep + 'taskkill.exe','bin' + os.sep + 'SDL.dll') | def addModule(f, recursive=True): if OSNAME != 'posix' or not goodFile(f): return if os.path.isdir(f): for i in os.listdir(f): if os.path.isdir(f + os.sep + i) and recursive: addDir(f + os.sep + i) addModule(f + os.sep + i, recursive=recursive) elif i[-3:] == '.py': addModule(f + os.sep + i, recursive=recursive) elif f[-3:] == '.py': try: py_compile.compile(f) if os.path.exists(f+'o'): addFile(f+'o') addFile(f) elif os.path.exists(f+'c'): addFile(f+'c') addFile(f) addFile(f) except: print >> sys.stderr, 'Error while compyling', f addFile(f) | 94652ffc633e3e937358a57a9c4c87aff3211d3a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11142/94652ffc633e3e937358a57a9c4c87aff3211d3a/build-required-files.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
3120,
12,
74,
16,
5904,
33,
5510,
4672,
309,
5932,
1985,
480,
296,
24463,
11,
578,
486,
7494,
812,
12,
74,
4672,
327,
309,
1140,
18,
803,
18,
291,
1214,
12,
74,
4672,
364,
277,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3120,
12,
74,
16,
5904,
33,
5510,
4672,
309,
5932,
1985,
480,
296,
24463,
11,
578,
486,
7494,
812,
12,
74,
4672,
327,
309,
1140,
18,
803,
18,
291,
1214,
12,
74,
4672,
364,
277,
... |
'author': row['author']} | 'author': escape(row['author'])} | def perform_query (self, query, changeset, tickets, wiki, page=0): keywords = query.split(' ') | 117d80f197a861587863b346ce4b11b5754a4845 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/117d80f197a861587863b346ce4b11b5754a4845/Search.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2271,
261,
2890,
16,
843,
16,
22463,
16,
24475,
16,
9050,
16,
1363,
33,
20,
4672,
7093,
273,
843,
18,
4939,
2668,
8624,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2271,
261,
2890,
16,
843,
16,
22463,
16,
24475,
16,
9050,
16,
1363,
33,
20,
4672,
7093,
273,
843,
18,
4939,
2668,
8624,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
p = patterns[match_index] for c in chains[chain_index:]: if (isinstance(p, Chain) and p.matches(c)) or \ (isinstance(p, Packet) and c.contains(p)): | filter = patterns[match_index] for i in xrange(next_chain, len(chains)): c = chains[i] if isinstance(filter, Chain) and filter.matches(c): | def expect(self, patterns=[], timeout=None, limit=None): """Read from the Connector and return the index of the first pattern which matches the input chain; otherwise, raise an exception. | b6a8cf48ec93af35cd798dd7447c4de8ba46bad1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5910/b6a8cf48ec93af35cd798dd7447c4de8ba46bad1/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4489,
12,
2890,
16,
6884,
22850,
6487,
2021,
33,
7036,
16,
1800,
33,
7036,
4672,
3536,
1994,
628,
326,
15779,
471,
327,
326,
770,
434,
326,
1122,
1936,
1492,
1885,
326,
810,
2687,
31,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4489,
12,
2890,
16,
6884,
22850,
6487,
2021,
33,
7036,
16,
1800,
33,
7036,
4672,
3536,
1994,
628,
326,
15779,
471,
327,
326,
770,
434,
326,
1122,
1936,
1492,
1885,
326,
810,
2687,
31,
... |
src = os.path.join(trac.siteconfig.__default_macro_dir__, f) | src = os.path.join(trac.siteconfig.__default_macros_dir__, f) | def do_initenv(self, line): if self.env_check(): print "Initenv for '%s' failed.\nDoes an environment already exist?" % self.envname return arg = self.arg_tokenize(line) project_name = None repository_dir = None templates_dir = None if len(arg) == 1: returnvals = self.get_initenv_args() project_name = returnvals[0] repository_dir = returnvals[1] templates_dir = returnvals[2] elif len(arg)!= 3: print 'Wrong number of arguments to initenv %d' % len(arg) return else: project_name = arg[0] repository_dir = arg[1] templates_dir = arg[2] | f5e551367f081d29fc085e90230f1b91d70d64f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/f5e551367f081d29fc085e90230f1b91d70d64f8/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2738,
3074,
12,
2890,
16,
980,
4672,
309,
365,
18,
3074,
67,
1893,
13332,
1172,
315,
2570,
3074,
364,
1995,
87,
11,
2535,
8403,
82,
10154,
392,
3330,
1818,
1005,
7225,
738,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2738,
3074,
12,
2890,
16,
980,
4672,
309,
365,
18,
3074,
67,
1893,
13332,
1172,
315,
2570,
3074,
364,
1995,
87,
11,
2535,
8403,
82,
10154,
392,
3330,
1818,
1005,
7225,
738,
36... |
answer.append(to_xml(str((ans.answer)))) | answer.append(to_xml(tools.ustr((ans.answer)))) | def create(self, cr, uid, ids, datas, context): | 359c4ac3c3deec88d37b44f93123f5d4ba02f3b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/359c4ac3c3deec88d37b44f93123f5d4ba02f3b3/survey_form.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
5386,
16,
819,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
5386,
16,
819,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
_fonts[font.fontName] = font | fontName = str(font.fontName) _fonts[fontName] = font | def registerFont(font): "Registers a font, including setting up info for accelerated stringWidth" #assert isinstance(font, Font), 'Not a Font: %s' % font _fonts[font.fontName] = font if not font._multiByte: if _stringWidth: _rl_accel.setFontInfo(string.lower(font.fontName), _dummyEncoding, font.face.ascent, font.face.descent, font.widths) | 255237541447c464464fa0e85e9a7bd90fcf34a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/255237541447c464464fa0e85e9a7bd90fcf34a1/pdfmetrics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1744,
5711,
12,
5776,
4672,
315,
10277,
279,
3512,
16,
6508,
3637,
731,
1123,
364,
15153,
19007,
533,
2384,
6,
468,
11231,
1549,
12,
5776,
16,
10063,
3631,
296,
1248,
279,
10063,
30,
738... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1744,
5711,
12,
5776,
4672,
315,
10277,
279,
3512,
16,
6508,
3637,
731,
1123,
364,
15153,
19007,
533,
2384,
6,
468,
11231,
1549,
12,
5776,
16,
10063,
3631,
296,
1248,
279,
10063,
30,
738... |
__np.random.seed(seed) | __np.random.seed(int(seed)) | def killtraces(N,perc=50,maxfactor=1,seed=None): ''' Return a mask to remove random samples from an N-vector using a maximum gap size constraint. Parameters: N length of the vector perc percentage of samples to retain (0 < perc < 100) maxfactor maximum gap factor (>=1) seed seed for random number generator ''' if seed is not None: __np.random.seed(seed) if maxfactor<1: print "ERROR: maxfactor must be >=1" return if perc<=0 or perc>=100: print "ERROR: 0 < perc < 100" return unifdist = 100./perc numtraces = __np.int(round(N*perc/100.)) maxdist = maxfactor * unifdist meandist = unifdist + (maxfactor-1.)*unifdist/2. randstart = (__np.random.rand()*(meandist-unifdist)) initpick = randstart + __np.arange(0,N,meandist) randfactor = (__np.random.rand(initpick.size)-.5)*(meandist-unifdist) initpick = __np.round(initpick + randfactor) initpick = __np.sort(__np.unique(initpick.clip(1,N-1))) RemainingTrLocs = __np.setxor1d(initpick,__np.array(range(N))) __np.random.shuffle(RemainingTrLocs) if (numtraces-len(initpick))>0: pickinginds = __np.union1d(initpick,RemainingTrLocs[:(numtraces-len(initpick))]) else: pickinginds = initpick picking = __np.zeros(N) picking.put(__np.ones(len(pickinginds)),list(pickinginds)) return picking | d698847fbb0050c03e0290edbb8e62969ff1765d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3143/d698847fbb0050c03e0290edbb8e62969ff1765d/hegilles.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
2033,
764,
12,
50,
16,
457,
71,
33,
3361,
16,
1896,
6812,
33,
21,
16,
12407,
33,
7036,
4672,
9163,
2000,
279,
3066,
358,
1206,
2744,
5216,
628,
392,
423,
17,
7737,
1450,
279,
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,
8673,
2033,
764,
12,
50,
16,
457,
71,
33,
3361,
16,
1896,
6812,
33,
21,
16,
12407,
33,
7036,
4672,
9163,
2000,
279,
3066,
358,
1206,
2744,
5216,
628,
392,
423,
17,
7737,
1450,
279,
4... |
self.assertEquals(os.path.realpath(os.path.join(os.path.dirname(base), 'parentdir.txt')), | self.assertEquals(os.path.join(os.path.dirname(base), 'parentdir.txt'), | def test_getpath(self): base = os.path.dirname(self.filename) config = self._read() config.set('a', 'path_a', os.path.join(base, 'here', 'absolute.txt')) config.set('a', 'path_b', 'thisdir.txt') config.set('a', 'path_c', os.path.join(os.pardir, 'parentdir.txt')) | 886fde18162d22bdb313cb00e2b68f191fbe708d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/886fde18162d22bdb313cb00e2b68f191fbe708d/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
588,
803,
12,
2890,
4672,
1026,
273,
1140,
18,
803,
18,
12287,
12,
2890,
18,
3459,
13,
642,
273,
365,
6315,
896,
1435,
642,
18,
542,
2668,
69,
2187,
296,
803,
67,
69,
2187,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
588,
803,
12,
2890,
4672,
1026,
273,
1140,
18,
803,
18,
12287,
12,
2890,
18,
3459,
13,
642,
273,
365,
6315,
896,
1435,
642,
18,
542,
2668,
69,
2187,
296,
803,
67,
69,
2187,... |
(attributeName, reference.itsUUID, None) | (attributeName, str(reference.itsUUID), None) | def completeAssignments(self, item, assignments): """ Perform all the delayed attribute assignments for an item """ | 4dea23bc60b6ddf48185a0673c01c4e9b396c6cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/4dea23bc60b6ddf48185a0673c01c4e9b396c6cf/Parcel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3912,
18628,
12,
2890,
16,
761,
16,
13610,
4672,
3536,
11217,
777,
326,
15278,
1566,
13610,
364,
392,
761,
3536,
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,
3912,
18628,
12,
2890,
16,
761,
16,
13610,
4672,
3536,
11217,
777,
326,
15278,
1566,
13610,
364,
392,
761,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
lines.append( (string.join(currentline), currentlength, len(currentline)) ) | lines.append( (' '.join(currentline), currentlength, len(currentline)) ) | def wrap(self, availableWidth, availableHeight): simpletext = self.simpletext self.availableWidth = availableWidth style = self.style text = self.simpletext rightIndent = style.rightIndent leftIndent = style.leftIndent leading = style.leading font = style.fontName size = style.fontSize firstindent = style.firstLineIndent #textcolor = style.textColor words = string.split(simpletext) lines = [] from reportlab.pdfbase.pdfmetrics import stringWidth spacewidth = stringWidth(" ", font, size) currentline = [] currentlength = 0 firstmaxlength = availableWidth - rightIndent - firstindent maxlength = availableWidth - rightIndent - leftIndent if maxlength<spacewidth: return (spacewidth+rightIndent+firstindent, availableHeight) # need something wider than this! if availableHeight<leading: return (availableWidth, leading) # need something longer if self.lines is None: heightused = 0 cursor = 0 nwords = len(words) done = 0 #heightused = leading # ??? while cursor<nwords and not done: thismaxlength = maxlength if not lines: thismaxlength = firstmaxlength thisword = words[cursor] thiswordsize = stringWidth(thisword, font, size) if currentlength: thiswordsize = thiswordsize+spacewidth nextlength = currentlength + thiswordsize if not currentlength or nextlength<maxlength: # add the word cursor = cursor+1 currentlength = nextlength currentline.append(thisword) #print "currentline", currentline else: # emit the line lines.append( (string.join(currentline), currentlength, len(currentline)) ) currentline = [] currentlength = 0 heightused = heightused+leading if heightused+leading>availableHeight: done = 1 if currentlength and not done: lines.append( (string.join(currentline), currentlength, len(currentline) )) heightused = heightused+leading self.lines = lines self.height = heightused remainder = self.remainder = string.join(words[cursor:]) #print "lines", lines #print "remainder is", remainder else: remainder = None heightused = self.height lines = self.lines if remainder: result = (availableWidth, availableHeight+leading) # need to split else: result = (availableWidth, heightused) #if debug: print "wrap is", (availableWidth, availableHeight), result, len(lines) return result | 041e2d265f4d145658b08edc02ff501d425029d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/041e2d265f4d145658b08edc02ff501d425029d6/para.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2193,
12,
2890,
16,
2319,
2384,
16,
2319,
2686,
4672,
3142,
1469,
408,
273,
365,
18,
9812,
1469,
408,
365,
18,
5699,
2384,
273,
2319,
2384,
2154,
273,
365,
18,
4060,
977,
273,
365,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2193,
12,
2890,
16,
2319,
2384,
16,
2319,
2686,
4672,
3142,
1469,
408,
273,
365,
18,
9812,
1469,
408,
365,
18,
5699,
2384,
273,
2319,
2384,
2154,
273,
365,
18,
4060,
977,
273,
365,
18,... |
if size: | if size is not None: | def table_padding_style(key, value, start, stop): style = [] size = format_size(value, None) if size: if key == 'padding': for padding in TABLE_PADDINGS.values(): style.append((padding, start, stop, size)) elif key in TABLE_PADDINGS.keys(): style.append((TABLE_PADDINGS[key], start, stop, size)) return style | 9f040c61a8fd3a1fda10ffd20ba6db6efe48e08e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/9f040c61a8fd3a1fda10ffd20ba6db6efe48e08e/style.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1014,
67,
9598,
67,
4060,
12,
856,
16,
460,
16,
787,
16,
2132,
4672,
2154,
273,
5378,
963,
273,
740,
67,
1467,
12,
1132,
16,
599,
13,
309,
963,
353,
486,
599,
30,
309,
498,
422,
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,
1014,
67,
9598,
67,
4060,
12,
856,
16,
460,
16,
787,
16,
2132,
4672,
2154,
273,
5378,
963,
273,
740,
67,
1467,
12,
1132,
16,
599,
13,
309,
963,
353,
486,
599,
30,
309,
498,
422,
29... |
fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),viewFile) | fn = os.path.join(os.path.abspath(os.path.dirname(__file__)), viewFile) | def ViewFile(self, viewTitle, viewFile, encoding=None): fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),viewFile) if encoding: import codecs try: textFile = codecs.open(fn, 'r') except IOError: tkMessageBox.showerror(title='File Load Error', message='Unable to load file '+ `fileName`+' .') return else: data = textFile.read() else: data = None textView.TextViewer(self, viewTitle, fn, data=data) | 4e4da51b025878e84436c56679b325fb24465147 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/4e4da51b025878e84436c56679b325fb24465147/aboutDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4441,
812,
12,
2890,
16,
1476,
4247,
16,
1476,
812,
16,
2688,
33,
7036,
4672,
2295,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
5113,
803,
12,
538,
18,
803,
18,
12287,
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,
4441,
812,
12,
2890,
16,
1476,
4247,
16,
1476,
812,
16,
2688,
33,
7036,
4672,
2295,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
5113,
803,
12,
538,
18,
803,
18,
12287,
12,
... |
for ctl in (self.GroupItemFrame.children() + self.GroupCharInfo.children()): pass | def initLayout(self): testfont = QFontMetrics(qApp.font()) | 2433b74bb1c06af29f55b695b1c920b01fc76536 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6671/2433b74bb1c06af29f55b695b1c920b01fc76536/ScWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
3744,
12,
2890,
4672,
1842,
5776,
273,
2238,
5711,
5653,
12,
85,
3371,
18,
5776,
10756,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
3744,
12,
2890,
4672,
1842,
5776,
273,
2238,
5711,
5653,
12,
85,
3371,
18,
5776,
10756,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
'path': path, 'rev': node.rev, | 'path': path, 'rev': node.rev, 'stickyrev': rev, | def process_request(self, req): path = req.args.get('path', '/') rev = req.args.get('rev') or None | bf1d50ac479a1a6f11e57debc84a84af720c4670 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/bf1d50ac479a1a6f11e57debc84a84af720c4670/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2293,
12,
2890,
16,
1111,
4672,
589,
273,
1111,
18,
1968,
18,
588,
2668,
803,
2187,
2023,
13,
5588,
273,
1111,
18,
1968,
18,
588,
2668,
9083,
6134,
578,
599,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2293,
12,
2890,
16,
1111,
4672,
589,
273,
1111,
18,
1968,
18,
588,
2668,
803,
2187,
2023,
13,
5588,
273,
1111,
18,
1968,
18,
588,
2668,
9083,
6134,
578,
599,
2,
-100,
-100,
... |
for mod, desc in value.iteritems(): menu[name][mod] = desc | for mod, desc in value.iteritems(): cur_menu[1].append((mod, desc)) menu.sort(stupid_cmp) for x in menu: x[1].sort(stupid_cmp) | def gen_doc_menu(mod_layer, module_list): menu = {} for name, value in module_list.iteritems(): if not menu.has_key(name): menu[name] = {} if name == mod_layer or mod_layer == None: #we are in our layer so fill in the other modules or we want them all for mod, desc in value.iteritems(): menu[name][mod] = desc return menu | d6b0f3712fe2f90c233e491ae89534d2fe500e1a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7247/d6b0f3712fe2f90c233e491ae89534d2fe500e1a/sedoctool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
67,
2434,
67,
5414,
12,
1711,
67,
6363,
16,
1605,
67,
1098,
4672,
3824,
273,
2618,
364,
508,
16,
460,
316,
1605,
67,
1098,
18,
2165,
3319,
13332,
309,
486,
3824,
18,
5332,
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,
3157,
67,
2434,
67,
5414,
12,
1711,
67,
6363,
16,
1605,
67,
1098,
4672,
3824,
273,
2618,
364,
508,
16,
460,
316,
1605,
67,
1098,
18,
2165,
3319,
13332,
309,
486,
3824,
18,
5332,
67,
... |
self.pool = PoolStack(self) self.turned = TurnedStack(self) | x = x + XSPACING | def __init__(self, master): | 90f09405606ca0eb9c7b66595fbe62655a2101df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/90f09405606ca0eb9c7b66595fbe62655a2101df/solitaire.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4171,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4171,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matplotlib.rcParams['numerix'] = 'numpy' | def importModules(verbose=True): global matplotlib,xmlplot # If MatPlotLib if already loaded, we are done: return. if matplotlib is not None: return # Configure MatPlotLib backend and numerical library. # (should be done before any modules that use MatPlotLib are loaded) import matplotlib matplotlib.rcParams['numerix'] = 'numpy' matplotlib.use('Qt4Agg') # Get GOTM-GUI directory from environment. if 'GOTMGUIDIR' in os.environ: relguipath = os.environ['GOTMGUIDIR'] elif 'GOTMDIR' in os.environ: relguipath = os.environ['GOTMDIR']+'/gui.py' else: print 'Cannot find GOTM-GUI directory. Please set environment variable "GOTMDIR" to the GOTM root (containing gui.py), or "GOTMGUIDIR" to the GOTM-GUI root, before running.' sys.exit(1) if verbose: print 'Getting GOTM-GUI libraries from "%s".' % relguipath # Add the GOTM-GUI directory to the search path and import the common # GOTM-GUI module (needed for command line parsing). gotmguiroot = os.path.join(os.path.dirname(os.path.realpath(__file__)),relguipath) path = sys.path[:] sys.path.append(gotmguiroot) # Import remaining GOTM-GUI modules try: import xmlplot.data,xmlplot.plot,xmlplot.gui_qt4 except ImportError,e: print 'Unable to import GOTM-GUI libraries (%s). Please ensure that environment variable GOTMDIR or GOTMGUIDIR is set.' % e sys.exit(1) sys.path = path | 4e2feb7d61fc667b6752e77b007b7f6c16ba25cb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/383/4e2feb7d61fc667b6752e77b007b7f6c16ba25cb/multiplot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
7782,
12,
11369,
33,
5510,
4672,
2552,
13892,
16,
2902,
4032,
225,
468,
971,
14493,
11532,
5664,
309,
1818,
4203,
16,
732,
854,
2731,
30,
327,
18,
309,
13892,
353,
486,
599,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
7782,
12,
11369,
33,
5510,
4672,
2552,
13892,
16,
2902,
4032,
225,
468,
971,
14493,
11532,
5664,
309,
1818,
4203,
16,
732,
854,
2731,
30,
327,
18,
309,
13892,
353,
486,
599,
30,
... | |
print "About to AppendItem %s" %data | def changeHierarchy(self, data, x, y): print "Changing hierarchy for %s..." % repr(data) | 018dc2f3a19f43f863b8a1cd816cbdb4591b1bce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7242/018dc2f3a19f43f863b8a1cd816cbdb4591b1bce/SceneGraphUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
12074,
12,
2890,
16,
501,
16,
619,
16,
677,
4672,
1172,
315,
782,
18183,
9360,
364,
738,
87,
7070,
738,
8480,
12,
892,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
12074,
12,
2890,
16,
501,
16,
619,
16,
677,
4672,
1172,
315,
782,
18183,
9360,
364,
738,
87,
7070,
738,
8480,
12,
892,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
_prelude.prelude_option_new_request(self._client, self._msgbuf, 0, analyzer_path) | _prelude.prelude_option_new_request(self._msgbuf, 0, analyzer_path) | def _request(self, analyzer_path, type, value=None): _prelude.prelude_option_new_request(self._client, self._msgbuf, 0, analyzer_path) _prelude.prelude_option_push_request(self._msgbuf, type, value) _prelude.prelude_msgbuf_mark_end(self._msgbuf) msg = _prelude.my_prelude_msg_read(_prelude.prelude_connection_get_fd(self._manager_connection)) return msg | 70503a61b09c81c138dcbfff4fd6a60a97ea41c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11628/70503a61b09c81c138dcbfff4fd6a60a97ea41c3/prelude.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2293,
12,
2890,
16,
15116,
67,
803,
16,
618,
16,
460,
33,
7036,
4672,
389,
1484,
80,
1317,
18,
1484,
80,
1317,
67,
3482,
67,
2704,
67,
2293,
12,
2890,
6315,
3576,
4385,
16,
374,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2293,
12,
2890,
16,
15116,
67,
803,
16,
618,
16,
460,
33,
7036,
4672,
389,
1484,
80,
1317,
18,
1484,
80,
1317,
67,
3482,
67,
2704,
67,
2293,
12,
2890,
6315,
3576,
4385,
16,
374,... |
if result != None: return result DebugPrint(0, 'ERROR: unable to find valid certinfo file for job ' + localJobId) | if result == None: DebugPrint(0, 'ERROR: unable to find valid certinfo file for job ' + localJobId) return result | def readCertInfo(localJobId, probeName): " Look for and read contents of cert info file if present" global Config global jobManagers certinfo_files = [] DebugPrint(4, "readCertInfo: received (" + str(localJobId) + ", " + str(probeName) + ")") # Ascertain LRMS type -- from explicit set method if possible, from probe name if not lrms = __lrms if lrms == None: match = re.search(r'^(?P<Type>.*?):', probeName) if match: lrms = string.lower(match.group("Type")) DebugPrint(4, "readCertInfo: obtained LRMS type " + lrms + \ " from ProbeName") else: DebugPrint(0, 'Error: Unable to ascertain lrms to match against multiple certinfo entries') return if len(jobManagers) == 0: jobManagers.append(lrms) # Useful default DebugPrint(4, "readCertInfo: added default LRMS type " + lrms + " to search list") # Ascertain local job ID idMatch = __certinfoLocalJobIdMunger.search(localJobId) if idMatch: DebugPrint(4, "readCertInfo: trimming " + localJobId + " to " + idMatch.group(1)) localJobId = idMatch.group("ID") if localJobId == None: return # No LocalJobId, so no dice DebugPrint(4, "readCertInfo: continuing to process") for jobManager in jobManagers: filestem = Config.get_DataFolder() + \ 'gratia_certinfo' + '_' + \ jobManager + '_' + \ localJobId DebugPrint(4, "readCertInfo: looking for " + filestem) if os.path.exists(filestem): certinfo_files.append(filestem) break elif os.path.exists(filestem + '.0.0'): certinfo_files.append(filestem + '.0.0') break if len(certinfo_files) == 1: DebugPrint(4, "readCertInfo: found certinfo file " + certinfo_files[0]) else: DebugPrint(4, "readCertInfo: globbing for certinfo file") certinfo_files = glob.glob(Config.get_DataFolder() + 'gratia_certinfo_*_' + localJobId + '*') if certinfo_files == None or len(certinfo_files) == 0: DebugPrint(4, "readCertInfo: could not find certinfo files matching localJobId " + str(localJobId)) return # No files if len(certinfo_files) == 1: fileMatch = __certinfoJobManagerExtractor.search(certinfo_files[0]) if fileMatch: jobManagers.insert(0,fileMatch.group(1)) # Save to short-circuit glob next time DebugPrint(4, "readCertInfo: (1) saving jobManager " + fileMatch.group(1) + " for future reference") for certinfo in certinfo_files: found = 0 # Keep track of whether to return info for this file. result = None try: certinfo_doc = xml.dom.minidom.parse(certinfo) except Exception, e: DebugPrint(0, 'ERROR: Unable to parse XML file ' + certinfo, ": ", e) continue # Next, find the correct information and send it back. certinfo_nodes = certinfo_doc.getElementsByTagName('GratiaCertInfo') if certinfo_nodes.length == 1: if (DN_FQAN_DISABLED): DebugPrint(4, "readCertInfo: removing " + str(certinfo)) os.remove(certinfo) # Clean up. continue if len(certinfo_files) == 1: found = 1 # Only had one candidate -- use it else: # Check LRMS as recorded in certinfo matches our LRMS ascertained from system or probe. certinfo_lrms = string.lower(GetNodeData(certinfo_nodes[0]. getElementsByTagName('BatchManager'), 0)) DebugPrint(4, "readCertInfo: want LRMS " + lrms + ": found " + certinfo_lrms) if certinfo_lrms == lrms: # Match found = 1 fileMatch = __certinfoJobManagerExtractor.search(certinfo) if fileMatch: jobManagers.insert(0,fileMatch.group(1)) # Save to short-circuit glob next time DebugPrint(4, "readCertInfo: saving jobManager " + fileMatch.group(1) + " for future reference") if found == 1: result = { "DN": GetNodeData(certinfo_nodes[0].getElementsByTagName('DN'), 0), "VO": GetNodeData(certinfo_nodes[0].getElementsByTagName('VO'), 0), "FQAN": GetNodeData(certinfo_nodes[0].getElementsByTagName('FQAN'), 0) } DebugPrint(4, "readCertInfo: removing " + str(certinfo)) os.remove(certinfo) # Clean up. break # Done -- stop looking else: DebugPrint(0, 'ERROR: certinfo file ' + certinfo + ' does not contain one valid GratiaCertInfo node') if result != None: return result DebugPrint(0, 'ERROR: unable to find valid certinfo file for job ' + localJobId) | 2abb6f512aead669f454a58e7b6bf70e0d0428a5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/637/2abb6f512aead669f454a58e7b6bf70e0d0428a5/Gratia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
5461,
966,
12,
3729,
23378,
16,
10695,
461,
4672,
315,
10176,
364,
471,
855,
2939,
434,
3320,
1123,
585,
309,
3430,
6,
2552,
1903,
2552,
1719,
17570,
3320,
1376,
67,
2354,
273,
5378... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5461,
966,
12,
3729,
23378,
16,
10695,
461,
4672,
315,
10176,
364,
471,
855,
2939,
434,
3320,
1123,
585,
309,
3430,
6,
2552,
1903,
2552,
1719,
17570,
3320,
1376,
67,
2354,
273,
5378... |
dia.activate() | def startDebugWin(self, cmd): print "Services startDebugWin [info]" self.windeb = elementary.Window("servicesDebug", elementary.ELM_WIN_BASIC) self.windeb.title_set(_("Service output")) self.windeb.autodel_set(True) | f85c48ab2183f86a418338ad59805bed2ccfd32c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11428/f85c48ab2183f86a418338ad59805bed2ccfd32c/shr_services.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
2829,
18049,
12,
2890,
16,
1797,
4672,
1172,
315,
5676,
787,
2829,
18049,
306,
1376,
4279,
365,
18,
8082,
31888,
273,
930,
814,
18,
3829,
2932,
8387,
2829,
3113,
930,
814,
18,
2247,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
2829,
18049,
12,
2890,
16,
1797,
4672,
1172,
315,
5676,
787,
2829,
18049,
306,
1376,
4279,
365,
18,
8082,
31888,
273,
930,
814,
18,
3829,
2932,
8387,
2829,
3113,
930,
814,
18,
2247,... | |
are expanded). | are expanded). Any build/table files present in "./ups" are automatically added to files. | def InstallEups(env, dest, files, presetup=""): """Install a ups directory, setting absolute versions as appropriate (unless you're installing from the trunk, in which case no versions are expanded). If presetup is provided, it's expected to be a dictionary with keys product names and values the version that should be installed into the table files, overriding eups expandtable's usual behaviour. E.g. | 3443cee899423ac974afa336b3b952c83fc3cca8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6561/3443cee899423ac974afa336b3b952c83fc3cca8/SConsUtils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10284,
41,
18294,
12,
3074,
16,
1570,
16,
1390,
16,
12313,
416,
1546,
6,
4672,
3536,
6410,
279,
731,
87,
1867,
16,
3637,
4967,
5244,
487,
5505,
261,
28502,
1846,
4565,
3799,
310,
628,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10284,
41,
18294,
12,
3074,
16,
1570,
16,
1390,
16,
12313,
416,
1546,
6,
4672,
3536,
6410,
279,
731,
87,
1867,
16,
3637,
4967,
5244,
487,
5505,
261,
28502,
1846,
4565,
3799,
310,
628,
... |
if bodyfat >= 25.0: | if bodyfat > 25.0: | def on_bodyfat_calc(self, *args): """This formula comes from 'The Bodyfat Guide' by Ron Brown""" waist = self.waist_spinbutton.get_value() weight = self.weight_spinbutton.get_value() | 15a834372b4854ff4811d1f409a9e19cb96e978b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5454/15a834372b4854ff4811d1f409a9e19cb96e978b/bodyfat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
3432,
74,
270,
67,
12448,
12,
2890,
16,
380,
1968,
4672,
3536,
2503,
8013,
14535,
628,
296,
1986,
5652,
74,
270,
13018,
11,
635,
534,
265,
605,
26253,
8395,
27098,
376,
273,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
3432,
74,
270,
67,
12448,
12,
2890,
16,
380,
1968,
4672,
3536,
2503,
8013,
14535,
628,
296,
1986,
5652,
74,
270,
13018,
11,
635,
534,
265,
605,
26253,
8395,
27098,
376,
273,
3... |
return [ (w_key,cell) for w_key,hash,cell in self.data if not cell.is_empty()] | return [ (w_key, hash, cell) for w_key,hash,cell in self.data if not cell.is_empty()] | def non_empties(self): return [ (w_key,cell) for w_key,hash,cell in self.data if not cell.is_empty()] | a9a72cafc2a01ecab085d2980211916bd9911e63 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/a9a72cafc2a01ecab085d2980211916bd9911e63/dictobject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1661,
67,
5744,
606,
12,
2890,
4672,
327,
306,
261,
91,
67,
856,
16,
3855,
13,
364,
341,
67,
856,
16,
2816,
16,
3855,
316,
365,
18,
892,
309,
486,
2484,
18,
291,
67,
5531,
1435,
65... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1661,
67,
5744,
606,
12,
2890,
4672,
327,
306,
261,
91,
67,
856,
16,
3855,
13,
364,
341,
67,
856,
16,
2816,
16,
3855,
316,
365,
18,
892,
309,
486,
2484,
18,
291,
67,
5531,
1435,
65... |
def replacement(self, **form): | """ A decorator (meant to be used under ``wsgiapp()``) that resolves the ``debugcount`` variable to a ``DebugInfo`` object (or gives an error if it can't be found). """ def debug_info_replacement(self, **form): | def replacement(self, **form): try: if 'debugcount' not in form: raise ValueError('You must provide a debugcount parameter') debugcount = form.pop('debugcount') try: debugcount = int(debugcount) except ValueError: raise ValueError('Bad value for debugcount') if debugcount not in self.debug_infos: raise ValueError('Debug %s no longer found (maybe it has expired?)' % debugcount) debug_info = self.debug_infos[debugcount] return func(self, debug_info=debug_info, **form) except ValueError, e: form['headers']['status'] = '500 Server Error' return '<html>There was an error: %s</html>' % e | b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1/middleware.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3536,
432,
7367,
261,
3501,
970,
358,
506,
1399,
3613,
12176,
28539,
2910,
1435,
10335,
13,
716,
17385,
326,
12176,
4148,
1883,
10335,
2190,
358,
279,
12176,
2829,
966,
10335,
733,
261,
280,
147... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3536,
432,
7367,
261,
3501,
970,
358,
506,
1399,
3613,
12176,
28539,
2910,
1435,
10335,
13,
716,
17385,
326,
12176,
4148,
1883,
10335,
2190,
358,
279,
12176,
2829,
966,
10335,
733,
261,
280,
147... |
"" def add_anonymous(self, homedir, perm=('r')): "" def validate_authentication(self, username, password): "" def has_user(self, username): "" def get_home_dir(self, username): "" def r_perm(self, username, obj): "" def w_perm(self, username, obj): "" class DummyAuthorizer: """An "authorizer" is a class handling authentications and permissions of the ftp server. It is used inside FTPHandler class for verifying user's password, getting users home directory and checking user permissions when a r/w I/O filesystem event occurs. DummyAuthorizer is the base authorizer providing a platform independent interface for managing "virtual" FTP users. According to methods provided by this class different kind on system-dependent authorizers could be optionally written from scratch subclassing this base class. """ user_table = {} def add_user(self, username, password, homedir, perm=('r')): | """Add a user to the virtual users table. Exceptions raised on error conditions such as insufficient permissions or duplicate usernames. """ | def add_user(self, username, password, homedir, perm=('r')): "" | 367a95e4363ae8b7515230480fff6ef354b95226 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3782/367a95e4363ae8b7515230480fff6ef354b95226/FTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
1355,
12,
2890,
16,
2718,
16,
2201,
16,
13995,
23210,
16,
4641,
33,
2668,
86,
26112,
30,
1408,
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,
527,
67,
1355,
12,
2890,
16,
2718,
16,
2201,
16,
13995,
23210,
16,
4641,
33,
2668,
86,
26112,
30,
1408,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
j = expand_job( self.dsage_server.get_jobs_by_username('testing123')[0]) | jobs = self.dsage_server.get_jobs_by_username('testing123', 'processing') j = expand_job(jobs[0]) | def testget_jobs_by_username(self): self.assertEquals( type(self.dsage_server.get_jobs_by_username('yqiang')), list) self.assertEquals( len(self.dsage_server.get_jobs_by_username('test')), 0) job = expand_job(self.dsage_server.get_job()) job.username = 'testing123' job.code = '' jdict = self.dsage_server.submit_job(job._reduce()) j = expand_job( self.dsage_server.get_jobs_by_username('testing123')[0]) self.assertEquals(j.username, job.username) | c54c403d67d31ac32abe9fc05ec4f6e32ce3a8a0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/c54c403d67d31ac32abe9fc05ec4f6e32ce3a8a0/test_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
588,
67,
10088,
67,
1637,
67,
5053,
12,
2890,
4672,
365,
18,
11231,
8867,
12,
618,
12,
2890,
18,
2377,
410,
67,
3567,
18,
588,
67,
10088,
67,
1637,
67,
5053,
2668,
93,
85,
77,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
588,
67,
10088,
67,
1637,
67,
5053,
12,
2890,
4672,
365,
18,
11231,
8867,
12,
618,
12,
2890,
18,
2377,
410,
67,
3567,
18,
588,
67,
10088,
67,
1637,
67,
5053,
2668,
93,
85,
77,
... |
if not is_valid_email(email): errors['email'] = True if not organisation: errors['organisation'] = True | def subscribe(self, REQUEST, notif_type, lang=None): """ Add a new subscribtion. First to a temporary list, then after confirmation to the correct container """ email = REQUEST.get('email', '') organisation = REQUEST.get('organisation', '') sector = REQUEST.get('sector', '') country = REQUEST.get('country', '') errors = {} REQUEST.SESSION['errors'] = {} # Send errors back to form if not is_valid_email(email): errors['email'] = True if not organisation: errors['organisation'] = True if not lang: lang = self.get_implicit_lang() try: notificationTool = self.getSite().portal_anonymous_notification notificationTool.add_email_subscription( email, organisation, sector, country, notif_type, lang, str(self.absolute_url()) + '/confirm' ) except ValueError, e: if is_valid_email(email): errors['email_exists'] = True if not len(errors): return REQUEST.RESPONSE.redirect(self.absolute_url() + '/thank_you') else: REQUEST.SESSION['errors'] = errors return REQUEST.RESPONSE.redirect(self.absolute_url()) | 44a3c836a13187db8fe15aa3671fabc4fc1faa8b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/44a3c836a13187db8fe15aa3671fabc4fc1faa8b/AnonymousSubscriber.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9129,
12,
2890,
16,
12492,
16,
486,
430,
67,
723,
16,
3303,
33,
7036,
4672,
3536,
1436,
279,
394,
10189,
24252,
18,
5783,
358,
279,
6269,
666,
16,
1508,
1839,
14296,
358,
326,
3434,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9129,
12,
2890,
16,
12492,
16,
486,
430,
67,
723,
16,
3303,
33,
7036,
4672,
3536,
1436,
279,
394,
10189,
24252,
18,
5783,
358,
279,
6269,
666,
16,
1508,
1839,
14296,
358,
326,
3434,
14... | |
return self._reportError('%s is not a valid destination site' %(destination),**kwargs) | return self._reportError( '%s is not a valid destination site' % ( destination ), **kwargs ) | def setDestination(self,destination): """Helper function. | 50b3322668816ba92ea3f9b253d993dc34c53a21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/50b3322668816ba92ea3f9b253d993dc34c53a21/Job.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
5683,
12,
2890,
16,
10590,
4672,
3536,
2276,
445,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
5683,
12,
2890,
16,
10590,
4672,
3536,
2276,
445,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self._test_missing(self.store, invalidate=False) | return self._test_missing(self.store, invalidate=False) | def test_missing_noInvalidation(self): self._test_missing(self.store, invalidate=False) | 151d4e273e221c24b54afdc10739e9abaadefeb1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11494/151d4e273e221c24b54afdc10739e9abaadefeb1/test_simple.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
7337,
67,
2135,
27946,
12,
2890,
4672,
365,
6315,
3813,
67,
7337,
12,
2890,
18,
2233,
16,
11587,
33,
8381,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
7337,
67,
2135,
27946,
12,
2890,
4672,
365,
6315,
3813,
67,
7337,
12,
2890,
18,
2233,
16,
11587,
33,
8381,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
' value="%s">' % (self.name, cgi.escape(term.token)) | ' value=%s />' % (self.name, xml.sax.saxutils.quoteattr(term.token)) | def __call__(self): result = ['<div class="value">'] value = self._value() field = self.context | 5a5ebcd67ef2320e6d11b92c3d4b95439b460343 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9530/5a5ebcd67ef2320e6d11b92c3d4b95439b460343/source.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
4672,
563,
273,
10228,
32,
2892,
667,
1546,
1132,
7918,
65,
460,
273,
365,
6315,
1132,
1435,
652,
273,
365,
18,
2472,
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,
1991,
972,
12,
2890,
4672,
563,
273,
10228,
32,
2892,
667,
1546,
1132,
7918,
65,
460,
273,
365,
6315,
1132,
1435,
652,
273,
365,
18,
2472,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
valid = False | return False | def _validateNumeric(self, candidate=None): """ Validate that the value is within the specified range (if specified.)""" if candidate is None: value = self._GetValue() else: value = candidate try: groupchar = self._fields[0]._groupChar if self._isFloat: number = float(value.replace(groupchar, '').replace(self._decimalChar, '.').replace('(', '-').replace(')', '')) else: number = long( value.replace(groupchar, '').replace('(', '-').replace(')', '')) if value.strip(): if self._fields[0]._alignRight: require_digit_at = self._fields[0]._extent[1]-1 else: require_digit_at = self._fields[0]._extent[0] | 89f9e172e206e88c784ef0ef88f77a38a5585d35 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/89f9e172e206e88c784ef0ef88f77a38a5585d35/maskededit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5662,
9902,
12,
2890,
16,
5500,
33,
7036,
4672,
3536,
3554,
716,
326,
460,
353,
3470,
326,
1269,
1048,
261,
430,
1269,
18,
15574,
309,
5500,
353,
599,
30,
460,
273,
365,
6315,
967... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5662,
9902,
12,
2890,
16,
5500,
33,
7036,
4672,
3536,
3554,
716,
326,
460,
353,
3470,
326,
1269,
1048,
261,
430,
1269,
18,
15574,
309,
5500,
353,
599,
30,
460,
273,
365,
6315,
967... |
if loglink: try: os.remove(loglink) except OSError as e: pass try: os.symlink(logfile, loglink) except OSError as e: pass | logfile = d.getVar("BB_LOGFILE", True) | def exec_func(func, d, dirs = None): """Execute an BB 'function'""" body = data.getVar(func, d) if not body: bb.warn("Function %s doesn't exist" % func) return flags = data.getVarFlags(func, d) for item in ['deps', 'check', 'interactive', 'python', 'cleandirs', 'dirs', 'lockfiles', 'fakeroot', 'task']: if not item in flags: flags[item] = None ispython = flags['python'] cleandirs = flags['cleandirs'] if cleandirs: for cdir in data.expand(cleandirs, d).split(): os.system("rm -rf %s" % cdir) if dirs is None: dirs = flags['dirs'] if dirs: dirs = data.expand(dirs, d).split() if dirs: for adir in dirs: bb.utils.mkdirhier(adir) adir = dirs[-1] else: adir = data.getVar('B', d, 1) # Save current directory try: prevdir = os.getcwd() except OSError: prevdir = data.getVar('TOPDIR', d, True) # Setup logfiles t = data.getVar('T', d, 1) if not t: raise SystemExit("T variable not set, unable to build") bb.utils.mkdirhier(t) loglink = "%s/log.%s" % (t, func) logfile = "%s/log.%s.%s" % (t, func, str(os.getpid())) runfile = "%s/run.%s.%s" % (t, func, str(os.getpid())) # Even though the log file has not yet been opened, lets create the link if loglink: try: os.remove(loglink) except OSError as e: pass try: os.symlink(logfile, loglink) except OSError as e: pass # Change to correct directory (if specified) if adir and os.access(adir, os.F_OK): os.chdir(adir) # Handle logfiles si = file('/dev/null', 'r') try: if bb.msg.debug_level['default'] > 0 and not ispython: so = os.popen("tee \"%s\"" % logfile, "w") else: so = file(logfile, 'w') except OSError as e: bb.msg.error(bb.msg.domain.Build, "opening log file: %s" % e) pass se = so # Dup the existing fds so we dont lose them osi = [os.dup(sys.stdin.fileno()), sys.stdin.fileno()] oso = [os.dup(sys.stdout.fileno()), sys.stdout.fileno()] ose = [os.dup(sys.stderr.fileno()), sys.stderr.fileno()] # Replace those fds with our own os.dup2(si.fileno(), osi[1]) os.dup2(so.fileno(), oso[1]) os.dup2(se.fileno(), ose[1]) # Since we've remapped stdout and stderr, its safe for log messages to be printed there now # exec_func can nest so we have to save state origstdout = bb.event.useStdout bb.event.useStdout = True locks = [] lockfiles = flags['lockfiles'] if lockfiles: for lock in data.expand(lockfiles, d).split(): locks.append(bb.utils.lockfile(lock)) try: # Run the function if ispython: exec_func_python(func, d, runfile, logfile) else: exec_func_shell(func, d, runfile, logfile, flags) # Restore original directory try: os.chdir(prevdir) except: pass finally: # Unlock any lockfiles for lock in locks: bb.utils.unlockfile(lock) sys.stdout.flush() sys.stderr.flush() bb.event.useStdout = origstdout # Restore the backup fds os.dup2(osi[0], osi[1]) os.dup2(oso[0], oso[1]) os.dup2(ose[0], ose[1]) # Close our logs si.close() so.close() se.close() if os.path.exists(logfile) and os.path.getsize(logfile) == 0: bb.msg.debug(2, bb.msg.domain.Build, "Zero size logfile %s, removing" % logfile) os.remove(logfile) try: os.remove(loglink) except OSError as e: pass # Close the backup fds os.close(osi[0]) os.close(oso[0]) os.close(ose[0]) | d14f9bf6c470907d77654a35b4b55f30bdc182ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8123/d14f9bf6c470907d77654a35b4b55f30bdc182ff/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1196,
67,
644,
12,
644,
16,
302,
16,
7717,
273,
599,
4672,
3536,
5289,
392,
21752,
296,
915,
11,
8395,
225,
1417,
273,
501,
18,
588,
1537,
12,
644,
16,
302,
13,
309,
486,
1417,
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,
1196,
67,
644,
12,
644,
16,
302,
16,
7717,
273,
599,
4672,
3536,
5289,
392,
21752,
296,
915,
11,
8395,
225,
1417,
273,
501,
18,
588,
1537,
12,
644,
16,
302,
13,
309,
486,
1417,
30,
... |
f = zipf.open("foo.txt") for i in range(FIXEDTEST_SIZE): self.assertEqual(f.read(0), b'') self.assertEqual(f.read(), b"O, for a Muse of Fire!") | with zipf.open("foo.txt") as f: for i in range(FIXEDTEST_SIZE): self.assertEqual(f.read(0), b'') self.assertEqual(f.read(), b"O, for a Muse of Fire!") | def test_read0(self): """Check that calling read(0) on a ZipExtFile object returns an empty string and doesn't advance file pointer.""" with zipfile.ZipFile(TESTFN, mode="w") as zipf: zipf.writestr("foo.txt", "O, for a Muse of Fire!") # read the data to make sure the file is there f = zipf.open("foo.txt") for i in range(FIXEDTEST_SIZE): self.assertEqual(f.read(0), b'') | df64e4ebf884a9041c9514c1c88905dd4793c799 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/df64e4ebf884a9041c9514c1c88905dd4793c799/test_zipfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
896,
20,
12,
2890,
4672,
3536,
1564,
716,
4440,
855,
12,
20,
13,
603,
279,
8603,
2482,
812,
733,
1135,
392,
1008,
533,
471,
3302,
1404,
8312,
585,
4407,
12123,
598,
18823,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
896,
20,
12,
2890,
4672,
3536,
1564,
716,
4440,
855,
12,
20,
13,
603,
279,
8603,
2482,
812,
733,
1135,
392,
1008,
533,
471,
3302,
1404,
8312,
585,
4407,
12123,
598,
18823,
18... |
self.msgText("Shrink Display!\n") | if (self.debugLevel >= HighDebug) : self.msgText("Shrink Display!\n") | def whenShrinkButtonClicked(self, event): if (self.shrinkGrow == True) : self.msgText("Shrink Display!\n") # add text self.speedPane.setVisible(False) self.shrinkGrow = False self.fullScrollRows = self.scrollArea.getRows() self.scrollArea.setRows(self.fullScrollRows / 2) self.scriptFrame.pack() else : self.msgText("Grow Display!\n") self.speedPane.setVisible(True) self.shrinkGrow = True self.scrollArea.setRows(self.fullScrollRows) self.scriptFrame.pack() return | 637586c522dc4614e3aa55f7046de00d6eaa8ae0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1660/637586c522dc4614e3aa55f7046de00d6eaa8ae0/RobotThrottle2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1347,
28747,
3616,
27633,
12,
2890,
16,
871,
4672,
309,
261,
2890,
18,
674,
12334,
30948,
422,
1053,
13,
294,
309,
261,
2890,
18,
4148,
2355,
1545,
15207,
2829,
13,
294,
365,
18,
3576,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1347,
28747,
3616,
27633,
12,
2890,
16,
871,
4672,
309,
261,
2890,
18,
674,
12334,
30948,
422,
1053,
13,
294,
309,
261,
2890,
18,
4148,
2355,
1545,
15207,
2829,
13,
294,
365,
18,
3576,
... |
self.rel = rel | self.rel = rel | def __init__(self, rel=None, feed_link=None, extension_elements=None, extension_attributes=None, text=None): self.rel = rel self.feed_link = feed_link self.text = text self.extension_elements = extension_elements or [] self.extension_attributes = extension_attributes or {} | 6a016768dbbd7d5ee9c62bcd2d2ce3bf7f6d1048 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6580/6a016768dbbd7d5ee9c62bcd2d2ce3bf7f6d1048/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1279,
33,
7036,
16,
4746,
67,
1232,
33,
7036,
16,
2710,
67,
6274,
33,
7036,
16,
2710,
67,
4350,
33,
7036,
16,
977,
33,
7036,
4672,
365,
18,
2878,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1279,
33,
7036,
16,
4746,
67,
1232,
33,
7036,
16,
2710,
67,
6274,
33,
7036,
16,
2710,
67,
4350,
33,
7036,
16,
977,
33,
7036,
4672,
365,
18,
2878,
273,
... |
slideLow = Slider(axLowcut, 'Lowcut', low, high, valinit=low) slideHigh = Slider(axHighcut, 'Highcut', low, high, valinit=high) | slideLow = Slider(axLowcut, 'Lowcut', low, high, valinit=low, facecolor='darkgrey', edgecolor='k', linewidth=1.7) slideHigh = Slider(axHighcut, 'Highcut', low, high, valinit=high, facecolor='darkgrey', edgecolor='k', linewidth=1.7) | def addSliders(): global axLowcut global axHighcut global slideLow global slideHigh #add filter slider axLowcut = fig.add_axes([0.45, 0.05, 0.35, 0.03], xscale='log') axHighcut = fig.add_axes([0.45, 0.10, 0.35, 0.03], xscale='log') low = 1.0/ (streams[stPt][0].stats.npts/float(streams[stPt][0].stats.sampling_rate)) high = streams[stPt][0].stats.sampling_rate/2.0 slideLow = Slider(axLowcut, 'Lowcut', low, high, valinit=low) slideHigh = Slider(axHighcut, 'Highcut', low, high, valinit=high) slideLow.on_changed(update) slideHigh.on_changed(update) | 93a2c795e7328c6f7046a8695c8888ff7fc3a875 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/93a2c795e7328c6f7046a8695c8888ff7fc3a875/pickingGUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
3738,
24290,
13332,
2552,
1740,
10520,
5150,
2552,
1740,
8573,
5150,
2552,
12701,
10520,
2552,
12701,
8573,
468,
1289,
1034,
18442,
1740,
10520,
5150,
273,
4291,
18,
1289,
67,
10855,
38... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3738,
24290,
13332,
2552,
1740,
10520,
5150,
2552,
1740,
8573,
5150,
2552,
12701,
10520,
2552,
12701,
8573,
468,
1289,
1034,
18442,
1740,
10520,
5150,
273,
4291,
18,
1289,
67,
10855,
38... |
def GetPrevHashKey(id, idx): | def GetPrevHashKey(hashid, idx): | def GetPrevHashKey(id, idx): raise DeprecatedIDCError, "Use python pickles instead." | 76aa24fecdace41c9fc827e500b95cfdf5053272 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4773/76aa24fecdace41c9fc827e500b95cfdf5053272/idc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
9958,
31006,
12,
2816,
350,
16,
2067,
4672,
1002,
9336,
734,
39,
668,
16,
315,
3727,
5790,
6002,
1040,
3560,
1199,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
9958,
31006,
12,
2816,
350,
16,
2067,
4672,
1002,
9336,
734,
39,
668,
16,
315,
3727,
5790,
6002,
1040,
3560,
1199,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
{'candela':'SI base unit of luminous intensity.\nDefined to be the luminous intensity, in a given direction, of a source that emits monochromatic radiation of frequency 540*10^12 hertz and that has a radiant intensity in that direction of 1\xe2\x81\x84683 watt per steradian.', | {'candela':'SI base unit of luminous intensity.\nDefined to be the luminous intensity, in a given direction, of a source that emits monochromatic radiation of frequency 540*10^12 hertz and that has a radiant intensity in that direction of 1/683 watt per steradian.', | 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())) | 4a7f8e846ab20476d1219a326ba1d0012a65c6c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4a7f8e846ab20476d1219a326ba1d0012a65c6c6/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,
... |
inner.thread(mailbox.close) | yield inner.thread(mailbox.close) | def feed(inner, self): self.log.info("Connecting to IMAP server %r port %d", self.mail_server, self.mail_port) mailbox = yield inner.thread(imaplib.IMAP4_SSL, self.mail_server, self.mail_port) | ee8bc9695ed606d567f6aafd4865deb72885ce63 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14361/ee8bc9695ed606d567f6aafd4865deb72885ce63/imapbot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4746,
12,
7872,
16,
365,
4672,
365,
18,
1330,
18,
1376,
2932,
30049,
358,
6246,
2203,
1438,
738,
86,
1756,
738,
72,
3113,
365,
18,
4408,
67,
3567,
16,
365,
18,
4408,
67,
655,
13,
141... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4746,
12,
7872,
16,
365,
4672,
365,
18,
1330,
18,
1376,
2932,
30049,
358,
6246,
2203,
1438,
738,
86,
1756,
738,
72,
3113,
365,
18,
4408,
67,
3567,
16,
365,
18,
4408,
67,
655,
13,
141... |
this = apply(_quickfix.new_CashDistribAgentAcctName, args) | this = _quickfix.new_CashDistribAgentAcctName(*args) | def __init__(self, *args): this = apply(_quickfix.new_CashDistribAgentAcctName, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
39,
961,
1669,
665,
3630,
9988,
299,
461,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
39,
961,
1669,
665,
3630,
9988,
299,
461,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
... |
self.aq_inner.aq_parent.error_log.raising(sys.exc_info()) | aq_acquire(self, 'error_log').raising(sys.exc_info()) | def safe_render(self, portlet_renderer): try: return portlet_renderer.render() except ConflictError: raise except Exception: logger.exception('Error while rendering %r' % (self,)) self.aq_inner.aq_parent.error_log.raising(sys.exc_info()) return self.error_message() | 1ca60f66bf51b67f9a0ddd2592e5b49894815bfc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12194/1ca60f66bf51b67f9a0ddd2592e5b49894815bfc/manager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4183,
67,
5902,
12,
2890,
16,
13114,
67,
14374,
4672,
775,
30,
327,
13114,
67,
14374,
18,
5902,
1435,
1335,
23460,
668,
30,
1002,
1335,
1185,
30,
1194,
18,
4064,
2668,
668,
1323,
9782,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4183,
67,
5902,
12,
2890,
16,
13114,
67,
14374,
4672,
775,
30,
327,
13114,
67,
14374,
18,
5902,
1435,
1335,
23460,
668,
30,
1002,
1335,
1185,
30,
1194,
18,
4064,
2668,
668,
1323,
9782,
... |
return os.environ[name] | return os.environ.get(name, default) | def envvar(self, name): """ Get an environment variable. """ return os.environ[name] | dfae400320ff64999627f72278320e86b9060bf9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1270/dfae400320ff64999627f72278320e86b9060bf9/common.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1550,
1401,
12,
2890,
16,
508,
4672,
3536,
968,
392,
3330,
2190,
18,
3536,
327,
1140,
18,
28684,
63,
529,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1550,
1401,
12,
2890,
16,
508,
4672,
3536,
968,
392,
3330,
2190,
18,
3536,
327,
1140,
18,
28684,
63,
529,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
class StaticCalendarRedirectAttribute (StaticRedirectAttribute): def shouldShow (self, item): | class CalendarEventBlock (DetailSynchronizer, LabeledTextAttributeBlock): def shouldShow (self, item): | def loadAttributeIntoWidget(self, item, widget): value = '' try: section = item.getAttributeValue (self.whichAttribute()) value = section.getAttributeValue ('emailAddresses') except AttributeError: value = {} # convert the email address list to a nice string. whoNames = [] for whom in value.values(): whoNames.append (str (whom)) whoString = ', '.join(whoNames) widget.SetValue(whoString) | 18f063c6853532f818031110a69fa7d2bec069cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/18f063c6853532f818031110a69fa7d2bec069cd/Detail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
1499,
5952,
4609,
12,
2890,
16,
761,
16,
3604,
4672,
460,
273,
875,
775,
30,
2442,
273,
761,
18,
588,
14942,
261,
2890,
18,
12784,
1499,
10756,
460,
273,
2442,
18,
588,
14942,
77... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
1499,
5952,
4609,
12,
2890,
16,
761,
16,
3604,
4672,
460,
273,
875,
775,
30,
2442,
273,
761,
18,
588,
14942,
261,
2890,
18,
12784,
1499,
10756,
460,
273,
2442,
18,
588,
14942,
77... |
''' % dict(module=module, func=func, python=python, egg_name=egg_name)) | ''' % locals()) | def write_script(fpath, entry_pt, egg_name): if verbose: print 'Creating script', fpath assert entry_pt.count(':') == 1 module, func = entry_pt.strip().split(':') python = sys.executable if on_win: python = '"%s"' % python rm_rf(fpath) fo = open(fpath, 'w') fo.write('''\ | d07a1ae2b14b571248f8ef869f8301b029f2bb0d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7707/d07a1ae2b14b571248f8ef869f8301b029f2bb0d/scripts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
4263,
12,
28900,
16,
1241,
67,
337,
16,
25144,
67,
529,
4672,
309,
3988,
30,
1172,
296,
11092,
2728,
2187,
13543,
225,
1815,
1241,
67,
337,
18,
1883,
2668,
2497,
13,
422,
404... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
4263,
12,
28900,
16,
1241,
67,
337,
16,
25144,
67,
529,
4672,
309,
3988,
30,
1172,
296,
11092,
2728,
2187,
13543,
225,
1815,
1241,
67,
337,
18,
1883,
2668,
2497,
13,
422,
404... |
if os.environ.get("TERM") or os.environ.get("DISPLAY"): _tryorder = ["links", "lynx", "w3m"] if os.environ.get("TERM"): if _iscommand("links"): register("links", None, GenericBrowser("links '%s'")) if _iscommand("lynx"): register("lynx", None, GenericBrowser("lynx '%s'")) if _iscommand("w3m"): register("w3m", None, GenericBrowser("w3m '%s'")) if os.environ.get("DISPLAY"): _tryorder = ["galeon", "skipstone", "mozilla-firefox", "mozilla-firebird", "mozilla", "netscape", "kfm", "grail"] + _tryorder for browser in ("mozilla-firefox", "mozilla-firebird", "mozilla", "netscape"): if _iscommand(browser): register(browser, None, Netscape(browser)) if _iscommand("mosaic"): register("mosaic", None, GenericBrowser( "mosaic '%s' >/dev/null &")) if _iscommand("galeon"): register("galeon", None, Galeon("galeon")) if _iscommand("skipstone"): register("skipstone", None, GenericBrowser( "skipstone '%s' >/dev/null &")) if _iscommand("kfm") or _iscommand("konqueror"): register("kfm", Konqueror, Konqueror()) if _iscommand("grail"): register("grail", Grail, None) class InternetConfig: def open(self, url, new=0, autoraise=1): ic.launchurl(url) def open_new(self, url): self.open(url) | if os.environ.get("DISPLAY"): for browser in ("mozilla-firefox", "firefox", "mozilla-firebird", "firebird", "mozilla", "netscape"): if _iscommand(browser): register(browser, None, Mozilla(browser)) if _iscommand("gconftool-2"): gc = 'gconftool-2 -g /desktop/gnome/url-handlers/http/command' out = os.popen(gc) commd = out.read().strip() retncode = out.close() if retncode == None and len(commd) != 0: register("gnome", None, GenericBrowser( commd + " '%s' >/dev/null &")) if _iscommand("kfm") or _iscommand("konqueror"): register("kfm", Konqueror, Konqueror()) for browser in ("galeon", "epiphany"): if _iscommand(browser): register(browser, None, Galeon(browser)) if _iscommand("skipstone"): register("skipstone", None, GenericBrowser("skipstone '%s' &")) if _iscommand("opera"): register("opera", None, Opera("opera")) if _iscommand("mosaic"): register("mosaic", None, GenericBrowser("mosaic '%s' &")) if _iscommand("grail"): register("grail", Grail, None) if os.environ.get("TERM"): if _iscommand("links"): register("links", None, GenericBrowser("links '%s'")) if _iscommand("elinks"): register("elinks", None, Elinks("elinks")) if _iscommand("lynx"): register("lynx", None, GenericBrowser("lynx '%s'")) if _iscommand("w3m"): register("w3m", None, GenericBrowser("w3m '%s'")) | def open_new(self, url): self.open(url) | 2e17d91b4cf4bb0fb2a60b21783a4491e2a33017 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/2e17d91b4cf4bb0fb2a60b21783a4491e2a33017/webbrowser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
2704,
12,
2890,
16,
880,
4672,
365,
18,
3190,
12,
718,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1696,
67,
2704,
12,
2890,
16,
880,
4672,
365,
18,
3190,
12,
718,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
try: | try: | def _AsciiHexTest(text='What is the average velocity of a sparrow?'): "Do the obvious test for whether Ascii Hex encoding works" print 'Plain text:', text encoded = _AsciiHexEncode(text) print 'Encoded:', encoded decoded = _AsciiHexDecode(encoded) print 'Decoded:', decoded if decoded == text: print 'Passed' else: print 'Failed!' | 6fb7d8aa1f13d4f22c6524b9f91dd0d91cf3fa7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/6fb7d8aa1f13d4f22c6524b9f91dd0d91cf3fa7b/pdfutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
21363,
7037,
4709,
12,
955,
2218,
23801,
353,
326,
8164,
14767,
434,
279,
272,
1065,
492,
4899,
4672,
315,
3244,
326,
28067,
1842,
364,
2856,
22475,
2835,
15734,
2688,
6330,
6,
1172,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
21363,
7037,
4709,
12,
955,
2218,
23801,
353,
326,
8164,
14767,
434,
279,
272,
1065,
492,
4899,
4672,
315,
3244,
326,
28067,
1842,
364,
2856,
22475,
2835,
15734,
2688,
6330,
6,
1172,
... |
class Indexable(object): def __init__(self, value): self._value = value def __index__(self): return self._value | def __long__(self): return -163L | 9d6bc6c20b4f944f9b845461ec9e73fabb2a20c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/9d6bc6c20b4f944f9b845461ec9e73fabb2a20c2/test_struct.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
5748,
972,
12,
2890,
4672,
327,
300,
30886,
48,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
5748,
972,
12,
2890,
4672,
327,
300,
30886,
48,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
self.polys.append(self.create_poly(self.poly_points)) | center = u.calc_center(self.poly_points) self.poly_points = u.poly_vectors_around_center(self.poly_points) self.polys.append(self.create_poly(self.poly_points, pos=center)) | def loop(self): for event in pygame.event.get(): if event.type == QUIT: self.running = False elif event.type == KEYDOWN and event.key == K_ESCAPE: self.running = False elif event.type == MOUSEBUTTONDOWN and event.button == 1: # LMB if pygame.key.get_mods() & KMOD_SHIFT: p = self.flipyv(Vec2d(event.pos)) self.polys.append(self.create_box(pos = p)) else: #t = -10000 p = self.flipyv(Vec2d(event.pos)) self.balls.append(self.create_ball(p)) print p elif event.type == MOUSEBUTTONDOWN and event.button == 3: #RMB if pygame.key.get_mods() & KMOD_SHIFT: pass elif pygame.key.get_mods() & KMOD_CTRL: p = self.flipyv(Vec2d(event.pos)) self.wall_points.append(p) elif self.shape_to_remove is not None: print self.shape_to_remove self.balls = filter(lambda a: a.id != self.shape_to_remove.id, self.balls) self.walls = filter(lambda a: a.id != self.shape_to_remove.id, self.walls) self.polys = filter(lambda a: a.id != self.shape_to_remove.id, self.polys) self.space.remove(self.shape_to_remove.body, self.shape_to_remove) elif event.type == KEYUP and event.key in (K_RCTRL, K_LCTRL): ### Create Wall self.create_wall_segments(self.wall_points) self.wall_points = [] elif event.type == KEYUP and event.key in (K_RSHIFT, K_LSHIFT): ### Create Polygon if len(self.poly_points) > 2: self.poly_points = u.reduce_poly(self.poly_points) self.poly_points = u.convex_hull(self.poly_points) if not u.is_clockwise(self.poly_points): self.poly_points.reverse() self.polys.append(self.create_poly(self.poly_points)) self.poly_points = [] elif event.type == KEYDOWN and event.key == K_SPACE: self.run_physics = not self.run_physics elif event.type == KEYDOWN and event.key == K_k: for x in range (-100,100,25): for y in range(-100,100,25): p = pygame.mouse.get_pos() p = self.flipyv(Vec2d(p)) + (x,y) self.polys.append(self.create_box(pos=p)) elif event.type == KEYDOWN and event.key == K_b: p = flipyv(Vec2d(pygame.mouse.get_pos())) self.polys.append(self.create_box(p, size=10, mass = 1)) elif event.type == KEYDOWN and event.key == K_f: bp = Vec2d(100,500) p = self.flipyv(Vec2d(pygame.mouse.get_pos())) -bp ball = self.create_ball(bp) p = p.normalized() ball.body.apply_impulse(p*1000, Vec2d(0,0)) self.balls.append(ball) elif event.type == KEYDOWN and event.key == K_g: g = self.space.gravity g.rotate(45) self.space.gravity = g mpos = pygame.mouse.get_pos() if pygame.key.get_mods() & KMOD_SHIFT and pygame.mouse.get_pressed()[2]: p = self.flipyv(Vec2d(mpos)) self.poly_points.append(p) self.mouse_body.position = self.flipyv(Vec2d(mpos)) ### Reset mouse contact point self.mouse_contact = None | 357a18dfb2992f3a7a89b76b284238fb568250f1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8535/357a18dfb2992f3a7a89b76b284238fb568250f1/demo_playground.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2798,
12,
2890,
4672,
364,
871,
316,
2395,
13957,
18,
2575,
18,
588,
13332,
309,
871,
18,
723,
422,
10110,
1285,
30,
365,
18,
8704,
273,
1083,
1327,
871,
18,
723,
422,
5311,
12711,
471... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2798,
12,
2890,
4672,
364,
871,
316,
2395,
13957,
18,
2575,
18,
588,
13332,
309,
871,
18,
723,
422,
10110,
1285,
30,
365,
18,
8704,
273,
1083,
1327,
871,
18,
723,
422,
5311,
12711,
471... |
for (fromTrove,toTrove), steps in map.items(): | for (fromTrove,toTrove), steps in sorted(map.items()): | def _getShortestCycles(self, depGraph, cycleTroves): remainingTroves = set(cycleTroves) cycles = [] map = {} for trove in cycleTroves: l = [] for child in depGraph.iterChildren(trove): map[trove, child] = [] changed = True while changed: changed = False for (fromTrove,toTrove), steps in map.items(): for child in depGraph.iterChildren(toTrove): if child == fromTrove: steps = [fromTrove] + steps + [toTrove, fromTrove] if set(steps) & remainingTroves: remainingTroves.difference_update(steps) cycles.append(steps) if not remainingTroves: return cycles if (fromTrove,child) not in map: map[fromTrove,child] = steps + [toTrove] changed = True | 3afb198f128908bbe83c1982151a1d2afbdb6a9b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8749/3afb198f128908bbe83c1982151a1d2afbdb6a9b/dephandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
4897,
395,
17992,
9558,
12,
2890,
16,
5993,
4137,
16,
8589,
56,
303,
3324,
4672,
4463,
56,
303,
3324,
273,
444,
12,
13946,
56,
303,
3324,
13,
15139,
273,
5378,
852,
273,
2618... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
4897,
395,
17992,
9558,
12,
2890,
16,
5993,
4137,
16,
8589,
56,
303,
3324,
4672,
4463,
56,
303,
3324,
273,
444,
12,
13946,
56,
303,
3324,
13,
15139,
273,
5378,
852,
273,
2618... |
string="Return with Echange" type="object"/> | string="Return with Exchange" type="object"/> | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False,submenu=False): | f881f95bfe14d636766f9cad8e3940eaffcbcbe0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f881f95bfe14d636766f9cad8e3940eaffcbcbe0/pos_return.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1466,
67,
1945,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1476,
67,
350,
33,
7036,
16,
1476,
67,
723,
2218,
687,
2187,
819,
33,
7036,
16,
12748,
33,
8381,
16,
1717,
5414,
33,
8381,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1466,
67,
1945,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1476,
67,
350,
33,
7036,
16,
1476,
67,
723,
2218,
687,
2187,
819,
33,
7036,
16,
12748,
33,
8381,
16,
1717,
5414,
33,
8381,
... |
print "%s %% %s == %s != %s" %\ (repr(formatstr), repr(args), repr(result), repr(output)) | print "overflow expected on %s %% %s" % \ (repr(formatstr), repr(args)) elif output and result != output: if verbose: print 'no' print "%s %% %s == %s != %s" % \ (repr(formatstr), repr(args), repr(result), repr(output)) | def testformat(formatstr, args, output=None): if verbose: if output: print "%s %% %s =? %s ..." %\ (repr(formatstr), repr(args), repr(output)), else: print "%s %% %s works? ..." % (repr(formatstr), repr(args)), try: result = formatstr % args except OverflowError: if not overflowok: raise if verbose: print 'overflow (this is fine)' else: if output and result != output: if verbose: print 'no' print "%s %% %s == %s != %s" %\ (repr(formatstr), repr(args), repr(result), repr(output)) else: if verbose: print 'yes' | 868cd4617d040da948a8ff1fe3cfbab7d2db9982 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/868cd4617d040da948a8ff1fe3cfbab7d2db9982/test_format.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2139,
12,
2139,
701,
16,
833,
16,
876,
33,
7036,
4672,
309,
3988,
30,
309,
876,
30,
1172,
2213,
87,
26510,
738,
87,
273,
35,
738,
87,
18483,
738,
64,
261,
12715,
12,
2139,
701,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2139,
12,
2139,
701,
16,
833,
16,
876,
33,
7036,
4672,
309,
3988,
30,
309,
876,
30,
1172,
2213,
87,
26510,
738,
87,
273,
35,
738,
87,
18483,
738,
64,
261,
12715,
12,
2139,
701,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.