rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
def date(self, t): return util.datestr(t) | def date(self, t): return util.datestr(t) | 8eb9be6abd3187feaac096b4536a6d749634d750 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/8eb9be6abd3187feaac096b4536a6d749634d750/hgweb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1509,
12,
2890,
16,
268,
4672,
327,
1709,
18,
9683,
313,
12,
88,
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,
1509,
12,
2890,
16,
268,
4672,
327,
1709,
18,
9683,
313,
12,
88,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
from rlib import rwin32 | from pypy.rlib import rwin32 | def posix_fakeimpl(arg): st = getattr(os, name)(arg) fields = [TYPE for fieldname, TYPE in LL_STAT_FIELDS] TP = TUPLE_TYPE(fields) ll_tup = lltype.malloc(TP.TO) for i, (fieldname, TYPE) in enumerate(LL_STAT_FIELDS): val = getattr(st, fieldname) rffi.setintfield(ll_tup, 'item%d' % i, int(val)) return ll_tup | 1a4b5ad5a52ad1574f231532dfc4539404bbaefe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/1a4b5ad5a52ad1574f231532dfc4539404bbaefe/ll_os_stat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16366,
67,
28395,
11299,
12,
3175,
4672,
384,
273,
3869,
12,
538,
16,
508,
21433,
3175,
13,
1466,
273,
306,
2399,
364,
14680,
16,
3463,
316,
29863,
67,
28549,
67,
12683,
65,
26878,
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,
16366,
67,
28395,
11299,
12,
3175,
4672,
384,
273,
3869,
12,
538,
16,
508,
21433,
3175,
13,
1466,
273,
306,
2399,
364,
14680,
16,
3463,
316,
29863,
67,
28549,
67,
12683,
65,
26878,
273,
... |
self.grade_0_button.setDefault(grades_enabled) self.disconnect(self.defaultAction,SIGNAL("activated()"), self.grade_4_button.animateClick) | self.grade_0_button.setDefault(grades_enabled) try: self.disconnect(self.defaultAction,SIGNAL("activated()"), self.grade_4_button.animateClick) except: pass | def updateDialog(self): | 1334529172468a3d7e03743ffb2fe2711cc038a7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1240/1334529172468a3d7e03743ffb2fe2711cc038a7/main_dlg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
6353,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
6353,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if self._wrapArgs!=(availWidth,availHeight): | I = self._I if self._wrapArgs!=(availWidth,availHeight) or getattr(I,'_oldDrawSize',None) is not None: | def split(self,availWidth, availHeight): if hasattr(self,'_wrapArgs'): if self._wrapArgs!=(availWidth,availHeight): self._reset() W,H=self.wrap(availWidth,availHeight) if self._aH>availHeight: return [] C1 = self._C1 if C1: c0 = C1[0] S = c0.split(availWidth,availHeight-self._aH) if not S: self._C1 = [] self.height = self._aH else: self._C1 = [S[0]] self.height = self._aH + S[0].height C1 = S[1:]+C1[1:] else: self._C1 = [] self.height = self._aH return [self]+C1 | bcf9882a1e7d176fbd8e03023ed7b3c8b7d7338d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3878/bcf9882a1e7d176fbd8e03023ed7b3c8b7d7338d/flowables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
12,
2890,
16,
842,
671,
2384,
16,
15783,
2686,
4672,
309,
3859,
12,
2890,
11189,
67,
4113,
2615,
11,
4672,
467,
273,
365,
6315,
45,
309,
365,
6315,
4113,
2615,
5,
28657,
842,
671... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
12,
2890,
16,
842,
671,
2384,
16,
15783,
2686,
4672,
309,
3859,
12,
2890,
11189,
67,
4113,
2615,
11,
4672,
467,
273,
365,
6315,
45,
309,
365,
6315,
4113,
2615,
5,
28657,
842,
671... |
pl.write(" | pl.write(" | def getTime(self, t): t = time.mktime((int(t[0]), int(t[1]), int(t[2]), int(t[3]), int(t[4]), int(t[5]), 0, 0, 0))+float(t[6])/1000 global mintime, maxtime if t < mintime: mintime = t if t > maxtime: maxtime = t return t | d51ece44e96bac0a1eb9cdc87bae03c6a0fea034 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6866/d51ece44e96bac0a1eb9cdc87bae03c6a0fea034/jobchart.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6135,
12,
2890,
16,
268,
4672,
268,
273,
813,
18,
24816,
957,
12443,
474,
12,
88,
63,
20,
65,
3631,
509,
12,
88,
63,
21,
65,
3631,
509,
12,
88,
63,
22,
65,
3631,
509,
12,
88,
63,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6135,
12,
2890,
16,
268,
4672,
268,
273,
813,
18,
24816,
957,
12443,
474,
12,
88,
63,
20,
65,
3631,
509,
12,
88,
63,
21,
65,
3631,
509,
12,
88,
63,
22,
65,
3631,
509,
12,
88,
63,... |
total = 0 | total = %d | def f(a,b): if a < 0: return -1 return a-b | 24fd2524a66fed384df997968bc530ba185e64e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/24fd2524a66fed384df997968bc530ba185e64e2/test_pypy_c.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
12,
69,
16,
70,
4672,
309,
279,
411,
374,
30,
327,
300,
21,
327,
279,
17,
70,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
12,
69,
16,
70,
4672,
309,
279,
411,
374,
30,
327,
300,
21,
327,
279,
17,
70,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
cachedir = misc.getCacheDir(tmpdir, reuse) | try: cachedir = misc.getCacheDir(tmpdir, reuse) except (IOError, OSError), e: self.logger.critical(_('Could not set cachedir: %s') % str(e)) cachedir = None | def setCacheDir(self, force=False, tmpdir='/var/tmp', reuse=True, suffix='/$basearch/$releasever'): ''' Set a new cache dir, using misc.getCacheDir() and var. replace on suffix. ''' | 25d5648fa097e4a0652e0df7634e5af5448d3860 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5445/25d5648fa097e4a0652e0df7634e5af5448d3860/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20007,
1621,
12,
2890,
16,
2944,
33,
8381,
16,
20213,
2218,
19,
1401,
19,
5645,
2187,
11827,
33,
5510,
16,
3758,
2218,
11141,
1969,
991,
11141,
9340,
502,
11,
4672,
9163,
1000,
279,
394,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20007,
1621,
12,
2890,
16,
2944,
33,
8381,
16,
20213,
2218,
19,
1401,
19,
5645,
2187,
11827,
33,
5510,
16,
3758,
2218,
11141,
1969,
991,
11141,
9340,
502,
11,
4672,
9163,
1000,
279,
394,... |
Retrieve stylesheet references from the settings object. | Retrieve a stylesheet reference from the settings object. | def get_stylesheet_reference(settings, relative_to=None): """ Retrieve stylesheet references from the settings object. Deprecated. Use get_stylesheet_reference_list() instead to enable specification of multiple stylesheets as a comma-separated list. """ if settings.stylesheet_path: assert not settings.stylesheet, ( 'stylesheet and stylesheet_path are mutually exclusive.') if relative_to == None: relative_to = settings._destination return relative_path(relative_to, settings.stylesheet_path) else: return settings.stylesheet | 172d1dc00690a7b59b91b126dbeb374ea6d77338 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1532/172d1dc00690a7b59b91b126dbeb374ea6d77338/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
19403,
67,
6180,
12,
4272,
16,
3632,
67,
869,
33,
7036,
4672,
3536,
10708,
279,
13820,
2114,
628,
326,
1947,
733,
18,
225,
9336,
18,
2672,
336,
67,
19403,
67,
6180,
67,
1098,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
19403,
67,
6180,
12,
4272,
16,
3632,
67,
869,
33,
7036,
4672,
3536,
10708,
279,
13820,
2114,
628,
326,
1947,
733,
18,
225,
9336,
18,
2672,
336,
67,
19403,
67,
6180,
67,
1098,
... |
comp = playoffs.Playoff('testcomp') config = { 'players' : { 't1' : Player_config("test1"), 't2' : Player_config("test2"), }, 'board_size' : 12, 'komi' : 3.5, 'matchups' : [ Matchup_config('t1', 't2', alternating=True), ], } comp.initialise_from_control_file(config) comp.set_clean_status() jobs = [comp.get_game() for _ in range(8)] | fx = Playoff_fixture(tc) jobs = [fx.comp.get_game() for _ in range(8)] | def test_play_many(tc): comp = playoffs.Playoff('testcomp') config = { 'players' : { 't1' : Player_config("test1"), 't2' : Player_config("test2"), }, 'board_size' : 12, 'komi' : 3.5, 'matchups' : [ Matchup_config('t1', 't2', alternating=True), ], } comp.initialise_from_control_file(config) comp.set_clean_status() jobs = [comp.get_game() for _ in range(8)] def fake_response(job, winner): result = Game_result({'b' : 't1', 'w' : 't2'}, winner) response = Game_job_result() response.game_id = job.game_id response.game_result = result response.engine_names = {} response.engine_descriptions = {} response.game_data = job.game_data return response for i in [0, 3]: response = fake_response(jobs[i], 'b') comp.process_game_result(response) jobs += [comp.get_game() for _ in range(3)] for i in [4, 2, 6, 7]: response = fake_response(jobs[i], 'w') comp.process_game_result(response) out = StringIO() comp.write_screen_report(out) tc.assertMultiLineEqual( out.getvalue(), "t1 v t2 (6 games)\n" "board size: 12 komi: 3.5\n" " wins\n" "t1 2 33.33% (black)\n" "t2 4 66.67% (white)\n") tc.assertEqual(len(comp.get_matchup_results('0')), 6) #tc.assertEqual(comp.scheduler.allocators['0'].issued, 11) #tc.assertEqual(comp.scheduler.allocators['0'].fixed, 6) config2 = { 'players' : { 't1' : Player_config("test1"), 't2' : Player_config("test2"), }, 'board_size' : 12, 'komi' : 3.5, 'matchups' : [ Matchup_config('t1', 't2', alternating=True), ], } comp2 = playoffs.Playoff('testcomp') comp2.initialise_from_control_file(config2) comp2.set_status(comp.get_status()) #tc.assertEqual(comp2.scheduler.allocators['0'].issued, 6) #tc.assertEqual(comp2.scheduler.allocators['0'].fixed, 6) jobs2 = [comp.get_game() for _ in range(4)] tc.assertListEqual([job.game_id for job in jobs2], ['0_1', '0_5', '0_8', '0_9']) | 83af52a9949a36d3c03a96d81382ba6e299c8cdb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6121/83af52a9949a36d3c03a96d81382ba6e299c8cdb/playoff_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1601,
67,
9353,
12,
5111,
4672,
12661,
273,
19592,
3674,
67,
904,
10970,
12,
5111,
13,
225,
6550,
273,
306,
19595,
18,
2919,
18,
588,
67,
13957,
1435,
364,
389,
316,
1048,
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,
1842,
67,
1601,
67,
9353,
12,
5111,
4672,
12661,
273,
19592,
3674,
67,
904,
10970,
12,
5111,
13,
225,
6550,
273,
306,
19595,
18,
2919,
18,
588,
67,
13957,
1435,
364,
389,
316,
1048,
12... |
self.write(struct.pack("l", len(pdata)) + pdata) | self.write(struct.pack("I", len(pdata)) + pdata) | def _send_packet(self, packet_type, data, seq = 0, timeout = 2.0): if not self.socket: raise IPCDisconnectedError("Remote end no longer connected") if seq == 0: seq = self.last_seq = self.last_seq + 1 | 63bff94a05bd08f559883dafe8a566d6ceb3c620 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11722/63bff94a05bd08f559883dafe8a566d6ceb3c620/ipc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4661,
67,
11482,
12,
2890,
16,
4414,
67,
723,
16,
501,
16,
3833,
273,
374,
16,
2021,
273,
576,
18,
20,
4672,
309,
486,
365,
18,
7814,
30,
1002,
2971,
39,
26303,
668,
2932,
5169,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4661,
67,
11482,
12,
2890,
16,
4414,
67,
723,
16,
501,
16,
3833,
273,
374,
16,
2021,
273,
576,
18,
20,
4672,
309,
486,
365,
18,
7814,
30,
1002,
2971,
39,
26303,
668,
2932,
5169,... |
print "running plotnumgalaxies for " + times[0].upper() | print "running plotnumgalaxies for " + times[0].upper() + " pop" + str(popfiles.index(pop)) | def symlinksafe( target, linkname ): """ Creates a link, does not nag about when it already exists """ try: os.symlink( target, linkname ) except OSError, (errno, strerror): if errno==17: print "WARNING: link %s already exist" % (linkname) else: raise | 6ad3c83b17a791224c0765a4003cd99798d403c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/6ad3c83b17a791224c0765a4003cd99798d403c1/upperlimit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10563,
4626,
12,
1018,
16,
1692,
529,
262,
30,
3536,
10210,
279,
1692,
16,
1552,
486,
290,
346,
2973,
1347,
518,
1818,
1704,
3536,
775,
30,
1140,
18,
21278,
12,
1018,
16,
1692,
529,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10563,
4626,
12,
1018,
16,
1692,
529,
262,
30,
3536,
10210,
279,
1692,
16,
1552,
486,
290,
346,
2973,
1347,
518,
1818,
1704,
3536,
775,
30,
1140,
18,
21278,
12,
1018,
16,
1692,
529,
26... |
self._fileLocks[filename].release() finally: sys.setcheckinterval(old_interval) | self._fileLocks[filename].release() | def unlockFile(self, filename): ''' Method to unlock a file. | af9fe702a9f3cb0840ab7146e8cb797694da1457 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10739/af9fe702a9f3cb0840ab7146e8cb797694da1457/nfsmount.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7186,
812,
12,
2890,
16,
1544,
4672,
9163,
2985,
358,
7186,
279,
585,
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,
... | [
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,
7186,
812,
12,
2890,
16,
1544,
4672,
9163,
2985,
358,
7186,
279,
585,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
def __init__(self,dir='./'): self._file_ = os.path.join(dir, 'POTCAR') | def __init__(self,vaspdir='./'): self._file_ = os.path.join(vaspdir, 'POTCAR') | def __init__(self,dir='./'): self._file_ = os.path.join(dir, 'POTCAR') | 6a89da2a0a41561b153928e180694dab9ecea901 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5572/6a89da2a0a41561b153928e180694dab9ecea901/vasp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1214,
2218,
18,
2473,
4672,
365,
6315,
768,
67,
273,
1140,
18,
803,
18,
5701,
12,
1214,
16,
296,
52,
1974,
39,
985,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1214,
2218,
18,
2473,
4672,
365,
6315,
768,
67,
273,
1140,
18,
803,
18,
5701,
12,
1214,
16,
296,
52,
1974,
39,
985,
6134,
2,
-100,
-100,
-100,
-100,
-1... |
self._debug("opcode: write | buf: %s | offset: %d" % (repr(buf), offset)) | self._debug("opcode: write | offset: %d | buf: %s" % (offset, repr(buf))) | def write(self, buf, offset): self._debug("opcode: write | buf: %s | offset: %d" % (repr(buf), offset)) | f1cc66c0cf22d3b632421f096b12d1c5d5986888 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10739/f1cc66c0cf22d3b632421f096b12d1c5d5986888/fusefile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
1681,
16,
1384,
4672,
365,
6315,
4148,
2932,
556,
710,
30,
1045,
571,
1681,
30,
738,
87,
571,
1384,
30,
738,
72,
6,
738,
261,
12715,
12,
4385,
3631,
1384,
3719,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
1681,
16,
1384,
4672,
365,
6315,
4148,
2932,
556,
710,
30,
1045,
571,
1681,
30,
738,
87,
571,
1384,
30,
738,
72,
6,
738,
261,
12715,
12,
4385,
3631,
1384,
3719,
2... |
def _iis_solve_delta(N, feature, f_sharp, empirical, prob_yx): | def _iis_solve_delta(N, feature, f_sharp, empirical, prob_yx, max_newton_iterations, newton_converge): | def _iis_solve_delta(N, feature, f_sharp, empirical, prob_yx): # Solve delta using Newton's method for: # SUM_x P(x) * SUM_c P(c|x) f_i(x, c) e^[delta_i * f#(x, c)] = 0 delta = 0.0 iters = 0 while iters < MAX_NEWTON_ITERATIONS: # iterate for Newton's method f_newton = df_newton = 0.0 # evaluate the function and derivative for (i, j), f in feature.items(): prod = prob_yx[i][j] * f * numpy.exp(delta * f_sharp[i][j]) f_newton += prod df_newton += prod * f_sharp[i][j] f_newton, df_newton = empirical - f_newton / N, -df_newton / N ratio = f_newton / df_newton delta -= ratio if numpy.fabs(ratio) < NEWTON_CONVERGE: # converged break iters = iters + 1 else: raise RuntimeError("Newton's method did not converge") return delta | 230ddfffe0c863a6de97e38fd9fa516b5020e9d6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7167/230ddfffe0c863a6de97e38fd9fa516b5020e9d6/MaxEntropy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
77,
291,
67,
24626,
67,
9878,
12,
50,
16,
2572,
16,
284,
67,
674,
11441,
16,
801,
84,
481,
1706,
16,
3137,
67,
93,
92,
16,
943,
67,
2704,
1917,
67,
19330,
16,
394,
1917,
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,
389,
77,
291,
67,
24626,
67,
9878,
12,
50,
16,
2572,
16,
284,
67,
674,
11441,
16,
801,
84,
481,
1706,
16,
3137,
67,
93,
92,
16,
943,
67,
2704,
1917,
67,
19330,
16,
394,
1917,
67,
... |
Note that 'f' is evaluated at each pair of points using a Python loop, which can be slow if the number of points is large. If speed is an issue, you should if possible compute functions matrix-wise using Numeric's built-in ufuncs. | If 'ufunc=0', then 'f' is evaluated at each pair of points using a Python loop. This can be slow if the number of points is large. If speed is an issue, you should write 'f' in terms of Numeric ufuncs and use the 'ufunc=1' feature described next. If called with 'ufunc=1', then 'f' should be a function that is composed entirely of ufuncs (i.e., a function that can operate element-by-element on whole matrices). It will be passed the xvals and yvals as rectangular matrices. | def grid_function(f, xvals, yvals, typecode=Numeric.Float32): """Evaluate and tabulate a function on a grid. 'xvals' and 'yvals' should be 1-D arrays listing the values of x and y at which 'f' should be tabulated. 'f' should be a function taking two floating point arguments. The return value is a matrix M where 'M[i,j] = f(xvals[i],yvals[j])', which can for example be used in the 'GridData' constructor. Note that 'f' is evaluated at each pair of points using a Python loop, which can be slow if the number of points is large. If speed is an issue, you should if possible compute functions matrix-wise using Numeric's built-in ufuncs. """ m = Numeric.zeros((len(xvals), len(yvals)), typecode) for xi in range(len(xvals)): x = xvals[xi] for yi in range(len(yvals)): y = yvals[yi] m[xi,yi] = f(x,y) return m | 57b7d171447e091edf5aff623b42289284f0cd78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/57b7d171447e091edf5aff623b42289284f0cd78/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3068,
67,
915,
12,
74,
16,
619,
4524,
16,
677,
4524,
16,
618,
710,
33,
9902,
18,
4723,
1578,
4672,
3536,
15369,
471,
3246,
6243,
279,
445,
603,
279,
3068,
18,
225,
296,
92,
4524,
11,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3068,
67,
915,
12,
74,
16,
619,
4524,
16,
677,
4524,
16,
618,
710,
33,
9902,
18,
4723,
1578,
4672,
3536,
15369,
471,
3246,
6243,
279,
445,
603,
279,
3068,
18,
225,
296,
92,
4524,
11,... |
def create_channel_query_reply(self,id,hits): | def create_channel_query_reply(self,id,hits,selversion): | def create_channel_query_reply(self,id,hits): d = {} d['id'] = id d2 = {} for hit in hits: r = {} r['publisher_id'] = hit[0] r['publisher_name'] = hit[1] r['infohash'] = hit[2] r['torrenthash'] = hit[3] r['torrentname'] = hit[4] r['time_stamp'] = hit[5] # hit[6]: signature, which is unique for any torrent published by a user signature = hit[6].encode('ascii','ignore') d2[signature] = r d['a'] = d2 return bencode(d) | 25c1f6bb9528cb91b3f785b567900987814b281f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9686/25c1f6bb9528cb91b3f785b567900987814b281f/RemoteQueryMsgHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
4327,
67,
2271,
67,
10629,
12,
2890,
16,
350,
16,
15173,
16,
1786,
1589,
4672,
302,
273,
2618,
302,
3292,
350,
3546,
273,
612,
302,
22,
273,
2618,
364,
6800,
316,
11076,
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,
752,
67,
4327,
67,
2271,
67,
10629,
12,
2890,
16,
350,
16,
15173,
16,
1786,
1589,
4672,
302,
273,
2618,
302,
3292,
350,
3546,
273,
612,
302,
22,
273,
2618,
364,
6800,
316,
11076,
30,
... |
if name not in self.ok_dynamic_modules: raise ImportError, "untrusted dynamic module: %s" % name if sys.modules.has_key(name): src = sys.modules[name] else: import imp src = imp.load_dynamic(name, filename, file) dst = self.copy_except(src, []) return dst | if name not in self.ok_dynamic_modules: raise ImportError, "untrusted dynamic module: %s" % name if sys.modules.has_key(name): src = sys.modules[name] else: import imp src = imp.load_dynamic(name, filename, file) dst = self.copy_except(src, []) return dst | def load_dynamic(self, name, filename, file): | 3ec38f0ee48b31c80510c60b3df0e6bc4dfb89f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3ec38f0ee48b31c80510c60b3df0e6bc4dfb89f9/rexec.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
14507,
12,
2890,
16,
508,
16,
1544,
16,
585,
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,... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
14507,
12,
2890,
16,
508,
16,
1544,
16,
585,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
startTimeArea, makeSpacer(parcel, height=1), endTimeArea, | startAndEndTimeArea, | def makeCalendarArea(parcel, oldVersion): blocks = schema.ns("osaf.framework.blocks", parcel.itsView) locationArea = \ CalendarLocationAreaBlock.template('CalendarLocationArea', childrenBlocks=[ makeSpacer(parcel, SizeType(0, 22)), makeEditor(parcel, 'CalendarLocation', viewAttribute=pim.EventStamp.location.name, presentationStyle={'sampleText': _(u'location'), 'editInPlace': True})], stretchFactor=0.0, minimumSize=SizeType(300,10), border=RectType(0, 6, 0, 6)) if '__WXMSW__' in wx.PlatformInfo: allDaySpacerWidth = 8 else: allDaySpacerWidth = 6 allDayArea = \ makeArea(parcel, 'CalendarAllDayArea', baseClass=CalendarAllDayAreaBlock, childrenBlocks=[ makeLabel(parcel, _(u'&all-day'), borderTop=4), makeSpacer(parcel, width=allDaySpacerWidth), makeEditor(parcel, 'EditAllDay', viewAttribute=pim.EventStamp.allDay.name, stretchFactor=0.0, minimumSize=SizeType(16,-1))]) startTimeArea = \ makeArea(parcel, 'CalendarStartTimeArea', childrenBlocks=[ makeLabel(parcel, _(u'sta&rts'), borderTop=4), makeSpacer(parcel, width=8), makeEditor(parcel, 'EditCalendarStartDate', viewAttribute=pim.EventStamp.startTime.name, presentationStyle={'format': 'calendarDateOnly'}, stretchFactor=0.0, size=SizeType(75, -1)), CalendarConditionalLabelBlock.template('CalendarStartAtLabel', title=_(u'at'), characterStyle=blocks.LabelStyle, textAlignmentEnum='Center', stretchFactor=0.0, border=RectType(4, 4, 0, 4)), makeEditor(parcel, 'EditCalendarStartTime', baseClass=CalendarTimeAEBlock, viewAttribute=pim.EventStamp.startTime.name, presentationStyle={'format': 'calendarTimeOnly'}, stretchFactor=0.0, size=SizeType(85, -1))]) endTimeArea = \ makeArea(parcel, 'CalendarEndTimeArea', childrenBlocks=[ makeLabel(parcel, _(u'en&ds'), borderTop=4), makeSpacer(parcel, width=8), makeEditor(parcel, 'EditCalendarEndDate', viewAttribute=pim.EventStamp.endTime.name, presentationStyle={'format': 'calendarDateOnly'}, stretchFactor=0.0, size=SizeType(75, -1)), CalendarConditionalLabelBlock.template('CalendarEndAtLabel', title=_(u'at'), characterStyle=blocks.LabelStyle, textAlignmentEnum='Center', stretchFactor=0.0, border=RectType(4, 4, 0, 4)), makeEditor(parcel, 'EditCalendarEndTime', baseClass=CalendarTimeAEBlock, viewAttribute=pim.EventStamp.endTime.name, presentationStyle={'format': 'calendarTimeOnly'}, stretchFactor=0.0, size=SizeType(85, -1))]) timeZoneArea = \ makeArea(parcel, 'CalendarTimeZoneArea', baseClass=CalendarTimeZoneAreaBlock, childrenBlocks=[ makeLabel(parcel, _(u'time &zone')), makeSpacer(parcel, width=8), makeEditor(parcel, 'EditTimeZone', baseClass=CalendarTimeZoneAEBlock, viewAttribute=pim.EventStamp.startTime.name, presentationStyle={'format': 'timeZoneOnly'}, stretchFactor=0.0, minimumSize=SizeType(100, -1))]) transparencyArea = \ makeArea(parcel, 'CalendarTransparencyArea', baseClass=CalendarTransparencyAreaBlock, childrenBlocks=[ makeLabel(parcel, _(u'stat&us')), makeSpacer(parcel, width=8), makeEditor(parcel, 'EditTransparency', baseClass=CalendarTransparencyAEBlock, viewAttribute=pim.EventStamp.transparency.name, presentationStyle={ 'format': 'popup', # It'd be nice to not maintain the transparency choices # separately from the enum values; currently, the # choices must match the enum's items and ordering. # @@@ XXX i18n! 'choices': [_(u'Confirmed'), _(u'Tentative'), _(u'FYI')]}, stretchFactor=0.0, minimumSize=SizeType(100, -1))]) recurrencePopupArea = \ makeArea(parcel, 'CalendarRecurrencePopupArea', baseClass=CalendarRecurrencePopupAreaBlock, childrenBlocks=[ makeLabel(parcel, _(u'&occurs')), makeSpacer(parcel, width=8), makeEditor(parcel, 'EditRecurrence', viewAttribute=pim.EventStamp.rruleset.name, presentationStyle={ 'format': 'occurs', # These choices must match the enumerated indexes in the # RecurrenceAttributeEditor python code 'choices': [_(u'Once'), _(u'Daily'), _(u'Weekly'), _(u'Biweekly'), _(u'Monthly'), _(u'Yearly'), _(u'Custom...')]}, stretchFactor=0.0, minimumSize=SizeType(100, -1))]) recurrenceCustomArea = \ makeArea(parcel, 'CalendarRecurrenceCustomArea', baseClass=CalendarRecurrenceCustomAreaBlock, childrenBlocks=[ makeLabel(parcel, u'', borderTop=2), # leave label blank. makeSpacer(parcel, width=8), makeEditor(parcel, 'CalCustomValue', viewAttribute=pim.EventStamp.rruleset.name, presentationStyle={'format': 'custom'}, minimumSize=SizeType(300, -1))]) recurrenceEndArea = \ makeArea(parcel, 'CalendarRecurrenceEndArea', baseClass=CalendarRecurrenceEndAreaBlock, childrenBlocks=[ makeLabel(parcel, _(u'ends')), makeSpacer(parcel, width=8), makeEditor(parcel, 'EditRecurrenceEnd', viewAttribute=pim.EventStamp.rruleset.name, presentationStyle={'format': 'ends'}, stretchFactor=0.0, size=SizeType(75, -1))]) timeDescriptionArea = \ makeArea(parcel, 'CalendarTimeDescriptionArea', childrenBlocks=[ makeLabel(parcel, _(u'when'), borderTop=2), makeSpacer(parcel, width=8), makeEditor(parcel, 'TimeDescription', viewAttribute=pim.EventStamp.timeDescription.name, readOnly=True, )]) timeEditArea = \ makeArea(parcel, 'CalendarTimeEditArea', orientationEnum='Vertical', childrenBlocks=[ allDayArea, makeSpacer(parcel, height=4), startTimeArea, makeSpacer(parcel, height=1), endTimeArea, makeSpacer(parcel, height=7, baseClass=CalendarTimeZoneSpacerBlock), timeZoneArea, makeSpacer(parcel, height=7, baseClass=CalendarTransparencySpacerBlock), transparencyArea, makeSpacer(parcel, height=7, baseClass=CalendarRecurrencePopupSpacerBlock), recurrencePopupArea, makeSpacer(parcel, height=1, baseClass=CalendarRecurrenceCustomSpacerBlock), recurrenceCustomArea, recurrenceEndArea, ]) return makeArea(parcel, 'CalendarDetails', baseClass=EventAreaBlock, orientationEnum='Vertical', position=0.8, childrenBlocks = [ locationArea, makeSpacer(parcel, height=4), #timeDescriptionArea, timeEditArea]).install(parcel) | e41e86aaf109a2a1aa678159bf00177d2b46a0ca /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/e41e86aaf109a2a1aa678159bf00177d2b46a0ca/detailblocks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
7335,
5484,
12,
1065,
2183,
16,
1592,
1444,
4672,
4398,
273,
1963,
18,
2387,
2932,
538,
1727,
18,
12303,
18,
7996,
3113,
779,
2183,
18,
1282,
1767,
13,
225,
2117,
5484,
273,
521,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
7335,
5484,
12,
1065,
2183,
16,
1592,
1444,
4672,
4398,
273,
1963,
18,
2387,
2932,
538,
1727,
18,
12303,
18,
7996,
3113,
779,
2183,
18,
1282,
1767,
13,
225,
2117,
5484,
273,
521,
... |
return init_scalar(indent, arg, argtype, varname) def init_inputs(indent, src_arg_types): | return init_scalar(indent, arg, argtype, varname, immediate) def init_inputs(indent, src_arg_types, immediate=False): | def init_variable(indent, arg, argtype, varname): if is_array(arg) and is_array(arg[0]): return init_matrix(indent, arg, argtype, varname) elif is_array(arg): return init_attrib(indent, arg, argtype, varname) else: return init_scalar(indent, arg, argtype, varname) | 8976924ff6eb127faa58d059c4cb78dd8ae9e8a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1804/8976924ff6eb127faa58d059c4cb78dd8ae9e8a5/shtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
6105,
12,
9355,
16,
1501,
16,
1501,
723,
16,
15434,
4672,
309,
353,
67,
1126,
12,
3175,
13,
471,
353,
67,
1126,
12,
3175,
63,
20,
65,
4672,
327,
1208,
67,
5667,
12,
9355,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
6105,
12,
9355,
16,
1501,
16,
1501,
723,
16,
15434,
4672,
309,
353,
67,
1126,
12,
3175,
13,
471,
353,
67,
1126,
12,
3175,
63,
20,
65,
4672,
327,
1208,
67,
5667,
12,
9355,
... |
self.assertEqual(sys.getrefcount(grandchild), grand_refcount_before-1) | self.assertEqual(sys.getrefcount(grandchild), 2) | def testRecursiveParentDelete(self): '''Delete parent should invalidate grandchildren''' | 396c6b7ea7f774c60a44b36617bf7a767c208d59 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13343/396c6b7ea7f774c60a44b36617bf7a767c208d59/ownership_delete_parent_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
10483,
3054,
2613,
12,
2890,
4672,
9163,
2613,
982,
1410,
11587,
16225,
5906,
26418,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
10483,
3054,
2613,
12,
2890,
4672,
9163,
2613,
982,
1410,
11587,
16225,
5906,
26418,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
retval=os.system("cp "+self.settings["boot/kernel/"+x+"/config "+self.settings["chroot_dir"]+"/var/tmp/"+x+".config") | retval=os.system("cp "+self.settings["boot/kernel/"+x+"/config"]+" "+self.settings["chroot_dir"]+"/var/tmp/"+x+".config") | def run(self): self.dir_setup() self.unpack_and_bind() try: self.chroot_setup() except: self.unbind() raise #modify the current environment. This is an ugly hack that should be fixed. We need this #to use the os.system() call since we can't specify our own environ: for x in self.settings.keys(): if type(self.settings[x])==types.StringType: #prefix to prevent namespace clashes: os.environ["clst_"+x]=self.settings[x] elif type(self.settings[x])==types.ListType: os.environ["clst_"+x]=string.join(self.settings[x]) if self.settings["target"] not in ["grp","tinderbox"]: try: cmd(self.settings["sharedir"]+"/targets/"+self.settings["target"]+"/"+self.settings["target"]+".sh run","build script failed") except CatalystError: self.unbind() raise CatalystError,"Stage build aborting due to error." elif self.settings["target"]=="grp": for pkgset in self.settings["grp"]: #example call: "grp.sh run pkgset cd1 xmms vim sys-apps/gleep" try: cmd(self.settings["sharedir"]+"/targets/grp/grp.sh run "+self.settings["grp/"+pkgset+"/type"]+" "+pkgset+" "+string.join(self.settings["grp/"+pkgset+"/packages"])) except CatalystError: self.unbind() raise CatalystError,"GRP build aborting due to error." elif self.settings["target"]=="livecd-stage1": try: cmd(self.settings["sharedir"]+"/targets/livecd-stage1/livecd-stage1.sh run "+string.join(self.settings["livecd-stage1/packages"])) except CatalystError: self.unbind() raise CatalystError,"GRP build aborting due to error." elif self.settings["target"]=="livecd-stage2": mynames=self.settings["boot/kernel"] if type(mynames)==types.StringType: mynames=[mynames] args=`len(mynames)` for x in mynames: args=args+" "+x+" "+self.settings["boot/kernel/"+x+"/sources"] if not os.path.exists(self.settings["boot/kernel/"+x+"/config"]: raise CatalystError, "Can't find kernel config: "+self.settings["boot/kernel/"+x+"/config"] retval=os.system("cp "+self.settings["boot/kernel/"+x+"/config "+self.settings["chroot_dir"]+"/var/tmp/"+x+".config") if retval!=0: raise CatalystError, "Couldn't copy kernel config: "+self.settings["boot/kernel/"+x+"/config"] try: cmd(self.settings["sharedir"]+"/targets/livecd-stage2/livecd-stage2.sh run "+args)) except CatalystError: self.unbind() raise CatalystError,"GRP build aborting due to error." else: #tinderbox #example call: "grp.sh run xmms vim sys-apps/gleep" try: cmd(self.settings["sharedir"]+"/targets/tinderbox/tinderbox.sh run "+string.join(self.settings["tinderbox/packages"])) except CatalystError: self.unbind() raise CatalystError,"Tinderbox aborting due to error." if self.settings["target"] not in ["grp","tinderbox"]: self.preclean() self.unbind() if self.settings["target"] not in ["grp","tinderbox"]: #clean is for removing things after bind-mounts are unmounted (general file removal and cleanup) self.clean() self.capture() | 63c55ce8265098763d129b7565cc9afdbd506963 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7327/63c55ce8265098763d129b7565cc9afdbd506963/targets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
365,
18,
1214,
67,
8401,
1435,
365,
18,
17309,
67,
464,
67,
4376,
1435,
775,
30,
365,
18,
343,
3085,
67,
8401,
1435,
1335,
30,
365,
18,
318,
4376,
1435,
1002,
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,
1086,
12,
2890,
4672,
365,
18,
1214,
67,
8401,
1435,
365,
18,
17309,
67,
464,
67,
4376,
1435,
775,
30,
365,
18,
343,
3085,
67,
8401,
1435,
1335,
30,
365,
18,
318,
4376,
1435,
1002,
4... |
if doupdate: os.unsetenv("GST_REGISTRY_UPDATE") update_registry() | def gst_message_new_buffering(*args, **kwargs): warnings.warn("gst_message_new_buffering() is deprecated, please use message_new_buffering() instead", DeprecationWarning) return message_new_buffering(*args, **kwargs) | bbedab4e6521fe7c813f23698fe650203b1d0820 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1020/bbedab4e6521fe7c813f23698fe650203b1d0820/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
314,
334,
67,
2150,
67,
2704,
67,
4106,
310,
30857,
1968,
16,
2826,
4333,
4672,
5599,
18,
8935,
2932,
75,
334,
67,
2150,
67,
2704,
67,
4106,
310,
1435,
353,
6849,
16,
9582,
999,
883,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
314,
334,
67,
2150,
67,
2704,
67,
4106,
310,
30857,
1968,
16,
2826,
4333,
4672,
5599,
18,
8935,
2932,
75,
334,
67,
2150,
67,
2704,
67,
4106,
310,
1435,
353,
6849,
16,
9582,
999,
883,
... | |
titles = list(settings.value("FrameCombo/titles", QVariant(['Artist', 'Title', 'Album', 'Track', u'Year', "Genre", 'Comment'])).toStringList()) tags = list(settings.value("FrameCombo/tags", QVariant(['artist', 'title', 'album', 'track', u'date', 'genre', 'comment'])).toStringList()) | titles = list(settings.value("FrameCombo/titles").toStringList()) if not titles: titles = ['Artist', 'Title', 'Album', 'Track', u'Year', "Genre", 'Comment'] tags = list(settings.value("FrameCombo/tags").toStringList()) if not tags: tags = ['artist', 'title', 'album', 'track', u'year', 'genre', 'comment'] | def __init__(self, parent = None, cenwid = None): settings = QSettings() #Default shit titles = list(settings.value("FrameCombo/titles", QVariant(['Artist', 'Title', 'Album', 'Track', u'Year', "Genre", 'Comment'])).toStringList()) tags = list(settings.value("FrameCombo/tags", QVariant(['artist', 'title', 'album', 'track', u'date', 'genre', 'comment'])).toStringList()) newtags = [(unicode(title),unicode(tag)) for title, tag in zip(titles, tags)] print newtags HeaderSetting.__init__(self, newtags, parent, False) self.grid.addWidget(QLabel("You need to restart puddletag for these setting to be applied."),3,0) #Get the number of rows numrows = settings.beginReadArray("FrameCombo") rowcolors = {} if numrows <= 0: settings = QSettings(":/puddletag.conf",QSettings.IniFormat) numrows = settings.beginReadArray("FrameCombo") for i in range(numrows): settings.setArrayIndex(i) rowcolor = settings.value('row', QVariant(-1)).toLongLong()[0] combos = list([long(z) for z in settings.value("rows").toStringList()]) print combos rowcolors[rowcolor] = combos if rowcolor != -1: for z in combos: rowcolor = QColor(rowcolor) self.listbox.item(z).setBackgroundColor(rowcolor) textcolor = (255-rowcolor.red(),255 - rowcolor.green(),255 - rowcolor.blue()) self.listbox.item(z).setTextColor(QColor(*textcolor)) settings.endArray() if cenwid is not None: cenwid.combogroup.setCombos(newtags, rowcolors) return self.samerow = QPushButton("&Samerow") self.vboxgrid.addWidget(self.samerow) self.connect(self.samerow, SIGNAL("clicked()"), self.sameRow) | aad4813362dd10059358fc82f83fdf80e6086e4a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3907/aad4813362dd10059358fc82f83fdf80e6086e4a/puddlesettings.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
273,
599,
16,
276,
275,
30902,
273,
599,
4672,
225,
1947,
273,
2238,
2628,
1435,
468,
1868,
699,
305,
14693,
273,
666,
12,
4272,
18,
1132,
2932,
321... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
273,
599,
16,
276,
275,
30902,
273,
599,
4672,
225,
1947,
273,
2238,
2628,
1435,
468,
1868,
699,
305,
14693,
273,
666,
12,
4272,
18,
1132,
2932,
321... |
tdc = self.attributes[XMLSchemaComponent.xsd].get(attribute) | tdc = self.attributes.get(attribute) | def getQNameAttribute(self, collection, attribute): """returns object instance representing QName --> (namespace,name), or if does not exist return None. attribute -- an information item attribute, with a QName value. collection -- collection in parent Schema instance to search. """ obj = None tdc = self.attributes[XMLSchemaComponent.xsd].get(attribute) if tdc: parent = GetSchema(self) if parent.targetNamespace == tdc.getTargetNamespace(): obj = getattr(parent, collection)[tdc.getName()] elif parent.imports.has_key(tdc.getTargetNamespace()): schema = parent.imports[tdc.getTargetNamespace()].getSchema() obj = getattr(schema, collection)[tdc.getName()] return obj | e50368f02a007b522df43404acf761191b9356f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13054/e50368f02a007b522df43404acf761191b9356f0/XMLSchema.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
13688,
1499,
12,
2890,
16,
1849,
16,
1566,
4672,
3536,
6154,
733,
791,
5123,
16723,
15431,
261,
4937,
16,
529,
3631,
578,
309,
1552,
486,
1005,
327,
599,
18,
1566,
1493,
392,
1779,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
13688,
1499,
12,
2890,
16,
1849,
16,
1566,
4672,
3536,
6154,
733,
791,
5123,
16723,
15431,
261,
4937,
16,
529,
3631,
578,
309,
1552,
486,
1005,
327,
599,
18,
1566,
1493,
392,
1779,
... |
'set op->ob_type=0xDEADBEEF') | 'set op->ob_type=0xDEADBEEF', expvalue=42) | def test_corrupt_ob_type(self): 'Ensure that a PyObject* with a corrupt ob_type is handled gracefully' self.assertSane('print 42', 'set op->ob_type=0xDEADBEEF') | 27f8b9752a8f90e85f5bdca76569e46fb3cb5281 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/27f8b9752a8f90e85f5bdca76569e46fb3cb5281/test_gdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3850,
10433,
67,
947,
67,
723,
12,
2890,
4672,
296,
12512,
716,
279,
4707,
921,
14,
598,
279,
16899,
3768,
67,
723,
353,
7681,
25063,
11,
365,
18,
11231,
55,
8806,
2668,
1188... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3850,
10433,
67,
947,
67,
723,
12,
2890,
4672,
296,
12512,
716,
279,
4707,
921,
14,
598,
279,
16899,
3768,
67,
723,
353,
7681,
25063,
11,
365,
18,
11231,
55,
8806,
2668,
1188... |
l = l << LONG_BIT | l = l << SHIFT | def longval(self): #YYYYYY l = 0 for d in self.digits[::-1]: l = l << LONG_BIT l += long(d) return l * self.sign | ad929a678777d2ef2df66adef7cd3564d723bca6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/ad929a678777d2ef2df66adef7cd3564d723bca6/longobject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1525,
1125,
12,
2890,
4672,
468,
26287,
9317,
328,
273,
374,
364,
302,
316,
365,
18,
16649,
63,
2866,
17,
21,
14542,
328,
273,
328,
2296,
6122,
17925,
328,
1011,
1525,
12,
72,
13,
327,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1525,
1125,
12,
2890,
4672,
468,
26287,
9317,
328,
273,
374,
364,
302,
316,
365,
18,
16649,
63,
2866,
17,
21,
14542,
328,
273,
328,
2296,
6122,
17925,
328,
1011,
1525,
12,
72,
13,
327,... |
target_roles = target_roles + ('Authenticated', 'Anonymous') print 'adjusting', target_roles | target_roles += ('Authenticated', 'Anonymous') | def _adjust_view_mode(self): """Set role privileges according to view mode.""" | bf5f1f4173166b8427ae6d557163320c468d62eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/bf5f1f4173166b8427ae6d557163320c468d62eb/Collector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
13362,
67,
1945,
67,
3188,
12,
2890,
4672,
3536,
694,
2478,
19583,
4888,
358,
1476,
1965,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
13362,
67,
1945,
67,
3188,
12,
2890,
4672,
3536,
694,
2478,
19583,
4888,
358,
1476,
1965,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
return [self._eval(i) for i in srange(Integer(1),n+1)] | return [self._eval(i) for i in srange(self.offset, n+self.offset)] | def list(self, n): return [self._eval(i) for i in srange(Integer(1),n+1)] | 6234db563ec4990fb462898e2401076f062d364a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/6234db563ec4990fb462898e2401076f062d364a/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
12,
2890,
16,
290,
4672,
327,
306,
2890,
6315,
8622,
12,
77,
13,
364,
277,
316,
272,
3676,
12,
4522,
12,
21,
3631,
82,
15,
21,
25887,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
12,
2890,
16,
290,
4672,
327,
306,
2890,
6315,
8622,
12,
77,
13,
364,
277,
316,
272,
3676,
12,
4522,
12,
21,
3631,
82,
15,
21,
25887,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
stats = os.stat(localfile) | def open_local_file(self, req): host = req.get_host() file = req.get_selector() localfile = url2pathname(file) stats = os.stat(localfile) size = stats[stat.ST_SIZE] modified = rfc822.formatdate(stats[stat.ST_MTIME]) mtype = mimetypes.guess_type(file)[0] stats = os.stat(localfile) headers = mimetools.Message(StringIO( 'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' % (mtype or 'text/plain', size, modified))) if host: host, port = splitport(host) if not host or \ (not port and socket.gethostbyname(host) in self.get_names()): return addinfourl(open(localfile, 'rb'), headers, 'file:'+file) raise URLError('file not on local host') | 44287135c63c9dd2fd475f5bb1b69c2cd4ae4297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/44287135c63c9dd2fd475f5bb1b69c2cd4ae4297/urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
3729,
67,
768,
12,
2890,
16,
1111,
4672,
1479,
273,
1111,
18,
588,
67,
2564,
1435,
585,
273,
1111,
18,
588,
67,
9663,
1435,
1191,
768,
273,
880,
22,
28336,
12,
768,
13,
963... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
3729,
67,
768,
12,
2890,
16,
1111,
4672,
1479,
273,
1111,
18,
588,
67,
2564,
1435,
585,
273,
1111,
18,
588,
67,
9663,
1435,
1191,
768,
273,
880,
22,
28336,
12,
768,
13,
963... | |
dbsnp = dbSNPRate(selectedVariants) covariates.append(CallCovariate(field, left, right, FPRate)) printFieldQual( category, prefix + field, left, right, selectedVariants, FPRate ) | cc.FPRate = FPRate covariates.append(cc) printFieldQual( category, prefix + field, cc, selectedVariants ) | def calibrateFeatures(variants, fields, titvTarget, printCall = False, cumulative = False, forcePrint = False, prefix = '', printHeader = True, category = None ): covariates = [] if printHeader: printFieldQualHeader() for field in fields: if DEBUG: print 'Optimizing field', field titv, FPRate = titvFPRateEstimate(variants, titvTarget) #print 'Overall FRRate:', FPRate, nErrors, phredScale(FPRate) for left, right, selectedVariants in mapVariantBins(variants, field, cumulative = cumulative): if len(selectedVariants) > max(OPTIONS.minVariantsPerBin,1) or forcePrint: titv, FPRate = titvFPRateEstimate(selectedVariants, titvTarget) dbsnp = dbSNPRate(selectedVariants) covariates.append(CallCovariate(field, left, right, FPRate)) printFieldQual( category, prefix + field, left, right, selectedVariants, FPRate ) else: print 'Not calibrating bin', left, right, 'because it contains too few variants:', len(selectedVariants) return covariates | 0d2a761460c77c781de3e2f8a5d09e1043809a0f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2773/0d2a761460c77c781de3e2f8a5d09e1043809a0f/snpSelector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26139,
5141,
8696,
12,
15886,
16,
1466,
16,
268,
305,
90,
2326,
16,
1172,
1477,
273,
1083,
16,
15582,
273,
1083,
16,
2944,
5108,
273,
1083,
16,
1633,
273,
10226,
1172,
1864,
273,
1053,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26139,
5141,
8696,
12,
15886,
16,
1466,
16,
268,
305,
90,
2326,
16,
1172,
1477,
273,
1083,
16,
15582,
273,
1083,
16,
2944,
5108,
273,
1083,
16,
1633,
273,
10226,
1172,
1864,
273,
1053,
... |
key = key.replcace('/', ':') | key = key.replace('/', ':') | def set(self, keys, values): """Alternate set. | c9fb5cb45e19096da2005d67889aea2b141a7f0e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14654/c9fb5cb45e19096da2005d67889aea2b141a7f0e/synth_agent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
1311,
16,
924,
4672,
3536,
25265,
444,
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... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
1311,
16,
924,
4672,
3536,
25265,
444,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
config = Configuration() | def _test (): # read local configuration config = Configuration() # test base url for all files baseurl = "http://localhost/~calvin/webcleaner.sf.net/htdocs/test/" update(config, baseurl, dryrun=True) | ff26d3c4dce7bb18e52370745ecc28f73cd601b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/ff26d3c4dce7bb18e52370745ecc28f73cd601b5/update.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3813,
1832,
30,
468,
855,
1191,
1664,
7,
1842,
1026,
880,
364,
777,
1390,
25427,
273,
315,
2505,
2207,
13014,
19,
98,
771,
21529,
19,
4875,
6200,
264,
18,
21668,
18,
2758,
19,
647... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3813,
1832,
30,
468,
855,
1191,
1664,
7,
1842,
1026,
880,
364,
777,
1390,
25427,
273,
315,
2505,
2207,
13014,
19,
98,
771,
21529,
19,
4875,
6200,
264,
18,
21668,
18,
2758,
19,
647... | |
ip = UnicodeCol(length=16) | ip = UnicodeCol() | def publiclist_hosts(productname=None, vername=None, archname=None): """ has a category of product, and an hcd that matches version """ product = None if productname is not None: try: product = Product.byName(productname) except SQLObjectNotFound: return [] if vername is not None and archname is not None: desiredPath = '(^|/)%s/.*%s/' % (vername, archname) elif vername is not None: desiredPath = '(^|/)%s/' % vername else: desiredPath = None sqlresult = _publiclist_hosts(product=product, re=desiredPath) valid_categories = categorymap(productname, vername) return _publiclist_sql_to_list(sqlresult, valid_categories) | 1914e98105bad444213144f8ad795c2e01bf6f73 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13031/1914e98105bad444213144f8ad795c2e01bf6f73/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1071,
1098,
67,
11588,
12,
5896,
529,
33,
7036,
16,
1924,
529,
33,
7036,
16,
6637,
529,
33,
7036,
4672,
3536,
711,
279,
3150,
434,
3017,
16,
471,
392,
366,
4315,
716,
1885,
1177,
3536,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1071,
1098,
67,
11588,
12,
5896,
529,
33,
7036,
16,
1924,
529,
33,
7036,
16,
6637,
529,
33,
7036,
4672,
3536,
711,
279,
3150,
434,
3017,
16,
471,
392,
366,
4315,
716,
1885,
1177,
3536,... |
return self.path[-1].name | if len(self) > 0: return self[-1].name return '' | def get_name(self): return self.path[-1].name | 965cca2addc3de576439ca1506b79c050a2b095e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11522/965cca2addc3de576439ca1506b79c050a2b095e/generic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
529,
12,
2890,
4672,
327,
365,
18,
803,
18919,
21,
8009,
529,
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,
336,
67,
529,
12,
2890,
4672,
327,
365,
18,
803,
18919,
21,
8009,
529,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ldfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8 | ldfp xmmh, seg, sib, disp, dataSize=8 | def macroop MOVHPS_XMM_M { ldfp xmmh, seg, sib, "DISPLACEMENT + 8", dataSize=8 | 5cf2e7ccf027a485c2e2eb9a60b70c3b45853f0c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6787/5cf2e7ccf027a485c2e2eb9a60b70c3b45853f0c/move.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
556,
16070,
58,
2500,
55,
67,
60,
8206,
67,
49,
288,
328,
2180,
84,
619,
7020,
76,
16,
2291,
16,
12092,
16,
315,
2565,
3118,
2534,
1441,
3212,
397,
1725,
3113,
30216,
33,
28,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11522,
556,
16070,
58,
2500,
55,
67,
60,
8206,
67,
49,
288,
328,
2180,
84,
619,
7020,
76,
16,
2291,
16,
12092,
16,
315,
2565,
3118,
2534,
1441,
3212,
397,
1725,
3113,
30216,
33,
28,
... |
pairs = zip(self.subplots.keys(),self.subplots.values()) | pairs = zip(self.subplots.keys(),self.subplots.values()) | def sortLabels(self,sort_type='max_value'): """ Sort labels with a specified method: alpha - alphabetic order max_value - by max value of the subplot sum - by the sum of values of the subplot """ if self.plotdata: if self.key_type == "string": if sort_type in ['max_value','sum']: self.labels = self.plotdata.sortKeys('weight') else: self.labels = self.plotdata.sortKeys() self.label_values = [ self.plotdata.parsed_data[l] for l in self.labels] else: if sort_type == 'max_value': pairs = zip(self.subplots.keys(),self.subplots.values()) pairs.sort(key = lambda x: x[1].max_value,reverse=True) self.labels = [ x[0] for x in pairs ] self.label_values = [ x[1].max_value for x in pairs ] elif sort_type == 'last_value': pairs = zip(self.subplots.keys(),self.subplots.values()) pairs.sort(key = lambda x: x[1].last_value,reverse=True) self.labels = [ x[0] for x in pairs ] self.label_values = [ x[1].last_value for x in pairs ] elif sort_type == 'sum': pairs = [] for key in self.subplots: pairs.append( (key,self.subplots[key].sum_value) ) pairs.sort(key = lambda x: x[1],reverse=True) self.labels = [ x[0] for x in pairs ] self.label_values = [ x[1] for x in pairs ] elif sort_type == 'alpha': self.labels = self.subplots.keys() self.labels.sort() self.label_values = [ self.subplots[x].sum_value for x in self.labels ] else: self.labels = self.subplots.keys() | 682c6896ec385a0c1e3a073755a73ae602c61b4f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/682c6896ec385a0c1e3a073755a73ae602c61b4f/GraphData.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1524,
5888,
12,
2890,
16,
3804,
67,
723,
2218,
1896,
67,
1132,
11,
4672,
3536,
5928,
3249,
598,
279,
1269,
707,
30,
4190,
300,
524,
8133,
7943,
1353,
943,
67,
1132,
300,
635,
943,
460,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1524,
5888,
12,
2890,
16,
3804,
67,
723,
2218,
1896,
67,
1132,
11,
4672,
3536,
5928,
3249,
598,
279,
1269,
707,
30,
4190,
300,
524,
8133,
7943,
1353,
943,
67,
1132,
300,
635,
943,
460,... |
assert False | print cpsdates[0]; assert False | def SetNameMatch(cp, cpsdates): cp.matchid = "" # don't match names that are in the lords if not re.search("Duke |Lord |Baroness |Dame ", cp.fullname): fullname = cp.fullname cons = cp.cons if fullname == "Mr Michael Foster" and not cons: if cpsdates[0] == "2006-05-09": cons = "Worcester" # this Michael Foster had been a PPS else: assert False # double check we still have the right Michael Foster cp.matchid, cp.remadename, cp.remadecons = memberList.matchfullnamecons(fullname, cons, cpsdates[0]) if not cp.matchid: print cpsdates[0] print (cp.matchid, cp.remadename, cp.remadecons) raise Exception, 'No match: ' + fullname + " : " + (cons or "[nocons]") + "\nOrig:" + cp.fullname else: cp.remadename = cp.fullname cp.remadename = re.sub("^Rt Hon ", "", cp.remadename) cp.remadename = re.sub(" [COM]BE$", "", cp.remadename) cp.remadecons = "" date = cpsdates[0] # Manual fixes for old date stuff. Hmm. if cp.remadename == 'Lord Adonis' and date<'2005-05-23': date = '2005-05-23' if cp.remadename == 'Baroness Clark of Calton' and date=='2005-06-28': date = '2005-07-13' if (cp.remadename == 'Baroness Morgan of Huyton' or cp.remadename == 'Lord Rooker') and date=='2001-06-11': date = '2001-06-21' if cp.remadename == 'Lord Grocott' and date=='2001-06-12': date = '2001-07-03' if cp.remadename == 'Lord Davidson of Glen Cova': cp.remadename = 'Lord Davidson of Glen Clova' if cp.remadename != 'Duke of Abercorn' and cp.remadename != 'Lord Vestey': fullname = cp.remadename cp.matchid = lordsList.GetLordIDfname(fullname, None, date) # loffice isn't used? # make the structure we will sort by. Note the ((,),) structure cp.sortobj = ((re.sub("(.*) (\S+)$", "\\2 \\1", cp.remadename), cp.remadecons), cp.sdatestart) | 06541d8e87e54eccf4b051d21f109390d9b466f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8428/06541d8e87e54eccf4b051d21f109390d9b466f9/minpostparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17823,
2060,
12,
4057,
16,
276,
1121,
9683,
4672,
3283,
18,
1916,
350,
273,
1408,
225,
468,
2727,
1404,
845,
1257,
716,
854,
316,
326,
328,
517,
87,
309,
486,
283,
18,
3072,
2932,
40,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17823,
2060,
12,
4057,
16,
276,
1121,
9683,
4672,
3283,
18,
1916,
350,
273,
1408,
225,
468,
2727,
1404,
845,
1257,
716,
854,
316,
326,
328,
517,
87,
309,
486,
283,
18,
3072,
2932,
40,
... |
def document(self, object, *args): | def document(self, object, name=None, *args): | def document(self, object, *args): """Generate documentation for an object.""" args = (object,) + args if inspect.ismodule(object): return apply(self.docmodule, args) if inspect.isclass(object): return apply(self.docclass, args) if inspect.isroutine(object): return apply(self.docroutine, args) raise TypeError, "don't know how to document objects of type " + \ type(object).__name__ | 37f7b38eb6247564c00c8a355ab12268e8486c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/37f7b38eb6247564c00c8a355ab12268e8486c4e/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1668,
12,
2890,
16,
733,
16,
508,
33,
7036,
16,
380,
1968,
4672,
3536,
4625,
7323,
364,
392,
733,
12123,
833,
273,
261,
1612,
16,
13,
397,
833,
309,
5334,
18,
291,
2978,
12,
1612,
46... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1668,
12,
2890,
16,
733,
16,
508,
33,
7036,
16,
380,
1968,
4672,
3536,
4625,
7323,
364,
392,
733,
12123,
833,
273,
261,
1612,
16,
13,
397,
833,
309,
5334,
18,
291,
2978,
12,
1612,
46... |
elif byte_order == '<': byte_order = LittleEndian elif byte_order == '>': byte_order = BigEndian swap = bool(byte_order != nativeByteOrder) for bytes in interleaveiter(swap): | if byte_order == LittleEndian: byte_order = '<' elif byte_order == BigEndian: byte_order = '>' for bytes in interleaveiter(byte_order): | def iterRaw(self, size, interleaveiter, byte_order=None): """Iterator used to return the raw data of the cube in manageable chunks. Uses one of L{iterRawBIP}, L{iterRawBIL}, or L{iterRawBSQ} to grab the next chunk of data. Once there are enough bytes to fill the requested size, the bytes are yielded to the calling function. This loop continues until all the data has been returned to the caller. @param size: length of buffer to return at each iteration (note the final iteration may be shorter) @param iterleaveiter: an interleave functor taking no arguments and yielding chunks of data at each iteration @param byte_order: the desired byte order of the output data """ fh = StringIO() i = 0 if byte_order is None: byte_order = self.byte_order elif byte_order == '<': byte_order = LittleEndian elif byte_order == '>': byte_order = BigEndian swap = bool(byte_order != nativeByteOrder) for bytes in interleaveiter(swap): count = len(bytes) if (i + count) < size: fh.write(bytes) i += len(bytes) else: bi = 0 while bi < count: remaining_bytes = count - bi unfilled = size - i if remaining_bytes < unfilled: fh.write(bytes[bi:]) i += remaining_bytes break fh.write(bytes[bi:bi + unfilled]) yield fh.getvalue() bi += unfilled fh = StringIO() i = 0 leftover = fh.getvalue() if len(leftover) > 0: yield leftover | 76fd4dd2813de31275bd61bfe7f8a3aa3c2ca966 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11522/76fd4dd2813de31275bd61bfe7f8a3aa3c2ca966/cube.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
4809,
12,
2890,
16,
963,
16,
1554,
19574,
2165,
16,
1160,
67,
1019,
33,
7036,
4672,
3536,
3198,
1399,
358,
327,
326,
1831,
501,
434,
326,
18324,
316,
10680,
429,
6055,
18,
225,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
4809,
12,
2890,
16,
963,
16,
1554,
19574,
2165,
16,
1160,
67,
1019,
33,
7036,
4672,
3536,
3198,
1399,
358,
327,
326,
1831,
501,
434,
326,
18324,
316,
10680,
429,
6055,
18,
225,
1... |
self.toolsExtrudeAction.setIconSet(QIconSet(self.image70)) | self.toolsExtrudeAction.setIconSet(QIconSet(self.image69)) | def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar() | e48e859515237593d94b403a9c0a7295e08c31f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/e48e859515237593d94b403a9c0a7295e08c31f2/MainWindowUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2938,
273,
599,
16,
529,
273,
599,
16,
2242,
273,
374,
4672,
2238,
6376,
3829,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
2242,
13,
365,
18,
23... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
2938,
273,
599,
16,
529,
273,
599,
16,
2242,
273,
374,
4672,
2238,
6376,
3829,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
2242,
13,
365,
18,
23... |
if self.__rows * self.__cols == 0: return wx.Size(0,0) height = 0 for j in range(0,self.__rows): row_height = 0 for i in range(0,self.__cols): item = self.GetItem(self.idx(i,j)) row_height = max([row_height, item.CalcMin()[1]]) height += row_height; return wx.Size(self.calc_edit_size()[0] + self.__min_text_width + self.calc_help_size()[0], height) | try: if self.__rows * self.__cols == 0: return wx.Size(0,0) height = 0 for j in range(0,self.__rows): row_height = 0 for i in range(0,self.__cols): item = self.GetItem(self.idx(i,j)) row_height = max([row_height, item.CalcMin()[1]]) height += row_height; self.__printed_exception = False return wx.Size(self.calc_edit_size()[0] + self.__min_text_width + self.calc_help_size()[0], height) except: if not self.__printed_exception: traceback.print_exc() self.__printed_exception = True return wx.Size(0,0) | def CalcMin(self): """Calculate the minimum from the edit controls. Returns a wx.Size where the height is the total height of the grid and the width is self.__min_text_width plus the widths of the edit controls and help controls. """ if self.__rows * self.__cols == 0: return wx.Size(0,0) height = 0 for j in range(0,self.__rows): row_height = 0 for i in range(0,self.__cols): item = self.GetItem(self.idx(i,j)) row_height = max([row_height, item.CalcMin()[1]]) height += row_height; return wx.Size(self.calc_edit_size()[0] + self.__min_text_width + self.calc_help_size()[0], height) | 53ddcf19ef4f6728ee4cd7c801c8571507190b5c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2870/53ddcf19ef4f6728ee4cd7c801c8571507190b5c/moduleview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29128,
2930,
12,
2890,
4672,
3536,
8695,
326,
5224,
628,
326,
3874,
11022,
18,
225,
2860,
279,
7075,
18,
1225,
1625,
326,
2072,
353,
326,
2078,
2072,
434,
326,
3068,
471,
326,
1835,
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,
29128,
2930,
12,
2890,
4672,
3536,
8695,
326,
5224,
628,
326,
3874,
11022,
18,
225,
2860,
279,
7075,
18,
1225,
1625,
326,
2072,
353,
326,
2078,
2072,
434,
326,
3068,
471,
326,
1835,
353,... |
self.categories = self.page.categories() | def __init__(self, site, pageName, db, formats = None): self.pageName = pageName self.page = wikipedia.Page(site, self.pageName) pageNameParts = re.split("[ _]+", self.pageName) self.date = pageNameParts[0] self.lat = pageNameParts[1] self.lon = pageNameParts[2] self.gratAdd = self.lat+" "+self.lon name_list = db.getLatLon(self.lat,self.lon) if((name_list == None) or (name_list[1] == None) or (name_list[2] == None)): self.gratName = u"Unknown (" + self.lat + u", " + self.lon + u")" else: self.gratName = name_list[1] + u", " + name_list[2] self.text = self.page.get() | 7e4af1bc9b47325ba3e3af5b004427e027f92499 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12839/7e4af1bc9b47325ba3e3af5b004427e027f92499/Expedition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2834,
16,
30398,
16,
1319,
16,
6449,
273,
599,
4672,
365,
18,
2433,
461,
273,
30398,
365,
18,
2433,
273,
21137,
18,
1964,
12,
4256,
16,
365,
18,
2433,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2834,
16,
30398,
16,
1319,
16,
6449,
273,
599,
4672,
365,
18,
2433,
461,
273,
30398,
365,
18,
2433,
273,
21137,
18,
1964,
12,
4256,
16,
365,
18,
2433,
... | |
... "Returns the nth item or empty list" ... return list(islice(iterable, n, n+1)) | ... "Returns the nth item or None" ... return next(islice(iterable, n, None), None) | >>> def nth(iterable, n): | 11485b4869f989299d806e30a530dd5234c8e9b6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/11485b4869f989299d806e30a530dd5234c8e9b6/test_itertools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
20196,
12,
15364,
16,
290,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
20196,
12,
15364,
16,
290,
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,
-1... |
row_to_readd_to, row_to_readd_to + 1) | row_to_readd_to, row_to_readd_to + 1, xoptions=gtk.FILL|gtk.EXPAND, yoptions=gtk.FILL|gtk.SHRINK) | def DeleteButton(self, button): """ Called when the user clicks the delete button for an action, which removes that action. Parameters: button -- reserved for GTK callbacks, don't use it explicitly. """ # remove the action from the list self.actions.remove(button.mixdownaction) # delete the action del(button.mixdownaction) # delete the buttons table = button.get_parent() actionbutton = button.actionbutton # walk through the table; when we find our button, delete it and # its associated action button, and then move everything up a row; # finally, resize the table to be one row smaller our_row = table.child_get_property(button, "top-attach") table.remove(button) table.remove(actionbutton) # move everything up a row # we do this by finding all the table's children which are in a row greater # than the buttons we've removed, and removing them too while stashing them # in a list. Then sort the list into incrementing row order, and finally # walk through the list readding them. We have to do this stupid dance # so that we read them all in increasing row order, otherwise it'll # possibly break by putting two things in a table cell, etc. removed_buttons_to_readd = [] for child in table.get_children(): this_child_row = table.child_get_property(child, "top-attach") this_child_col = table.child_get_property(child, "left-attach") if this_child_row > our_row: removed_buttons_to_readd.append((this_child_row - 1, this_child_col, child)) table.remove(child) removed_buttons_to_readd.sort(cmp=lambda a,b: cmp(a[0], b[0])) for row_to_readd_to, col_to_readd_to, widget in removed_buttons_to_readd: table.attach(widget, col_to_readd_to, col_to_readd_to + 1, row_to_readd_to, row_to_readd_to + 1) # finally resize the table down by one row rows = self.actionstable.get_property("n-rows") cols = self.actionstable.get_property("n-columns") rows -= 1 self.actionstable.resize(rows, cols) | 674e243eca017ec12e0a9467d89824c593625826 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10033/674e243eca017ec12e0a9467d89824c593625826/MixdownProfileDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2504,
3616,
12,
2890,
16,
3568,
4672,
3536,
11782,
1347,
326,
729,
27659,
326,
1430,
3568,
364,
392,
1301,
16,
1492,
7157,
716,
1301,
18,
225,
7012,
30,
3568,
1493,
8735,
364,
19688,
47,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2504,
3616,
12,
2890,
16,
3568,
4672,
3536,
11782,
1347,
326,
729,
27659,
326,
1430,
3568,
364,
392,
1301,
16,
1492,
7157,
716,
1301,
18,
225,
7012,
30,
3568,
1493,
8735,
364,
19688,
47,... |
res = self.submitToExternal(taskDict[taskID]['TaskObject']) | res = self.submitTaskToExternal(taskDict[taskID]['TaskObject']) | def submitTasks(self,taskDict): submitted = 0 failed = 0 startTime = time.time() for taskID in sortLit(taskDict.keys()): taskDict[taskID] res = self.submitToExternal(taskDict[taskID]['TaskObject']) if res['OK']: taskDict[taskID]['ExternalID'] = res['Value'] taskDict[taskID]['Success'] = True submitted +=1 else: self.log.warn("Failed to submit task to WMS",res['Message']) taskDict[taskID]['Success'] = False failed += 1 self.log.info('submitTasks: Submitted %d tasks to WMS in %.1f seconds' % (submitted,time.time()-startTime)) self.log.info('submitTasks: Failed to submit %d tasks to WMS.' % (failed,time.time()-startTime)) return S_OK(taskDict) | 7e361d624cd9374c5dec904aad18c8eb176604b6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/7e361d624cd9374c5dec904aad18c8eb176604b6/TaskManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4879,
6685,
12,
2890,
16,
4146,
5014,
4672,
9638,
273,
374,
2535,
273,
374,
8657,
273,
813,
18,
957,
1435,
364,
29772,
316,
1524,
23707,
12,
4146,
5014,
18,
2452,
1435,
4672,
1562,
5014,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4879,
6685,
12,
2890,
16,
4146,
5014,
4672,
9638,
273,
374,
2535,
273,
374,
8657,
273,
813,
18,
957,
1435,
364,
29772,
316,
1524,
23707,
12,
4146,
5014,
18,
2452,
1435,
4672,
1562,
5014,... |
schema_file = 'resourcelists.xsd' | schema_file = 'resource-lists.xsd' | def get_ns_bindings(self, uri, check_etag): d = self.get_document(uri, check_etag) return d.addCallbacks(self._cb_get_ns_bindings, callbackArgs=(uri, )) | 84028f4705433e76a5576fe2d92c7906feb05923 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3446/84028f4705433e76a5576fe2d92c7906feb05923/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2387,
67,
15863,
12,
2890,
16,
2003,
16,
866,
67,
20788,
4672,
302,
273,
365,
18,
588,
67,
5457,
12,
1650,
16,
866,
67,
20788,
13,
327,
302,
18,
1289,
10617,
12,
2890,
6315,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2387,
67,
15863,
12,
2890,
16,
2003,
16,
866,
67,
20788,
4672,
302,
273,
365,
18,
588,
67,
5457,
12,
1650,
16,
866,
67,
20788,
13,
327,
302,
18,
1289,
10617,
12,
2890,
6315,... |
if key == metakey: | if key.strip() == metakey.strip() and val.strip() == oldval.strip(): | def subfun(mo): old_keyval_pairs = mo.group(2).split(',') newargs=[] for key, val in zip(old_keyval_pairs[::2], old_keyval_pairs[1::2]): key = key.strip() if key == metakey: val = newmetaval newargs.append('%s,%s' % (key, val)) return '[[MetaData(%s)]]' % (string.join(newargs, ',')) | f8623249f297dc15d6e1cf9b56651de0875a70f3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/888/f8623249f297dc15d6e1cf9b56651de0875a70f3/MetaTableEdit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
12125,
12,
8683,
4672,
1592,
67,
856,
1125,
67,
11545,
273,
7344,
18,
1655,
12,
22,
2934,
4939,
12,
2187,
6134,
394,
1968,
33,
8526,
364,
498,
16,
1244,
316,
3144,
12,
1673,
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,
720,
12125,
12,
8683,
4672,
1592,
67,
856,
1125,
67,
11545,
273,
7344,
18,
1655,
12,
22,
2934,
4939,
12,
2187,
6134,
394,
1968,
33,
8526,
364,
498,
16,
1244,
316,
3144,
12,
1673,
67,
... |
self.image0 = QPixmap() self.image0.loadFromData(image0_data,"PNG") self.image4 = QPixmap() self.image4.loadFromData(image4_data,"PNG") self.image10 = QPixmap() self.image10.loadFromData(image10_data,"PNG") self.image34 = QPixmap() self.image34.loadFromData(image34_data,"PNG") self.image37 = QPixmap() self.image37.loadFromData(image37_data,"PNG") self.image45 = QPixmap() self.image45.loadFromData(image45_data,"PNG") self.image46 = QPixmap() self.image46.loadFromData(image46_data,"PNG") self.image49 = QPixmap() self.image49.loadFromData(image49_data,"PNG") self.image50 = QPixmap() self.image50.loadFromData(image50_data,"PNG") self.image65 = QPixmap() self.image65.loadFromData(image65_data,"PNG") | self.image0 = QPixmap(image0_data) | def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar() | 2bdc60455ab85cd2792604c15ae9034d3632b0df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/2bdc60455ab85cd2792604c15ae9034d3632b0df/MainWindowUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2938,
273,
599,
16,
529,
273,
599,
16,
2242,
273,
374,
4672,
2238,
6376,
3829,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
2242,
13,
365,
18,
23... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
2938,
273,
599,
16,
529,
273,
599,
16,
2242,
273,
374,
4672,
2238,
6376,
3829,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
2242,
13,
365,
18,
23... |
The number of assignments on the page in the filtered results list, equivalent to the number of assignments being returned by this call. | The number of assignments on the page in the filtered results list, equivalent to the number of assignments being returned by this call. | def get_assignments(self, hit_id, status=None, sort_by='SubmitTime', sort_direction='Ascending', page_size=10, page_number=1): """ Retrieves completed assignments for a HIT. Use this operation to retrieve the results for a HIT. | ccfdc9ec5c0cd1044df8085ab2d2c98d4f4618d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1098/ccfdc9ec5c0cd1044df8085ab2d2c98d4f4618d0/connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
24326,
12,
2890,
16,
6800,
67,
350,
16,
1267,
33,
7036,
16,
1524,
67,
1637,
2218,
11620,
950,
2187,
1524,
67,
9855,
2218,
13665,
2846,
2187,
1363,
67,
1467,
33,
2163,
16,
1363... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
24326,
12,
2890,
16,
6800,
67,
350,
16,
1267,
33,
7036,
16,
1524,
67,
1637,
2218,
11620,
950,
2187,
1524,
67,
9855,
2218,
13665,
2846,
2187,
1363,
67,
1467,
33,
2163,
16,
1363... |
form_class = kwargs.get('form_class', getattr(self, 'form_class', self.get_form_class())) form_args = kwargs.get('form_args', getattr(self, 'form_args', self.get_form_args(*args, **kwargs))) template_name=kwargs.get('template_name', getattr(self, 'template_name', self.get_template_name())) pagemenu = kwargs.get('pagemenu', getattr(self, 'pagemenu', self.get_pagemenu(request, *args, **kwargs))) success_message = kwargs.get('success_message', getattr(self, 'success_message', self.get_success_message(*args, **kwargs))) | self.form_class = kwargs.get('form_class', getattr(self, 'form_class', self.get_form_class())) self.form_args = kwargs.get('form_args', getattr(self, 'form_args', self.get_form_args(*args, **kwargs))) self.template_name=kwargs.get('template_name', getattr(self, 'template_name', self.get_template_name())) self.pagemenu = kwargs.get('pagemenu', getattr(self, 'pagemenu', self.get_pagemenu(request, *args, **kwargs))) self.success_message = kwargs.get('success_message', getattr(self, 'success_message', self.get_success_message(*args, **kwargs))) | def __call__(self, request, *args, **kwargs): form_class = kwargs.get('form_class', getattr(self, 'form_class', self.get_form_class())) form_args = kwargs.get('form_args', getattr(self, 'form_args', self.get_form_args(*args, **kwargs))) template_name=kwargs.get('template_name', getattr(self, 'template_name', self.get_template_name())) pagemenu = kwargs.get('pagemenu', getattr(self, 'pagemenu', self.get_pagemenu(request, *args, **kwargs))) success_message = kwargs.get('success_message', getattr(self, 'success_message', self.get_success_message(*args, **kwargs))) | 34a2e9c7044829a5a6cdb3f63c9be5a103290f99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12648/34a2e9c7044829a5a6cdb3f63c9be5a103290f99/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
590,
16,
380,
1968,
16,
2826,
4333,
4672,
646,
67,
1106,
273,
1205,
18,
588,
2668,
687,
67,
1106,
2187,
3869,
12,
2890,
16,
296,
687,
67,
1106,
2187,
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,
1001,
1991,
972,
12,
2890,
16,
590,
16,
380,
1968,
16,
2826,
4333,
4672,
646,
67,
1106,
273,
1205,
18,
588,
2668,
687,
67,
1106,
2187,
3869,
12,
2890,
16,
296,
687,
67,
1106,
2187,
3... |
else | else: | def __init__(data = None) if data == None: quickfix.CharField.__init__(self, 206) else quickfix.CharField.__init__(self, 206, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
2156,
974,
16186,
2738,
972,
12,
2890,
16,
4200,
26,
13,
469,
30,
9549,
904,
18,
2156,
974,
16186,
2738... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
2156,
974,
16186,
2738,
972,
12,
2890,
16,
4200,
26,
13,
469,
30,
9549,
904,
18,
2156,
974,
16186,
2738... |
sage: [NumberField(ZZx(_[i][1]), 't').is_galois() for i in range(len(_))] | sage: [NumberField(ZZx(x[1]), 't').is_galois() for x in ls] | def enumerate_totallyreal_fields_rel(F, m, B, a = [], verbose=0, return_seqs=False): r""" This function enumerates (primitive) totally real field extensions of degree $m>1$ of the totally real field F with discriminant $d \leq B$; optionally one can specify the first few coefficients, where the sequence $a$ corresponds to a polynomial by $$ a[d]*x^n + ... + a[0]*x^(n-d) $$ if length(a) = d+1, so in particular always a[d] = 1. If verbose == 1 (or 2), then print to the screen (really) verbosely; if verbose is a string, then print verbosely to the file specified by verbose. If return_seqs, then return the polynomials as sequences (for easier exporting to a file). NOTE: This is guaranteed to give all primitive such fields, and seems in practice to give many imprimitive ones. INPUT: F -- number field, the base field m -- integer, the degree B -- integer, the discriminant bound a -- list (default: []), the coefficient list to begin with verbose -- boolean or string (default: 0) return_seqs -- boolean (default: False) OUTPUT: the list of fields with entries [d,fabs,f], where d is the discriminant, fabs is an absolute defining polynomial, and f is a defining polynomial relative to F, sorted by discriminant. EXAMPLES: In this first simple example, we compute the totally real quadratic fields of Q(sqrt(2)) of discriminant <= 2000. sage: ZZx = ZZ['x'] sage: F.<t> = NumberField(x^2-2) sage: enumerate_totallyreal_fields_rel(F, 2, 2000) [[1600, x^4 - 6*x^2 + 4, xF^2 + xF - 1]] There is indeed only one such extension, given by F(sqrt(5)). Next, we list all totally real quadratic extensions of Q(sqrt(5)) with root discriminant <= 10. sage: F.<t> = NumberField(x^2-5) sage: ls = enumerate_totallyreal_fields_rel(F, 2, 10^4) sage: ls # random [[725, x^4 - x^3 - 3*x^2 + x + 1, xF^2 + (-1/2*t + 1/2)*xF - t - 2], [1125, x^4 - x^3 - 4*x^2 + 4*x + 1, xF^2 + (-1/2*t + 1/2)*xF - 1/2*t - 3/2], [1600, x^4 - 6*x^2 + 4, xF^2 - t - 3], [2000, x^4 - 5*x^2 + 5, xF^2 - 1/2*t - 5/2], [2225, x^4 - x^3 - 5*x^2 + 2*x + 4, xF^2 + (-1/2*t + 1/2)*xF - 3/2*t - 7/2], [2525, x^4 - 2*x^3 - 4*x^2 + 5*x + 5, xF^2 + (-1/2*t - 1/2)*xF - 1/2*t - 5/2], [3600, x^4 - 2*x^3 - 7*x^2 + 8*x + 1, xF^2 - 3/2*t - 9/2], [4225, x^4 - 9*x^2 + 4, xF^2 + (-1/2*t - 1/2)*xF - 3/2*t - 9/2], [4400, x^4 - 7*x^2 + 11, xF^2 - 1/2*t - 7/2], [4525, x^4 - x^3 - 7*x^2 + 3*x + 9, xF^2 + (-1/2*t - 1/2)*xF - 3], [5125, x^4 - 2*x^3 - 6*x^2 + 7*x + 11, xF^2 + (-1/2*t - 1/2)*xF - t - 4], [5225, x^4 - x^3 - 8*x^2 + x + 11, xF^2 + (-1/2*t - 1/2)*xF - 1/2*t - 7/2], [5725, x^4 - x^3 - 8*x^2 + 6*x + 11, xF^2 + (-1/2*t + 1/2)*xF - 1/2*t - 7/2], [6125, x^4 - x^3 - 9*x^2 + 9*x + 11, xF^2 + (-1/2*t + 1/2)*xF - t - 4], [7600, x^4 - 9*x^2 + 19, xF^2 - 1/2*t - 9/2], [7625, x^4 - x^3 - 9*x^2 + 4*x + 16, xF^2 + (-1/2*t - 1/2)*xF - 4], [8000, x^4 - 10*x^2 + 20, xF^2 - t - 5], [8525, x^4 - 2*x^3 - 8*x^2 + 9*x + 19, xF^2 + xF - 1/2*t - 9/2], [8725, x^4 - x^3 - 10*x^2 + 2*x + 19, xF^2 + (-1/2*t - 1/2)*xF - 1/2*t - 9/2], [9225, x^4 - x^3 - 10*x^2 + 7*x + 19, xF^2 + (-1/2*t + 1/2)*xF - 1/2*t - 9/2]] sage: [ f[0] for f in ls ] [725, 1125, 1600, 2000, 2225, 2525, 3600, 4225, 4400, 4525, 5125, 5225, 5725, 6125, 7600, 7625, 8000, 8525, 8725, 9225] sage: [NumberField(ZZx(_[i][1]), 't').is_galois() for i in range(len(_))] [False, True, True, True, False, False, True, True, False, False, False, False, False, True, False, False, True, False, False, False] Seven out of 18 such fields are Galois (with Galois group Z/4Z or Z/2Z + Z/2Z); the others have have Galois closure of degree 8 (with Galois group D_8). Finally, we compute the cubic extensions of Q(zeta_7)^+ with discriminant <= 17*10^9. sage: F.<t> = NumberField(ZZx([1,-4,3,1])) sage: F.disc() 49 sage: enumerate_totallyreal_fields_rel(F, 3, 17*10^9) [[16240385609L, x^9 - x^8 - 9*x^7 + 4*x^6 + 26*x^5 - 2*x^4 - 25*x^3 - x^2 + 7*x + 1, xF^3 + (-t^2 - 4*t + 1)*xF^2 + (t^2 + 3*t - 5)*xF + 3*t^2 + 11*t - 5]] # 32-bit [[16240385609, x^9 - x^8 - 9*x^7 + 4*x^6 + 26*x^5 - 2*x^4 - 25*x^3 - x^2 + 7*x + 1, xF^3 + (-t^2 - 4*t + 1)*xF^2 + (t^2 + 3*t - 5)*xF + 3*t^2 + 11*t - 5]] # 64-bit NOTES: We enumerate polynomials f(x) = x^n + a[n-1]*x^(n-1) + ... + a[0]. A relative Hunter's theorem gives bounds on a[n-1] and a[n-2]; then given a[n-1] and a[n-2], one can recursively compute bounds on a[n-3], ..., a[0] using the fact that the polynomial is totally real by looking at the zeros of successive derivatives and applying Rolle's theorem! See references in totallyreal.py. AUTHORS: - John Voight (2007-11-01) """ if not isinstance(m, Integer): try: m = Integer(m) except: raise TypeError, "cannot coerce m (= %s) to an integer"%n if (m < 1): raise ValueError, "m must be at least 1." n = F.degree()*m # Initialize T = tr_data_rel(F,m,B,a) S = [] Srel = [] dB_odlyzko = odlyzko_bound_totallyreal(n) dB = math.ceil(40000*dB_odlyzko**n) counts = [0,0,0,0] # Trivial case if m == 1: g = pari(F.defining_polynomial()).reverse().Vec() if return_seqs: return [[0,0,0,0],[1,g,[-1,1]]] else: return [[1,pari('x-1'),g]] if verbose: saveout = sys.stdout if type(verbose) == str: fsock = open(verbose, 'w') sys.stdout = fsock # Else, print to screen f_out = [0]*m + [1] if verbose == 2: T.incr(f_out,verbose) else: T.incr(f_out) Fx = PolynomialRing(F, 'xF') nfF = pari(str(F.defining_polynomial()).replace('x', str(F.primitive_element()) ) ) parit = pari(str(F.primitive_element())) while f_out[m] <> 0: counts[0] += 1 if verbose: print "==>", f_out, f_str = '' for i in range(len(f_out)): f_str += '(' + str(f_out[i]) + ')*x^' + str(i) if i < len(f_out)-1: f_str += '+' nf = pari(f_str).polresultant(nfF, parit) d = nf.poldisc() counts[0] += 1 if d > 0 and nf.polsturm_full() == n: da = int_has_small_square_divisor(Integer(d)) if d > dB or d <= B*da: counts[1] += 1 if nf.polisirreducible(): counts[2] += 1 [zk,d] = nf.nfbasis_d() if d <= B: if verbose: print "has discriminant", d, # Find a minimal lattice element counts[3] += 1 ng = pari([nf,zk]).polredabs() # Check if K is contained in the list. found = False ind = bisect.bisect_left(S, [d,ng]) while ind < len(S) and S[ind][0] == d: if S[ind][1] == ng: if verbose: print "but is not new" found = True break ind += 1 if not found: if verbose: print "and is new!" S.insert(ind, [d,ng]) Srel.insert(ind, Fx(f_out)) else: if verbose: print "has discriminant", abs(d), "> B" else: if verbose: print "is not absolutely irreducible" else: if verbose: print "has discriminant", abs(d), "with no large enough square divisor" else: if verbose: if d == 0: print "is not squarefree" else: print "is not totally real" if verbose == 2: T.incr(f_out,verbose=verbose) else: T.incr(f_out) # In the application of Smyth's theorem above, we exclude finitely # many possibilities which we must now throw back in. if m == 2: if Fx([-1,1,1]).is_irreducible(): K = F.extension(Fx([-1,1,1]), 'tK') Kabs = K.absolute_field('tKabs') Kabs_pari = pari(Kabs.defining_polynomial()) d = K.disc() if abs(d) <= B: ng = Kabs_pari.polredabs() ind = bisect.bisect_left(S, [d,ng]) S.insert(ind, [d,ng]) Srel.insert(ind, Fx([-1,1,1])) elif d == 2: for ff in [[1,-7,13,-7,1],[1,-8,14,-7,1]]: f = Fx(ff).factor()[0][0] K = F.extension(f, 'tK') Kabs = K.absolute_field('tKabs') Kabs_pari = pari(Kabs.defining_polynomial()) d = K.disc() if abs(d) <= B: ng = Kabs_pari.polredabs() ind = bisect.bisect_left(S, [d,ng]) S.insert(ind, [d,ng]) Srel.insert(ind, f) elif m == 3: if Fx([-1,6,-5,1]).is_irreducible(): K = F.extension(Fx([-1,6,-5,1]), 'tK') Kabs = K.absolute_field('tKabs') Kabs_pari = pari(Kabs.defining_polynomial()) d = K.disc() if abs(d) <= B: ng = Kabs_pari.polredabs() ind = bisect.bisect_left(S, [d,ng]) S.insert(ind, [d,ng]) Srel.insert(ind, Fx([-1,6,-5,1])) # Now check for isomorphic fields S = [[S[i][0],S[i][1],Srel[i]] for i in range(len(S))] weed_fields(S) # Output. if verbose: print "="*80 print "Polynomials tested:", counts[0] print "Irreducible polynomials:", counts[1] print "Polynomials with nfdisc <= B:", counts[2] for i in range(len(S)): print S[i] if type(verbose) == str: fsock.close() sys.stdout = saveout if return_seqs: return [counts,[[s[0],s[1].reverse().Vec(),s[2].coeffs()] for s in S]] else: return S | f57f2474597d20d4af5eace4c554b7378ae052ee /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/f57f2474597d20d4af5eace4c554b7378ae052ee/totallyreal_rel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4241,
67,
3307,
1230,
7688,
67,
2821,
67,
2878,
12,
42,
16,
312,
16,
605,
16,
279,
273,
5378,
16,
3988,
33,
20,
16,
327,
67,
22437,
33,
8381,
4672,
436,
8395,
1220,
445,
3557,
815,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4241,
67,
3307,
1230,
7688,
67,
2821,
67,
2878,
12,
42,
16,
312,
16,
605,
16,
279,
273,
5378,
16,
3988,
33,
20,
16,
327,
67,
22437,
33,
8381,
4672,
436,
8395,
1220,
445,
3557,
815,
... |
del self.params[name[:-6].upper().replace('_', '-')] | del self.params[toVName(name, 6, True)] | def __delattr__(self, name): try: if name.endswith('_param'): del self.params[name[:-6].upper().replace('_', '-')] elif name.endswith('_paramlist'): del self.params[name[:-10].upper().replace('_', '-')] else: object.__delattr__(self, name) except KeyError: raise exceptions.AttributeError, name | 3bcfacc1aeae62b13b509d0eb3beea6d9b9a2b5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9169/3bcfacc1aeae62b13b509d0eb3beea6d9b9a2b5b/base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
1747,
972,
12,
2890,
16,
508,
4672,
775,
30,
309,
508,
18,
5839,
1918,
2668,
67,
891,
11,
4672,
1464,
365,
18,
2010,
63,
869,
58,
461,
12,
529,
16,
1666,
16,
1053,
25887,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3771,
1747,
972,
12,
2890,
16,
508,
4672,
775,
30,
309,
508,
18,
5839,
1918,
2668,
67,
891,
11,
4672,
1464,
365,
18,
2010,
63,
869,
58,
461,
12,
529,
16,
1666,
16,
1053,
25887,... |
[(0 : 0 : 1), (0 : 1 : 1), (0 : 2 : 1), (1 : 1 : 0), (a + 1 : 2*a : 1), | [(0 : 0 : 1), (0 : 1 : 1), (0 : 2 : 1), (1 : 1 : 0), (a + 1 : 2*a : 1), | def enum_projective_finite_field(X): """ Enumerates projective points on scheme X defined over a finite field INPUT: - ``X`` - a scheme defined over a finite field or set of abstract rational points of such a scheme OUTPUT: - a list containing the projective points of X over the finite field, sorted EXAMPLES:: sage: F = GF(53) sage: P.<X,Y,Z> = ProjectiveSpace(2,F) sage: from sage.schemes.generic.rational_point import enum_projective_finite_field sage: len(enum_projective_finite_field(P(F))) 2863 sage: 53^2+53+1 2863 :: sage: F = GF(9,'a') sage: P.<X,Y,Z> = ProjectiveSpace(2,F) sage: C = Curve(X^3-Y^3+Z^2*Y) sage: enum_projective_finite_field(C(F)) [(0 : 0 : 1), (0 : 1 : 1), (0 : 2 : 1), (1 : 1 : 0), (a + 1 : 2*a : 1), (a + 1 : 2*a + 1 : 1), (a + 1 : 2*a + 2 : 1), (2*a + 2 : a : 1), (2*a + 2 : a + 1 : 1), (2*a + 2 : a + 2 : 1)] :: sage: F = GF(5) sage: P2F.<X,Y,Z> = ProjectiveSpace(2,F) sage: enum_projective_finite_field(P2F) [(0 : 0 : 1), (0 : 1 : 0), (0 : 1 : 1), (0 : 2 : 1), (0 : 3 : 1), (0 : 4 : 1), (1 : 0 : 0), (1 : 0 : 1), (1 : 1 : 0), (1 : 1 : 1), (1 : 2 : 1), (1 : 3 : 1), (1 : 4 : 1), (2 : 0 : 1), (2 : 1 : 0), (2 : 1 : 1), (2 : 2 : 1), (2 : 3 : 1), (2 : 4 : 1), (3 : 0 : 1), (3 : 1 : 0), (3 : 1 : 1), (3 : 2 : 1), (3 : 3 : 1), (3 : 4 : 1), (4 : 0 : 1), (4 : 1 : 0), (4 : 1 : 1), (4 : 2 : 1), (4 : 3 : 1), (4 : 4 : 1)] ALGORITHM: Checks all points in projective space to see if they lie on X. NOTE: Warning:if X given as input is defined over an infinite field then this code will not finish! AUTHORS: John Cremona and Charlie Turner (06-2010) """ if is_Scheme(X): X = X(X.base_ring()) n = X.codomain().ambient_space().ngens()-1 F = X.value_ring() pts = [] for k in range(n+1): for c in cartesian_product_iterator([F for _ in range(k)]): try: pts.append(X(list(c)+[1]+[0]*(n-k))) except: pass pts.sort() return pts | 8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2792,
67,
4406,
688,
67,
9551,
67,
1518,
12,
60,
4672,
3536,
6057,
264,
815,
1984,
688,
3143,
603,
4355,
1139,
2553,
1879,
279,
25922,
652,
225,
12943,
30,
225,
300,
12176,
60,
10335,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2792,
67,
4406,
688,
67,
9551,
67,
1518,
12,
60,
4672,
3536,
6057,
264,
815,
1984,
688,
3143,
603,
4355,
1139,
2553,
1879,
279,
25922,
652,
225,
12943,
30,
225,
300,
12176,
60,
10335,
... |
print '%d. Fahrt, Dauer %s' % (i, route.duration()) | print('%d. Fahrt, Dauer %s' % (i, route.duration())) | def get_url(self): return (_REQ_URL + ('&' if _REQ_URL.find('?') > -1 else '?') + urllib.urlencode(self.post) ) | dd568e81c1b8182cd4ce3412e911e6ca45e46cbd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7908/dd568e81c1b8182cd4ce3412e911e6ca45e46cbd/bsag.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
718,
12,
2890,
4672,
327,
261,
67,
20373,
67,
1785,
397,
7707,
26045,
309,
389,
20373,
67,
1785,
18,
4720,
2668,
4899,
13,
405,
300,
21,
469,
6787,
13,
397,
11527,
18,
718,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
718,
12,
2890,
4672,
327,
261,
67,
20373,
67,
1785,
397,
7707,
26045,
309,
389,
20373,
67,
1785,
18,
4720,
2668,
4899,
13,
405,
300,
21,
469,
6787,
13,
397,
11527,
18,
718,
... |
tun_srv_thread = TUNServer () threads.append (tun_srv_thread) tun_srv_thread.start () | def stop (self): self.kill = True | 06f9f6679283b3891781dbcda4305146aa4b6782 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12216/06f9f6679283b3891781dbcda4305146aa4b6782/lan_tun.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2132,
261,
2890,
4672,
365,
18,
16418,
273,
1053,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2132,
261,
2890,
4672,
365,
18,
16418,
273,
1053,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
'.svg' : 'image/svg+xml' | '.svg' : 'image/svg+xml', | def _default_mime_types(): global suffix_map global encodings_map global types_map global common_types suffix_map = { '.svgz': '.svg.gz', '.tgz': '.tar.gz', '.taz': '.tar.gz', '.tz': '.tar.gz', '.tbz2': '.tar.bz2', } encodings_map = { '.gz': 'gzip', '.Z': 'compress', '.bz2': 'bzip2', } # Before adding new types, make sure they are either registered with IANA, # at http://www.iana.org/assignments/media-types # or extensions, i.e. using the x- prefix # If you add to these, please keep them sorted! types_map = { '.a' : 'application/octet-stream', '.ai' : 'application/postscript', '.aif' : 'audio/x-aiff', '.aifc' : 'audio/x-aiff', '.aiff' : 'audio/x-aiff', '.au' : 'audio/basic', '.avi' : 'video/x-msvideo', '.bat' : 'text/plain', '.bcpio' : 'application/x-bcpio', '.bin' : 'application/octet-stream', '.bmp' : 'image/x-ms-bmp', '.c' : 'text/plain', # Duplicates :( '.cdf' : 'application/x-cdf', '.cdf' : 'application/x-netcdf', '.cpio' : 'application/x-cpio', '.csh' : 'application/x-csh', '.css' : 'text/css', '.dll' : 'application/octet-stream', '.doc' : 'application/msword', '.dot' : 'application/msword', '.dvi' : 'application/x-dvi', '.eml' : 'message/rfc822', '.eps' : 'application/postscript', '.etx' : 'text/x-setext', '.exe' : 'application/octet-stream', '.gif' : 'image/gif', '.gtar' : 'application/x-gtar', '.h' : 'text/plain', '.hdf' : 'application/x-hdf', '.htm' : 'text/html', '.html' : 'text/html', '.ief' : 'image/ief', '.jpe' : 'image/jpeg', '.jpeg' : 'image/jpeg', '.jpg' : 'image/jpeg', '.js' : 'application/x-javascript', '.ksh' : 'text/plain', '.latex' : 'application/x-latex', '.m1v' : 'video/mpeg', '.man' : 'application/x-troff-man', '.me' : 'application/x-troff-me', '.mht' : 'message/rfc822', '.mhtml' : 'message/rfc822', '.mif' : 'application/x-mif', '.mov' : 'video/quicktime', '.movie' : 'video/x-sgi-movie', '.mp2' : 'audio/mpeg', '.mp3' : 'audio/mpeg', '.mp4' : 'video/mp4', '.mpa' : 'video/mpeg', '.mpe' : 'video/mpeg', '.mpeg' : 'video/mpeg', '.mpg' : 'video/mpeg', '.ms' : 'application/x-troff-ms', '.nc' : 'application/x-netcdf', '.nws' : 'message/rfc822', '.o' : 'application/octet-stream', '.obj' : 'application/octet-stream', '.oda' : 'application/oda', '.p12' : 'application/x-pkcs12', '.p7c' : 'application/pkcs7-mime', '.pbm' : 'image/x-portable-bitmap', '.pdf' : 'application/pdf', '.pfx' : 'application/x-pkcs12', '.pgm' : 'image/x-portable-graymap', '.pl' : 'text/plain', '.png' : 'image/png', '.pnm' : 'image/x-portable-anymap', '.pot' : 'application/vnd.ms-powerpoint', '.ppa' : 'application/vnd.ms-powerpoint', '.ppm' : 'image/x-portable-pixmap', '.pps' : 'application/vnd.ms-powerpoint', '.ppt' : 'application/vnd.ms-powerpoint', '.ps' : 'application/postscript', '.pwz' : 'application/vnd.ms-powerpoint', '.py' : 'text/x-python', '.pyc' : 'application/x-python-code', '.pyo' : 'application/x-python-code', '.qt' : 'video/quicktime', '.ra' : 'audio/x-pn-realaudio', '.ram' : 'application/x-pn-realaudio', '.ras' : 'image/x-cmu-raster', '.rdf' : 'application/xml', '.rgb' : 'image/x-rgb', '.roff' : 'application/x-troff', '.rtx' : 'text/richtext', '.sgm' : 'text/x-sgml', '.sgml' : 'text/x-sgml', '.sh' : 'application/x-sh', '.shar' : 'application/x-shar', '.snd' : 'audio/basic', '.so' : 'application/octet-stream', '.src' : 'application/x-wais-source', '.sv4cpio': 'application/x-sv4cpio', '.sv4crc' : 'application/x-sv4crc', '.svg' : 'image/svg+xml' '.swf' : 'application/x-shockwave-flash', '.t' : 'application/x-troff', '.tar' : 'application/x-tar', '.tcl' : 'application/x-tcl', '.tex' : 'application/x-tex', '.texi' : 'application/x-texinfo', '.texinfo': 'application/x-texinfo', '.tif' : 'image/tiff', '.tiff' : 'image/tiff', '.tr' : 'application/x-troff', '.tsv' : 'text/tab-separated-values', '.txt' : 'text/plain', '.ustar' : 'application/x-ustar', '.vcf' : 'text/x-vcard', '.wav' : 'audio/x-wav', '.wiz' : 'application/msword', '.wsdl' : 'application/xml', '.xbm' : 'image/x-xbitmap', '.xlb' : 'application/vnd.ms-excel', # Duplicates :( '.xls' : 'application/excel', '.xls' : 'application/vnd.ms-excel', '.xml' : 'text/xml', '.xpdl' : 'application/xml', '.xpm' : 'image/x-xpixmap', '.xsl' : 'application/xml', '.xwd' : 'image/x-xwindowdump', '.zip' : 'application/zip', } # These are non-standard types, commonly found in the wild. They will # only match if strict=0 flag is given to the API methods. # Please sort these too common_types = { '.jpg' : 'image/jpg', '.mid' : 'audio/midi', '.midi': 'audio/midi', '.pct' : 'image/pict', '.pic' : 'image/pict', '.pict': 'image/pict', '.rtf' : 'application/rtf', '.xul' : 'text/xul' } | 1696f822e887ec262785a6902cf0296ddd05ebf4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/1696f822e887ec262785a6902cf0296ddd05ebf4/mimetypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1886,
67,
11757,
67,
2352,
13332,
2552,
3758,
67,
1458,
2552,
24118,
67,
1458,
2552,
1953,
67,
1458,
2552,
2975,
67,
2352,
225,
3758,
67,
1458,
273,
288,
2418,
5751,
9764,
4278,
241... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1886,
67,
11757,
67,
2352,
13332,
2552,
3758,
67,
1458,
2552,
24118,
67,
1458,
2552,
1953,
67,
1458,
2552,
2975,
67,
2352,
225,
3758,
67,
1458,
273,
288,
2418,
5751,
9764,
4278,
241... |
raise OSError('%s failed: %s' % (name, exitcode)) | raise OSError('%s failed: exitcode=%s' % (name, exitcode)) | def _run(cmd, options): from epydoc.epytext import wordwrap if '|' in cmd: name = cmd.split('|')[1].strip().split(' ', 1)[0] else: name = cmd.strip().split(' ', 1)[0] if options['verbosity'] == 1: print >>sys.stderr, 'Running %s...' % name elif options['verbosity'] > 1: cmd_str = wordwrap(`cmd`, 10+len(name)).lstrip() print >>sys.stderr, 'Running %s' % cmd_str.rstrip() exitcode = os.system(cmd) if exitcode != 0: raise OSError('%s failed: %s' % (name, exitcode)) | 5397b1945fdf3feb9813ef60349d76c37defaafe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/5397b1945fdf3feb9813ef60349d76c37defaafe/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2681,
12,
4172,
16,
702,
4672,
628,
425,
2074,
2434,
18,
881,
93,
955,
1930,
2076,
4113,
309,
8030,
316,
1797,
30,
508,
273,
1797,
18,
4939,
2668,
96,
6134,
63,
21,
8009,
6406,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2681,
12,
4172,
16,
702,
4672,
628,
425,
2074,
2434,
18,
881,
93,
955,
1930,
2076,
4113,
309,
8030,
316,
1797,
30,
508,
273,
1797,
18,
4939,
2668,
96,
6134,
63,
21,
8009,
6406,
... |
gobject.idle_add(self.infowindow_show_lyrics, lyrics) | gobject.idle_add(self.infowindow_show_lyrics, lyrics, artist, title) | def infowindow_get_lyrics(self, artist, title): if self.lyricServer is None: wsdlFile = "http://lyricwiki.org/server.php?wsdl" try: self.lyricServer = True timeout = socket.getdefaulttimeout() socket.setdefaulttimeout(self.LYRIC_TIMEOUT) self.lyricServer = WSDL.Proxy(wsdlFile) except: socket.setdefaulttimeout(timeout) lyrics = _("Couldn't connect to LyricWiki") gobject.idle_add(self.infowindow_show_lyrics, lyrics) self.lyricServer = None return try: timeout = socket.getdefaulttimeout() socket.setdefaulttimeout(self.LYRIC_TIMEOUT) lyrics = self.lyricServer.getSong(artist, title)["lyrics"] lyrics = artist + " - " + title + "\n\n" + lyrics gobject.idle_add(self.infowindow_show_lyrics, lyrics) except: lyrics = _("Fetching lyrics failed") gobject.idle_add(self.infowindow_show_lyrics, lyrics) socket.setdefaulttimeout(timeout) | ef335bb5758783289bea4a5b77282ae0c87d687a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2312/ef335bb5758783289bea4a5b77282ae0c87d687a/sonata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8286,
543,
1700,
67,
588,
67,
715,
1512,
87,
12,
2890,
16,
15469,
16,
2077,
4672,
309,
365,
18,
715,
1512,
2081,
353,
599,
30,
17642,
812,
273,
315,
2505,
2207,
715,
1512,
13044,
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,
8286,
543,
1700,
67,
588,
67,
715,
1512,
87,
12,
2890,
16,
15469,
16,
2077,
4672,
309,
365,
18,
715,
1512,
2081,
353,
599,
30,
17642,
812,
273,
315,
2505,
2207,
715,
1512,
13044,
18,
... |
s = """ include "cdefs.pxi" """ + s | s = """\ninclude "cdefs.pxi"\n""" + s | def pyx_preparse(s): r""" Preparse a Pyx file * include cdefs.pxi, interrupt.pxi, stdsage.pxi * parse clang pragma (c or c++) * parse clib pragma (additional libraries to link in) * parse cinclude (additional include directories) The pragmas: \begin{description} \item[clang] may be either c or c++ indicating whether a C or C++ compiler should be used \item[clib] additional libraries to be linked in, the space separated list is split and passed to distutils. \item[cinclude] additional directories to search for header files. The space separated list is split and passed to distutils. \end{description} EXAMPLE: sage: from sage.misc.cython import pyx_preparse sage: pyx_preparse("") ('\ninclude "interrupt.pxi" # ctrl-c interrupt block support\ninclude "stdsage.pxi" # ctrl-c interrupt block support\n\ninclude "cdefs.pxi"\n', ['mpfr', 'gmp', 'gmpxx', 'stdc++', 'pari', 'm', 'curvesntl', 'g0nntl', 'jcntl', 'rankntl', 'gsl', 'cblas', 'atlas', 'ntl', 'csage'], ['.../local/include/csage/', '.../local/include/', '.../local/include/python2.5/', '.../devel/sage/sage/ext/', '.../devel/sage/', '.../devel/sage/sage/gsl/'], 'c', []) sage: s, libs, inc, lang, f = pyx_preparse("# clang c++\n #clib foo\n # cinclude bar\n") sage: lang 'c++' sage: libs ['foo', 'mpfr', 'gmp', 'gmpxx', 'stdc++', 'pari', 'm', 'curvesntl', 'g0nntl', 'jcntl', 'rankntl', 'gsl', 'cblas', 'atlas', 'ntl', 'csage'] sage: inc ['bar', '.../local/include/csage/', '.../local/include/', '.../local/include/python2.5/', '.../devel/sage/sage/ext/', '.../devel/sage/', '.../devel/sage/sage/gsl/'] """ lang = parse_keywords('clang', s) if lang[0]: lang = lang[0][0] else: lang = "c" v, s = parse_keywords('clib', s) libs = v + standard_libs additional_source_files, s = parse_keywords('cfile', s) v, s = parse_keywords('cinclude', s) inc = [environ_parse(x.replace('"','').replace("'","")) for x in v] + include_dirs s = """ | 0f48279a25cd52f6d55431cd7023ad3b77edecae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/0f48279a25cd52f6d55431cd7023ad3b77edecae/cython.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2395,
92,
67,
1484,
2670,
12,
87,
4672,
436,
8395,
2962,
2670,
279,
4707,
92,
585,
380,
2341,
276,
12537,
18,
4430,
77,
16,
13123,
18,
4430,
77,
16,
2044,
87,
410,
18,
4430,
77,
380,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2395,
92,
67,
1484,
2670,
12,
87,
4672,
436,
8395,
2962,
2670,
279,
4707,
92,
585,
380,
2341,
276,
12537,
18,
4430,
77,
16,
13123,
18,
4430,
77,
16,
2044,
87,
410,
18,
4430,
77,
380,... |
print >> f, self.wavelen[i], self.flambda[i], self.fnu[i] | fnu = self.flambdaTofnu(wavelen=wavelen, flambda=flambda) print >> f, wavelen[i], flambda[i], fnu[i] | def writeSED(self, filename, print_header=None, print_fnu=False, wavelen_min=None, wavelen_max=None, wavelen_step=None): """Write SED (wavelen, flambda, optional fnu) out to file. Option of adding a header line (such as version info) to output file. Does not alter self, regardless of grid or presence/absence of fnu""" # This can be useful for debugging or recording an SED. f = open(filename, 'w') wavelen = self.wavelen flambda = self.flambda # See if need to regrid data (if regrid, new memory copy). if self.needResample(wavelen, wavelen_min, wavelen_max, wavelen_step): wavelen, flambda = self.resampleSED(wavelen, flambda, wavelen_min, wavelen_max, wavelen_step) # Then just use this gridded wavelen/flambda to calculate fnu. # Print header. if print_header != None: print >>f, "#", print_header # Print standard header info. if print_fnu: wavelen, fnu = self.flambdaTofnu(wavelen, flambda, wavelen_min, wavelen_max, wavelen_step) print >>f, "# Wavelength(nm) Flambda(ergs/cm^s/s/nm) Fnu(Jansky)" else: print >>f, "# Wavelength(nm) Flambda(ergs/cm^s/s/nm)" for i in range(0, len(wavelen), 1): if print_fnu: print >> f, self.wavelen[i], self.flambda[i], self.fnu[i] else: #print >> f, self.wavelen[i], self.flambda[i] print >> f "%.2f %.7g" %(self.wavelen[i], self.flambda[i]) # Done writing, close file. f.close() return | 891a786375901d734d3598820c476bc62ff95fb2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/91/891a786375901d734d3598820c476bc62ff95fb2/Sed.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
18204,
12,
2890,
16,
1544,
16,
1172,
67,
3374,
33,
7036,
16,
1172,
67,
4293,
89,
33,
8381,
16,
341,
7882,
275,
67,
1154,
33,
7036,
16,
341,
7882,
275,
67,
1896,
33,
7036,
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,
1045,
18204,
12,
2890,
16,
1544,
16,
1172,
67,
3374,
33,
7036,
16,
1172,
67,
4293,
89,
33,
8381,
16,
341,
7882,
275,
67,
1154,
33,
7036,
16,
341,
7882,
275,
67,
1896,
33,
7036,
16,
... |
name, '", "'.join(choices), arg)) | name, '", "'.join([repr(choice) for choice in choices]), arg)) | def get_choice(request, arg, name=None, choices=[None]): """ For use with values returned from parse_quoted_separated or given as macro parameters, return a unicode string that must be in the choices given. None is a valid input and yields first of the valid choices. @param request: A request instance @param arg: The argument, may be None or a unicode string @param name: Name of the argument, for error messages @param choices: the possible choices @rtype: unicode or None @returns: the unicode string (or default value) """ assert isinstance(choices, (tuple, list)) if arg is None: return choices[0] elif not isinstance(arg, unicode): raise TypeError('Argument must be None or unicode') elif not arg in choices: _ = request.getText if name: raise ValueError( _('Argument "%s" must be one of "%s", not "%s"') % ( name, '", "'.join(choices), arg)) else: raise ValueError( _('Argument must be one of "%s", not "%s"') % ( '", "'.join(choices), arg)) return arg | 8cf5a7c75fc44624e99c344bf3281307ca65d999 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/888/8cf5a7c75fc44624e99c344bf3281307ca65d999/wikiutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
11569,
12,
2293,
16,
1501,
16,
508,
33,
7036,
16,
7246,
22850,
7036,
65,
4672,
3536,
2457,
999,
598,
924,
2106,
628,
1109,
67,
15179,
67,
24622,
578,
864,
487,
11522,
1472,
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,
336,
67,
11569,
12,
2293,
16,
1501,
16,
508,
33,
7036,
16,
7246,
22850,
7036,
65,
4672,
3536,
2457,
999,
598,
924,
2106,
628,
1109,
67,
15179,
67,
24622,
578,
864,
487,
11522,
1472,
16... |
"""retrieve a mirrorlist file from a url""" | """retrieve an up2date-style mirrorlist file from a url, we also s/$ARCH/$BASEARCH/ and move along""" | def getMirrorList(mirrorlist): """retrieve a mirrorlist file from a url""" returnlist = [] if hasattr(urlgrabber.grabber, 'urlopen'): urlresolver = urlgrabber.grabber else: urlresolver = urllib scheme = urlparse.urlparse(mirrorlist)[0] if scheme == '': url = 'file://' + mirrorlist else: url = mirrorlist try: fo = urlresolver.urlopen(url) except urlgrabber.grabber.URLGrabError, e: fo = None if fo is not None: content = fo.readlines() for line in content: mirror = re.sub('\n$', '', line) # no more trailing \n's returnlist.append(mirror) return returnlist | 2d999a95b5fed166fb4f32cae26a24be5434bb62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/2d999a95b5fed166fb4f32cae26a24be5434bb62/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2108,
8299,
682,
12,
27197,
1098,
4672,
3536,
17466,
392,
731,
22,
712,
17,
4060,
15593,
1098,
585,
628,
279,
880,
16,
732,
2546,
272,
11141,
10586,
11141,
8369,
10586,
19,
471,
3635,
75... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2108,
8299,
682,
12,
27197,
1098,
4672,
3536,
17466,
392,
731,
22,
712,
17,
4060,
15593,
1098,
585,
628,
279,
880,
16,
732,
2546,
272,
11141,
10586,
11141,
8369,
10586,
19,
471,
3635,
75... |
if line.credit and line.reconcile_partial_id: | if line.credit and line.reconcile_partial_id and ttype == 'receipt': | def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id=False, price=0.0, currency_id=False, ttype=False, context={}): """price Returns a dict that contains new values and context @param partner_id: latest value from user input for field partner_id @param args: other arguments @param context: context arguments, like lang, time zone @return: Returns a dict which contains new values, and context """ if not journal_id: return {} currency_pool = self.pool.get('res.currency') move_pool = self.pool.get('account.move') line_pool = self.pool.get('account.voucher.line') move_line_pool = self.pool.get('account.move.line') partner_pool = self.pool.get('res.partner') journal_pool = self.pool.get('account.journal') default = { 'value':{'line_ids':[], 'line_dr_ids':[], 'line_cr_ids':[], 'pre_line': False}, } | 4a3baffa6dfeca0db4cd0bcbe105c0026883c2ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4a3baffa6dfeca0db4cd0bcbe105c0026883c2ec/voucher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
31993,
67,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
19170,
67,
350,
16,
13001,
67,
350,
33,
8381,
16,
6205,
33,
20,
18,
20,
16,
5462,
67,
350,
33,
8381,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
31993,
67,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
19170,
67,
350,
16,
13001,
67,
350,
33,
8381,
16,
6205,
33,
20,
18,
20,
16,
5462,
67,
350,
33,
8381,
16,
... |
self.myRequests[-1].append(self.raw_requestline) | self.myRequests[self.reqidx].append(self.raw_requestline) | def handle_one_request(self): result = self.parentClass.handle_one_request(self) self.myRequests[-1].append(self.raw_requestline) return result | 8a851e2f8602d6cab6579657c1a8b19ecf7d4f11 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/8a851e2f8602d6cab6579657c1a8b19ecf7d4f11/test_xmlrpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
476,
67,
2293,
12,
2890,
4672,
563,
273,
365,
18,
2938,
797,
18,
4110,
67,
476,
67,
2293,
12,
2890,
13,
365,
18,
4811,
6421,
63,
2890,
18,
3658,
3465,
8009,
6923,
12,
2890,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
476,
67,
2293,
12,
2890,
4672,
563,
273,
365,
18,
2938,
797,
18,
4110,
67,
476,
67,
2293,
12,
2890,
13,
365,
18,
4811,
6421,
63,
2890,
18,
3658,
3465,
8009,
6923,
12,
2890,... |
print_records(req, range(recid,recidb), -1, -9999, of, ot, ln) | print_records(req, range(recid,recidb), -1, -9999, of, ot, ln) if req and of.startswith("h"): client_ip_address = str(req.get_remote_host(apache.REMOTE_NOLOOKUP)) run_sql("INSERT INTO rnkPAGEVIEWS (id_bibrec,id_user,client_host,view_time) VALUES (%s,%s,INET_ATON(%s),NOW())", (recid, uid, client_ip_address)) | def perform_request_search(req=None, cc=cdsname, c=None, p="", f="", rg="10", sf="", so="d", sp="", rm="", of="id", ot="", as="0", p1="", f1="", m1="", op1="", p2="", f2="", m2="", op2="", p3="", f3="", m3="", sc="0", jrec="0", recid="-1", recidb="-1", sysno="", id="-1", idb="-1", sysnb="", action="", d1y="0", d1m="0", d1d="0", d2y="0", d2m="0", d2d="0", verbose="0", ap="0", ln=cdslang): """Perform search or browse request, without checking for authentication. Return list of recIDs found, if of=id. Otherwise create web page. The arguments are as follows: req - mod_python Request class instance. cc - current collection (e.g. "ATLAS"). The collection the user started to search/browse from. c - collectin list (e.g. ["Theses", "Books"]). The collections user may have selected/deselected when starting to search from 'cc'. p - pattern to search for (e.g. "ellis and muon or kaon"). f - field to search within (e.g. "author"). rg - records in groups of (e.g. "10"). Defines how many hits per collection in the search results page are displayed. sf - sort field (e.g. "title"). so - sort order ("a"=ascending, "d"=descending). sp - sort pattern (e.g. "CERN-") -- in case there are more values in a sort field, this argument tells which one to prefer rm - ranking method (e.g. "jif"). Defines whether results should be ranked by some known ranking method. of - output format (e.g. "hb"). Usually starting "h" means HTML output (and "hb" for HTML brief, "hd" for HTML detailed), "x" means XML output, "t" means plain text output, "id" means no output at all but to return list of recIDs found. (Suitable for high-level API.) ot - output only these MARC tags (e.g. "100,700,909C0b"). Useful if only some fields are to be shown in the output, e.g. for library to control some fields. as - advanced search ("0" means no, "1" means yes). Whether search was called from within the advanced search interface. p1 - first pattern to search for in the advanced search interface. Much like 'p'. f1 - first field to search within in the advanced search interface. Much like 'f'. m1 - first matching type in the advanced search interface. ("a" all of the words, "o" any of the words, "e" exact phrase, "p" partial phrase, "r" regular expression). op1 - first operator, to join the first and the second unit in the advanced search interface. ("a" add, "o" or, "n" not). p2 - second pattern to search for in the advanced search interface. Much like 'p'. f2 - second field to search within in the advanced search interface. Much like 'f'. m2 - second matching type in the advanced search interface. ("a" all of the words, "o" any of the words, "e" exact phrase, "p" partial phrase, "r" regular expression). op2 - second operator, to join the second and the third unit in the advanced search interface. ("a" add, "o" or, "n" not). p3 - third pattern to search for in the advanced search interface. Much like 'p'. f3 - third field to search within in the advanced search interface. Much like 'f'. m3 - third matching type in the advanced search interface. ("a" all of the words, "o" any of the words, "e" exact phrase, "p" partial phrase, "r" regular expression). sc - split by collection ("0" no, "1" yes). Governs whether we want to present the results in a single huge list, or splitted by collection. jrec - jump to record (e.g. "234"). Used for navigation inside the search results. recid - display record ID (e.g. "20000"). Do not search/browse but go straight away to the Detailed record page for the given recID. recidb - display record ID bis (e.g. "20010"). If greater than 'recid', then display records from recid to recidb. Useful for example for dumping records from the database for reformatting. sysno - display old system SYS number (e.g. ""). If you migrate to CDSware from another system, and store your old SYS call numbers, you can use them instead of recid if you wish so. id - the same as recid, in case recid is not set. For backwards compatibility. idb - the same as recid, in case recidb is not set. For backwards compatibility. sysnb - the same as sysno, in case sysno is not set. For backwards compatibility. action - action to do. "SEARCH" for searching, "Browse" for browsing. Default is to search. d1y - first date year (e.g. "1998"). Useful for search limits on creation date. d1m - first date month (e.g. "08"). Useful for search limits on creation date. d1d - first date day (e.g. "23"). Useful for search limits on creation date. d2y - second date year (e.g. "1998"). Useful for search limits on creation date. d2m - second date month (e.g. "09"). Useful for search limits on creation date. d2d - second date day (e.g. "02"). Useful for search limits on creation date. verbose - verbose level (0=min, 9=max). Useful to print some internal information on the searching process in case something goes wrong. ap - alternative patterns (0=no, 1=yes). In case no exact match is found, the search engine can try alternative patterns e.g. to replace non-alphanumeric characters by a boolean query. ap defines if this is wanted. ln - language of the search interface (e.g. "en"). Useful for internationalization. """ # wash all passed arguments: cc = wash_url_argument(cc, 'str') sc = wash_url_argument(sc, 'int') (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) # which colls to search and to display? p = wash_pattern(wash_url_argument(p, 'str')) f = wash_field(wash_url_argument(f, 'str')) rg = wash_url_argument(rg, 'int') sf = wash_url_argument(sf, 'str') so = wash_url_argument(so, 'str') sp = wash_url_argument(sp, 'str') rm = wash_url_argument(rm, 'str') of = wash_url_argument(of, 'str') if type(ot) is list: ot = string.join(ot,",") ot = wash_url_argument(ot, 'str') as = wash_url_argument(as, 'int') p1 = wash_pattern(wash_url_argument(p1, 'str')) f1 = wash_field(wash_url_argument(f1, 'str')) m1 = wash_url_argument(m1, 'str') op1 = wash_url_argument(op1, 'str') p2 = wash_pattern(wash_url_argument(p2, 'str')) f2 = wash_field(wash_url_argument(f2, 'str')) m2 = wash_url_argument(m2, 'str') op2 = wash_url_argument(op2, 'str') p3 = wash_pattern(wash_url_argument(p3, 'str')) f3 = wash_field(wash_url_argument(f3, 'str')) m3 = wash_url_argument(m3, 'str') jrec = wash_url_argument(jrec, 'int') recid = wash_url_argument(recid, 'int') recidb = wash_url_argument(recidb, 'int') sysno = wash_url_argument(sysno, 'str') id = wash_url_argument(id, 'int') idb = wash_url_argument(idb, 'int') sysnb = wash_url_argument(sysnb, 'str') action = wash_url_argument(action, 'str') d1y = wash_url_argument(d1y, 'int') d1m = wash_url_argument(d1m, 'int') d1d = wash_url_argument(d1d, 'int') d2y = wash_url_argument(d2y, 'int') d2m = wash_url_argument(d2m, 'int') d2d = wash_url_argument(d2d, 'int') day1, day2 = wash_dates(d1y, d1m, d1d, d2y, d2m, d2d) verbose = wash_url_argument(verbose, 'int') ap = wash_url_argument(ap, 'int') ln = wash_language(ln) # backwards compatibility: id, idb, sysnb -> recid, recidb, sysno (if applicable) if sysnb != "" and sysno == "": sysno = sysnb if id > 0 and recid == -1: recid = id if idb > 0 and recidb == -1: recidb = idb # TODO deduce passed search limiting criterias (if applicable) pl, pl_in_url = "", "" # no limits by default if action != msg_browse[ln] and req and req.args: # we do not want to add options while browsing or while calling via command-line fieldargs = cgi.parse_qs(req.args) for fieldcode in get_fieldcodes(): if fieldargs.has_key(fieldcode): for val in fieldargs[fieldcode]: pl += "+%s:\"%s\" " % (fieldcode, val) pl_in_url += "&%s=%s" % (urllib.quote(fieldcode), urllib.quote(val)) # deduce recid from sysno argument (if applicable): if sysno: # ALEPH SYS number was passed, so deduce MySQL recID for the record: recid = get_mysql_recid_from_aleph_sysno(sysno) # deduce collection we are in (if applicable): if recid>0: cc = guess_primary_collection_of_a_record(recid) # deduce user id (if applicable): try: uid = getUid(req) except: uid = 0 ## 0 - start output if recid>0: ## 1 - detailed record display page_start(req, of, cc, as, ln, uid, msg_detailed_record[ln] + " #%d" % recid) if of == "hb": of = "hd" if record_exists(recid): if recidb<=recid: # sanity check recidb=recid+1 print_records(req, range(recid,recidb), -1, -9999, of, ot, ln) else: # record does not exist if of.startswith("h"): print_warning(req, "Requested record does not seem to exist.") elif action == msg_browse[ln]: ## 2 - browse needed page_start(req, of, cc, as, ln, uid, msg_browse[ln]) if of.startswith("h"): req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, rm, of, ot, as, ln, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, pl, d1y, d1m, d1d, d2y, d2m, d2d, action)) try: if as==1 or (p1 or p2 or p3): browse_pattern(req, colls_to_search, p1, f1, rg) browse_pattern(req, colls_to_search, p2, f2, rg) browse_pattern(req, colls_to_search, p3, f3, rg) else: browse_pattern(req, colls_to_search, p, f, rg) except: if of.startswith("h"): req.write(create_error_box(req, verbose=verbose, ln=ln)) return page_end(req, of, ln) elif rm and p.startswith("recid:"): ## 3-ter - similarity search needed page_start(req, of, cc, as, ln, uid, msg_search_results[ln]) if of.startswith("h"): req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, rm, of, ot, as, ln, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, pl, d1y, d1m, d1d, d2y, d2m, d2d, action)) if record_exists(p[6:]) != 1: # record does not exist if of.startswith("h"): print_warning(req, "Requested record does not seem to exist.") if of == "id": return [] else: # record well exists, so find similar ones to it t1 = os.times()[4] results_similar_recIDs, results_similar_relevances, results_similar_relevances_prologue, results_similar_relevances_epilogue, results_similar_comments = \ rank_records(rm, 0, get_collection_reclist(cdsname), string.split(p), verbose) if results_similar_recIDs: t2 = os.times()[4] cpu_time = t2 - t1 if of.startswith("h"): req.write(print_search_info(p, f, sf, so, sp, rm, of, ot, cdsname, len(results_similar_recIDs), jrec, rg, as, ln, p1, p2, p3, f1, f2, f3, m1, m2, m3, op1, op2, sc, pl_in_url, d1y, d1m, d1d, d2y, d2m, d2d, cpu_time)) print_warning(req, results_similar_comments) print_records(req, results_similar_recIDs, jrec, rg, of, ot, ln, results_similar_relevances, results_similar_relevances_prologue, results_similar_relevances_epilogue) elif of=="id": return results_similar_recIDs else: # rank_records failed and returned some error message to display: if of.startswith("h"): print_warning(req, results_similar_relevances_prologue) print_warning(req, results_similar_relevances_epilogue) print_warning(req, results_similar_comments) if of == "id": return [] elif p.startswith("cociting:"): ## 3-terter - cited by search needed page_start(req, of, cc, as, ln, uid, msg_search_results[ln]) if of.startswith("h"): req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, rm, of, ot, as, ln, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, pl, d1y, d1m, d1d, d2y, d2m, d2d, action)) recID = p[7:] if record_exists(recID) != 1: # record does not exist if of.startswith("h"): print_warning(req, "***Requested record does not seem to exist.") if of == "id": return [] else: # record well exists, so find citing ones t1 = os.times()[4] results_citing_recIDs = get_co_cited_with_list(int(recID)) #results_citing_recIDs = [1, 2, 3, 5, 8] if results_citing_recIDs: t2 = os.times()[4] cpu_time = t2 - t1 if of.startswith("h"): req.write(print_search_info(p, f, sf, so, sp, rm, of, ot, cdsname, len(results_citing_recIDs), jrec, rg, as, ln, p1, p2, p3, f1, f2, f3, m1, m2, m3, op1, op2, sc, pl_in_url, d1y, d1m, d1d, d2y, d2m, d2d, cpu_time)) print_records(req, results_citing_recIDs, jrec, rg, of, ot, ln) elif of=="id": return results_citing_recIDs else: # cited rank_records failed and returned some error message to display: if of.startswith("h"): print_warning(req, "nothing found") if of == "id": return [] else: ## 3 - common search needed page_start(req, of, cc, as, ln, uid, msg_search_results[ln]) if of.startswith("h"): req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, rm, of, ot, as, ln, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, pl, d1y, d1m, d1d, d2y, d2m, d2d, action)) t1 = os.times()[4] results_in_any_collection = HitSet() if as == 1 or (p1 or p2 or p3): ## 3A - advanced search try: results_in_any_collection = search_pattern(req, p1, f1, m1, ap=ap, of=of, verbose=verbose, ln=ln) if results_in_any_collection._nbhits == 0: if of.startswith("h"): req.write(create_google_box(cc, p, f, p1, p2, p3, ln)) return page_end(req, of, ln) if p2: results_tmp = search_pattern(req, p2, f2, m2, ap=ap, of=of, verbose=verbose, ln=ln) if op1 == "a": # add results_in_any_collection.intersect(results_tmp) elif op1 == "o": # or results_in_any_collection.union(results_tmp) elif op1 == "n": # not results_in_any_collection.difference(results_tmp) else: if of.startswith("h"): print_warning(req, "Invalid set operation %s." % op1, "Error") results_in_any_collection.calculate_nbhits() if results_in_any_collection._nbhits == 0: if of.startswith("h"): req.write(create_google_box(cc, p, f, p1, p2, p3, ln)) return page_end(req, of, ln) if p3: results_tmp = search_pattern(req, p3, f3, m3, ap=ap, of=of, verbose=verbose, ln=ln) if op2 == "a": # add results_in_any_collection.intersect(results_tmp) elif op2 == "o": # or results_in_any_collection.union(results_tmp) elif op2 == "n": # not results_in_any_collection.difference(results_tmp) else: if of.startswith("h"): print_warning(req, "Invalid set operation %s." % op2, "Error") results_in_any_collection.calculate_nbhits() except: if of.startswith("h"): req.write(create_error_box(req, verbose=verbose, ln=ln)) req.write(create_google_box(cc, p, f, p1, p2, p3, ln)) return page_end(req, of, ln) else: ## 3B - simple search try: results_in_any_collection = search_pattern(req, p, f, ap=ap, of=of, verbose=verbose, ln=ln) except: if of.startswith("h"): req.write(create_error_box(req, verbose=verbose, ln=ln)) req.write(create_google_box(cc, p, f, p1, p2, p3, ln)) return page_end(req, of, ln) if results_in_any_collection._nbhits == 0: if of.startswith("h"): req.write(create_google_box(cc, p, f, p1, p2, p3, ln)) return page_end(req, of, ln) | 77860f4e5d732765c14e8d50d4cec6133d081c82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/77860f4e5d732765c14e8d50d4cec6133d081c82/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
3072,
12,
3658,
33,
7036,
16,
4946,
33,
71,
2377,
529,
16,
276,
33,
7036,
16,
293,
1546,
3113,
284,
1546,
3113,
14524,
1546,
2163,
3113,
9033,
1546,
3113,
1427,
154... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
3072,
12,
3658,
33,
7036,
16,
4946,
33,
71,
2377,
529,
16,
276,
33,
7036,
16,
293,
1546,
3113,
284,
1546,
3113,
14524,
1546,
2163,
3113,
9033,
1546,
3113,
1427,
154... |
'--disable-webkit', '--disable-youtube' | '--disable-boo', '--disable-youtube', '--disable-gnome' | def __init__ (self): Package.__init__ (self, 'banshee-1', '1.7.3') | 93722fb098262ae12282276346cdaaa48c188fcc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14879/93722fb098262ae12282276346cdaaa48c188fcc/banshee.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
4672,
7508,
16186,
2738,
972,
261,
2890,
16,
296,
70,
634,
580,
73,
17,
21,
2187,
296,
21,
18,
27,
18,
23,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
4672,
7508,
16186,
2738,
972,
261,
2890,
16,
296,
70,
634,
580,
73,
17,
21,
2187,
296,
21,
18,
27,
18,
23,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
- 12 : forward-left - 14 : forward-right - 21 : left-forward - 41 : right-forward - 121: forward-left-forward - 141: forward-right-forward | - 12 : forward-left OK - 14 : forward-right OK - 121: forward-left-forward OK - 141: forward-right-forward OK | def generateVertexes(self, grid, start=None, end=None, tileIndexStart=None, tileIndexEnd=None): # can't use a for loop since inside I'll change i, not a very good # design though... if start == None: start = 0 if end == None: end = len(grid) if tileIndexStart == None: tileIndexStart = 0 if tileIndexEnd == None: tileIndexEnd = len(grid[0]) for i,r in enumerate(grid): for j,col in enumerate(r): if col is not None: pass#print i,j, "|", col.y, col.x,col.direction while start < end: row = grid[start] """ Read the whole row, detect the curves. Possible cases are: - 12 : forward-left - 14 : forward-right - 21 : left-forward - 41 : right-forward - 121: forward-left-forward - 141: forward-right-forward """ case = None tiles = filter(lambda x: x is not None, row[tileIndexStart:]) if len(tiles) > 0: tileStr = "".join(map(lambda t: str(t.direction), tiles)) if "12" in tileStr and "21" in tileStr: logger.debug("Forward-Left-Forward detected") idx = start s = len(row) - row.index(tiles[tileStr.rfind("2")]) e = len(row) - row.index(tiles[tileStr.find("2")]) newGrid = rotateMatrixClockwise(grid) self.generateVertexes(newGrid, s-1, e, idx) # find out where to restart newEnd = 0 for col in newGrid[e-1]: if col is not None and col.x > newEnd: newEnd = col.x # I need to increase it by the width of the curve start = int(newEnd) -1 continue elif "21" in tileStr: logger.debug("Curve left detected") idx = start s = len(row) - row.index(tiles[tileStr.rfind("2")]) e = len(grid) # TODO probably wrong, try the one on flf newGrid = rotateMatrixClockwise(grid) | 225697350492711b09cc292c7229559fdda28fd4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7999/225697350492711b09cc292c7229559fdda28fd4/preview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
6475,
281,
12,
2890,
16,
3068,
16,
787,
33,
7036,
16,
679,
33,
7036,
16,
4769,
1016,
1685,
33,
7036,
16,
4769,
1016,
1638,
33,
7036,
4672,
468,
848,
1404,
999,
279,
364,
2798,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
6475,
281,
12,
2890,
16,
3068,
16,
787,
33,
7036,
16,
679,
33,
7036,
16,
4769,
1016,
1685,
33,
7036,
16,
4769,
1016,
1638,
33,
7036,
4672,
468,
848,
1404,
999,
279,
364,
2798,
... |
(0.52848223531423055, 4.1633141378838452e-11, 231, 0) | (0.52848223531423055, 4.163...e-11, 231, 0) | def nintegral(self, x, a, b, desired_relative_error='1e-8', maximum_num_subintervals=200): r""" Return a floating point machine precision numerical approximation to the integral of self from a to b, computed using floating point arithmetic via maxima. | 91e9cad27aeebb16c13e55875b5b8464eecb56e1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/91e9cad27aeebb16c13e55875b5b8464eecb56e1/calculus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
14970,
23811,
12,
2890,
16,
619,
16,
279,
16,
324,
16,
6049,
67,
11626,
67,
1636,
2218,
21,
73,
17,
28,
2187,
4207,
67,
2107,
67,
1717,
19812,
33,
6976,
4672,
436,
8395,
2000,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
14970,
23811,
12,
2890,
16,
619,
16,
279,
16,
324,
16,
6049,
67,
11626,
67,
1636,
2218,
21,
73,
17,
28,
2187,
4207,
67,
2107,
67,
1717,
19812,
33,
6976,
4672,
436,
8395,
2000,
2... |
res.append(get_proxy_attr_obj(arg)) | obj = get_proxy_attr_obj(arg) if is_proxy(obj): res.append(obj.wx_obj) else: res.append(obj) | def dereference_arglist(lst): """ Scan for proxy objects and convert to underlying object """ res = [] for arg in lst: if is_proxy(arg): res.append(arg.wx_obj) #print 'dereferenced ', arg.wx_obj elif is_proxy_attr(arg): res.append(get_proxy_attr_obj(arg)) else: res.append(arg) return res | 4d50a24916bde5ccf37876de92ba8f8d8c0a41c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/4d50a24916bde5ccf37876de92ba8f8d8c0a41c4/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
27794,
67,
3175,
1098,
12,
16923,
4672,
3536,
8361,
364,
2889,
2184,
471,
1765,
358,
6808,
733,
3536,
400,
273,
5378,
364,
1501,
316,
9441,
30,
309,
353,
67,
5656,
12,
3175,
4672,
400,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
27794,
67,
3175,
1098,
12,
16923,
4672,
3536,
8361,
364,
2889,
2184,
471,
1765,
358,
6808,
733,
3536,
400,
273,
5378,
364,
1501,
316,
9441,
30,
309,
353,
67,
5656,
12,
3175,
4672,
400,
... |
version="0.91", | version="0.91.1", | def main(): import glob from aksetup_helper import hack_distutils, get_config, setup, \ PyUblasExtension, NumpyExtension hack_distutils() conf = get_config(get_config_schema()) LIBRARY_DIRS = conf["BOOST_LIB_DIR"] LIBRARIES = conf["BOOST_PYTHON_LIBNAME"] from os.path import dirname, join, normpath if conf["CUDA_ROOT"] is None: nvcc_path = search_on_path("nvcc") if nvcc_path is None: print "*** CUDA_ROOT not set, and nvcc not in path. Giving up." import sys sys.exit(1) conf["CUDA_ROOT"] = normpath(join(dirname(nvcc_path), "..")) if conf["CUDA_INC_DIR"] is None: conf["CUDA_INC_DIR"] = [join(conf["CUDA_ROOT"], "include")] if not conf["CUDADRV_LIB_DIR"]: conf["CUDADRV_LIB_DIR"] = [join(conf["CUDA_ROOT"], "lib")] EXTRA_DEFINES = { } EXTRA_INCLUDE_DIRS = [] EXTRA_LIBRARY_DIRS = [] EXTRA_LIBRARIES = [] INCLUDE_DIRS = ['src/cpp'] + conf["BOOST_INC_DIR"] + conf["CUDA_INC_DIR"] conf["USE_CUDA"] = True import sys if 'darwin' in sys.platform: # prevent from building ppc since cuda on OS X is not compiled for ppc if "-arch" not in conf["CXXFLAGS"]: conf["CXXFLAGS"].extend(['-arch', 'i386']) if "-arch" not in conf["LDFLAGS"]: conf["LDFLAGS"].extend(['-arch', 'i386']) setup(name="pycuda", # metadata version="0.91", description="Python wrapper for Nvidia CUDA", long_description=""" PyCuda lets you access `Nvidia <http://nvidia.com>`_'s `CUDA <http://nvidia.com/cuda/>`_ parallel computation API from Python. Several wrappers of the CUDA API already exist-so what's so special about PyCuda? * Object cleanup tied to lifetime of objects. This idiom, often called `RAII <http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization>`_ in C++, makes it much easier to write correct, leak- and crash-free code. PyCuda knows about dependencies, too, so (for example) it won't detach from a context before all memory allocated in it is also freed. * Convenience. Abstractions like pycuda.driver.SourceModule and pycuda.gpuarray.GPUArray make CUDA programming even more convenient than with Nvidia's C-based runtime. * Completeness. PyCuda puts the full power of CUDA's driver API at your disposal, if you wish. * Automatic Error Checking. All CUDA errors are automatically translated into Python exceptions. * Speed. PyCuda's base layer is written in C++, so all the niceties above are virtually free. * Helpful `Documentation <http://tiker.net/doc/pycuda>`_. """, author=u"Andreas Kloeckner", author_email="inform@tiker.net", license = "MIT", url="http://mathema.tician.de/software/pycuda", classifiers=[ 'Environment :: Console', 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: Other Audience', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Programming Language :: C++', 'Programming Language :: Python', 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Mathematics', 'Topic :: Scientific/Engineering :: Physics', 'Topic :: Scientific/Engineering :: Visualization', ], # build info packages=["pycuda"], zip_safe=False, install_requires=[ "pytools>=7", ], package_dir={"pycuda": "src/python"}, ext_package="pycuda", ext_modules=[ NumpyExtension("_driver", [ "src/cpp/cuda.cpp", "src/wrapper/wrap_cudadrv.cpp", "src/wrapper/tools.cpp", ], include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS, library_dirs=LIBRARY_DIRS + conf["CUDADRV_LIB_DIR"], libraries=LIBRARIES + conf["CUDADRV_LIBNAME"], define_macros=list(EXTRA_DEFINES.iteritems()), extra_compile_args=conf["CXXFLAGS"], extra_link_args=conf["LDFLAGS"], ), ] ) | 399b6c1af02580bef858319b886734b14ab2aadf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12870/399b6c1af02580bef858319b886734b14ab2aadf/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1930,
4715,
628,
20952,
8401,
67,
4759,
1930,
11769,
67,
4413,
5471,
16,
336,
67,
1425,
16,
3875,
16,
521,
4707,
57,
3083,
345,
3625,
16,
6805,
2074,
3625,
225,
11769,
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,
2774,
13332,
1930,
4715,
628,
20952,
8401,
67,
4759,
1930,
11769,
67,
4413,
5471,
16,
336,
67,
1425,
16,
3875,
16,
521,
4707,
57,
3083,
345,
3625,
16,
6805,
2074,
3625,
225,
11769,
67,
... |
self.addLineToPage([(line.center(self.width, u'⠀'), object)]) | self.addLineToPage([(line.center(self.width, u'⠀'), obj)]) | def addCenteredLine(self, text, object=None): for line in textwrap.wrap(unicode(text), self.width): self.addLineToPage([(line.center(self.width, u'⠀'), object)]) | 33ef92586a1f46016e0adc007cb50c6fe70f43a0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8648/33ef92586a1f46016e0adc007cb50c6fe70f43a0/braillemusic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
8449,
329,
1670,
12,
2890,
16,
977,
16,
733,
33,
7036,
4672,
364,
980,
316,
30271,
18,
4113,
12,
9124,
12,
955,
3631,
365,
18,
2819,
4672,
365,
18,
1289,
1670,
774,
1964,
3816,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
8449,
329,
1670,
12,
2890,
16,
977,
16,
733,
33,
7036,
4672,
364,
980,
316,
30271,
18,
4113,
12,
9124,
12,
955,
3631,
365,
18,
2819,
4672,
365,
18,
1289,
1670,
774,
1964,
3816,
... |
self.start_download() | self.start_download(resume=resume) | def start(self): """Continues a paused or stopped download thread. """ if self.state in ('paused', 'stopped', 'offline'): self.state = "downloading" self.start_download() | acd0211a4895596a67625963d10ec1c9bf3319c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/acd0211a4895596a67625963d10ec1c9bf3319c8/download.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
3536,
660,
267,
3610,
279,
17781,
578,
9627,
4224,
2650,
18,
3536,
309,
365,
18,
2019,
316,
7707,
8774,
3668,
2187,
296,
24228,
2187,
296,
23787,
11,
4672,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
3536,
660,
267,
3610,
279,
17781,
578,
9627,
4224,
2650,
18,
3536,
309,
365,
18,
2019,
316,
7707,
8774,
3668,
2187,
296,
24228,
2187,
296,
23787,
11,
4672,
365,
18,
... |
self._config_dir = pathjoin(build_options_dir,'configs') | def __init__(self, build_options, prj_path=None, platform='', cxx='', debug='', config = None, locals=None, globals=None, projects_db = {}): | 521b17ea80b2588d7d8d2c1aac63cc163f49ab9b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8002/521b17ea80b2588d7d8d2c1aac63cc163f49ab9b/project.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1361,
67,
2116,
16,
27378,
67,
803,
33,
7036,
16,
4072,
2218,
2187,
276,
5279,
2218,
2187,
1198,
2218,
2187,
642,
273,
599,
16,
8985,
33,
7036,
16,
10941... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1361,
67,
2116,
16,
27378,
67,
803,
33,
7036,
16,
4072,
2218,
2187,
276,
5279,
2218,
2187,
1198,
2218,
2187,
642,
273,
599,
16,
8985,
33,
7036,
16,
10941... | |
if change.offset == 0: break | if change.offset == 0: break | def optimize_tightloop(self, node): if not isinstance(node, ComplexNode): return node | 55a86fc4f319ddc89439f1749954cde74fdadcf3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2040/55a86fc4f319ddc89439f1749954cde74fdadcf3/esotope-bfc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10979,
67,
88,
750,
6498,
12,
2890,
16,
756,
4672,
309,
486,
1549,
12,
2159,
16,
16060,
907,
4672,
327,
756,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10979,
67,
88,
750,
6498,
12,
2890,
16,
756,
4672,
309,
486,
1549,
12,
2159,
16,
16060,
907,
4672,
327,
756,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
by reducing the poits modulo all primes of good reduction up | by reducing the points modulo all primes of good reduction up | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. | 9932a677a12413086a59217c4c0d425b0543b6eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/9932a677a12413086a59217c4c0d425b0543b6eb/interface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5942,
295,
340,
12,
2890,
16,
943,
67,
16382,
29711,
21,
16,
14800,
67,
683,
4485,
67,
3700,
33,
8381,
4672,
436,
8395,
25793,
295,
340,
333,
720,
1655,
434,
326,
490,
517,
1165,
17,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5942,
295,
340,
12,
2890,
16,
943,
67,
16382,
29711,
21,
16,
14800,
67,
683,
4485,
67,
3700,
33,
8381,
4672,
436,
8395,
25793,
295,
340,
333,
720,
1655,
434,
326,
490,
517,
1165,
17,
... |
return self.config.get('bitten', 'templates_dir') | return self.config.get('bitten', 'templates_dir') or self.templates_dir | def get_templates_dir(self): return self.config.get('bitten', 'templates_dir') | 09ccd1787876ae409cf4e19feb0f95d37f1f3494 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4547/09ccd1787876ae409cf4e19feb0f95d37f1f3494/web_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
8502,
67,
1214,
12,
2890,
4672,
327,
365,
18,
1425,
18,
588,
2668,
3682,
2253,
2187,
296,
8502,
67,
1214,
6134,
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,
336,
67,
8502,
67,
1214,
12,
2890,
4672,
327,
365,
18,
1425,
18,
588,
2668,
3682,
2253,
2187,
296,
8502,
67,
1214,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.storage.set('seen', what, seen) self.storage.save() | if seen: self.storage.set('seen', what, seen) self.storage.save() | def _iter_messages_of(self, what, thread_wanted, only_new): if not what in self.storage.get('seen', default={}): self.storage.set('seen', what, {}) | 707cd69e4bc3c475867be49cb953a8f8db973c5c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7471/707cd69e4bc3c475867be49cb953a8f8db973c5c/backend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2165,
67,
6833,
67,
792,
12,
2890,
16,
4121,
16,
2650,
67,
25861,
16,
1338,
67,
2704,
4672,
309,
486,
4121,
316,
365,
18,
5697,
18,
588,
2668,
15156,
2187,
805,
12938,
4672,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2165,
67,
6833,
67,
792,
12,
2890,
16,
4121,
16,
2650,
67,
25861,
16,
1338,
67,
2704,
4672,
309,
486,
4121,
316,
365,
18,
5697,
18,
588,
2668,
15156,
2187,
805,
12938,
4672,
365,
... |
print 'FROM LAST FETCH', time.time() - self.last_fetch self.last_fetch = time.time() print 'QUEUE SIZE', self.job_queue.qsize() | def fetch_url(self, url, filename=None, opener=None, callback=None): """Fetch given URL @param url: URL to fetch @type url: str @param filename: if given, write fetched content to file with filename @type filename: basestring @param opener: if given, use this opener to fetch the URL @type opener: L{urlib2.OpenerDirector} """ print 'FROM LAST FETCH', time.time() - self.last_fetch self.last_fetch = time.time() print 'QUEUE SIZE', self.job_queue.qsize() if not self.started: self.started = True for i in range(self.num_threads): FetcherThread(self).start() atexit.register(self.kill_threads) self.job_queue.put({ 'url': url, 'filename': filename, 'opener': opener, 'callback': callback, }) | 1e2d0ec868850da02c1c3837e58da483a476dd3a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12391/1e2d0ec868850da02c1c3837e58da483a476dd3a/fetcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
67,
718,
12,
2890,
16,
880,
16,
1544,
33,
7036,
16,
20532,
33,
7036,
16,
1348,
33,
7036,
4672,
3536,
5005,
864,
1976,
225,
632,
891,
880,
30,
1976,
358,
2158,
632,
723,
880,
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,
2158,
67,
718,
12,
2890,
16,
880,
16,
1544,
33,
7036,
16,
20532,
33,
7036,
16,
1348,
33,
7036,
4672,
3536,
5005,
864,
1976,
225,
632,
891,
880,
30,
1976,
358,
2158,
632,
723,
880,
30... | |
ExceptionExplorer.CODE, line) | ExceptionExplorer.CODE, line, ExceptionExplorer.FILE, filename) | def __init__(self, tb): g.Frame.__init__(self, _('Stack trace (innermost last)')) | 101eafe13e746f2a95d0d91ca3e0e7b30ebfdb7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4591/101eafe13e746f2a95d0d91ca3e0e7b30ebfdb7d/debug.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8739,
4672,
314,
18,
3219,
16186,
2738,
972,
12,
2890,
16,
389,
2668,
2624,
2606,
261,
267,
82,
28055,
1142,
2506,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8739,
4672,
314,
18,
3219,
16186,
2738,
972,
12,
2890,
16,
389,
2668,
2624,
2606,
261,
267,
82,
28055,
1142,
2506,
3719,
2,
-100,
-100,
-100,
-100,
-100,
... |
if request.method == 'POST': MILLION_CONSTANT = 100000 username = request.POST.get('username', '') user_id = run_query("Select id from auth_user where username = %s", username) if len(user_id) > 0 : result = run_query("Select id from user where user_id = %s", user_id[0].get('id')) if len(result) == 0: query_string = "insert into user(id, user_id) values (%s, %s)" id = int (user_id[0].get('id')) * MILLION_CONSTANT query_args = [id, user_id[0].get('id')] cursor = connection.cursor() cursor.execute(query_string, query_args) transaction.commit_unless_managed() return HttpResponse(id) else: return HttpResponse(result[0].get('id')) else: return HttpResponse("0") else: return HttpResponse("error") | if request.method == 'POST': MILLION_CONSTANT = 100000 username = request.POST.get('username', '') user_id = run_query("Select id from auth_user where username = %s", username) if len(user_id) > 0 : result = run_query("Select id from user where user_id = %s", user_id[0].get('id')) if len(result) == 0: query_string = "insert into user(id, user_id) values (%s, %s)" id = int (user_id[0].get('id')) * MILLION_CONSTANT query_args = [id, user_id[0].get('id')] cursor = connection.cursor() cursor.execute(query_string, query_args) transaction.commit_unless_managed() return HttpResponse(id) else: return HttpResponse(result[0].get('id')) else: return HttpResponse("0") else: return HttpResponse("error") | def get_key_for_user(request): if request.method == 'POST': MILLION_CONSTANT = 100000 username = request.POST.get('username', '') user_id = run_query("Select id from auth_user where username = %s", username) if len(user_id) > 0 : result = run_query("Select id from user where user_id = %s", user_id[0].get('id')) if len(result) == 0: query_string = "insert into user(id, user_id) values (%s, %s)" id = int (user_id[0].get('id')) * MILLION_CONSTANT query_args = [id, user_id[0].get('id')] cursor = connection.cursor() cursor.execute(query_string, query_args) transaction.commit_unless_managed() return HttpResponse(id) else: return HttpResponse(result[0].get('id')) else: return HttpResponse("0") else: return HttpResponse("error") | 7759d6eb08a7e6568691e648ed314450c8afa48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11995/7759d6eb08a7e6568691e648ed314450c8afa48e/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
856,
67,
1884,
67,
1355,
12,
2293,
4672,
309,
590,
18,
2039,
422,
296,
3798,
4278,
490,
15125,
1146,
67,
25878,
273,
25259,
2718,
273,
590,
18,
3798,
18,
588,
2668,
5053,
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,
336,
67,
856,
67,
1884,
67,
1355,
12,
2293,
4672,
309,
590,
18,
2039,
422,
296,
3798,
4278,
490,
15125,
1146,
67,
25878,
273,
25259,
2718,
273,
590,
18,
3798,
18,
588,
2668,
5053,
2187... |
for dt in itertools.islice(event.rruleset, MAXRECUR): | isDate = type(event.dtstart[0].value) == datetime.date if isDate: recurrenceIter = [event.dtstart[0].value] else: recurrenceIter = itertools.islice(event.rruleset, MAXRECUR) for dt in recurrenceIter: | def importProcess(self, text, extension=None, item=None): # the item parameter is so that a share item can be passed in for us # to populate. | cd6be57bfd5a7caa2cca4c6487dcbc3f28ecaa76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/cd6be57bfd5a7caa2cca4c6487dcbc3f28ecaa76/ICalendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
2227,
12,
2890,
16,
977,
16,
2710,
33,
7036,
16,
761,
33,
7036,
4672,
468,
326,
761,
1569,
353,
1427,
716,
279,
7433,
761,
848,
506,
2275,
316,
364,
584,
468,
358,
6490,
18,
2,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
2227,
12,
2890,
16,
977,
16,
2710,
33,
7036,
16,
761,
33,
7036,
4672,
468,
326,
761,
1569,
353,
1427,
716,
279,
7433,
761,
848,
506,
2275,
316,
364,
584,
468,
358,
6490,
18,
2,... |
return except TypeError: transform = getattr(element, "_as_immutable", None) if transform is None: raise data[transform()] = value | except TypeError: transform = getattr(element, "_as_immutable", None) if transform is None: raise data[transform()] = value | def _update(self, iterable): # The main loop for update() and the subclass __init__() methods. data = self._data | c6b0d86a757ed9ca55650f22475167b7a632a27d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/c6b0d86a757ed9ca55650f22475167b7a632a27d/sets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
12,
2890,
16,
6087,
4672,
468,
1021,
2774,
2798,
364,
1089,
1435,
471,
326,
10177,
1001,
2738,
972,
1435,
2590,
18,
501,
273,
365,
6315,
892,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
12,
2890,
16,
6087,
4672,
468,
1021,
2774,
2798,
364,
1089,
1435,
471,
326,
10177,
1001,
2738,
972,
1435,
2590,
18,
501,
273,
365,
6315,
892,
2,
-100,
-100,
-100,
-100,
-100,
... |
"""Return a list of highest weight vectors and multiplicities | """ Returns a list of highest weight vectors and multiplicities | def hlist(self): """Return a list of highest weight vectors and multiplicities of the irreducible characters in self. EXAMPLE: sage: B3 = WeylCharacterRing(['B',3]) sage: B3(1/2,1/2,1/2).hlist() [[(1/2, 1/2, 1/2), 1]] """ return [[self._parent.VS(k),m] for k,m in self._hdict.iteritems()] | 0a30ee9b10542e4dc66149f6ffe87504cb679b84 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/0a30ee9b10542e4dc66149f6ffe87504cb679b84/weyl_characters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
366,
1098,
12,
2890,
4672,
3536,
2860,
279,
666,
434,
9742,
3119,
10046,
471,
3309,
1780,
1961,
434,
326,
9482,
1118,
5286,
1523,
3949,
316,
365,
18,
5675,
21373,
30,
272,
410,
30,
605,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
366,
1098,
12,
2890,
4672,
3536,
2860,
279,
666,
434,
9742,
3119,
10046,
471,
3309,
1780,
1961,
434,
326,
9482,
1118,
5286,
1523,
3949,
316,
365,
18,
5675,
21373,
30,
272,
410,
30,
605,
... |
if disp in [diTrueCPK, diBALL, diTUBES]: | if disp in (diTrueCPK, diBALL, diTUBES): | def func(special_drawing_prefs, args = (glpane, dispdef, col, level)): self.draw(*args, **dict(special_drawing_prefs = special_drawing_prefs)) | 719f793723e6cacb4e83f31d353c7969d765c359 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/719f793723e6cacb4e83f31d353c7969d765c359/chem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1326,
12,
9371,
67,
9446,
310,
67,
1484,
2556,
16,
833,
273,
261,
7043,
29009,
16,
16232,
536,
16,
645,
16,
1801,
3719,
30,
365,
18,
9446,
30857,
1968,
16,
2826,
1576,
12,
9371,
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,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1326,
12,
9371,
67,
9446,
310,
67,
1484,
2556,
16,
833,
273,
261,
7043,
29009,
16,
16232,
536,
16,
645,
16,
1801,
3719,
30,
365,
18,
9446,
30857,
1968,
16,
2826,
1576,
12,
9371,
67,
... |
safe_name = milestone.name.replace('/', '%2F') req.redirect(req.href.milestone(safe_name)) | req.redirect(req.href.milestone(milestone.name)) | def process_request(self, req): milestone_id = req.args.get('id') if not milestone_id: req.redirect(req.href.roadmap()) | 4b929d632a124d4dbdfde5d29e612fb0be3519e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/4b929d632a124d4dbdfde5d29e612fb0be3519e4/roadmap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2293,
12,
2890,
16,
1111,
4672,
28664,
67,
350,
273,
1111,
18,
1968,
18,
588,
2668,
350,
6134,
309,
486,
28664,
67,
350,
30,
1111,
18,
7590,
12,
3658,
18,
7547,
18,
5975,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1207,
67,
2293,
12,
2890,
16,
1111,
4672,
28664,
67,
350,
273,
1111,
18,
1968,
18,
588,
2668,
350,
6134,
309,
486,
28664,
67,
350,
30,
1111,
18,
7590,
12,
3658,
18,
7547,
18,
5975,
1... |
force_copy(image, '/boot/vmlinuz-' + tag) force_copy('vmlinux', '/boot/vmlinux-' + tag) force_copy('System.map', '/boot/System.map-' + tag) force_copy('.config', '/boot/config-' + tag) | force_copy(image, dir + '/boot/vmlinuz-' + tag) force_copy('vmlinux', dir + '/boot/vmlinux-' + tag) force_copy('System.map', dir + '/boot/System.map-' + tag) force_copy('.config', dir + '/boot/config-' + tag) | def install(self, tag='autotest'): """make install in the kernel tree""" os.chdir(self.build_dir) arch = get_file_arch('vmlinux') image = os.path.join('arch', arch, 'boot', self.build_target) force_copy(image, '/boot/vmlinuz-' + tag) force_copy('vmlinux', '/boot/vmlinux-' + tag) force_copy('System.map', '/boot/System.map-' + tag) force_copy('.config', '/boot/config-' + tag) if kernel_config.modules_needed('.config'): system('make modules_install') | 81e4661d28c8eda73a424c3a37fe6dbc6c2a2220 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12268/81e4661d28c8eda73a424c3a37fe6dbc6c2a2220/kernel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
12,
2890,
16,
1047,
2218,
5854,
352,
395,
11,
4672,
3536,
6540,
3799,
316,
326,
5536,
2151,
8395,
1140,
18,
343,
1214,
12,
2890,
18,
3510,
67,
1214,
13,
6637,
273,
336,
67,
768,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
12,
2890,
16,
1047,
2218,
5854,
352,
395,
11,
4672,
3536,
6540,
3799,
316,
326,
5536,
2151,
8395,
1140,
18,
343,
1214,
12,
2890,
18,
3510,
67,
1214,
13,
6637,
273,
336,
67,
768,
... |
phrase = L | if is_64bit_linux: phrase = '[C\x1b[C\n' else: phrase = L | def eval(self, code, strip=True): self._synchronize() code = str(code) code = code.strip() code = code.replace('\n',' ') x = [] for L in code.split('\n'): if L != '': try: s = self.__in_seq + 1 pr = '\[%s\]>'%s M = self._eval_line(L, wait_for_prompt=self._prompt) phrase = L #phrase = '[C\x1b[C\n' i = M.rfind(phrase) if i > 1: M = M[i+len(phrase):] x.append(M.strip()) self.__in_seq = s except KeyboardInterrupt: self._keyboard_interrupt() except TypeError, s: return 'error evaluating "%s":\n%s'%(code,s) return '\n'.join(x) | 83d5e463974acf105ad7eaa07d4799207f89ac9c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/83d5e463974acf105ad7eaa07d4799207f89ac9c/lisp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5302,
12,
2890,
16,
981,
16,
2569,
33,
5510,
4672,
365,
6315,
87,
2600,
554,
1435,
981,
273,
609,
12,
710,
13,
981,
273,
981,
18,
6406,
1435,
981,
273,
981,
18,
2079,
2668,
64,
82,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
981,
16,
2569,
33,
5510,
4672,
365,
6315,
87,
2600,
554,
1435,
981,
273,
609,
12,
710,
13,
981,
273,
981,
18,
6406,
1435,
981,
273,
981,
18,
2079,
2668,
64,
82,
... |
base = base + ', digest="%s"' % entdig if algorithm != 'MD5': base = base + ', algorithm="%s"' % algorithm | base += ', digest="%s"' % entdig base += ', algorithm="%s"' % algorithm | def get_authorization(self, req, chal): try: realm = chal['realm'] nonce = chal['nonce'] qop = chal.get('qop') algorithm = chal.get('algorithm', 'MD5') # mod_digest doesn't send an opaque, even though it isn't # supposed to be optional opaque = chal.get('opaque', None) except KeyError: return None | b300ae3a79624867cad30fddfb3350f9c731f21c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b300ae3a79624867cad30fddfb3350f9c731f21c/urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
12218,
12,
2890,
16,
1111,
16,
462,
287,
4672,
775,
30,
11319,
273,
462,
287,
3292,
24056,
3546,
7448,
273,
462,
287,
3292,
12824,
3546,
1043,
556,
273,
462,
287,
18,
588,
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,
336,
67,
12218,
12,
2890,
16,
1111,
16,
462,
287,
4672,
775,
30,
11319,
273,
462,
287,
3292,
24056,
3546,
7448,
273,
462,
287,
3292,
12824,
3546,
1043,
556,
273,
462,
287,
18,
588,
266... |
EXAMPLES: | EXAMPLES:: | def strip_string_literals(code, state=None): r""" Returns a string with all literal quotes replaced with labels and a dict of labels for re-subsitution. This makes parsing much easier. EXAMPLES: sage: from sage.misc.preparser import strip_string_literals sage: s, literals, state = strip_string_literals(r'''['a', "b", 'c', "d\""]''') sage: s '[%(L1)s, %(L2)s, %(L3)s, %(L4)s]' sage: literals {'L4': '"d\\""', 'L2': '"b"', 'L3': "'c'", 'L1': "'a'"} sage: print s % literals ['a', "b", 'c', "d\""] sage: print strip_string_literals(r'-"\\\""-"\\"-')[0] -%(L1)s-%(L2)s- Triple-quotes are handled as well. sage: s, literals, state = strip_string_literals("[a, '''b''', c, '']") sage: s '[a, %(L1)s, c, %(L2)s]' sage: print s % literals [a, '''b''', c, ''] Comments are subsituted too: sage: s, literals, state = strip_string_literals("code '#' # ccc 't'"); s 'code %(L1)s #%(L2)s' sage: s % literals "code '#' # ccc 't'" A state is returned so one can break strings across multiple calls to this function: sage: s, literals, state = strip_string_literals('s = "some'); s 's = %(L1)s' sage: s, literals, state = strip_string_literals('thing" * 5', state); s '%(L1)s * 5' """ new_code = [] literals = {} counter = 0 start = q = 0 if state is None: in_quote = False raw = False else: in_quote, raw = state while True: sig_q = code.find("'", q) dbl_q = code.find('"', q) hash_q = code.find('#', q) q = min(sig_q, dbl_q) if q == -1: q = max(sig_q, dbl_q) if not in_quote and hash_q != -1 and (q == -1 or hash_q < q): # it's a comment newline = code.find('\n', hash_q) if newline == -1: newline = len(code) counter += 1 label = "L%s" % counter literals[label] = code[hash_q+1:newline] new_code.append(code[start:hash_q].replace('%','%%')) new_code.append("#%%(%s)s" % label) start = q = newline elif q == -1: if in_quote: counter += 1 label = "L%s" % counter literals[label] = code[start:] new_code.append("%%(%s)s" % label) else: new_code.append(code[start:].replace('%','%%')) break elif in_quote: if not raw and code[q-1] == '\\': k = 2 while code[q-k] == '\\': k += 1 if k % 2 == 0: q += 1 if code[q:q+len(in_quote)] == in_quote: counter += 1 label = "L%s" % counter literals[label] = code[start:q+len(in_quote)] new_code.append("%%(%s)s" % label) q += len(in_quote) start = q in_quote = False else: q += 1 else: raw = q>0 and code[q-1] in 'rR' if len(code) >= q+3 and (code[q+1] == code[q] == code[q+2]): in_quote = code[q]*3 else: in_quote = code[q] new_code.append(code[start:q].replace('%', '%%')) start = q q += len(in_quote) return "".join(new_code), literals, (in_quote, raw) | 5a2c96c32563a398062508fd709c7a214197b32d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/5a2c96c32563a398062508fd709c7a214197b32d/preparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2569,
67,
1080,
67,
80,
11235,
12,
710,
16,
919,
33,
7036,
4672,
436,
8395,
2860,
279,
533,
598,
777,
7158,
10681,
8089,
598,
3249,
471,
279,
2065,
434,
3249,
364,
283,
17,
22284,
305,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2569,
67,
1080,
67,
80,
11235,
12,
710,
16,
919,
33,
7036,
4672,
436,
8395,
2860,
279,
533,
598,
777,
7158,
10681,
8089,
598,
3249,
471,
279,
2065,
434,
3249,
364,
283,
17,
22284,
305,... |
s = shelve.open(self.fn, protocol=0) | def test_ascii_file_shelf(self): try: s = shelve.open(self.fn, protocol=0) s['key1'] = (1,2,3,4) self.assertEqual(s['key1'], (1,2,3,4)) s.close() finally: for f in glob.glob(self.fn+"*"): os.unlink(f) | f56409765faa2cd669bceb1203129d302370ef99 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/f56409765faa2cd669bceb1203129d302370ef99/test_shelve.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9184,
67,
768,
67,
674,
19079,
12,
2890,
4672,
775,
30,
272,
3292,
856,
21,
3546,
273,
261,
21,
16,
22,
16,
23,
16,
24,
13,
365,
18,
11231,
5812,
12,
87,
3292,
856,
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,
67,
9184,
67,
768,
67,
674,
19079,
12,
2890,
4672,
775,
30,
272,
3292,
856,
21,
3546,
273,
261,
21,
16,
22,
16,
23,
16,
24,
13,
365,
18,
11231,
5812,
12,
87,
3292,
856,
21,
... | |
product_dir, utils_module_file = os.path.split( __file__ ) | def directlyProvides(obj, *interfaces): obj.__implements__ = ( getattr( obj.__class__, '__implements__', () ) + tuple( interfaces ) ) | e58f55338e3ae53924affa4e6e9b7c5bef83a609 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/e58f55338e3ae53924affa4e6e9b7c5bef83a609/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5122,
17727,
12,
2603,
16,
380,
15898,
4672,
1081,
16186,
17061,
972,
273,
261,
3869,
12,
1081,
16186,
1106,
972,
16,
4940,
17061,
972,
2187,
1832,
262,
397,
3193,
12,
7349,
262,
262,
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,
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,
5122,
17727,
12,
2603,
16,
380,
15898,
4672,
1081,
16186,
17061,
972,
273,
261,
3869,
12,
1081,
16186,
1106,
972,
16,
4940,
17061,
972,
2187,
1832,
262,
397,
3193,
12,
7349,
262,
262,
2,... | |
displayname = "Baseboard Management Controller (BMC) for %s" % biosHdr.getProductName(), | displayname = "System BIOS for %s" % biosHdr.getProductName(), | def BootstrapGenerator(base=None, cb=None, *args, **kargs): sysId = biosHdr.getSystemId() biosVer = biosHdr.getSystemBiosVer() yield package.Device( name = ("bmc_firmware(ven_0x1028_dev_0x%04x)" % sysId).lower(), displayname = "System BIOS for %s" % biosHdr.getProductName(), version = biosVer, ) yield package.Device( name = ("system_bios(ven_0x1028_dev_0x%04x)" % sysId).lower(), displayname = "Baseboard Management Controller (BMC) for %s" % biosHdr.getProductName(), version = biosVer, ) # output all normal PCI bootstrap packages with system-specific name pymod = "firmwaretools.bootstrap_pci" module = __import__(pymod, globals(), locals(), []) for i in pymod.split(".")[1:]: module = getattr(module, i) for pkg in module.BootstrapGenerator(base=base, cb=cb, *args, **kargs): pkg.name = "%s/%s" % (pkg.name, "system(ven_0x1028_dev_0x%04x)" % sysId) yield pkg | 07d8efcebda72bc18b597f81cf5654439479359c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/36/07d8efcebda72bc18b597f81cf5654439479359c/dellbios.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11830,
3908,
12,
1969,
33,
7036,
16,
2875,
33,
7036,
16,
380,
1968,
16,
2826,
79,
1968,
4672,
2589,
548,
273,
324,
7441,
14659,
18,
588,
3163,
548,
1435,
324,
7441,
3945,
273,
324,
744... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11830,
3908,
12,
1969,
33,
7036,
16,
2875,
33,
7036,
16,
380,
1968,
16,
2826,
79,
1968,
4672,
2589,
548,
273,
324,
7441,
14659,
18,
588,
3163,
548,
1435,
324,
7441,
3945,
273,
324,
744... |
if output_fname: | png_thumbnail = None png_data = None svg_data = None png_output_fname = None if commit: png_thumbnail = StringIO.StringIO() png_data = StringIO.StringIO() svg_data = StringIO.StringIO() pylab.savefig(png_thumbnail, format='png', dpi=40) pylab.savefig(png_data, format='png', dpi=300) pylab.savefig(svg_data, format='svg', dpi=300) elif output_fname: png_output_fname = output_fname | def plotCurve(cls, rdata, no_of_top_snps_info, min_distance_info, output_fname=None, need_svg=False): """ 2008-10-29 draw candidate ratio, non-candidate ratio, pvalues etc against score cutoff at different distances. """ sys.stderr.write("Plotting curves ... ") pylab.clf() #fig = Figure() fig = pylab.gcf() #canvas = FigureCanvasAgg(fig) #calculate the number of rows needed according to how many score_rank_data, always two-column pylab.subplots_adjust(left=0.08, right=0.92,bottom = 0.05, hspace = 0.3) no_of_rows = rdata.data_matrix.shape[1] legend_ls = [] patch_ls = [] pd = PassingData(left_1st_ax = None, right_1st_ax = None, min_x = None, max_x = None) for i in range(rdata.data_matrix.shape[1]): pd = cls.plotSubCurve(rdata, no_of_top_snps_info, min_distance_info, i, no_of_rows=no_of_rows, \ legend_ls=legend_ls, patch_ls=patch_ls, pd=pd) #put a main title and single legend for all plots ax = pylab.axes([0.1, 0.1, 0.9, 0.9], frameon=False) ax.set_xticks([]) ax.set_yticks([]) ax.legend(patch_ls, legend_ls, loc='upper right', handlelen=0.02) pd.left_1st_ax.set_xlim([pd.min_x-0.2, pd.max_x+0.2]) pd.right_1st_ax.set_xlim([pd.min_x-0.2, pd.max_x+0.2]) """ #put a main title and single legend for all plots ax = pylab.axes([0.1, 0.1, 0.8, 0.85], frameon=False) ax.set_xticks([]) ax.set_yticks([]) title = '%s by %s'%(self.results_id, self.list_type_id) ax.set_title(title) """ if output_fname: pylab.savefig('%s'%output_fname, dpi=300) if need_svg: pylab.savefig('%s.svg'%output_fname, dpi=300) sys.stderr.write("Done.\n") | a419170eae9b455921b4003eb7af109dabd831e2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9645/a419170eae9b455921b4003eb7af109dabd831e2/DrawTopSNPTest2DMapForOneRM.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
9423,
12,
6429,
16,
24291,
16,
1158,
67,
792,
67,
3669,
67,
8134,
1121,
67,
1376,
16,
1131,
67,
8969,
67,
1376,
16,
876,
67,
12749,
33,
7036,
16,
1608,
67,
11451,
33,
8381,
467... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
9423,
12,
6429,
16,
24291,
16,
1158,
67,
792,
67,
3669,
67,
8134,
1121,
67,
1376,
16,
1131,
67,
8969,
67,
1376,
16,
876,
67,
12749,
33,
7036,
16,
1608,
67,
11451,
33,
8381,
467... |
functions = [] | functions = {} names_to_functions = {} | def run_tests(start, full=False): os.path.walk(start, lister, full) functions = [] for module in modules: # Create a function that'll test a particular module. module=module # is a hack to force python to evaluate the params now. We then # rename the function to make error reporting nicer. run_module = lambda module=module: run_test(module) run_module.__name__ = '.'.join(module) functions.append(run_module) try: dargs = {} if debug: dargs['max_simultaneous_procs'] = 1 pe = parallel.ParallelExecute(functions, **dargs) pe.run_until_completion() except parallel.ParallelError, err: return err.errors return [] | 78d5a60a153b05fd0a0657beaee98eab5069b074 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/78d5a60a153b05fd0a0657beaee98eab5069b074/unittest_suite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
12,
1937,
16,
1983,
33,
8381,
4672,
1140,
18,
803,
18,
11348,
12,
1937,
16,
666,
264,
16,
1983,
13,
225,
4186,
273,
2618,
1257,
67,
869,
67,
10722,
273,
2618,
364,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
12,
1937,
16,
1983,
33,
8381,
4672,
1140,
18,
803,
18,
11348,
12,
1937,
16,
666,
264,
16,
1983,
13,
225,
4186,
273,
2618,
1257,
67,
869,
67,
10722,
273,
2618,
364,
1... |
We know in to calculate unconditional probabilities (not based on | To calculate unconditional probabilities (not based on | def ReinterpretUncondEvent(event, z): """ We know in to calculate unconditional probabilities (not based on each coealescing lineages' present states), "m_1" and "m_2" are treated as "s_b_arrow_t", and "kappa" is treated as either "s_bb", "s_tt", or "s_bt". This method "reinterprets" the event for unconditional probabilities. Input parameters ---------------- event An event operator, UnconditionalTransitionProbability and MaketransitionMatrixForLevel for more details. An event could be either one of the following: "m_1", "m_2", "s_b_arrow_t", "kappa", "s_bb", "s_tt", or "s_bt" z a 4-tuple (q_t, r_t, x_1, x_2) Details ------- In unconditional probability calculations, event 'kappa' is treated as (a) 's_bb' if the state of the next-coalescing lineages is (0, 0) (b) 's_tt' if the state of the two next-coalescing lineages is (1, 1). (c) 's_bt' is the state of the next-coalescing lineages is (1, 0) or (0, 1) For instance, if event kappa operates on z=(5,2,1,0), then this must be a "s_bt" speciation event. Return value ------------ A string as "s_bb", "s_tt", "s_bt", or "s_b_arrow_t", "m_1",or "m_2" """ if (event=="kappa"): (x_1,x_2) = z[2:4] map = {(0,0):"s_bb", (1,1):"s_tt", (1,0):"s_bt", (0,1):"s_bt"} return map[(x_1,x_2)] return event; | 7faf202b1836f91fc50c86fe3b92f5a5d79dc08b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7945/7faf202b1836f91fc50c86fe3b92f5a5d79dc08b/cjumpchain.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
868,
24713,
984,
10013,
1133,
12,
2575,
16,
998,
4672,
3536,
2974,
4604,
6301,
1434,
6457,
17958,
261,
902,
2511,
603,
1517,
6256,
287,
742,
310,
980,
1023,
11,
3430,
5493,
3631,
315,
81... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
868,
24713,
984,
10013,
1133,
12,
2575,
16,
998,
4672,
3536,
2974,
4604,
6301,
1434,
6457,
17958,
261,
902,
2511,
603,
1517,
6256,
287,
742,
310,
980,
1023,
11,
3430,
5493,
3631,
315,
81... |
if len(arglist)>1: order=len(arglist[1]) else: | try: order=int(arglist[1]) except IndexError: | def _setMarkovBG(self,arglist=None): "Arguments: bgSampleSequence [order]\nBackground sample sequence and order of the model or saved background file." if len(arglist)>1: order=len(arglist[1]) else: order=4 try: self.setMarkovBG(arglist[0],order) except Exception,e: print "No such sequence or saved background (%s). Markov background not set."%(str(e)) return | e11e852e45c2f92edf09dc52192724964ca052d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11674/e11e852e45c2f92edf09dc52192724964ca052d0/Commandline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
3882,
1527,
30098,
12,
2890,
16,
3175,
1098,
33,
7036,
4672,
315,
4628,
30,
7611,
8504,
4021,
306,
1019,
13944,
82,
8199,
3296,
3102,
471,
1353,
434,
326,
938,
578,
5198,
5412,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
542,
3882,
1527,
30098,
12,
2890,
16,
3175,
1098,
33,
7036,
4672,
315,
4628,
30,
7611,
8504,
4021,
306,
1019,
13944,
82,
8199,
3296,
3102,
471,
1353,
434,
326,
938,
578,
5198,
5412,... |
Returns the adjacency matrix of the digraph. Each vertex is represented by its position in the list returned by the vertices() | Returns the adjacency matrix of the digraph as a matrix over the field of two elements. Each vertex is represented by its position in the list returned by the vertices() | def adjacency_matrix(self, sparse=True): """ Returns the adjacency matrix of the digraph. Each vertex is represented by its position in the list returned by the vertices() function. | 626a82169bd0d544dddaa7c64848161784242a7e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/626a82169bd0d544dddaa7c64848161784242a7e/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25220,
67,
5667,
12,
2890,
16,
9387,
33,
5510,
4672,
3536,
2860,
326,
25220,
3148,
434,
326,
3097,
1483,
487,
279,
3148,
1879,
326,
652,
434,
2795,
2186,
18,
8315,
5253,
353,
10584,
635,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25220,
67,
5667,
12,
2890,
16,
9387,
33,
5510,
4672,
3536,
2860,
326,
25220,
3148,
434,
326,
3097,
1483,
487,
279,
3148,
1879,
326,
652,
434,
2795,
2186,
18,
8315,
5253,
353,
10584,
635,... |
l = Link(mlist.GetRelativeScriptURL('edithtml') + '/' + template, info) | l = Link(mlist.GetScriptURL('edithtml') + '/' + template, info) | def main(): template_data = ( ('listinfo.html', 'General list information page'), ('subscribe.html', 'Subscribe results page'), ('options.html', 'User specific options page'), ('handle_opts.html', 'Changing user options results page'), ) doc = Document() path = os.environ['PATH_INFO'] parts = Utils.GetPathPieces(path) if len(parts) < 1: doc.AddItem(Header(2, "List name is required.")) print doc.Format(bgcolor='#ffffff') return listname = string.lower(parts[0]) try: mlist = MailList.MailList(listname, lock=0) except Errors.MMListError, e: doc.AddItem(Header(2, 'No such list <em>%s</em>' % listname)) print doc.Format(bgcolor='#ffffff') syslog('error', 'No such list "%s": %s\n' % (listname, e)) return # get the list._template_dir attribute HTMLFormatter.InitVars(mlist) if len(parts) > 1: template_name = parts[1] for (template, info) in template_data: if template == template_name: template_info = info doc.SetTitle('%s -- Edit html for %s' % (mlist.real_name, template_info)) break else: doc.SetTitle('Edit HTML : Error') doc.AddItem(Header(2, "%s: Invalid template" % template_name)) doc.AddItem(mlist.GetMailmanFooter()) print doc.Format(bgcolor='#ffffff') return else: doc.SetTitle('%s -- HTML Page Editing' % mlist.real_name) doc.AddItem(Header(1, '%s -- HTML Page Editing' % mlist.real_name)) doc.AddItem(Header(2, 'Select page to edit:')) template_list = UnorderedList() for (template, info) in template_data: l = Link(mlist.GetRelativeScriptURL('edithtml') + '/' + template, info) template_list.AddItem(l) doc.AddItem(FontSize("+2", template_list)) doc.AddItem(mlist.GetMailmanFooter()) print doc.Format(bgcolor='#ffffff') return try: cgi_data = cgi.FieldStorage() if len(cgi_data.keys()): if not cgi_data.has_key('adminpw'): m = 'Error: You must supply the admin password to edit html.' doc.AddItem(Header(3, Italic(FontAttr(m, color="ff5060")))) doc.AddItem('<hr>') else: try: mlist.ConfirmAdminPassword(cgi_data['adminpw'].value) ChangeHTML(mlist, cgi_data, template_name, doc) except Errors.MMBadPasswordError: m = 'Error: Incorrect admin password.' doc.AddItem(Header(3, Italic(FontAttr(m, color="ff5060")))) doc.AddItem('<hr>') FormatHTML(mlist, doc, template_name, template_info) finally: doc.AddItem(mlist.GetMailmanFooter()) print doc.Format(bgcolor='#ffffff') | 350031009f036b51a0266684821907b52c72df01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/350031009f036b51a0266684821907b52c72df01/edithtml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1542,
67,
892,
273,
261,
7707,
1098,
1376,
18,
2620,
2187,
565,
296,
12580,
666,
1779,
1363,
19899,
7707,
9174,
18,
2620,
2187,
282,
296,
16352,
1686,
1363,
19899,
7707,
2116,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1542,
67,
892,
273,
261,
7707,
1098,
1376,
18,
2620,
2187,
565,
296,
12580,
666,
1779,
1363,
19899,
7707,
9174,
18,
2620,
2187,
282,
296,
16352,
1686,
1363,
19899,
7707,
2116,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.