rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
scripts=['web/pyblosxom.cgi', 'web/xmlrpc.cgi'], | def Walk(root='.'): """ A really really scaled down version of what we have in tools.py. """ # initialize result = [] # must have at least root folder try: names = os.listdir(root) except os.error: return result # check each file for name in names: fullname = os.path.normpath(os.path.join(root, name)) # recursively scan other folders, appending results if os.path.isdir(fullname) and not os.path.islink(fullname): result.append(fullname) result = result + Walk(fullname) return result | 2a7ec182b59371d32fb2bca9aad506801e78f81e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11836/2a7ec182b59371d32fb2bca9aad506801e78f81e/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7564,
12,
3085,
2218,
1093,
4672,
3536,
432,
8654,
8654,
12304,
2588,
1177,
434,
4121,
732,
1240,
316,
8513,
18,
2074,
18,
3536,
468,
4046,
563,
273,
5378,
225,
468,
1297,
1240,
622,
452... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7564,
12,
3085,
2218,
1093,
4672,
3536,
432,
8654,
8654,
12304,
2588,
1177,
434,
4121,
732,
1240,
316,
8513,
18,
2074,
18,
3536,
468,
4046,
563,
273,
5378,
225,
468,
1297,
1240,
622,
452... | |
if menuw.menustack[1] == menuw.menustack[-1]: self.main_menu_selected = menuw.all_items.index(menuw.menustack[1].selected) | menu = menuw.menustack[1] sel = menu.choices.index(menu.selected) | def eventhandler(self, event = None, menuw=None): """ eventhandler for the main menu. The menu must be regenerated when a disc in a rom drive changes """ if event == rc.IDENTIFY_MEDIA: if not menuw: # this shouldn't happen menuw = menu.get_singleton() | c597eabb07d1d19996e3517901c2c154305ed589 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/c597eabb07d1d19996e3517901c2c154305ed589/mediamenu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
871,
4176,
12,
2890,
16,
871,
273,
599,
16,
3824,
91,
33,
7036,
4672,
3536,
871,
4176,
364,
326,
2774,
3824,
18,
1021,
3824,
1297,
506,
960,
7489,
1347,
279,
19169,
316,
279,
24137,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
871,
4176,
12,
2890,
16,
871,
273,
599,
16,
3824,
91,
33,
7036,
4672,
3536,
871,
4176,
364,
326,
2774,
3824,
18,
1021,
3824,
1297,
506,
960,
7489,
1347,
279,
19169,
316,
279,
24137,
14... |
def render_title(self, ctx, data): t = data.get('ptitle') if t == '': t = data.get('ttitle') t = clean(t) return ctx.tag(value=t) def render_body(self, ctx, data): return ctx.tag[data.get('pbody')] def render_onclick(self, ctx, data): return ctx.tag(onclick="removeNode('replform_%s'); return \ false;" % (data.get('pid'))) def render_form(self, ctx, data): return ctx.tag(id="replform_%s" % data.get('pid')) | def fillReply(ctx, d): ctx.tag.fillSlots('id', d.get('pid')) ctx.tag.fillSlots('edit', '/edit.xhtml') ctx.tag.fillSlots('permalink', '/permalink.xhtml') ctx.tag.fillSlots('title', d.get('ttitle')) ctx.tag.fillSlots('body', d.get('pbody')) ctx.tag.fillSlots('userpref', d.get('powner')+'.xhtml') ctx.tag.fillSlots('owner', d.get('powner')) ctx.tag.fillSlots('when', pptime(d.get('pmodification'))) | def437b78d006d8dbb74e679b558c3e3d618e03a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2507/def437b78d006d8dbb74e679b558c3e3d618e03a/topic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
7817,
12,
5900,
16,
302,
4672,
1103,
18,
2692,
18,
5935,
16266,
2668,
350,
2187,
302,
18,
588,
2668,
6610,
26112,
1103,
18,
2692,
18,
5935,
16266,
2668,
4619,
2187,
1173,
4619,
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,
3636,
7817,
12,
5900,
16,
302,
4672,
1103,
18,
2692,
18,
5935,
16266,
2668,
350,
2187,
302,
18,
588,
2668,
6610,
26112,
1103,
18,
2692,
18,
5935,
16266,
2668,
4619,
2187,
1173,
4619,
18,... | |
self.bind( "<Button-1>", self._n_pressed1) self.bind( "<Shift-Button-1>", self._s_pressed1) | def set_bindings( self): if not Store.app.in_batch_mode: self.bind( "<B1-Motion>", self._drag1) self.bind( "<ButtonRelease-1>", self._release1) self.bind( "<Button-1>", self._n_pressed1) self.bind( "<Shift-Button-1>", self._s_pressed1) self.bind( "<Shift-B1-Motion>", self._drag1) self.bind( "<Delete>", self.key_pressed) self.bind( "<Key>", self.key_pressed) self.bind( "<KeyRelease>", self.key_released) self.bind( "<Enter>", self.take_focus) self.bind( "<Button-3>", self._n_pressed3) self.bind( "<Button-2>", self._n_pressed2) self.bind( "<Motion>", self._move) self.bind( "<Leave>", self._leave) # scrolling (linux only?) self.bind( "<Button-4>", lambda e: self.yview( "scroll", -1, "units")) self.bind( "<Button-5>", lambda e: self.yview( "scroll", 1, "units")) | d467b50f30c771674063d4cf9ce49960de5c707b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4298/d467b50f30c771674063d4cf9ce49960de5c707b/paper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
15863,
12,
365,
4672,
309,
486,
4994,
18,
2910,
18,
267,
67,
5303,
67,
3188,
30,
365,
18,
4376,
12,
3532,
38,
21,
17,
29360,
2984,
16,
365,
6315,
15997,
21,
13,
365,
18,
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,
444,
67,
15863,
12,
365,
4672,
309,
486,
4994,
18,
2910,
18,
267,
67,
5303,
67,
3188,
30,
365,
18,
4376,
12,
3532,
38,
21,
17,
29360,
2984,
16,
365,
6315,
15997,
21,
13,
365,
18,
4... | |
Information extracted for bpl11897_PJL-Reference.pdf which was | Information extracted for bpl11897.pdf which was | def __repr__(self): return self.message | 89e10e8d55b2bda79ac7955ff0945ef536cd818f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/486/89e10e8d55b2bda79ac7955ff0945ef536cd818f/pjl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
327,
365,
18,
2150,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
327,
365,
18,
2150,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
res = user_obj.login(db, login, password) print 'login end' return res | return user_obj.login(db, login, password) | def login(db, login, password): print 'login' pool = pooler.get_pool(db) user_obj = pool.get('res.users') res = user_obj.login(db, login, password) print 'login end' return res | c076a2877bd920d48d1ba4881bbbfb1f3fcb421d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/c076a2877bd920d48d1ba4881bbbfb1f3fcb421d/security.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3925,
12,
1966,
16,
3925,
16,
2201,
4672,
1172,
296,
5819,
11,
2845,
273,
2845,
264,
18,
588,
67,
6011,
12,
1966,
13,
729,
67,
2603,
273,
2845,
18,
588,
2668,
455,
18,
5577,
6134,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3925,
12,
1966,
16,
3925,
16,
2201,
4672,
1172,
296,
5819,
11,
2845,
273,
2845,
264,
18,
588,
67,
6011,
12,
1966,
13,
729,
67,
2603,
273,
2845,
18,
588,
2668,
455,
18,
5577,
6134,
32... |
dummy,method = vocab[0].split(',') | dummy,method = vocab[0].split(':') | def schema_update(self, fielddata, REQUEST, RESPONSE=None): """ update a single field""" | 0978f40d66d33188558b2b77e7a170fbc66ebdaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/0978f40d66d33188558b2b77e7a170fbc66ebdaf/SchemaEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1963,
67,
2725,
12,
2890,
16,
7314,
292,
449,
396,
16,
225,
12492,
16,
20645,
33,
7036,
4672,
3536,
1089,
279,
2202,
652,
8395,
2,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1963,
67,
2725,
12,
2890,
16,
7314,
292,
449,
396,
16,
225,
12492,
16,
20645,
33,
7036,
4672,
3536,
1089,
279,
2202,
652,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if env.get('_GYP'): prog = env.Program(target, source, *args, **kw) result = env.ChromeInstall('$TOP_BUILDDIR', prog) else: result = env.ComponentProgram(target, source, *args, **kw) | result = env.Program('$TOP_BUILDDIR/' + str(target), source, *args, **kw) | def ChromeProgram(env, target, source, *args, **kw): source = compilable_files(env, source) if env.get('_GYP'): prog = env.Program(target, source, *args, **kw) result = env.ChromeInstall('$TOP_BUILDDIR', prog) else: result = env.ComponentProgram(target, source, *args, **kw) if env.get('INCREMENTAL'): env.Precious(result) return result | cda151c9d268687ee11acaf8c9a17869b45c87c9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/cda151c9d268687ee11acaf8c9a17869b45c87c9/chromium_builders.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15159,
9459,
12,
3074,
16,
1018,
16,
1084,
16,
380,
1968,
16,
2826,
9987,
4672,
1084,
273,
1161,
330,
429,
67,
2354,
12,
3074,
16,
1084,
13,
563,
273,
1550,
18,
9459,
2668,
8,
10462,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15159,
9459,
12,
3074,
16,
1018,
16,
1084,
16,
380,
1968,
16,
2826,
9987,
4672,
1084,
273,
1161,
330,
429,
67,
2354,
12,
3074,
16,
1084,
13,
563,
273,
1550,
18,
9459,
2668,
8,
10462,
... |
if __debug__ and not fileName: fileName = self.defaultFileName debugFile = open(self.defaultFileName, 'wt') try: debugFile.write(self.bodyString) finally: debugFile.close() | def execute(self, fileName=""): assert len(self.bodyString) > 0, "Empty script body" | 6a2b9204b4048bdc1171dd3200c5ce719fe118ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/6a2b9204b4048bdc1171dd3200c5ce719fe118ad/CPIAScript.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
3968,
1546,
6,
4672,
1815,
562,
12,
2890,
18,
3432,
780,
13,
405,
374,
16,
315,
1921,
2728,
1417,
6,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
3968,
1546,
6,
4672,
1815,
562,
12,
2890,
18,
3432,
780,
13,
405,
374,
16,
315,
1921,
2728,
1417,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
tree2.writeNewick(filename) | tree2.write(filename) | def write_in_tree(filename, tree, labels): tree2 = tree.copy() rename_tree_with_ids(tree2, labels) for node in tree2.nodes.values(): node.dist = 0 tree2.writeNewick(filename) | fbcef0514ac80732a481ca1ada1150cfe23ed533 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8482/fbcef0514ac80732a481ca1ada1150cfe23ed533/phylip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
267,
67,
3413,
12,
3459,
16,
2151,
16,
3249,
4672,
2151,
22,
273,
2151,
18,
3530,
1435,
6472,
67,
3413,
67,
1918,
67,
2232,
12,
3413,
22,
16,
3249,
13,
364,
756,
316,
2151,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
267,
67,
3413,
12,
3459,
16,
2151,
16,
3249,
4672,
2151,
22,
273,
2151,
18,
3530,
1435,
6472,
67,
3413,
67,
1918,
67,
2232,
12,
3413,
22,
16,
3249,
13,
364,
756,
316,
2151,... |
logger.info('%s upgraded from %s to %s', self, object_version, version) | def update(self, version): # We don't check the version is good getattr(self, 'update_%s' % version)() logger.info('%s upgraded from %s to %s', self, object_version, version) self.set_property('version', version) | d2528b3327b8196a6551de62a950218dde639b25 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/d2528b3327b8196a6551de62a950218dde639b25/Handler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
1177,
4672,
468,
1660,
2727,
1404,
866,
326,
1177,
353,
7494,
3869,
12,
2890,
16,
296,
2725,
10185,
87,
11,
738,
1177,
13,
1435,
365,
18,
542,
67,
4468,
2668,
1589,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1089,
12,
2890,
16,
1177,
4672,
468,
1660,
2727,
1404,
866,
326,
1177,
353,
7494,
3869,
12,
2890,
16,
296,
2725,
10185,
87,
11,
738,
1177,
13,
1435,
365,
18,
542,
67,
4468,
2668,
1589,... | |
if 0: | if PY_STRUCT_RANGE_CHECKING: | def test_1229380(): for endian in ('', '>', '<'): for cls in (int, long): for fmt in ('B', 'H', 'I', 'L'): any_err(struct.pack, endian + fmt, cls(-1)) any_err(struct.pack, endian + 'B', cls(300)) any_err(struct.pack, endian + 'H', cls(70000)) any_err(struct.pack, endian + 'I', sys.maxint * 4L) any_err(struct.pack, endian + 'L', sys.maxint * 4L) | e93b40650089282d5fa0fdd7310471a346fb037a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e93b40650089282d5fa0fdd7310471a346fb037a/test_struct.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2138,
5540,
23,
3672,
13332,
364,
14759,
316,
7707,
2187,
7481,
16,
9138,
4672,
364,
2028,
316,
261,
474,
16,
1525,
4672,
364,
1325,
316,
7707,
38,
2187,
296,
44,
2187,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2138,
5540,
23,
3672,
13332,
364,
14759,
316,
7707,
2187,
7481,
16,
9138,
4672,
364,
2028,
316,
261,
474,
16,
1525,
4672,
364,
1325,
316,
7707,
38,
2187,
296,
44,
2187,
296,
... |
key = (original, percent) | key = (original, request.cfg.siteid, percent) | def getText(original, request, lang, **kw): """ Return a translation of some original text. @param original: the original (english) text @param request: the request object @lang: the target language for the translation @keyword wiki: True to use the wiki parser/formatter on the translation result, False to return the translation result "as is" @keyword percent: True if we need special escaping because we use the translation result as the left side of a % operator: e.g. % chars need to become %% for that usage. This will only escape generated % chars, e.g. in wiki links to non-ascii pagenames (%XX%XX%XX). False, if we don't use it as a left-side of % operator. Only specify this option for wiki==True, it doesn't do anything for wiki==False. """ formatted = kw.get('wiki', False) # 1.6 and early 1.7 (until 2/2008) used 'formatted' with True as default! percent = kw.get('percent', False) if original == u"": return u"" # we don't want to get *.po files metadata! global translations if not lang in translations: # load translation if needed t = Translation(lang) t.loadLanguage(request) translations[lang] = t # get the matching entry in the mapping table translated = original translation = translations[lang] if original in translation.raw: translated = translation.raw[original] if formatted: key = (original, percent) if key in translation.formatted: translated = translation.formatted[key] if translated is None: logging.error("formatting a %r text that is already being formatted: %r" % (lang, original)) translated = original + u'*' # get some error indication to the UI else: translation.formatted[key] = None # we use this as "formatting in progress" indicator translated = translation.formatMarkup(request, translated, percent) translation.formatted[key] = translated # remember it else: try: if languages is None: # languages not initialized yet raise KeyError language = languages[lang]['x-language-in-english'] dictpagename = "%sDict" % language.replace(' ', '') dicts = request.dicts if dictpagename in dicts: userdict = dicts[dictpagename] translated = userdict[original] else: raise KeyError except KeyError: # do not simply return trans with str, but recursively call # to get english translation, maybe formatted. # if we don't find an english "translation", we just format it # on the fly (this is needed for quickhelp). if lang != 'en': logging.debug("falling back to english, requested string not in %r translation: %r" % (lang, original)) translated = getText(original, request, 'en', wiki=formatted, percent=percent) elif formatted: # and lang == 'en' logging.debug("formatting for %r on the fly: %r" % (lang, original)) translated = translations[lang].formatMarkup(request, original, percent) return translated | dfbb05e8b666a6b17bdfe97933c2e1da362db2c6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/888/dfbb05e8b666a6b17bdfe97933c2e1da362db2c6/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6701,
12,
8830,
16,
590,
16,
3303,
16,
2826,
9987,
4672,
3536,
2000,
279,
4794,
434,
2690,
2282,
977,
18,
225,
632,
891,
2282,
30,
326,
2282,
261,
275,
13740,
13,
977,
632,
891,
590,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6701,
12,
8830,
16,
590,
16,
3303,
16,
2826,
9987,
4672,
3536,
2000,
279,
4794,
434,
2690,
2282,
977,
18,
225,
632,
891,
2282,
30,
326,
2282,
261,
275,
13740,
13,
977,
632,
891,
590,
... |
if not (u2 >= c * (2.0 - c) and u2 > c * _exp(1.0 - c)): | if u2 < c * (2.0 - c) or u2 <= c * _exp(1.0 - c): | def vonmisesvariate(self, mu, kappa): """Circular data distribution. | 4aa9408036856a9acf52e0804055e17317b4e3e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4aa9408036856a9acf52e0804055e17317b4e3e6/random.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
265,
81,
6141,
1401,
3840,
12,
2890,
16,
4129,
16,
23125,
4672,
3536,
25858,
501,
7006,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
265,
81,
6141,
1401,
3840,
12,
2890,
16,
4129,
16,
23125,
4672,
3536,
25858,
501,
7006,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if optional and len(params) == 1: line = line[m.end():] else: | def subconvert(self, endchar=None, depth=0): stack = [] line = self.line if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _comment_rx.match(line) if m: text = m.group(1) if text: self.write("(COMMENT\n- %s \n)COMMENT\n-\\n\n" % encode(text)) line = line[m.end():] continue m = _begin_env_rx.match(line) if m: # re-write to use the macro handler line = r"\%s %s" % (m.group(1), line[m.end():]) continue m = _end_env_rx.match(line) if m: # end of environment envname = m.group(1) if envname == "document": # special magic for n in stack[1:]: if n not in self.autoclosing: raise LaTeXFormatError( "open element on stack: " + `n`) # should be more careful, but this is easier to code: stack = [] self.write(")document\n") elif stack and envname == stack[-1]: self.write(")%s\n" % envname) del stack[-1] popping(envname, "a", len(stack) + depth) else: self.err_write("stack: %s\n" % `stack`) raise LaTeXFormatError( "environment close for %s doesn't match" % envname) line = line[m.end():] continue m = _begin_macro_rx.match(line) if m: # start of macro macroname = m.group(1) if macroname == "verbatim": # really magic case! pos = string.find(line, "\\end{verbatim}") text = line[m.end(1):pos] self.write("(verbatim\n") self.write("-%s\n" % encode(text)) self.write(")verbatim\n") line = line[pos + len("\\end{verbatim}"):] continue numbered = 1 opened = 0 if macroname[-1] == "*": macroname = macroname[:-1] numbered = 0 if macroname in self.autoclosing and macroname in stack: while stack[-1] != macroname: top = stack.pop() if top and top not in self.discards: self.write(")%s\n-\\n\n" % top) popping(top, "b", len(stack) + depth) if macroname not in self.discards: self.write("-\\n\n)%s\n-\\n\n" % macroname) popping(macroname, "c", len(stack) + depth - 1) del stack[-1] # if macroname in self.discards: self.push_output(StringIO.StringIO()) else: self.push_output(self.ofp) # params, optional, empty, environ = self.start_macro(macroname) if not numbered: self.write("Anumbered TOKEN no\n") # rip off the macroname if params: if optional and len(params) == 1: line = line[m.end():] else: line = line[m.end(1):] elif empty: line = line[m.end(1):] else: line = line[m.end():] # # Very ugly special case to deal with \item[]. The catch # is that this needs to occur outside the for loop that # handles attribute parsing so we can 'continue' the outer # loop. # if optional and type(params[0]) is type(()): # the attribute name isn't used in this special case pushing(macroname, "a", depth + len(stack)) stack.append(macroname) self.write("(%s\n" % macroname) m = _start_optional_rx.match(line) if m: self.line = line[m.end():] line = self.subconvert("]", depth + len(stack)) line = "}" + line continue # handle attribute mappings here: for attrname in params: if optional: optional = 0 if type(attrname) is type(""): m = _optional_rx.match(line) if m: line = line[m.end():] self.write("A%s TOKEN %s\n" % (attrname, encode(m.group(1)))) elif type(attrname) is type(()): # This is a sub-element; but don't place the # element we found on the stack (\section-like) pushing(macroname, "b", len(stack) + depth) stack.append(macroname) self.write("(%s\n" % macroname) macroname = attrname[0] m = _start_group_rx.match(line) if m: line = line[m.end():] elif type(attrname) is type([]): # A normal subelement: <macroname><attrname>...</>... attrname = attrname[0] if not opened: opened = 1 self.write("(%s\n" % macroname) pushing(macroname, "c", len(stack) + depth) self.write("(%s\n" % attrname) pushing(attrname, "sub-elem", len(stack) + depth + 1) self.line = skip_white(line)[1:] line = self.subconvert("}", len(stack) + depth + 1)[1:] dbgmsg("subconvert() ==> " + `line[:20]`) popping(attrname, "sub-elem", len(stack) + depth + 1) self.write(")%s\n" % attrname) else: m = _parameter_rx.match(line) if not m: raise LaTeXFormatError( "could not extract parameter %s for %s: %s" % (attrname, macroname, `line[:100]`)) value = m.group(1) if _token_rx.match(value): dtype = "TOKEN" else: dtype = "CDATA" self.write("A%s %s %s\n" % (attrname, dtype, encode(value))) line = line[m.end():] if params and type(params[-1]) is type('') \ and (not empty) and not environ: # attempt to strip off next '{' m = _start_group_rx.match(line) if not m: raise LaTeXFormatError( "non-empty element '%s' has no content: %s" % (macroname, line[:12])) line = line[m.end():] if not opened: self.write("(%s\n" % macroname) pushing(macroname, "d", len(stack) + depth) if empty: line = "}" + line stack.append(macroname) self.pop_output() continue if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line[1:] return self.line if line[0] == "}": # end of macro or group macroname = stack[-1] conversion = self.table.get(macroname) if macroname \ and macroname not in self.discards \ and type(conversion) is not type(""): # otherwise, it was just a bare group self.write(")%s\n" % stack[-1]) popping(macroname, "d", len(stack) + depth - 1) del stack[-1] line = line[1:] continue if line[0] == "{": pushing("", "e", len(stack) + depth) stack.append("") line = line[1:] continue if line[0] == "\\" and line[1] in ESCAPED_CHARS: self.write("-%s\n" % encode(line[1])) line = line[2:] continue if line[:2] == r"\\": self.write("(BREAK\n)BREAK\n") line = line[2:] continue m = _text_rx.match(line) if m: text = encode(m.group()) self.write("-%s\n" % text) line = line[m.end():] continue # special case because of \item[] if line[0] == "]": self.write("-]\n") line = line[1:] continue # avoid infinite loops extra = "" if len(line) > 100: extra = "..." raise LaTeXFormatError("could not identify markup: %s%s" % (`line[:100]`, extra)) while stack and stack[-1] in self.autoclosing: self.write("-\\n\n") self.write(")%s\n" % stack[-1]) popping(stack.pop(), "e", len(stack) + depth - 1) if stack: raise LaTeXFormatError("elements remain on stack: " + string.join(stack, ", ")) # otherwise we just ran out of input here... | bf2763cf07522d5ef19fe1c77b99de178484ab7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf2763cf07522d5ef19fe1c77b99de178484ab7b/latex2esis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
6283,
12,
2890,
16,
679,
3001,
33,
7036,
16,
3598,
33,
20,
4672,
2110,
273,
5378,
980,
273,
365,
18,
1369,
309,
6369,
471,
679,
3001,
30,
365,
18,
370,
67,
2626,
12,
315,
1717,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6283,
12,
2890,
16,
679,
3001,
33,
7036,
16,
3598,
33,
20,
4672,
2110,
273,
5378,
980,
273,
365,
18,
1369,
309,
6369,
471,
679,
3001,
30,
365,
18,
370,
67,
2626,
12,
315,
1717,
... | |
sage: b.save() sage: (a*b).save() sage: (a+b).save() | sage: b.save('sage.gif') sage: (a*b).save('sage.gif') sage: (a+b).save('sage.gif') | def __mul__(self, other): """ Multiply two animations. This has the effect of appending the two animinations (the second comes after the first). | 3fb70e537645114a76fb0d2132f72dc84f03fa76 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/3fb70e537645114a76fb0d2132f72dc84f03fa76/animate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16411,
972,
12,
2890,
16,
1308,
4672,
3536,
5991,
1283,
2795,
25536,
18,
225,
1220,
711,
326,
5426,
434,
19997,
326,
2795,
10536,
10144,
261,
5787,
2205,
14535,
1839,
326,
1122,
2934... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
16411,
972,
12,
2890,
16,
1308,
4672,
3536,
5991,
1283,
2795,
25536,
18,
225,
1220,
711,
326,
5426,
434,
19997,
326,
2795,
10536,
10144,
261,
5787,
2205,
14535,
1839,
326,
1122,
2934... |
return q.filter(screenshot=screenshot_id) | q = q.filter(screenshot=screenshot_id) return q | def get_queryset(self, request, review_request_id, screenshot_id, *args, **kwargs): q = super(ScreenshotCommentResource, self).get_queryset( request, review_request_id, *args, **kwargs) return q.filter(screenshot=screenshot_id) | 9e582837eb239498570b26edc98c805ba2ab59aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1600/9e582837eb239498570b26edc98c805ba2ab59aa/resources.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
21729,
12,
2890,
16,
590,
16,
10725,
67,
2293,
67,
350,
16,
17179,
67,
350,
16,
380,
1968,
16,
2826,
4333,
4672,
1043,
273,
2240,
12,
29354,
4469,
1420,
16,
365,
2934,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
21729,
12,
2890,
16,
590,
16,
10725,
67,
2293,
67,
350,
16,
17179,
67,
350,
16,
380,
1968,
16,
2826,
4333,
4672,
1043,
273,
2240,
12,
29354,
4469,
1420,
16,
365,
2934,
588,
... |
pygame.init() | def show(): '''Set up the basic pypixel environment, like the main window.''' global _clock title(None) pygame.init() pygame.display.set_mode(SIZE, _WINDOW_OPTS) pygame.mouse.set_visible(False) _clock = pygame.time.Clock() | 2e7901a7a4882d90575be3aa3a59dd77468aad36 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13059/2e7901a7a4882d90575be3aa3a59dd77468aad36/pypixel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
13332,
9163,
694,
731,
326,
5337,
18951,
3556,
3330,
16,
3007,
326,
2774,
2742,
1093,
6309,
2552,
389,
18517,
2077,
12,
7036,
13,
2395,
13957,
18,
5417,
18,
542,
67,
3188,
12,
4574... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
13332,
9163,
694,
731,
326,
5337,
18951,
3556,
3330,
16,
3007,
326,
2774,
2742,
1093,
6309,
2552,
389,
18517,
2077,
12,
7036,
13,
2395,
13957,
18,
5417,
18,
542,
67,
3188,
12,
4574... | |
mysql_cur.execute("SELECT * FROM attachments WHERE bug_id = %s" % bugid) | mysql_cur.execute("SELECT * FROM attachments WHERE bug_id = %s" % bugid) | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla print "Using Bugzilla v%s schema." % BZ_VERSION if BZ_VERSION == 2110: activityFields['removed'] = "oldvalue" activityFields['added'] = "newvalue" # init Bugzilla environment print "Bugzilla MySQL('%s':'%s':'%s':'%s'): connecting..." % \ (_db, _host, _user, ("*" * len(_password))) mysql_con = MySQLdb.connect(host=_host, user=_user, passwd=_password, db=_db, compress=1, cursorclass=MySQLdb.cursors.DictCursor) mysql_cur = mysql_con.cursor() # init Trac environment print "Trac SQLite('%s'): connecting..." % (_env) trac = TracDatabase(_env) # force mode... if _force == 1: print "\nCleaning all tickets..." c = trac.db().cursor() c.execute("DELETE FROM ticket_change") trac.db().commit() c.execute("DELETE FROM ticket") trac.db().commit() c.execute("DELETE FROM attachment") attachments_dir = os.path.join(os.path.normpath(trac.env.path), "attachments") # Straight from the Python documentation. for root, dirs, files in os.walk(attachments_dir, topdown=False): for name in files: os.remove(os.path.join(root, name)) for name in dirs: os.rmdir(os.path.join(root, name)) if not os.stat(attachments_dir): os.mkdir(attachments_dir) trac.db().commit() print "All tickets cleaned..." print "\n0. Filtering products..." if BZ_VERSION >= 2180: mysql_cur.execute("SELECT name FROM products") else: mysql_cur.execute("SELECT product AS name FROM products") products = [] for line in mysql_cur.fetchall(): product = line['name'] if PRODUCTS and product not in PRODUCTS: continue if product in IGNORE_PRODUCTS: continue products.append(product) PRODUCTS[:] = products print " Using products", " ".join(PRODUCTS) print "\n1. Import severities..." trac.setSeverityList(SEVERITIES) print "\n2. Import components..." if not COMPONENTS_FROM_PRODUCTS: if BZ_VERSION >= 2180: sql = """SELECT DISTINCT c.name AS name, c.initialowner AS owner FROM components AS c, products AS p WHERE c.product_id = p.id AND""" sql += makeWhereClause('p.name', PRODUCTS) else: sql = "SELECT value AS name, initialowner AS owner FROM components" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) components = mysql_cur.fetchall() for component in components: component['owner'] = trac.getLoginName(mysql_cur, component['owner']) trac.setComponentList(components, 'name') else: if BZ_VERSION >= 2180: sql = """SELECT p.name AS product, c.name AS comp, c.initialowner AS owner FROM components c, products p""" sql += " WHERE c.product_id = p.id and " + makeWhereClause('p.name', PRODUCTS) else: sql = """SELECT program AS product, value AS comp, initialowner AS owner FROM components""" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) lines = mysql_cur.fetchall() all_components = {} # product -> components all_owners = {} # product, component -> owner for line in lines: product = line['product'] comp = line['comp'] owner = line['owner'] all_components.setdefault(product, []).append(comp) all_owners[(product, comp)] = owner component_list = [] for product, components in all_components.items(): # find best default owner default = None for comp in DEFAULT_COMPONENTS: if comp in components: default = comp break if default is None: default = components[0] owner = all_owners[(product, default)] owner_name = trac.getLoginName(mysql_cur, owner) component_list.append({'product': product, 'owner': owner_name}) trac.setComponentList(component_list, 'product') print "\n3. Import priorities..." trac.setPriorityList(PRIORITIES) print "\n4. Import versions..." if BZ_VERSION >= 2180: sql = """SELECT DISTINCTROW versions.value AS value FROM products, versions""" sql += " WHERE" + makeWhereClause('products.name', PRODUCTS) else: sql = "SELECT DISTINCTROW value FROM versions" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) versions = mysql_cur.fetchall() trac.setVersionList(versions, 'value') print "\n5. Import milestones..." sql = "SELECT DISTINCT value FROM milestones" sql += " WHERE" + makeWhereClause('value', IGNORE_MILESTONES, negative=True) mysql_cur.execute(sql) milestones = mysql_cur.fetchall() trac.setMilestoneList(milestones, 'value') print "\n6. Retrieving bugs..." sql = """SELECT DISTINCT b.*, c.name AS component, p.name AS product FROM bugs AS b, components AS c, products AS p """ sql += " WHERE (" + makeWhereClause('p.name', PRODUCTS) sql += ") AND b.product_id = p.id" sql += " AND b.component_id = c.id" sql += " ORDER BY b.bug_id" mysql_cur.execute(sql) bugs = mysql_cur.fetchall() print "\n7. Import bugs and bug activity..." for bug in bugs: bugid = bug['bug_id'] ticket = {} keywords = [] ticket['id'] = bugid ticket['time'] = bug['creation_ts'] ticket['changetime'] = bug['delta_ts'] if COMPONENTS_FROM_PRODUCTS: ticket['component'] = bug['product'] else: ticket['component'] = bug['component'] ticket['severity'] = bug['bug_severity'] ticket['priority'] = bug['priority'].lower() ticket['owner'] = trac.getLoginName(mysql_cur, bug['assigned_to']) ticket['reporter'] = trac.getLoginName(mysql_cur, bug['reporter']) mysql_cur.execute("SELECT * FROM cc WHERE bug_id = %s", bugid) cc_records = mysql_cur.fetchall() cc_list = [] for cc in cc_records: cc_list.append(trac.getLoginName(mysql_cur, cc['who'])) cc_list = [cc for cc in cc_list if '@' in cc and cc not in IGNORE_CC] ticket['cc'] = string.join(cc_list, ', ') ticket['version'] = bug['version'] target_milestone = bug['target_milestone'] if target_milestone in IGNORE_MILESTONES: target_milestone = '' ticket['milestone'] = target_milestone bug_status = bug['bug_status'].lower() ticket['status'] = statusXlator[bug_status] ticket['resolution'] = bug['resolution'].lower() # a bit of extra work to do open tickets if bug_status == 'open': if owner != '': ticket['status'] = 'assigned' else: ticket['status'] = 'new' ticket['summary'] = bug['short_desc'] mysql_cur.execute("SELECT * FROM longdescs WHERE bug_id = %s" % bugid) longdescs = list(mysql_cur.fetchall()) # check for empty 'longdescs[0]' field... if len(longdescs) == 0: ticket['description'] = '' else: ticket['description'] = longdescs[0]['thetext'] del longdescs[0] for desc in longdescs: ignore = False for comment in IGNORE_COMMENTS: if re.match(comment, desc['thetext']): ignore = True if ignore: continue trac.addTicketComment(ticket=bugid, time = desc['bug_when'], author=trac.getLoginName(mysql_cur, desc['who']), value = desc['thetext']) mysql_cur.execute("""SELECT * FROM bugs_activity WHERE bug_id = %s ORDER BY bug_when""" % bugid) bugs_activity = mysql_cur.fetchall() resolution = '' ticketChanges = [] keywords = [] for activity in bugs_activity: field_name = trac.getFieldName(mysql_cur, activity['fieldid']).lower() removed = activity[activityFields['removed']] added = activity[activityFields['added']] # statuses and resolutions are in lowercase in trac if field_name == "resolution" or field_name == "bug_status": removed = removed.lower() added = added.lower() # remember most recent resolution, we need this later if field_name == "resolution": resolution = added.lower() add_keywords = [] remove_keywords = [] # convert bugzilla field names... if field_name == "bug_severity": field_name = "severity" elif field_name == "assigned_to": field_name = "owner" elif field_name == "bug_status": field_name = "status" if removed in STATUS_KEYWORDS: remove_keywords.append(STATUS_KEYWORDS[removed]) if added in STATUS_KEYWORDS: add_keywords.append(STATUS_KEYWORDS[added]) added = statusXlator[added] removed = statusXlator[removed] elif field_name == "short_desc": field_name = "summary" elif field_name == "product" and COMPONENTS_FROM_PRODUCTS: field_name = "component" elif ((field_name == "product" and not COMPONENTS_FROM_PRODUCTS) or (field_name == "component" and COMPONENTS_FROM_PRODUCTS)): if MAP_ALL_KEYWORDS or removed in KEYWORDS_MAPPING: kw = KEYWORDS_MAPPING.get(removed, removed) if kw: remove_keywords.append(kw) if MAP_ALL_KEYWORDS or added in KEYWORDS_MAPPING: kw = KEYWORDS_MAPPING.get(added, added) if kw: add_keywords.append(kw) if field_name == "component": # just keep the keyword change added = removed = "" elif field_name == "target_milestone": field_name = "milestone" if added in IGNORE_MILESTONES: added = "" if removed in IGNORE_MILESTONES: removed = "" ticketChange = {} ticketChange['ticket'] = bugid ticketChange['time'] = activity['bug_when'] ticketChange['author'] = trac.getLoginName(mysql_cur, activity['who']) ticketChange['field'] = field_name ticketChange['oldvalue'] = removed ticketChange['newvalue'] = added if add_keywords or remove_keywords: # ensure removed ones are in old old_keywords = keywords + [kw for kw in remove_keywords if kw not in keywords] # remove from new keywords = [kw for kw in keywords if kw not in remove_keywords] # add to new keywords += [kw for kw in add_keywords if kw not in keywords] if old_keywords != keywords: ticketChangeKw = ticketChange.copy() ticketChangeKw['field'] = "keywords" ticketChangeKw['oldvalue'] = ' '.join(old_keywords) ticketChangeKw['newvalue'] = ' '.join(keywords) ticketChanges.append(ticketChangeKw) if field_name in IGNORED_ACTIVITY_FIELDS: continue # Skip changes that have no effect (think translation!). if added == removed: continue # Bugzilla splits large summary changes into two records. for oldChange in ticketChanges: if (field_name == "summary" and oldChange['field'] == ticketChange['field'] and oldChange['time'] == ticketChange['time'] and oldChange['author'] == ticketChange['author']): oldChange['oldvalue'] += " " + ticketChange['oldvalue'] oldChange['newvalue'] += " " + ticketChange['newvalue'] break # cc sometime appear in different activities with same time if (field_name == "cc" \ and oldChange['time'] == ticketChange['time']): oldChange['newvalue'] += ", " + ticketChange['newvalue'] break else: ticketChanges.append (ticketChange) for ticketChange in ticketChanges: trac.addTicketChange (**ticketChange) # For some reason, bugzilla v2.11 seems to clear the resolution # when you mark a bug as closed. Let's remember it and restore # it if the ticket is closed but there's no resolution. if not ticket['resolution'] and ticket['status'] == "closed": ticket['resolution'] = resolution bug_status = bug['bug_status'] if bug_status in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[bug_status] if kw not in keywords: keywords.append(kw) product = bug['product'] if product in KEYWORDS_MAPPING and not COMPONENTS_FROM_PRODUCTS: kw = KEYWORDS_MAPPING.get(product, product) if kw and kw not in keywords: keywords.append(kw) component = bug['component'] if (COMPONENTS_FROM_PRODUCTS and \ (MAP_ALL_KEYWORDS or component in KEYWORDS_MAPPING)): kw = KEYWORDS_MAPPING.get(component, component) if kw and kw not in keywords: keywords.append(kw) ticket['keywords'] = string.join(keywords) ticketid = trac.addTicket(**ticket) if BZ_VERSION >= 2180: mysql_cur.execute("SELECT attachments.*, attach_data.thedata FROM attachments, attach_data WHERE attachments.bug_id = %s AND attachments.attach_id = attach_data.id" % bugid) else: mysql_cur.execute("SELECT * FROM attachments WHERE bug_id = %s" % bugid) attachments = mysql_cur.fetchall() for a in attachments: author = trac.getLoginName(mysql_cur, a['submitter_id']) trac.addAttachment(author, a) print "\n8. Importing users and passwords..." if BZ_VERSION >= 2180: mysql_cur.execute("SELECT login_name, cryptpassword FROM profiles") users = mysql_cur.fetchall() htpasswd = file("htpasswd", 'w') for user in users: if LOGIN_MAP.has_key(user['login_name']): login = LOGIN_MAP[user['login_name']] else: login = user['login_name'] htpasswd.write(login + ":" + user['cryptpassword'] + "\n") htpasswd.close() print " Bugzilla users converted to htpasswd format, see 'htpasswd'." print "\nAll tickets converted." | fd58378303b5d48d94b3e8bf7a1fb4935619a303 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9317/fd58378303b5d48d94b3e8bf7a1fb4935619a303/bugzilla2trac.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
24899,
1966,
16,
389,
2564,
16,
389,
1355,
16,
389,
3664,
16,
389,
3074,
16,
389,
5734,
4672,
5728,
2314,
273,
2286,
12233,
1435,
225,
468,
2236,
364,
12156,
5244,
434,
7934,
15990... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
24899,
1966,
16,
389,
2564,
16,
389,
1355,
16,
389,
3664,
16,
389,
3074,
16,
389,
5734,
4672,
5728,
2314,
273,
2286,
12233,
1435,
225,
468,
2236,
364,
12156,
5244,
434,
7934,
15990... |
spaces += sequence.getString(type) | spaces += sequence.getString(regexp_type) | def getString(self, type = "strict"): """This has only been implemented with OR kind in mind. The result depends on `type`. If `type` is "strict" the representation will be the exact interval (@TODO ? except if the whole class is covered for \d and \s). If `type` is "lax" the representation of the class will be used for some characters : - digit -> \d - letter or '_' -> \w - space -> \s If more than one character or different from a class is returned brakets will be added unless the sequence is part of a bigger interval.""" string = "" added_sequence = False logging.debug("Sequence.getString() [lax]") add_digits_class = False add_words_class = False add_spaces_class = False digits = "" words = "" spaces = "" others = "" added_digits = 0 added_words = 0 added_spaces = 0 added_others = 0 for key in self._sequences.keys(): if (len(self._sequences[key]) > 0): processed = False if (((len(self._sequences[key]) > 1) or (self._sequences[key][0].getLength() > 1)) and ("lax" == type)): if (key == DIGITS.getCategory()): processed = True add_digits_class = True elif (key in CATEGORY_WORDS): processed = True add_words_class = True elif (key == SPACES.getCategory()): processed = True add_spaces_class = True if (not processed): for sequence in self._sequences[key]: if (key == DIGITS.getCategory()): added_digits += 1 digits += sequence.getString(type) elif (key in CATEGORY_WORDS): added_words += 1 words += sequence.getString(type) elif (key == SPACES.getCategory()): added_spaces += 1 spaces += sequence.getString(type) else: added_others += 1 others += sequence.getString(type) added_count = 0 if (("lax" == type) and (add_digits_class)): added_count += 1 string += "\d" else: added_count += added_digits string += digits if (("lax" == type) and (add_words_class)): added_count += 1 string += "\w" else: added_count += added_words string += words if (("lax" == type) and (add_spaces_class)): added_count += 1 string += "\s" else: added_count += added_spaces string += spaces added_count += added_others string += others if (added_count > 1): string = "[" + string + "]" return string | 9b3ed74c17dec8d9116a2102e8382fb7fa489058 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6399/9b3ed74c17dec8d9116a2102e8382fb7fa489058/generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4997,
12,
2890,
16,
618,
273,
315,
13948,
6,
4672,
3536,
2503,
711,
1338,
2118,
8249,
598,
4869,
3846,
316,
22838,
18,
1021,
563,
10935,
603,
1375,
723,
8338,
971,
1375,
723,
68,
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,
4997,
12,
2890,
16,
618,
273,
315,
13948,
6,
4672,
3536,
2503,
711,
1338,
2118,
8249,
598,
4869,
3846,
316,
22838,
18,
1021,
563,
10935,
603,
1375,
723,
8338,
971,
1375,
723,
68,
353,
... |
break | result.append(('', '')) | def getaddrlist(self): """Parse all addresses. | 6526fb4e9fd8d35bff4b8afa929495a8443534ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/6526fb4e9fd8d35bff4b8afa929495a8443534ee/_parseaddr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
4793,
1098,
12,
2890,
4672,
3536,
3201,
777,
6138,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
4793,
1098,
12,
2890,
4672,
3536,
3201,
777,
6138,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
mountopt +== ',newinstance' | mountopt += ',newinstance' | def _setupDev(self): # files in /dev mock.util.rmtree(self.makeChrootPath("dev")) mock.util.mkdirIfAbsent(self.makeChrootPath("dev", "pts")) mock.util.mkdirIfAbsent(self.makeChrootPath("dev", "shm")) prevMask = os.umask(0000) devFiles = ( (stat.S_IFCHR | 0666, os.makedev(1, 3), "dev/null"), (stat.S_IFCHR | 0666, os.makedev(1, 7), "dev/full"), (stat.S_IFCHR | 0666, os.makedev(1, 5), "dev/zero"), (stat.S_IFCHR | 0666, os.makedev(1, 8), "dev/random"), (stat.S_IFCHR | 0444, os.makedev(1, 9), "dev/urandom"), (stat.S_IFCHR | 0666, os.makedev(5, 0), "dev/tty"), (stat.S_IFCHR | 0600, os.makedev(5, 1), "dev/console"), (stat.S_IFCHR | 0666, os.makedev(5, 2), "dev/ptmx"), ) for i in devFiles: # create node os.mknod( self.makeChrootPath(i[2]), i[0], i[1]) # set context. (only necessary if host running selinux enabled.) # fails gracefully if chcon not installed. mock.util.do( ["chcon", "--reference=/%s"% i[2], self.makeChrootPath(i[2])] , raiseExc=0, shell=False) | 08f7f800ae03b0b873e89c56c64906ca1cac829d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7328/08f7f800ae03b0b873e89c56c64906ca1cac829d/backend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8401,
8870,
12,
2890,
4672,
468,
1390,
316,
342,
5206,
5416,
18,
1367,
18,
86,
17371,
12,
2890,
18,
6540,
782,
3085,
743,
2932,
5206,
6,
3719,
5416,
18,
1367,
18,
26686,
14711,
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,
389,
8401,
8870,
12,
2890,
4672,
468,
1390,
316,
342,
5206,
5416,
18,
1367,
18,
86,
17371,
12,
2890,
18,
6540,
782,
3085,
743,
2932,
5206,
6,
3719,
5416,
18,
1367,
18,
26686,
14711,
12... |
capCount += 1 | def _autoCapitalize(self): name = self.get().decode('utf-8') # capitalize each word capName = '' # allow no more than two capital letters per word capCount = 0 capMax = 2 for i in xrange(len(name)): character = name[i] # is it a letter that can be capitalized? # This assumes that string.lower and string.upper will return different # values for all unicode letters. canCapitalize = string.lower(character) != string.upper(character) if not canCapitalize: # this is a non-capitalize-able letter, assume we are between words. # reset the per-word capital letter count capCount = 0 else: capitalize = False # if it's not preceded by a letter, capitalize it unconditionally; # it's the first letter of a word if (i == 0) or string.lower(name[i-1]) == string.upper(name[i-1]): capitalize = True elif capCount < capMax: # we haven't hit the per-word limit for capital letters yet # is it a capital letter? if (character == string.upper(character)): # allow this letter to remain capitalized capitalize = True if capitalize: character = string.upper(character) capCount += 1 else: character = string.lower(character) capName += character self.enterText(capName.encode('utf-8')) | bb330009601b6e1b23d3c3d0166c77818a1d168a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8543/bb330009601b6e1b23d3c3d0166c77818a1d168a/DirectEntry.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6079,
4664,
7053,
554,
12,
2890,
4672,
508,
273,
365,
18,
588,
7675,
3922,
2668,
3158,
17,
28,
6134,
468,
17451,
1517,
2076,
3523,
461,
273,
875,
468,
1699,
1158,
1898,
2353,
2795,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6079,
4664,
7053,
554,
12,
2890,
4672,
508,
273,
365,
18,
588,
7675,
3922,
2668,
3158,
17,
28,
6134,
468,
17451,
1517,
2076,
3523,
461,
273,
875,
468,
1699,
1158,
1898,
2353,
2795,
... | |
'filestats': filestats, | 'filestats': filestats, 'annotated': annotated, | def _content_changes(old_node, new_node): """Returns the list of differences. | 392e553ca963dc76a3b1aed79183e1f26ec1b597 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2831/392e553ca963dc76a3b1aed79183e1f26ec1b597/changeset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1745,
67,
6329,
12,
1673,
67,
2159,
16,
394,
67,
2159,
4672,
3536,
1356,
326,
666,
434,
16440,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1745,
67,
6329,
12,
1673,
67,
2159,
16,
394,
67,
2159,
4672,
3536,
1356,
326,
666,
434,
16440,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return int(self.interp._runningeval),self.interp._stdout.read(),self.interp._stderr.read(),self.interp._stdin.HasInputRequest() | print >>sys.__stdout__,'returning result' result=(int(self.interp._runningeval),self.interp._stdout.read(),self.interp._stderr.read(),self.interp._stdin.HasInputRequest()) print >>sys.__stdout__,'returning result',result return result | def cont(self,stdin): self.interp._stdin.write(stdin) if self.interp._stdin.HasInputRequest(): self.interp._stdin.InputRequestNotify() self.lock.acquire() if self.interp._runningeval: self.lock.wait(self.timeout) self.lock.release() return int(self.interp._runningeval),self.interp._stdout.read(),self.interp._stderr.read(),self.interp._stdin.HasInputRequest() #return status, stdout, stderr | 8bda109ca69a3384eb0e570c4fc302015e431e46 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2579/8bda109ca69a3384eb0e570c4fc302015e431e46/interp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
466,
12,
2890,
16,
21772,
4672,
365,
18,
24940,
6315,
21772,
18,
2626,
12,
21772,
13,
309,
365,
18,
24940,
6315,
21772,
18,
5582,
1210,
691,
13332,
365,
18,
24940,
6315,
21772,
18,
1210,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
466,
12,
2890,
16,
21772,
4672,
365,
18,
24940,
6315,
21772,
18,
2626,
12,
21772,
13,
309,
365,
18,
24940,
6315,
21772,
18,
5582,
1210,
691,
13332,
365,
18,
24940,
6315,
21772,
18,
1210,... |
if not hvm_pvdrv: | hvm_s_state = xc.hvm_get_param(self.domid, HVM_PARAM_ACPI_S_STATE) if not hvm_pvdrv or hvm_s_state != 0: | def shutdown(self, reason): """Shutdown a domain by signalling this via xenstored.""" log.debug('XendDomainInfo.shutdown(%s)', reason) if self._stateGet() in (DOM_STATE_SHUTDOWN, DOM_STATE_HALTED,): raise XendError('Domain cannot be shutdown') | 46daade38adb8ef42669b6fc05827f9242ee082b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6195/46daade38adb8ef42669b6fc05827f9242ee082b/XendDomainInfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5731,
12,
2890,
16,
3971,
4672,
3536,
10961,
279,
2461,
635,
1573,
454,
310,
333,
3970,
23048,
22601,
12123,
613,
18,
4148,
2668,
60,
409,
3748,
966,
18,
15132,
9275,
87,
13,
2187,
3971,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5731,
12,
2890,
16,
3971,
4672,
3536,
10961,
279,
2461,
635,
1573,
454,
310,
333,
3970,
23048,
22601,
12123,
613,
18,
4148,
2668,
60,
409,
3748,
966,
18,
15132,
9275,
87,
13,
2187,
3971,... |
else: | elif shifts[2] == 16 and shifts[1] == 8 and shifts[0] == 0: | def pixels3d (surface): """pygame.numpyarray.pixels3d (Surface): return array reference pixels into a 3d array Create a new 3D array that directly references the pixel values in a Surface. Any changes to the array will affect the pixels in the Surface. This is a fast operation since no data is copied. This will only work on Surfaces that have 24-bit or 32-bit formats. Lower pixel formats cannot be referenced. The Surface this references will remain locked for the lifetime of the array (see the Surface.lock - lock the Surface memory for pixel access method). """ bpp = surface.get_bytesize () if bpp < 3 or bpp > 4: raise ValueError, "unsupported bit depth for 3D reference array" start = 0 step = 0 end = 0 # Check for RGB or BGR surface. shifts = surface.get_shifts () if shifts[0] == 16 and shifts[1] == 8 and shifts[2] == 0: # RGB end = None if pygame.get_sdl_byteorder () == pygame.LIL_ENDIAN: start = 2 step = -1 else: start = 0 step = 1 else: # BGR end = 3 if pygame.get_sdl_byteorder () == pygame.LIL_ENDIAN: start = 0 step = 1 else: start = 2 step = -1 array = numpy.frombuffer (surface.get_buffer (), numpy.uint8) array.shape = surface.get_height (), surface.get_pitch () array = array[:,:surface.get_width () * bpp] array = numpy.reshape (array, (surface.get_width (), surface.get_height (), bpp)) array = array[:,:,start:end:step] return array | d84caf262965f3bfcdc549f16d00598b65c46c5c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1298/d84caf262965f3bfcdc549f16d00598b65c46c5c/_numpysurfarray.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8948,
23,
72,
261,
18266,
4672,
3536,
2074,
13957,
18,
15974,
1126,
18,
21084,
23,
72,
261,
11508,
4672,
327,
526,
225,
2114,
8948,
1368,
279,
890,
72,
526,
225,
1788,
279,
394,
890,
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,
8948,
23,
72,
261,
18266,
4672,
3536,
2074,
13957,
18,
15974,
1126,
18,
21084,
23,
72,
261,
11508,
4672,
327,
526,
225,
2114,
8948,
1368,
279,
890,
72,
526,
225,
1788,
279,
394,
890,
4... |
new = Request(newurl, req.get_data()) | new = Request(newurl, req.get_data(), req.headers) | def http_error_302(self, req, fp, code, msg, headers): if headers.has_key('location'): newurl = headers['location'] elif headers.has_key('uri'): newurl = headers['uri'] else: return newurl = urlparse.urljoin(req.get_full_url(), newurl) | 9b6c26fdd23687fbddc2e2daba87c16c76b2f32f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9b6c26fdd23687fbddc2e2daba87c16c76b2f32f/urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1062,
67,
1636,
67,
23,
3103,
12,
2890,
16,
1111,
16,
4253,
16,
981,
16,
1234,
16,
1607,
4672,
309,
1607,
18,
5332,
67,
856,
2668,
3562,
11,
4672,
394,
718,
273,
1607,
3292,
3562,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1062,
67,
1636,
67,
23,
3103,
12,
2890,
16,
1111,
16,
4253,
16,
981,
16,
1234,
16,
1607,
4672,
309,
1607,
18,
5332,
67,
856,
2668,
3562,
11,
4672,
394,
718,
273,
1607,
3292,
3562,
35... |
l = len(l) [self.posititonsOfUnmatchedPlus(i, dual=True, reverse=True)[l-1-j] | l = len(self) [self.positionsOfUnmatchedPlus(i, dual=True, reverse=True)[l-1-j] | def positionsOfUnmatchedMinus(self, i): | e2abaca418af8cb3ca8128b0fd154aed4615a689 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/e2abaca418af8cb3ca8128b0fd154aed4615a689/crystals.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6865,
951,
984,
11073,
18434,
12,
2890,
16,
277,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6865,
951,
984,
11073,
18434,
12,
2890,
16,
277,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self._priorValuesStack.push({}) | self._priorValuesStack.append({}) | def _handleLockParams(self): # this will store the names of the parameters that are modified self._paramsSet = {} # this will store the values of modified params (from prior to # the lock). self._priorValuesStack.push({}) | bc118592712a1b70a0b9a248ebe439604a6431c3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8543/bc118592712a1b70a0b9a248ebe439604a6431c3/PythonUtil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
2531,
1370,
12,
2890,
4672,
468,
333,
903,
1707,
326,
1257,
434,
326,
1472,
716,
854,
4358,
365,
6315,
2010,
694,
273,
2618,
468,
333,
903,
1707,
326,
924,
434,
4358,
859,
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
2531,
1370,
12,
2890,
4672,
468,
333,
903,
1707,
326,
1257,
434,
326,
1472,
716,
854,
4358,
365,
6315,
2010,
694,
273,
2618,
468,
333,
903,
1707,
326,
924,
434,
4358,
859,
2... |
if x in y.packageDeps: | if x in y.packageDeps and y not in x.packageDeps: | def cmpFunc (x, y): if x.part_count != y.part_count: return cmp(x.part_count, y.part_count) else: if x in y.packageDeps: # y needs x, so x is "larger" (must be earlier) return 1 elif y in x.packageDeps: # other way round return -1 else: return 0 | 1ccdbb9cb94de1c871e12a7644cd6318422c9cb5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/1ccdbb9cb94de1c871e12a7644cd6318422c9cb5/Part.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9411,
2622,
261,
92,
16,
677,
4672,
309,
619,
18,
2680,
67,
1883,
480,
677,
18,
2680,
67,
1883,
30,
327,
9411,
12,
92,
18,
2680,
67,
1883,
16,
677,
18,
2680,
67,
1883,
13,
469,
30,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9411,
2622,
261,
92,
16,
677,
4672,
309,
619,
18,
2680,
67,
1883,
480,
677,
18,
2680,
67,
1883,
30,
327,
9411,
12,
92,
18,
2680,
67,
1883,
16,
677,
18,
2680,
67,
1883,
13,
469,
30,... |
self.name="Composite{"+"".join(l)+"}" | self.name="Composite{"+",".join(l)+"}" | def __init__(self, inputs, outputs): self.inputs=copy(inputs) self.outputs=copy(outputs) | f6c713455fed941f05b6fb8a20c80f896a29700f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/f6c713455fed941f05b6fb8a20c80f896a29700f/basic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4540,
16,
6729,
4672,
365,
18,
10029,
33,
3530,
12,
10029,
13,
365,
18,
12295,
33,
3530,
12,
12295,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4540,
16,
6729,
4672,
365,
18,
10029,
33,
3530,
12,
10029,
13,
365,
18,
12295,
33,
3530,
12,
12295,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meta["embeds"] = _extractQxEmbeds(content) | meta["embeds"] = _extractQxEmbeds(content) | def getMeta(id): global classes entry = classes[id] path = entry["path"] cache = readCache(id, "meta", path) if cache != None: return cache meta = {} category = entry["category"] if category == "qx.doc": pass elif category == "qx.locale": meta["loadtimeDeps"] = ["qx.locale.Locale", "qx.locale.Manager"] elif category == "qx.impl": content = filetool.read(path, entry["encoding"]) meta["loadtimeDeps"] = _extractQxLoadtimeDeps(content, id) meta["runtimeDeps"] = _extractQxRuntimeDeps(content, id) meta["optionalDeps"] = _extractQxOptionalDeps(content) meta["ignoreDeps"] = _extractQxIgnoreDeps(content) meta["modules"] = _extractQxModules(content) meta["resources"] = _extractQxResources(content) meta["embeds"] = _extractQxEmbeds(content) writeCache(id, "meta", meta) return meta | e3364bd2416dfe75fd85aeea0ded427372ef3d08 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/e3364bd2416dfe75fd85aeea0ded427372ef3d08/generator2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11312,
12,
350,
4672,
2552,
3318,
225,
1241,
273,
3318,
63,
350,
65,
589,
273,
1241,
9614,
803,
11929,
225,
1247,
273,
855,
1649,
12,
350,
16,
315,
3901,
3113,
589,
13,
309,
1247,
480,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11312,
12,
350,
4672,
2552,
3318,
225,
1241,
273,
3318,
63,
350,
65,
589,
273,
1241,
9614,
803,
11929,
225,
1247,
273,
855,
1649,
12,
350,
16,
315,
3901,
3113,
589,
13,
309,
1247,
480,... |
'adj_move_id':fields.many2one('account.move', 'Expanse Entries', required=False, readonly=True), | 'adj_move_id':fields.many2one('account.move', 'Adjustment Entries', required=False, readonly=True), 'other_move_id':fields.many2one('account.move', 'Other Payment', required=False, readonly=True), | def _calculate(self, cr, uid, ids, field_names, arg, context): res = {} for rs in self.browse(cr, uid, ids, context): allow = 0.0 deduct = 0.0 others = 0.0 obj = {'basic':rs.basic} for line in rs.line_ids: amount = 0.0 if line.amount_type == 'per': amount = line.amount * eval(line.category_id.base, obj) elif line.amount_type == 'fix': amount = line.amount | 636663c0972dcecb1fe1891bee76266a5eb830e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/636663c0972dcecb1fe1891bee76266a5eb830e3/hr_payroll.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11162,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
1973,
16,
1501,
16,
819,
4672,
400,
273,
2618,
364,
3597,
316,
365,
18,
25731,
12,
3353,
16,
4555,
16,
3258,
16,
819,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11162,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
1973,
16,
1501,
16,
819,
4672,
400,
273,
2618,
364,
3597,
316,
365,
18,
25731,
12,
3353,
16,
4555,
16,
3258,
16,
819,... |
if not recorded: x, y = gl.getsize() print x, 'x', y v.SetSize(x, y) v.BindGLWindow(win, SV.IN_REPLACE) | x, y = gl.getsize() print x, 'x', y v.SetSize(x, y) v.BindGLWindow(win, SV.IN_REPLACE) | def main(): QSIZE = 16 TIME = 5 audio = 0 num, den = 1, 1 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:t:') for opt, arg in opts: if opt == '-a': audio = 1 elif opt == '-q': QSIZE = string.atoi(arg) elif opt == '-r': [nstr, dstr] = string.splitfields(arg, '/') num, den = string.atoi(nstr), string.atoi(dstr) elif opt == '-t': TIME = string.atoi(arg) if args[2:]: sys.stderr.write('usage: Vrec [options] [file [audiofile]]\n') sys.exit(2) if args: filename = args[0] else: filename = 'film.video' if args[1:] and not audio: sys.stderr.write('-a turned on by appearance of 2nd file\n') audio = 1 if audio: if args[1:]: audiofilename = args[1] else: audiofilename = 'film.aiff' else: audiofilename = None gl.foreground() x, y = SV.PAL_XMAX / 4, SV.PAL_YMAX / 4 print x, 'x', y gl.minsize(40, 30) gl.stepunit(8, 6) gl.maxsize(SV.PAL_XMAX, SV.PAL_YMAX) gl.keepaspect(SV.PAL_XMAX, SV.PAL_YMAX) win = gl.winopen(filename) x, y = gl.getsize() print x, 'x', y v = sv.OpenVideo() v.BindGLWindow(win, SV.IN_REPLACE) v.SetSize(x, y) v.BindGLWindow(win, SV.IN_REPLACE) v.SetCaptureFormat(SV.RGB_FRAMES) v.SetCaptureMode(SV.BLOCKING_CAPTURE) v.SetQueueSize(QSIZE) v.InitCapture() if v.GetQueueSize() != QSIZE: QSIZE = v.GetQueueSize() print 'Warning: QSIZE reduced to', QSIZE | dd2d726866c36f9ef98e011ae9958f47d4411fed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/dd2d726866c36f9ef98e011ae9958f47d4411fed/Vrec.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2238,
4574,
273,
2872,
8721,
273,
1381,
7447,
273,
374,
818,
16,
5545,
273,
404,
16,
404,
225,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
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,
2774,
13332,
2238,
4574,
273,
2872,
8721,
273,
1381,
7447,
273,
374,
818,
16,
5545,
273,
404,
16,
404,
225,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
... |
sys.stdout.flush() os.system("/depot/gnu/plat/bin/rlog -r %s </dev/null 2>&1" % self.name) | p = os.popen("/depot/gnu/plat/bin/rlog -r %s </dev/null 2>&1" % self.name) output = p.read() p.close() print cgi.escape(output) | def do_info(self): | ad1a35314a5efa738d30d85899e3ba525e0af160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/ad1a35314a5efa738d30d85899e3ba525e0af160/faqmain.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
1376,
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,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
1376,
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... |
features.add_value( f.attr[ id_attribute ], f.iv ) | feature_id = f.attr[ id_attribute ] | def count_reads_in_features( sam_filename, gff_filename, stranded, overlap_mode, feature_type, id_attribute, quiet ): features = HTSeq.GenomicArrayOfSets( [], stranded ) counts = {} for f in HTSeq.GFF_Reader( gff_filename ): if f.iv.chrom not in features.step_vectors.keys(): features.add_chrom( f.iv.chrom ) if f.type == feature_type: try: features.add_value( f.attr[ id_attribute ], f.iv ) except KeyError: sys.exit( "Feature %s does not contain a '%s' attribute" % ( f.name, id_attribute ) ) counts[ f.attr[ id_attribute ] ] = 0 if len( counts ) == 0 and not quiet: sys.stderr.write( "Warning: No features of type '%s' found.\n" % feature_type ) first_read = iter( HTSeq.SAM_Reader( sam_filename ) ).next() pe_mode = first_read.paired_end read_seq = HTSeq.SAM_Reader( sam_filename ) if pe_mode: read_seq = HTSeq.pair_SAM_alignments( read_seq ) empty = 0 ambiguous = 0 i = 0 for r in read_seq: if not pe_mode: if not r.aligned: continue iv_seq = ( co.ref_iv for co in r.cigar if co.type == "M" ) else: if r[0] is not None and r[0].aligned: iv_seq = ( co.ref_iv for co in r[0].cigar if co.type == "M" ) else: iv_seq = tuple() if r[1] is not None and r[1].aligned: iv_seq = itertools.chain( iv_seq, ( invert_strand( co.ref_iv ) for co in r[1].cigar if co.type == "M" ) ) else: if ( r[0] is None ) or not ( r[0].aligned ): continue try: if overlap_mode == "union": fs = set() for iv in iv_seq: if iv.chrom not in features.step_vectors: raise UnknownChrom for fs2 in features.get_steps( iv, values_only=True ): fs = fs.union( fs2 ) elif overlap_mode == "intersection-strict" or overlap_mode == "intersection-nonempty": fs = None for iv in iv_seq: if iv.chrom not in features.step_vectors: raise UnknownChrom for fs2 in features.get_steps( iv, values_only=True ): if len(fs2) > 0 or overlap_mode == "intersection-strict": if fs is None: fs = fs2.copy() else: fs = fs.intersection( fs2 ) else: sys.exit( "Illegal overlap mode." ) if fs is None or len( fs ) == 0: empty += 1 elif len( fs ) > 1: ambiguous += 1 else: counts[ list(fs)[0] ] += 1 except UnknownChrom: sys.stderr.write( ( "Warning: Skipping read '%s', aligned to %s, because " + "chromosome '%s' did not appear in the GFF file.\n" ) % ( r.read.name, r.iv, r.iv.chrom ) ) i += 1 if i % 100000 == 0 and not quiet: sys.stderr.write( "%d reads processed.\n" % i ) for fn in sorted( counts.keys() ): print "%s\t%d" % ( fn, counts[fn] ) print "no_feature\t%d" % empty print "ambiguous\t%d" % ambiguous | a4e70671af072650a170131c70e58179dc942f32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/596/a4e70671af072650a170131c70e58179dc942f32/count.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1056,
67,
11904,
67,
267,
67,
7139,
12,
16260,
67,
3459,
16,
26534,
67,
3459,
16,
609,
5860,
16,
7227,
67,
3188,
16,
2572,
67,
723,
16,
612,
67,
4589,
16,
10902,
262,
30,
225,
4467,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1056,
67,
11904,
67,
267,
67,
7139,
12,
16260,
67,
3459,
16,
26534,
67,
3459,
16,
609,
5860,
16,
7227,
67,
3188,
16,
2572,
67,
723,
16,
612,
67,
4589,
16,
10902,
262,
30,
225,
4467,
... |
end_index: End index (exclusive) of blob data to fetch. Must be | end_index: End index (inclusive) of blob data to fetch. Must be | def fetch_data(blob, start_index, end_index): """Fetch data for blob. Fetches a fragment of a blob up to MAX_BLOB_FETCH_SIZE in length. Attempting to fetch a fragment that extends beyond the boundaries of the blob will return the amount of data from start_index until the end of the blob, which will be a smaller size than requested. Requesting a fragment which is entirely outside the boundaries of the blob will return empty string. Attempting to fetch a negative index will raise an exception. Args: blob: BlobInfo, BlobKey, str or unicode representation of BlobKey of blob to fetch data from. start_index: Start index of blob data to fetch. May not be negative. end_index: End index (exclusive) of blob data to fetch. Must be >= start_index. Returns: str containing partial data of blob. If the indexes are legal but outside the boundaries of the blob, will return empty string. Raises: TypeError if start_index or end_index are not indexes. Also when blob is not a string, BlobKey or BlobInfo. DataIndexOutOfRangeError when start_index < 0 or end_index < start_index. BlobFetchSizeTooLargeError when request blob fragment is larger than MAX_BLOB_FETCH_SIZE. BlobNotFoundError when blob does not exist. """ if isinstance(blob, BlobInfo): blob = blob.key() return blobstore.fetch_data(blob, start_index, end_index) | 8f150e70255d6abb8009e44fcc26670ea604103a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10629/8f150e70255d6abb8009e44fcc26670ea604103a/blobstore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
67,
892,
12,
10721,
16,
787,
67,
1615,
16,
679,
67,
1615,
4672,
3536,
5005,
501,
364,
4795,
18,
225,
8065,
281,
279,
5481,
434,
279,
4795,
731,
358,
4552,
67,
38,
6038,
67,
202... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
892,
12,
10721,
16,
787,
67,
1615,
16,
679,
67,
1615,
4672,
3536,
5005,
501,
364,
4795,
18,
225,
8065,
281,
279,
5481,
434,
279,
4795,
731,
358,
4552,
67,
38,
6038,
67,
202... |
</tr>""" % (nbhits, weburl, urllib.quote(word), urllib.quote(f), urlarg_colls, word) | </tr>""" % (nbhits, weburl, urllib.quote(phrase), urllib.quote(f), urlarg_colls, phrase) | def browse_pattern(req, colls, p, f, rg): """Browse either biliographic phrases or words indexes, and display it.""" ## do we search in words indexes? if not f: return browse_in_bibwords(req, p, f) ## prepare collection urlargument for later printing: p_orig = p urlarg_colls = "" for coll in colls: urlarg_colls += "&c=%s" % urllib.quote(coll) ## okay, "real browse" follows: browsed_words = browse_in_bibxxx(p, f, rg) while not browsed_words: # try again and again with shorter and shorter pattern: try: p = p[:-1] browsed_words = browse_in_bibxxx(p, f, rg) except: # probably there are no hits at all: req.write("<p>No values found.") return ## try to check hits in these particular collection selection: browsed_words_in_colls = [] for word,nbhits in browsed_words: word_hitlist = HitList() word_hitlists = search_pattern("", word, f, colls, 'e') for coll in colls: word_hitlist.union(word_hitlists[coll]) word_hitlist.calculate_nbhits() if word_hitlist._nbhits > 0: # okay, this word has some hits in colls, so add it: browsed_words_in_colls.append([word, word_hitlist._nbhits]) ## were there hits in collections? if browsed_words_in_colls == []: if browsed_words != []: print_warning(req, """<p>No match close to <em>%s</em> found in given collections. Please try different term.<p>Displaying matches in any collection...""" % p_orig, "") browsed_words_in_colls = browsed_words ## display results now: out = """<table class="searchresultsbox"> <thead> <tr> <th class="searchresultsboxheader" align="left"> hits </th> <th class="searchresultsboxheader" width="15"> </th> <th class="searchresultsboxheader" align="left"> %s </th> </tr> </thead> <tbody>""" % f if len(browsed_words_in_colls) == 1: # one hit only found: word, nbhits = browsed_words_in_colls[0][0], browsed_words_in_colls[0][1] out += """<tr> <td class="searchresultsboxbody" align="right"> %s </td> <td class="searchresultsboxbody" width="15"> </td> <td class="searchresultsboxbody" align="left"> <a href="%s/search.py?p=%%22%s%%22&f=%s%s">%s</a> </td> </tr>""" % (nbhits, weburl, urllib.quote(word), urllib.quote(f), urlarg_colls, word) elif len(browsed_words_in_colls) > 1: # first display what was found but the last one: for word, nbhits in browsed_words_in_colls[:-1]: out += """<tr> <td class="searchresultsboxbody" align="right"> %s </td> <td class="searchresultsboxbody" width="15"> </td> <td class="searchresultsboxbody" align="left"> <a href="%s/search.py?p=%%22%s%%22&f=%s%s">%s</a> </td> </tr>""" % (nbhits, weburl, urllib.quote(word), urllib.quote(f), urlarg_colls, word) # now display last hit as "next term": word, nbhits = browsed_words_in_colls[-1] out += """<tr><td colspan="2" class="normal"> </td> <td class="normal"> <img src="%s/img/sn.gif" alt="" border="0"> next %s: <a href="%s/search.py?search=Browse&p=%s&f=%s%s">%s</a> </td> </tr>""" % (weburl, f, weburl, urllib.quote(word), urllib.quote(f), urlarg_colls, word) out += """</tbody> </table>""" req.write(out) return | 535ed6a8d836745c0ddd7f1016fbe145d7c7bebd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/535ed6a8d836745c0ddd7f1016fbe145d7c7bebd/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21670,
67,
4951,
12,
3658,
16,
645,
3251,
16,
293,
16,
284,
16,
14524,
4672,
3536,
27304,
3344,
324,
15700,
16983,
31413,
578,
4511,
5596,
16,
471,
2562,
518,
12123,
7541,
741,
732,
1623... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21670,
67,
4951,
12,
3658,
16,
645,
3251,
16,
293,
16,
284,
16,
14524,
4672,
3536,
27304,
3344,
324,
15700,
16983,
31413,
578,
4511,
5596,
16,
471,
2562,
518,
12123,
7541,
741,
732,
1623... |
self.users.append(connection.person.nickname()); | ul = UserAndLocation(); ul.person = connection.person ul.latitude = connection.latitude ul.longitude = connection.longitude self.users.append(ul); | def dispatch(self): people_query = Connection.all(); self.users = []; for connection in people_query: self.users.append(connection.person.nickname()); people_query = Connection.all(); response = "{action: '"+self.action+"', users : "+simplejson.dumps(self.users)+"}"; for connection in people_query: channel.send_message(connection.channelKey, response); | aa9214f26c95d5e9400316ba56c88944fbf2090f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13529/aa9214f26c95d5e9400316ba56c88944fbf2090f/app.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3435,
12,
2890,
4672,
16951,
67,
2271,
273,
4050,
18,
454,
5621,
365,
18,
5577,
273,
5378,
31,
364,
1459,
316,
16951,
67,
2271,
30,
7493,
273,
2177,
1876,
2735,
5621,
7493,
18,
12479,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3435,
12,
2890,
4672,
16951,
67,
2271,
273,
4050,
18,
454,
5621,
365,
18,
5577,
273,
5378,
31,
364,
1459,
316,
16951,
67,
2271,
30,
7493,
273,
2177,
1876,
2735,
5621,
7493,
18,
12479,
... |
result = self.__getWorkingPartition('InputSandbox') | result = self.__getWorkingPartition(sandbox) | def storeFile(self,jobID,filename,fileString,sandbox): """ Store input sandbox ASCII file for jobID with the name filename which is given with its string body """ | 21ab1ebbd0d993e01e1c80373e4dcf1bc3448220 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/21ab1ebbd0d993e01e1c80373e4dcf1bc3448220/SandboxDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1707,
812,
12,
2890,
16,
4688,
734,
16,
3459,
16,
768,
780,
16,
27004,
4672,
3536,
4994,
810,
15202,
11768,
585,
364,
28913,
598,
326,
508,
1544,
1492,
353,
864,
598,
2097,
533,
1417,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1707,
812,
12,
2890,
16,
4688,
734,
16,
3459,
16,
768,
780,
16,
27004,
4672,
3536,
4994,
810,
15202,
11768,
585,
364,
28913,
598,
326,
508,
1544,
1492,
353,
864,
598,
2097,
533,
1417,
... |
elif o1_type == 'orphaned' or o1_type == 'ajaxorphaned': | elif o1_type == 'orphaned': manager.loadUserOrphanedImages(filter_user_id) elif o1_type == 'ajaxorphaned': | def manage_user_containers(request, o1_type=None, o1_id=None, o2_type=None, o2_id=None, o3_type=None, o3_id=None, **kwargs): request.session['nav']['menu'] = 'collaboration' request.session['nav']['whos'] = 'userdata' try: url = kwargs["url"] except: logger.error(traceback.format_exc()) try: request.session['nav']['view'] = request.REQUEST['view'] # table, icon, tree except: pass view = request.session['nav']['view'] menu = request.session['nav']['menu'] whos = request.session['nav']['whos'] conn = None try: conn = kwargs["conn"] except: logger.error(traceback.format_exc()) manager = BaseContainer(conn, o1_type, o1_id, o2_type, o2_id, o3_type, o3_id) manager.buildBreadcrumb(whos) grs = list() grs.extend(list(conn.getEventContext().memberOfGroups)) grs.extend(list(conn.getEventContext().leaderOfGroups)) my_groups = set(list(conn.getExperimenterGroups(set(grs)))) request.session['groupId'] = None form_mygroups = MyGroupsForm(initial={'mygroups': my_groups}) filter_user_id = None form_users = None users = set(conn.getColleaguesAndStaffs()) try: if request.REQUEST['experimenter'] != "": form_users = MyUserForm(initial={'users': users}, data=request.REQUEST.copy()) if form_users.is_valid(): filter_user_id = request.REQUEST['experimenter'] request.session['experimenter'] = filter_user_id form_users = MyUserForm(initial={'user':filter_user_id, 'users': users}) else: try: filter_user_id = request.session['experimenter'] except: pass else: request.session['experimenter'] = None form_users = MyUserForm(initial={'users': users}) except: try: filter_user_id = request.session['experimenter'] form_users = MyUserForm(initial={'user':filter_user_id, 'users': users}) except: form_users = MyUserForm(initial={'users': users}) form_active_group = ActiveGroupForm(initial={'activeGroup':manager.eContext['context'].groupId, 'mygroups': manager.eContext['memberOfGroups']}) form_environment = None form_objective = None if o1_type =='image' or o2_type == 'image' or o3_type == 'image': form_environment = MetadataEnvironmentForm(initial={'image': manager.image}) form_objective = MetadataObjectiveForm(initial={'image': manager.image, 'mediums': conn.getEnumerationEntries("MediumI"), 'immersions': conn.getEnumerationEntries("ImmersionI"), 'corrections': conn.getEnumerationEntries("CorrectionI") }) form_comment = None form_tag = None form_url = None form_file = None try: action = request.REQUEST["action"] except: if o1_type and o1_id: form_comment = TextAnnotationForm() form_tag = TagAnnotationForm() form_url = UrlAnnotationForm(initial={'link':'http://'}) form_file = UploadFileForm() else: if action == "comment": form_comment = TextAnnotationForm(data=request.REQUEST.copy()) if form_comment.is_valid(): content = request.REQUEST['content'] if o3_type and o3_id: if o3_type == 'image': manager.saveImageTextAnnotation(content) elif o2_type and o2_id: if o2_type == 'dataset': manager.saveDatasetTextAnnotation(content) elif o2_type == 'image': manager.saveImageTextAnnotation(content) elif o1_type and o1_id: if o1_type == 'project': manager.saveProjectTextAnnotation(content) elif o1_type == 'dataset': manager.saveDatasetTextAnnotation(content) elif o1_type == 'image': manager.saveImageTextAnnotation(content) form_comment = TextAnnotationForm() form_tag = TagAnnotationForm() form_url = UrlAnnotationForm(initial={'link':'http://'}) form_file = UploadFileForm() elif action == "url": form_url = UrlAnnotationForm(data=request.REQUEST.copy()) if form_url.is_valid(): content = request.REQUEST['link'] if o3_type and o3_id: if o3_type == 'image': manager.saveImageUrlAnnotation(content) elif o2_type and o2_id: if o2_type == 'dataset': manager.saveDatasetUrlAnnotation(content) elif o2_type == 'image': manager.saveImageUrlAnnotation(content) elif o1_type and o1_id: if o1_type == 'project': manager.saveProjectUrlAnnotation(content) elif o1_type == 'dataset': manager.saveDatasetUrlAnnotation(content) elif o1_type == 'image': manager.saveImageUrlAnnotation(content) form_url = UrlAnnotationForm(initial={'link':'http://'}) form_tag = TagAnnotationForm() form_comment = TextAnnotationForm() form_file = UploadFileForm() elif action == "tag": form_tag = TagAnnotationForm(data=request.REQUEST.copy()) if form_tag.is_valid(): tag = request.REQUEST['tag'] if o3_type and o3_id: if o3_type == 'image': manager.saveImageTagAnnotation(tag) elif o2_type and o2_id: if o2_type == 'dataset': manager.saveDatasetTagAnnotation(tag) elif o2_type == 'image': manager.saveImageTagAnnotation(tag) elif o1_type and o1_id: if o1_type == 'project': manager.saveProjectTagAnnotation(tag) elif o1_type == 'dataset': manager.saveDatasetTagAnnotation(tag) elif o1_type == 'image': manager.saveImageTagAnnotation(tag) form_tag = TagAnnotationForm() form_url = UrlAnnotationForm() form_comment = TextAnnotationForm() form_file = UploadFileForm() elif action == "file": form_file = UploadFileForm(request.REQUEST, request.FILES) if form_file.is_valid(): f = request.FILES['custom_file'] #for chunk in f.chunks(): #print chunk form_file = UploadFileForm() form_tag = TagAnnotationForm() form_comment = TextAnnotationForm() form_url = UrlAnnotationForm(initial={'link':'http://'}) template = None if o3_type and o3_id: if o3_type == 'image': template = "omeroweb/image_details.html" elif o2_type and o2_id: if o2_type == 'dataset': if filter_user_id is not None: manager.listImagesInDatasetInUser(o2_id, filter_user_id) elif o2_type == 'image': template = "omeroweb/image_details.html" elif o1_type and o1_id: if o1_type == 'ajaxdataset': template = "omeroweb/container_subtree.html" if filter_user_id is not None: manager.loadUserImages(o1_id, filter_user_id) elif o1_type == 'project': if filter_user_id is not None: manager.listDatasetsInProjectInUser(o1_id, filter_user_id) elif o1_type == 'dataset': #if view == 'tree': #if filter_user_id is not None: #manager.loadUserImages(o1_id, filter_user_id) #else: if filter_user_id is not None: manager.listImagesInDatasetInUser(o1_id, filter_user_id) elif o1_type == 'image': template = "omeroweb/image_details.html" elif o1_type == 'orphaned' or o1_type == 'ajaxorphaned': template = "omeroweb/container_subtree.html" manager.loadUserOrphanedImages(filter_user_id) else: if view == 'tree': if filter_user_id is not None: manager.loadUserContainerHierarchy(filter_user_id) else: if filter_user_id is not None: manager.listRootsInUser(filter_user_id) if template is None and view =='icon': template = "omeroweb/containers_icon.html" context = {'nav':request.session['nav'], 'url':url, 'eContext':manager.eContext, 'manager':manager, 'form_comment':form_comment, 'form_url':form_url, 'form_tag':form_tag, 'form_file':form_file, 'form_users':form_users, 'form_mygroups':form_mygroups, 'form_active_group':form_active_group} elif template is None and view =='table': template = "omeroweb/containers_table.html" context = {'nav':request.session['nav'], 'url':url, 'eContext':manager.eContext, 'manager':manager, 'form_comment':form_comment, 'form_url':form_url, 'form_tag':form_tag, 'form_file':form_file, 'form_users':form_users, 'form_mygroups':form_mygroups, 'form_active_group':form_active_group} elif template is None and view =='tree' and o1_type is not None and o1_id > 0: template = "omeroweb/containers_table.html" context = {'nav':request.session['nav'], 'url':url, 'eContext':manager.eContext, 'manager':manager, 'form_comment':form_comment, 'form_url':form_url, 'form_tag':form_tag, 'form_file':form_file, 'form_active_group':form_active_group} elif template is None and view =='tree' and o1_type is None and o1_id is None: template = "omeroweb/containers_tree.html" context = {'nav':request.session['nav'], 'url':url, 'eContext':manager.eContext, 'manager':manager, 'form_comment':form_comment, 'form_url':form_url, 'form_tag':form_tag, 'form_file':form_file, 'form_users':form_users, 'form_mygroups':form_mygroups, 'form_active_group':form_active_group} elif template is not None and view == 'tree' and o1_type=='ajaxdataset' and o1_id > 0: template = "omeroweb/container_subtree.html" context = {'manager':manager, 'eContext':manager.eContext} elif template is not None and view == 'tree' and o1_type=='ajaxorphaned': template = "omeroweb/container_subtree.html" context = {'manager':manager, 'eContext':manager.eContext} else: context = {'nav':request.session['nav'], 'url':url, 'eContext':manager.eContext, 'manager':manager, 'form_comment':form_comment, 'form_url':form_url, 'form_tag':form_tag, 'form_file':form_file, 'form_environment':form_environment, 'form_objective':form_objective} t = template_loader.get_template(template) c = Context(request,context) return HttpResponse(t.render(c)) | 2036449251668eb4c0368b26bf12a9f5f2f749b0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12409/2036449251668eb4c0368b26bf12a9f5f2f749b0/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
1355,
67,
20596,
12,
2293,
16,
320,
21,
67,
723,
33,
7036,
16,
320,
21,
67,
350,
33,
7036,
16,
320,
22,
67,
723,
33,
7036,
16,
320,
22,
67,
350,
33,
7036,
16,
320,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
1355,
67,
20596,
12,
2293,
16,
320,
21,
67,
723,
33,
7036,
16,
320,
21,
67,
350,
33,
7036,
16,
320,
22,
67,
723,
33,
7036,
16,
320,
22,
67,
350,
33,
7036,
16,
320,
23,... |
for value in sample(xrange(1000000000), 255): | for value in sample(range(1000000000), 255): | def test_integer(self): for value in sample(xrange(1000000000), 255): words = split(Integer, value) self.assertEqual(len(words), 1) word = words[0] self.assertEqual(type(word), str) self.assertEqual(_decode(Integer, word), value) | c70ca5892efc93b48bc8ec06258a47c8f9c0bde7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12681/c70ca5892efc93b48bc8ec06258a47c8f9c0bde7/test_xapian.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
7745,
12,
2890,
4672,
364,
460,
316,
3296,
12,
3676,
12,
23899,
11706,
3631,
4561,
4672,
4511,
273,
1416,
12,
4522,
16,
460,
13,
365,
18,
11231,
5812,
12,
1897,
12,
3753,
363... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7745,
12,
2890,
4672,
364,
460,
316,
3296,
12,
3676,
12,
23899,
11706,
3631,
4561,
4672,
4511,
273,
1416,
12,
4522,
16,
460,
13,
365,
18,
11231,
5812,
12,
1897,
12,
3753,
363... |
regl = "(\"|\')(.*?)(\"|\')(, |\))" | regl = r"(\"|\')(.*?)(\"|\')(, |\))" | def load_word_function(wsite, raw): # This is a function used to load the badword and the whitelist. list_loaded = list() pos = 0 # I search with a regex how many user have not the talk page # and i put them in a list (i find it more easy and secure) while 1: regl = "(\"|\')(.*?)(\"|\')(, |\))" page = re.compile(regl, re.UNICODE) xl = page.search(raw, pos) if xl == None: if len(list_loaded) >= 1: wikipedia.output(u'\nReal-time list loaded.') return list_loaded break elif len(done) == 0: wikipedia.output(u'There was no input on the real-time page.') load_2 = False continue pos = xl.end() badword = xl.group(2) if badword not in list_loaded: list_loaded.append(badword) | 32fd26c310458893520cdd1b4c1793561661ad3f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/32fd26c310458893520cdd1b4c1793561661ad3f/welcome.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
1095,
67,
915,
12,
91,
4256,
16,
1831,
4672,
468,
1220,
353,
279,
445,
1399,
358,
1262,
326,
5570,
1095,
471,
326,
10734,
18,
666,
67,
4230,
273,
666,
1435,
949,
273,
374,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
1095,
67,
915,
12,
91,
4256,
16,
1831,
4672,
468,
1220,
353,
279,
445,
1399,
358,
1262,
326,
5570,
1095,
471,
326,
10734,
18,
666,
67,
4230,
273,
666,
1435,
949,
273,
374,
... |
def_op('DUP_TOPX', 99) | def jabs_op(name, op): def_op(name, op) hasjabs.append(op) | c83c794daf437568919ac64eeb81141994d70bc0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/c83c794daf437568919ac64eeb81141994d70bc0/opcode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
525,
5113,
67,
556,
12,
529,
16,
1061,
4672,
1652,
67,
556,
12,
529,
16,
1061,
13,
711,
78,
5113,
18,
6923,
12,
556,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
525,
5113,
67,
556,
12,
529,
16,
1061,
4672,
1652,
67,
556,
12,
529,
16,
1061,
13,
711,
78,
5113,
18,
6923,
12,
556,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
ret += ' <%s>%s</%s>\n' % (k, self.info[k], k) ret += ' </info>\n' | ret += u' <%s>' % k + Unicode(self.info[k]) + '</%s>\n' % k ret += u' </info>\n' | def print_info(self): """return info part for FXD writing""" ret = '' if self.info: ret = ' <info>\n' for k in self.info.keys(): ret += ' <%s>%s</%s>\n' % (k, self.info[k], k) ret += ' </info>\n' return ret | e4e4639f6ea3e57e463f291a7c76a06466bdd9d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/e4e4639f6ea3e57e463f291a7c76a06466bdd9d8/fxdimdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
1376,
12,
2890,
4672,
3536,
2463,
1123,
1087,
364,
478,
22953,
7410,
8395,
325,
273,
875,
309,
365,
18,
1376,
30,
325,
273,
296,
565,
411,
1376,
5333,
82,
11,
364,
417,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
1376,
12,
2890,
4672,
3536,
2463,
1123,
1087,
364,
478,
22953,
7410,
8395,
325,
273,
875,
309,
365,
18,
1376,
30,
325,
273,
296,
565,
411,
1376,
5333,
82,
11,
364,
417,
316,
... |
order = '%s.%s ASC' % (qn(meta.db_table), qn(column)) | order = '%s.%s ASC' % (inner_table_name, qn(column)) else: new_order = [] for x in order.split(','): if x.find('.') != -1: tbl, col = x.rsplit('.', 1) else: col = x new_order.append('%s.%s' % (inner_table_name, col)) order = ', '.join(new_order) | def as_sql(self, with_limits=True, with_col_aliases=False): self._using_row_number = False # Get out of the way if we're not a select query or there's no limiting involved. check_limits = with_limits and (self.low_mark or self.high_mark is not None) if not isinstance(self, SqlServerQuery) or not check_limits: return super(SqlServerQuery, self).as_sql(with_limits, with_col_aliases) | 84296e99de66123e569a464b8019a01dabe63cc3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1254/84296e99de66123e569a464b8019a01dabe63cc3/query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
487,
67,
4669,
12,
2890,
16,
598,
67,
14270,
33,
5510,
16,
598,
67,
1293,
67,
13831,
33,
8381,
4672,
365,
6315,
9940,
67,
492,
67,
2696,
273,
1083,
225,
468,
968,
596,
434,
326,
4031... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
487,
67,
4669,
12,
2890,
16,
598,
67,
14270,
33,
5510,
16,
598,
67,
1293,
67,
13831,
33,
8381,
4672,
365,
6315,
9940,
67,
492,
67,
2696,
273,
1083,
225,
468,
968,
596,
434,
326,
4031... |
print '\t | print >> stream, '\t | def WriteClassBody(self, generator): # Write in alpha order. names = self.mapFuncs.keys() names.sort() specialItems = {"count":None, "item":None,"value":None,"_newenum":None} # If found, will end up with (entry, invoke_tupe) itemCount = None for name in names: entry=self.mapFuncs[name] # skip [restricted] methods, unless it is the # enumerator (which, being part of the "system", # we know about and can use) dispid = entry.desc[0] if entry.desc[9] & pythoncom.FUNCFLAG_FRESTRICTED and \ dispid != pythoncom.DISPID_NEWENUM: continue # If not accessible via IDispatch, then we can't use it here. if entry.desc[3] != pythoncom.FUNC_DISPATCH: continue if dispid==pythoncom.DISPID_VALUE: lkey = "value" elif dispid==pythoncom.DISPID_NEWENUM: specialItems["_newenum"] = (entry, entry.desc[4], None) continue # Dont build this one now! else: lkey = string.lower(name) if specialItems.has_key(lkey) and specialItems[lkey] is None: # remember if a special one. specialItems[lkey] = (entry, entry.desc[4], None) if generator.bBuildHidden or not entry.hidden: if entry.GetResultName(): print '\t# Result is of type ' + entry.GetResultName() if entry.wasProperty: print '\t# The method %s is actually a property, but must be used as a method to correctly pass the arguments' % name ret = self.MakeFuncMethod(entry,build.MakePublicAttributeName(name)) for line in ret: print line print "\t_prop_map_get_ = {" names = self.propMap.keys(); names.sort() for key in names: entry = self.propMap[key] if generator.bBuildHidden or not entry.hidden: resultName = entry.GetResultName() if resultName: print "\t\t# Property '%s' is an object of type '%s'" % (key, resultName) lkey = string.lower(key) details = entry.desc resultDesc = details[2] argDesc = () mapEntry = MakeMapLineEntry(details[0], pythoncom.DISPATCH_PROPERTYGET, resultDesc, argDesc, key, entry.GetResultCLSIDStr()) if entry.desc[0]==pythoncom.DISPID_VALUE: lkey = "value" elif entry.desc[0]==pythoncom.DISPID_NEWENUM: lkey = "_newenum" else: lkey = string.lower(key) if specialItems.has_key(lkey) and specialItems[lkey] is None: # remember if a special one. specialItems[lkey] = (entry, pythoncom.DISPATCH_PROPERTYGET, mapEntry) # All special methods, except _newenum, are written # "normally". This is a mess! if entry.desc[0]==pythoncom.DISPID_NEWENUM: continue | cfd84d318292d699ca53899ee423b08bfb797445 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/cfd84d318292d699ca53899ee423b08bfb797445/genpy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
797,
2250,
12,
2890,
16,
4456,
4672,
468,
2598,
316,
4190,
1353,
18,
1257,
273,
365,
18,
1458,
10928,
18,
2452,
1435,
1257,
18,
3804,
1435,
4582,
3126,
273,
12528,
1883,
6877,
7036... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
797,
2250,
12,
2890,
16,
4456,
4672,
468,
2598,
316,
4190,
1353,
18,
1257,
273,
365,
18,
1458,
10928,
18,
2452,
1435,
1257,
18,
3804,
1435,
4582,
3126,
273,
12528,
1883,
6877,
7036... |
- ``prec`` - precision of the sqrt() calculation | - ``prec`` - precision of the ``sqrt()`` calculation | def _big_delta_coeff(aa, bb, cc, prec=None): r""" Calculates the Delta coefficient of the 3 angular momenta for Racah symbols. Also checks that the differences are of integer value. INPUT: - ``aa`` - first angular momentum, integer or half integer - ``bb`` - second angular momentum, integer or half integer - ``cc`` - third angular momentum, integer or half integer - ``prec`` - precision of the sqrt() calculation OUTPUT: double - Value of the Delta coefficient EXAMPLES:: sage: from sage.functions.wigner import _big_delta_coeff sage: _big_delta_coeff(1,1,1) 1/2*sqrt(1/6) """ if (int(aa + bb - cc) != (aa + bb - cc)): raise ValueError("j values must be integer or half integer and fulfil the triangle relation") if (int(aa + cc - bb) != (aa + cc - bb)): raise ValueError("j values must be integer or half integer and fulfil the triangle relation") if (int(bb + cc - aa) != (bb + cc - aa)): raise ValueError("j values must be integer or half integer and fulfil the triangle relation") if (aa + bb - cc) < 0: return 0 if (aa + cc - bb) < 0: return 0 if (bb + cc - aa) < 0: return 0 maxfact = max(aa + bb - cc, aa + cc - bb, bb + cc - aa, aa + bb + cc + 1) _calc_factlist(maxfact) argsqrt = Integer(_Factlist[int(aa + bb - cc)] * \ _Factlist[int(aa + cc - bb)] * \ _Factlist[int(bb + cc - aa)]) / \ Integer(_Factlist[int(aa + bb + cc + 1)]) ressqrt = argsqrt.sqrt(prec) if type(ressqrt) is ComplexNumber: res = ressqrt.real() else: res = ressqrt return res | c6a90d820f57455b2ff6063db98cb5e6f7a11f83 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/c6a90d820f57455b2ff6063db98cb5e6f7a11f83/wigner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
14002,
67,
9878,
67,
18132,
12,
7598,
16,
7129,
16,
4946,
16,
13382,
33,
7036,
4672,
436,
8395,
26128,
326,
17799,
16554,
434,
326,
890,
11759,
10382,
69,
364,
534,
1077,
9795,
7963... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14002,
67,
9878,
67,
18132,
12,
7598,
16,
7129,
16,
4946,
16,
13382,
33,
7036,
4672,
436,
8395,
26128,
326,
17799,
16554,
434,
326,
890,
11759,
10382,
69,
364,
534,
1077,
9795,
7963... |
def OnAutostart(evt=None): | def onChangeMode(evt=None): | def OnAutostart(evt=None): enbl=rb1.GetValue() favLbl.Enable(enbl) favCtrl.Enable(enbl) if evt is not None: evt.Skip() | 203a74863f8acce3a987dc9b61eaf2234a615f8b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8076/203a74863f8acce3a987dc9b61eaf2234a615f8b/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24031,
2309,
12,
73,
11734,
33,
7036,
4672,
570,
3083,
33,
6731,
21,
18,
967,
620,
1435,
18180,
48,
3083,
18,
8317,
12,
275,
3083,
13,
18180,
12418,
18,
8317,
12,
275,
3083,
13,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24031,
2309,
12,
73,
11734,
33,
7036,
4672,
570,
3083,
33,
6731,
21,
18,
967,
620,
1435,
18180,
48,
3083,
18,
8317,
12,
275,
3083,
13,
18180,
12418,
18,
8317,
12,
275,
3083,
13,
309,
... |
row = visualizer.graph.links.filter(u=(i,i), v=(j,j)) | row = visualizer.graph.links.filter(u=(i+1,i+1), v=(j+1,j+1)) if len(row) == 0: row = visualizer.graph.links.filter(u=(j+1,j+1), v=(i+1,i+1)) indexes = [k for k, x in enumerate(visualizer.graph.links) if (str(int(x[0])) == str(j+1) and str(int(x[1])) == str(int(i+1)))] else: indexes = [k for k, x in enumerate(visualizer.graph.links) if (str(int(x[0])) == str(i+1) and str(int(x[1])) == str(int(j+1)))] | def addVisualizer(self, visualizer): self.visualizer = visualizer self.clear() self.nVertices = 0 self.nEdges = 0 self.vertexDegree = [] self.vertices_old = {} self.vertices = [] self.edges_old = {} self.nEdges = 0 self.networkCurve = NetworkCurve(self) self.edges = [] self.minEdgeWeight = sys.maxint self.maxEdgeWeight = 0 if visualizer == None: self.replot() return self.nVertices = visualizer.graph.nVertices #add nodes for v in range(0, self.nVertices): self.vertices_old[v] = (None, []) vertex = NetworkVertex() vertex.index = v self.vertices.append(vertex) #print "addVisualizer" #add edges for (i, j) in visualizer.graph.getEdges(): self.edges_old[self.nEdges] = (None, i, j) edge = NetworkEdge() edge.u = self.vertices[i] edge.v = self.vertices[j] | 1ea773271ebad1b2b9725cefa852042d154b040d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/1ea773271ebad1b2b9725cefa852042d154b040d/OWNetworkCanvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
25780,
1824,
12,
2890,
16,
11623,
1824,
4672,
365,
18,
26671,
1824,
273,
11623,
1824,
365,
18,
8507,
1435,
225,
365,
18,
82,
13371,
273,
374,
365,
18,
82,
10697,
273,
374,
365,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
25780,
1824,
12,
2890,
16,
11623,
1824,
4672,
365,
18,
26671,
1824,
273,
11623,
1824,
365,
18,
8507,
1435,
225,
365,
18,
82,
13371,
273,
374,
365,
18,
82,
10697,
273,
374,
365,
18... |
paren = paren + 1 if bracket: email = email + str str = '' elif not seen_bracket: email = email + str str = '' continue if bracket: if c == '>': bracket = 0 email = email + str str = '' | paren = 1 token = string.join(token, '') tokens.append((was_quoted, token)) was_quoted = 0 token = [] continue if c in string.whitespace: space = 1 continue if c in '<>@,;:.[]': token = string.join(token, '') tokens.append((was_quoted, token)) was_quoted = 0 token = [] tokens.append((0, c)) space = 0 continue if space: token = string.join(token, '') tokens.append((was_quoted, token)) was_quoted = 0 token = [] space = 0 token.append(c) token = string.join(token, '') tokens.append((was_quoted, token)) if (0, '<') in tokens: name = [] addr = [] cur = name for token in tokens: if token[1] == '': | def parseaddr(address): import string str = '' email = '' comment = '' backslash = 0 dquote = 0 space = 0 paren = 0 bracket = 0 seen_bracket = 0 for c in address: if backslash: str = str + c backslash = 0 continue if c == '\\': backslash = 1 continue if dquote: if c == '"': dquote = 0 else: str = str + c continue if c == '"': dquote = 1 continue if c in string.whitespace: space = 1 continue if space: str = str + ' ' space = 0 if paren: if c == '(': paren = paren + 1 str = str + c continue if c == ')': paren = paren - 1 if paren == 0: comment = comment + str str = '' continue if c == '(': paren = paren + 1 if bracket: email = email + str str = '' elif not seen_bracket: email = email + str str = '' continue if bracket: if c == '>': bracket = 0 email = email + str str = '' continue if c == '<': bracket = 1 seen_bracket = 1 comment = comment + str str = '' email = '' continue if c == '#' and not bracket and not paren: # rest is comment break str = str + c if str: if seen_bracket: if bracket: email = str else: comment = comment + str else: if paren: comment = comment + str else: email = email + str return string.strip(comment), string.strip(email) | 4fc35f6fe9840dd900330fa5e979466e53ea44e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4fc35f6fe9840dd900330fa5e979466e53ea44e5/rfc822.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
4793,
12,
2867,
4672,
1930,
533,
609,
273,
875,
2699,
273,
875,
2879,
273,
875,
23253,
273,
374,
302,
6889,
273,
374,
3476,
273,
374,
22146,
273,
374,
9843,
273,
374,
5881,
67,
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,
1109,
4793,
12,
2867,
4672,
1930,
533,
609,
273,
875,
2699,
273,
875,
2879,
273,
875,
23253,
273,
374,
302,
6889,
273,
374,
3476,
273,
374,
22146,
273,
374,
9843,
273,
374,
5881,
67,
2... |
el1 = etree.SubElement(root, 'meta:initial-creator') | el1 = SubElement(root, 'meta:initial-creator') | def create_meta(self): root = etree.Element('office:document-meta', attrib=META_NAMESPACE_DICT) doc = etree.ElementTree(root) root = etree.SubElement(root, 'office:meta') el1 = etree.SubElement(root, 'meta:generator') el1.text = 'Docutils/rst2odf.py/%s' % (VERSION, ) s1 = os.environ.get('USER', '') el1 = etree.SubElement(root, 'meta:initial-creator') el1.text = s1 s2 = time.strftime('%Y-%m-%dT%H:%M:%S', time.localtime()) el1 = etree.SubElement(root, 'meta:creation-date') el1.text = s2 el1 = etree.SubElement(root, 'dc:creator') el1.text = s1 el1 = etree.SubElement(root, 'dc:date') el1.text = s2 el1 = etree.SubElement(root, 'dc:language') el1.text = 'en-US' el1 = etree.SubElement(root, 'meta:editing-cycles') el1.text = '1' el1 = etree.SubElement(root, 'meta:editing-duration') el1.text = 'PT00M01S' title = self.visitor.get_title() el1 = etree.SubElement(root, 'dc:title') if title: el1.text = title else: el1.text = '[no title]' s1 = etree.tostring(doc) #doc = minidom.parseString(s1) #s1 = doc.toprettyxml(' ') return s1 | 57ceb741b8ea9b94d9b9e314a03912d12bd3c5c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/57ceb741b8ea9b94d9b9e314a03912d12bd3c5c5/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3901,
12,
2890,
4672,
1365,
273,
12031,
18,
1046,
2668,
19789,
30,
5457,
17,
3901,
2187,
5885,
33,
19294,
67,
11368,
67,
31456,
13,
997,
273,
12031,
18,
1046,
2471,
12,
3085,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3901,
12,
2890,
4672,
1365,
273,
12031,
18,
1046,
2668,
19789,
30,
5457,
17,
3901,
2187,
5885,
33,
19294,
67,
11368,
67,
31456,
13,
997,
273,
12031,
18,
1046,
2471,
12,
3085,
... |
... form={'field.foo': u'<h1>&copy;</h1>'}) | ... form={'field.foo': u'<h1>©</h1>'}) | >>> def normalize(s): | 1c686361fede1ef96bd2a1733633f37501e58912 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9522/1c686361fede1ef96bd2a1733633f37501e58912/editingwidgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
3883,
12,
87,
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,
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,
4080,
1652,
3883,
12,
87,
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,
-10... |
print("SUCCESS: "+file+" converged"+" ("+str(round(dt,2))+"s)") | print("SUCCESS: File "+file+" converged successfully."+" ("+str(round(dt,2))+"s)") | def run_tests(argv): clean = 0 printerr = 1 #scan for --help and --clean if len(argv) > 1: for arg in argv: if "--help" in arg: do_help(); exit(0) if "--clean" in arg: clean = 1 if "--error" in arg: if printerr == 0: printerr = 1 if printerr == 1: printerr = 0 print("Starting autotest script") there_dir = os.getcwd() err_ct = 0 ex_ct = 0 first_time = time.time() end_time = 0 #if clean == 1: # print("Go clean?") # determine where the script starts here_dir = os.getcwd() print("Starting from \'"+here_dir+"\'") #determine where we _want_ the script to start if len(argv) > 1: argn = 1 while argn < len(argv): if argv[argn][0] == '-': argn+=1 # ignore anything that looks like a flag else: there_dir = argv[argn] # take the first path and be done with it # poor form but we're not doing much complicated break #locate autotest dirs #autotestdirs = find_autotest_dirs(there_dir) autotestdirs = [] for path, dirs, files in os.walk(there_dir): if "autotest" in dirs: autotestdirs.append(os.path.abspath(os.path.join(path,"autotest"))) #for path in autotestdirs: # print("Found dir: \'"+path+"\'") #locate autotest test files #autotestfiles = find_autotest_files(autotestdirs) autotestfiles = [] for path in autotestdirs: for file in os.listdir(path): if file.startswith("test_") and file.endswith(".glm") and file[0] != '.': autotestfiles.append((path, file)) #for path, file in autotestfiles: # print("Found file: \'"+file+"\'") #build test dirs #for file in autotestfiles: errlist=[] cleanlist=[] for path, file in autotestfiles: err = False slice = file[:-4] currpath = os.getcwd() xpath = os.path.join(path,slice) # path/slice xfile = os.path.join(xpath,file) # path/slice/file.glm if not os.path.exists(xpath): os.mkdir(xpath) if os.path.exists(os.path.join(xpath,"gridlabd.xml")): os.remove(os.path.join(xpath,"gridlabd.xml")) shutil.copy2(os.path.join(path,file), xfile) # path/file to path/slice/file os.chdir(xpath) #print("cwd: "+xpath) # build conf files # moo? #run files with popen #run file with: outfile = open(os.path.join(xpath,"outfile.txt"), "w") errfile = open(os.path.join(xpath,"errfile.txt"), "w") #print("NOTICE: Running \'"+xfile+"\'") start_time = time.time(); rv = subprocess.call(["gridlabd",xfile],stdout=outfile,stderr=errfile) end_time = time.time(); dt = end_time - start_time outfile.close() errfile.close() if os.path.exists(os.path.join(xpath,"gridlabd.xml")): statinfo = os.stat(os.path.join(xpath, "gridlabd.xml")) if(statinfo.st_mtime > start_time): if rv == 0: # didn't succeed if gridlabd.xml exists & updated since runtime rv = 1 # handle results if "err_" in file or "_err" in file: if rv == 0: if "opt_" in file or "_opt" in file: print("WARNING: Optional "+file+" converged when it shouldn't've"+" ("+str(round(dt,2))+"s)") cleanlist.append((path, file)) err = False else: print("ERROR: "+file+" converged when it shouldn't've"+" ("+str(round(dt,2))+"s)") print_error(path, printerr) err_ct += 1 err = True elif rv == 2: print("SUCCESS: "+file+" failed to converge, as planned."+" ("+str(round(dt,2))+"s)") cleanlist.append((path, file)) elif rv == 1: print("EXCEPTION: "+file+" failed to load"+" ("+str(dt)+"s)") print_error(path, printerr) ex_ct += 1 err = True else: print("EXCEPTION: "+file+" unrecognized return value ("+str(rv)+")"+" ("+str(round(dt,2))+"s)") print_error(path, printerr) ex_ct += 1 err = True elif "exc_" in file or "_exc" in file: if rv == 0: if "opt_" in file or "_opt" in file: print("WARNING: Optional "+file+" loaded when it shouldn't've"+" ("+str(round(dt,2))+"s)") cleanlist.append((path, file)) err = False else: print("ERROR: "+file+" loaded when it shouldn't've"+" ("+str(round(dt,2))+"s)") err_ct += 1 err = True elif rv == 1: print("SUCCESS: "+file+" failed to load, as planned"+" ("+str(round(dt,2))+"s)") cleanlist.append((path, file)) else: print("EXCEPTION: "+file+" unrecognized return value ("+str(rv)+")"+" ("+str(round(dt,2))+"s)") print_error(path, printerr) ex_ct += 1 err = True else: if rv == 2: if "opt_" in file or "_opt" in file: print("WARNING: Optional "+file+" failed to converge"+" ("+str(round(dt,2))+"s)") cleanlist.append((path, file)) err = False else: err_ct += 1 print("ERROR: "+file+" failed to converge"+" ("+str(round(dt,2))+"s)") print_error(path, printerr) err = True elif rv == 1: print("EXCEPTION: "+file+" failed to load"+" ("+str(round(dt,2))+"s)") print_error(path, printerr) ex_ct += 1 err = True elif rv == 0: print("SUCCESS: "+file+" converged"+" ("+str(round(dt,2))+"s)") cleanlist.append((path, file)) else: print("EXCEPTION: "+file+": unrecognized return value ("+str(rv)+")"+" ("+str(round(dt,2))+"s)") print_error(path, printerr) ex_ct += 1 err = True if err: # zip target directory errlist.append((path,file)) os.chdir(currpath) #print("cwd: "+currpath) # end autotestfiles loop #cleanup as appropriate #for cleanfile, cleanpath in cleanlist: # for path, dirs, file in os.walk(cleanpath): # print("foo") #end #print("bar") last_time = time.time() dt = last_time - first_time #return success/failure print("Validation detected "+str(err_ct)+" models with errors and "+str(ex_ct)+" models with exceptions in "+str(round(dt,2))+" seconds.") for errpath, errfile in errlist: print(" * "+os.path.join(errpath, errfile)) exit(err_ct+ex_ct) | df94e5b8a9553981a05c88f42b7f6175b9153ec1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/43/df94e5b8a9553981a05c88f42b7f6175b9153ec1/validate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
12,
19485,
4672,
2721,
273,
374,
1172,
370,
273,
404,
468,
9871,
364,
1493,
5201,
471,
1493,
6200,
309,
562,
12,
19485,
13,
405,
404,
30,
364,
1501,
316,
5261,
30,
309... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
12,
19485,
4672,
2721,
273,
374,
1172,
370,
273,
404,
468,
9871,
364,
1493,
5201,
471,
1493,
6200,
309,
562,
12,
19485,
13,
405,
404,
30,
364,
1501,
316,
5261,
30,
309... |
if any(self.range) and any(filter(lambda r: r is None, self.range)): | if len(filter(lambda r: r is not None, self.range)) > 0 and \ len(filter(lambda r: r is None, self.range)) > 0: | def allowedValues(self): """ return a list representing the complete set of values that will be returned by recognize() (except None). This may raise an exception if hasStaticValueSet() returns False. """ if any(self.range) and any(filter(lambda r: r is None, self.range)): raise RuntimeError("identifier set (%s) is not closed" % self.name) | 005069717b34defa495d43dfcc4d1a776cbfe2f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6545/005069717b34defa495d43dfcc4d1a776cbfe2f4/id.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25080,
12,
2890,
4672,
3536,
327,
279,
666,
5123,
326,
3912,
444,
434,
924,
716,
903,
506,
2106,
635,
21431,
1435,
261,
14137,
599,
2934,
225,
1220,
2026,
1002,
392,
1520,
309,
711,
5788... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25080,
12,
2890,
4672,
3536,
327,
279,
666,
5123,
326,
3912,
444,
434,
924,
716,
903,
506,
2106,
635,
21431,
1435,
261,
14137,
599,
2934,
225,
1220,
2026,
1002,
392,
1520,
309,
711,
5788... |
Returns the b-statistic for the Dyck word corresponding to the bounce statistic of the Dyck word. | Returns the b-statistic for the Dyck word corresponding to the bounce statistic of the Dyck word. | def b_statistic(self): r""" Returns the b-statistic for the Dyck word corresponding to the bounce statistic of the Dyck word. One can view a balanced Dyck word as a lattice path from `(0,0)` to `(n,n)` in the first quadrant by letting '1's represent steps in the direction `(0,1)` and '0's represent steps in the direction `(1,0)`. The resulting path will remain weakly above the diagonal `y = x`. We describe the b-statistic of such a path in terms of what is known as the "bounce path". We can think of our bounce path as describing the trail of a billiard ball shot West from (n, n), which "bounces" down whenever it encounters a vertical step and "bounces" left when it encounters the line y = x. | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
67,
5642,
5846,
12,
2890,
4672,
436,
8395,
2860,
326,
324,
17,
5642,
5846,
364,
326,
463,
93,
363,
2076,
4656,
358,
326,
324,
8386,
21605,
434,
326,
463,
93,
363,
2076,
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,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
67,
5642,
5846,
12,
2890,
4672,
436,
8395,
2860,
326,
324,
17,
5642,
5846,
364,
326,
463,
93,
363,
2076,
4656,
358,
326,
324,
8386,
21605,
434,
326,
463,
93,
363,
2076,
18,
225,
... |
if op is r_operator: if self._r_assoc: | if rop._binary: if op is r_operator: if self._r_assoc: rparens = False elif self._precedence == rop._precedence: if self._r_assoc: rparens = False elif self._precedence < rop._precedence: | def _repr_(self, simplify=True): """ TESTS: sage: a = (1-1/r)^(-1); a 1/(1 - 1/r) sage: a.derivative(r) -1/((1 - 1/r)^2*r^2) | a3e1ab6e3ad7fae21c3295e0c62a4037d937329a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/a3e1ab6e3ad7fae21c3295e0c62a4037d937329a/calculus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12715,
67,
12,
2890,
16,
16499,
33,
5510,
4672,
3536,
22130,
55,
30,
272,
410,
30,
279,
273,
261,
21,
17,
21,
19,
86,
13,
66,
19236,
21,
1769,
279,
404,
19,
12,
21,
300,
404,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12715,
67,
12,
2890,
16,
16499,
33,
5510,
4672,
3536,
22130,
55,
30,
272,
410,
30,
279,
273,
261,
21,
17,
21,
19,
86,
13,
66,
19236,
21,
1769,
279,
404,
19,
12,
21,
300,
404,
... |
hb = gtk.HBox() | bb = gtk.HButtonBox() bb.set_layout(gtk.BUTTONBOX_END) | def cb_no_clicked(self): record.args[2](False) | a8c2edc09d07d2894c71210dc6abea06c13b427e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2233/a8c2edc09d07d2894c71210dc6abea06c13b427e/logmanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2875,
67,
2135,
67,
7475,
329,
12,
2890,
4672,
1409,
18,
1968,
63,
22,
29955,
8381,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2875,
67,
2135,
67,
7475,
329,
12,
2890,
4672,
1409,
18,
1968,
63,
22,
29955,
8381,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
megaprocess_config = {'name': 'megaprocess', 'pipeline': 'uiuiuiui', 'type': 'process', 'target': 'yay'} gst_config = {'name': 'supertest', 'pipeline': 'pppppl', 'type': 'gstreamer', 'target': 'yay'} coherence = self.CoherenceStump(transcoder=[gst_config, megaprocess_config]) | coherence = self.CoherenceStump(transcoder=[self.gst_config, self.process_config]) | def test_is_loading_multiple_from_config(self): megaprocess_config = {'name': 'megaprocess', 'pipeline': 'uiuiuiui', 'type': 'process', 'target': 'yay'} | 57524504b476672a4f25a706269d224fefb63a33 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11626/57524504b476672a4f25a706269d224fefb63a33/test_transcoder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
291,
67,
15174,
67,
9622,
67,
2080,
67,
1425,
12,
2890,
4672,
312,
1332,
438,
16127,
67,
1425,
273,
13666,
529,
4278,
296,
81,
1332,
438,
16127,
2187,
296,
14511,
4278,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1842,
67,
291,
67,
15174,
67,
9622,
67,
2080,
67,
1425,
12,
2890,
4672,
312,
1332,
438,
16127,
67,
1425,
273,
13666,
529,
4278,
296,
81,
1332,
438,
16127,
2187,
296,
14511,
4278,
296,
... |
- ``childs``: a function returning a list (or iterable) | - ``children``: a function returning a list (or iterable) | def search_forest_iterator(roots, childs): """ INPUT: - ``roots``: a list (or iterable) - ``childs``: a function returning a list (or iterable) Returns an iterator on the nodes of the forest having the given roots, and where ``child(x)`` returns the childs of the node ``x`` of the forest. EXAMPLES:: sage: from sage.combinat.backtrack import search_forest_iterator sage: list(search_forest_iterator([[]], lambda l: [l+[0], l+[1]] if len(l) < 3 else [])) [[], [0], [0, 0], [0, 0, 0], [0, 0, 1], [0, 1], [0, 1, 0], [0, 1, 1], [1], [1, 0], [1, 0, 0], [1, 0, 1], [1, 1], [1, 1, 0], [1, 1, 1]] """ #Invariant: stack[i] contains an iterator for the siblings of the i-th node of the current branch stack = [iter(roots)] while len(stack) > 0: # Try to get the next node at this depth try: node = stack[-1].next() except StopIteration: #If there are no more, go back up the tree # We also need to check if we've exhausted all # possibilities stack.pop() continue yield node stack.append( iter(childs(node)) ) | d1bfa2893dda8805bd4c6dd2e7784bcbd0f5a99d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/d1bfa2893dda8805bd4c6dd2e7784bcbd0f5a99d/backtrack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
1405,
334,
67,
9838,
12,
22078,
16,
21619,
4672,
3536,
12943,
30,
225,
300,
12176,
22078,
10335,
30,
279,
666,
261,
280,
6087,
13,
225,
300,
12176,
5906,
10335,
30,
279,
445,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
1405,
334,
67,
9838,
12,
22078,
16,
21619,
4672,
3536,
12943,
30,
225,
300,
12176,
22078,
10335,
30,
279,
666,
261,
280,
6087,
13,
225,
300,
12176,
5906,
10335,
30,
279,
445,
... |
str = self._var_summary_row(var, container) private.write(str) if var.is_public(): public.write(str) | self._write_var_summary_row(public, private, var, container) | def _write_var_summary(self, public, private, variables, container, groups, heading='Variable Summary'): """ @return: The HTML code for a variable summary table. This is used by L{_module_to_html} to list the variables in a module; and by L{_class_to_html} to list instance variables and class variables. @rtype: C{string} """ if len(variables) == 0: return | 6ecda71cd0e7e4752ddec3a0c1619699a3092855 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/6ecda71cd0e7e4752ddec3a0c1619699a3092855/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
67,
1401,
67,
7687,
12,
2890,
16,
1071,
16,
3238,
16,
3152,
16,
1478,
16,
3252,
16,
11053,
2218,
3092,
17967,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
2190,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2626,
67,
1401,
67,
7687,
12,
2890,
16,
1071,
16,
3238,
16,
3152,
16,
1478,
16,
3252,
16,
11053,
2218,
3092,
17967,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
2190,... |
ref_code = int(open( '%s/%s/code.txt' % (self.base_path, cmdnum)).read()) | ref_code = int( open('%s/%s/code.txt' % (self.base_path, cmdnum)).read() ) | def RunCommand(self, cmdnum, batch=False): | 4a39be2a839d5859b17f80ac690543414526444a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/4a39be2a839d5859b17f80ac690543414526444a/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1939,
2189,
12,
2890,
16,
1797,
2107,
16,
2581,
33,
8381,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1939,
2189,
12,
2890,
16,
1797,
2107,
16,
2581,
33,
8381,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
raise RuntimeError( "%s lock already exists" % sLockName ) | raise RuntimeError( "%s lock already exists" % sLockManagerName ) | def createNewLockManager( self, sLockManagerName ): if sLockManagerName in self.dSubManagers.keys(): raise RuntimeError( "%s lock already exists" % sLockName ) self.dSubManagers[ sLockManagerName ] = LockManager( self.iMaxThreads ) return self.dSubManagers[ sLockManagerName ] | 4e23a42fa63d81204c4c07e511944dde858100c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/4e23a42fa63d81204c4c07e511944dde858100c3/LockManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15291,
2531,
1318,
12,
365,
16,
272,
2531,
1318,
461,
262,
30,
309,
272,
2531,
1318,
461,
316,
365,
18,
72,
1676,
17570,
18,
2452,
13332,
1002,
7265,
12,
2213,
87,
2176,
1818,
1704,
6,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15291,
2531,
1318,
12,
365,
16,
272,
2531,
1318,
461,
262,
30,
309,
272,
2531,
1318,
461,
316,
365,
18,
72,
1676,
17570,
18,
2452,
13332,
1002,
7265,
12,
2213,
87,
2176,
1818,
1704,
6,... |
if MODE == 'gmpy': LOG2_PREC_BSP = 14000 else: LOG2_PREC_BSP = 20000 | def machin(coefs, prec, hyperbolic=False): """ Evaluate a Machin-like formula, i.e., a linear combination of acot(n) or acoth(n) for specific integer values of n, using fixed- point arithmetic. The input should be a list [(c, n), ...], giving c*acot[h](n) + ... """ extraprec = 10 s = MP_ZERO for a, b in coefs: s += MP_BASE(a) * acot_fixed(MP_BASE(b), prec+extraprec, hyperbolic) return (s >> extraprec) | 84b14fb5c4250081cf746822d6aa77dcdf0fe6a7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11851/84b14fb5c4250081cf746822d6aa77dcdf0fe6a7/libelefun.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25046,
267,
12,
8075,
2556,
16,
13382,
16,
9512,
70,
1415,
33,
8381,
4672,
3536,
18176,
279,
490,
497,
267,
17,
5625,
8013,
16,
277,
18,
73,
12990,
279,
9103,
10702,
434,
1721,
352,
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,
25046,
267,
12,
8075,
2556,
16,
13382,
16,
9512,
70,
1415,
33,
8381,
4672,
3536,
18176,
279,
490,
497,
267,
17,
5625,
8013,
16,
277,
18,
73,
12990,
279,
9103,
10702,
434,
1721,
352,
12... | |
count += 1 item = iterator.next player.socket.sysmessage( "%i items have been removed from world" % count ) | player.socket.sysmessage( "%i items have been removed from world" % len(serials) ) | def wipeAllWorld( player, accept, state ): if not accept: player.socket.sysmessage( "Wipe command have been canceled" ) return 1 player.socket.sysmessage( "Removing all items from world, this may take a while" ) iterator = wolfpack.itemiterator() item = iterator.first count = 0 while item: if item.container == None: item.delete() count += 1 item = iterator.next player.socket.sysmessage( "%i items have been removed from world" % count ) return | 8e27d7236d242c83066b1d476e81d2d40875b2b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/8e27d7236d242c83066b1d476e81d2d40875b2b7/wipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
3151,
1595,
18071,
12,
7291,
16,
2791,
16,
919,
262,
30,
309,
486,
2791,
30,
7291,
18,
7814,
18,
9499,
2150,
12,
315,
59,
3151,
1296,
1240,
2118,
17271,
6,
262,
327,
404,
225,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
3151,
1595,
18071,
12,
7291,
16,
2791,
16,
919,
262,
30,
309,
486,
2791,
30,
7291,
18,
7814,
18,
9499,
2150,
12,
315,
59,
3151,
1296,
1240,
2118,
17271,
6,
262,
327,
404,
225,
7... |
def do_hg_checkout(dir, remote, hgroot, hg): fulldir = os.path.join(topsrcdir, dir) repository = '%s/%s' % (hgroot, remote) check_call([hg, 'clone', repository, fulldir]) | def do_hg_checkout(dir, remote, hgroot, hg): fulldir = os.path.join(topsrcdir, dir) repository = '%s/%s' % (hgroot, remote) check_call([hg, 'clone', repository, fulldir]) | 04320ce29e21ddac626ce28e2150dbca584ca20d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11102/04320ce29e21ddac626ce28e2150dbca584ca20d/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
26981,
67,
17300,
12,
1214,
16,
2632,
16,
22576,
3085,
16,
22576,
4672,
1983,
1214,
273,
1140,
18,
803,
18,
5701,
12,
3669,
4816,
1214,
16,
1577,
13,
3352,
273,
1995,
87,
5258... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
26981,
67,
17300,
12,
1214,
16,
2632,
16,
22576,
3085,
16,
22576,
4672,
1983,
1214,
273,
1140,
18,
803,
18,
5701,
12,
3669,
4816,
1214,
16,
1577,
13,
3352,
273,
1995,
87,
5258... | |
self.handle_read_event = callback | self.handle_read_event = handler | def __init__(self, map, file, callback): # Add self to map map[file.fileno()] = self self.handle_read_event = callback | 04a1448feda26fc31294d57ea17d771d9b643819 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12327/04a1448feda26fc31294d57ea17d771d9b643819/pymplayer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
852,
16,
585,
16,
1348,
4672,
468,
1436,
365,
358,
852,
852,
63,
768,
18,
7540,
5764,
1435,
65,
273,
365,
365,
18,
4110,
67,
896,
67,
2575,
273,
1348,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
852,
16,
585,
16,
1348,
4672,
468,
1436,
365,
358,
852,
852,
63,
768,
18,
7540,
5764,
1435,
65,
273,
365,
365,
18,
4110,
67,
896,
67,
2575,
273,
1348,
... |
raise self.failureException, \ (msg or '%r == %r within %r places' % (first, second, places)) | raise self.failureException( msg or '%r == %r within %r places' % (first, second, places)) | def failIfAlmostEqual(self, first, second, places=7, msg=None): """Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. | f64c3e352b01b2c5c40815e4240b2d73462e2ba7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/f64c3e352b01b2c5c40815e4240b2d73462e2ba7/unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2321,
2047,
1067,
10329,
5812,
12,
2890,
16,
1122,
16,
2205,
16,
12576,
33,
27,
16,
1234,
33,
7036,
4672,
3536,
3754,
309,
326,
2795,
2184,
854,
3959,
487,
11383,
635,
3675,
7114,
16729,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2321,
2047,
1067,
10329,
5812,
12,
2890,
16,
1122,
16,
2205,
16,
12576,
33,
27,
16,
1234,
33,
7036,
4672,
3536,
3754,
309,
326,
2795,
2184,
854,
3959,
487,
11383,
635,
3675,
7114,
16729,... |
class handler(WSGIHandler): def alog_request(self, *args, **kwargs): pass | def do_zip_post(self, collection_id, post_data, is_new=False): try: metabook_data = post_data['metabook'] except KeyError, exc: return self.error_response('POST argument required: %s' % exc) base_url = post_data.get('base_url') template_blacklist = post_data.get('template_blacklist', '') template_exclusion_category = post_data.get('template_exclusion_category', '') print_template_prefix = post_data.get('print_template_prefix', '') print_template_pattern = post_data.get('print_template_pattern', '') login_credentials = post_data.get('login_credentials', '') script_extension = post_data.get('script_extension', '') pod_api_url = post_data.get('pod_api_url', '') if pod_api_url: result = json.loads(unicode(urllib2.urlopen(pod_api_url, data="any").read(), 'utf-8')) post_url = result['post_url'].encode('utf-8') response = { 'state': 'ok', 'redirect_url': result['redirect_url'].encode('utf-8'), } else: try: post_url = post_data['post_url'] except KeyError: return self.error_response('POST argument required: post_url') response = {'state': 'ok'} log.info('zip_post %s %s' % (collection_id, pod_api_url)) | 7301f010396fc936f59b45a3f29b337a7ceb823a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12391/7301f010396fc936f59b45a3f29b337a7ceb823a/nserve.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
4450,
67,
2767,
12,
2890,
16,
1849,
67,
350,
16,
1603,
67,
892,
16,
353,
67,
2704,
33,
8381,
4672,
775,
30,
5100,
378,
1184,
67,
892,
273,
1603,
67,
892,
3292,
10578,
378,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
4450,
67,
2767,
12,
2890,
16,
1849,
67,
350,
16,
1603,
67,
892,
16,
353,
67,
2704,
33,
8381,
4672,
775,
30,
5100,
378,
1184,
67,
892,
273,
1603,
67,
892,
3292,
10578,
378,
... | |
sub_ids = ids2[i:i + cursor.IN_MAX] | sub_ids2 = ids2[i:i + cursor.IN_MAX] | def __where_calc(self, cursor, user, args, tables, tables_args, context=None): if context is None: context = {} i = 0 joins = [] while i < len(args): if args[i][1] not in ( 'child_of', '=', 'like', 'ilike', '', '!=', 'in', '<=', '>=', '<', '>'): raise Exception('ValidateError', 'Argument "%s" not supported' \ % args[i][1]) | 3b8d24eb9af0ae512a40d9dd3d7071af95c9878a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9266/3b8d24eb9af0ae512a40d9dd3d7071af95c9878a/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
6051,
67,
12448,
12,
2890,
16,
3347,
16,
729,
16,
833,
16,
4606,
16,
4606,
67,
1968,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
277,
273,
374,
13471,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
6051,
67,
12448,
12,
2890,
16,
3347,
16,
729,
16,
833,
16,
4606,
16,
4606,
67,
1968,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
277,
273,
374,
13471,
273,... |
print self.html etree.dump(html_tree) raise ODTExportError() | def select_id(self): """ Replace the HTML content by an element in the content. The element is selected by its HTML ID. """ try: html_tree = etree.fromstring(self.html) except etree.XMLSyntaxError: if self.options.verbose: raise else: raise ODTExportError("The XHTML is still not valid after " "Tidy's work, I can't convert it.") selected = html_tree.xpath("//*[@id='%s']" % self.options.htmlid) if selected: self.html = etree.tostring(selected[0], method="html") else: print >> sys.stderr, "Can't find the selected HTML id: %s, " \ % self.options.htmlid \ +"converting everything." print self.html etree.dump(html_tree) raise ODTExportError() | b7a11cdadc408e117dc5f65bb99c6926035231e3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7063/b7a11cdadc408e117dc5f65bb99c6926035231e3/xhtml2odt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
67,
350,
12,
2890,
4672,
3536,
6910,
326,
3982,
913,
635,
392,
930,
316,
326,
913,
18,
1021,
930,
353,
3170,
635,
2097,
3982,
1599,
18,
3536,
775,
30,
1729,
67,
3413,
273,
12031,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
67,
350,
12,
2890,
4672,
3536,
6910,
326,
3982,
913,
635,
392,
930,
316,
326,
913,
18,
1021,
930,
353,
3170,
635,
2097,
3982,
1599,
18,
3536,
775,
30,
1729,
67,
3413,
273,
12031,... | |
mysuffixes = ['.log' , '.fls' , targetext] for filename in out_files: base,ext = SCons.Util.splitext(filename) if ext in mysuffixes: | myfiles = [auxfilename, logfilename, flsfilename, targetbase+'.dvi',targetbase+'.pdf'] for filename in out_files[:]: if filename in myfiles: | def tex_emitter_core(target, source, env, graphics_extensions): """An emitter for TeX and LaTeX sources. For LaTeX sources we try and find the common created files that are needed on subsequent runs of latex to finish tables of contents, bibliographies, indices, lists of figures, and hyperlink references. """ targetbase, targetext = SCons.Util.splitext(str(target[0])) basename = SCons.Util.splitext(str(source[0]))[0] basefile = os.path.split(str(basename))[1] basedir = os.path.split(str(source[0]))[0] targetdir = os.path.split(str(target[0]))[0] abspath = os.path.abspath(basedir) target[0].attributes.path = abspath # # file names we will make use of in searching the sources and log file # emit_suffixes = ['.aux', '.log', '.ilg', '.blg', '.nls', '.nlg', '.gls', '.glg'] + all_suffixes auxfilename = targetbase + '.aux' logfilename = targetbase + '.log' flsfilename = targetbase + '.fls' env.SideEffect(auxfilename,target[0]) env.SideEffect(logfilename,target[0]) env.SideEffect(flsfilename,target[0]) env.Clean(target[0],auxfilename) env.Clean(target[0],logfilename) env.Clean(target[0],flsfilename) content = source[0].get_text_contents() idx_exists = os.path.exists(targetbase + '.idx') nlo_exists = os.path.exists(targetbase + '.nlo') glo_exists = os.path.exists(targetbase + '.glo') # set up list with the regular expressions # we use to find features used file_tests_search = [auxfile_re, makeindex_re, bibliography_re, tableofcontents_re, listoffigures_re, listoftables_re, hyperref_re, makenomenclature_re, makeglossary_re, beamer_re ] # set up list with the file suffixes that need emitting # when a feature is found file_tests_suff = [['.aux'], ['.idx', '.ind', '.ilg'], ['.bbl', '.blg'], ['.toc'], ['.lof'], ['.lot'], ['.out'], ['.nlo', '.nls', '.nlg'], ['.glo', '.gls', '.glg'], ['.nav', '.snm', '.out', '.toc'] ] # build the list of lists file_tests = [] for i in range(len(file_tests_search)): file_tests.append( [None, file_tests_suff[i]] ) # TO-DO: need to add a way for the user to extend this list for whatever # auxiliary files they create in other (or their own) packages # get path list from both env['TEXINPUTS'] and env['ENV']['TEXINPUTS'] savedpath = modify_env_var(env, 'TEXINPUTS', abspath) paths = env['ENV']['TEXINPUTS'] if SCons.Util.is_List(paths): pass else: # Split at os.pathsep to convert into absolute path # TODO(1.5) #paths = paths.split(os.pathsep) paths = string.split(paths, os.pathsep) # now that we have the path list restore the env if savedpath is _null: try: del env['ENV']['TEXINPUTS'] except KeyError: pass # was never set else: env['ENV']['TEXINPUTS'] = savedpath if Verbose: print "search path ",paths file_tests = ScanFiles(source[0], target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir) for (theSearch,suffix_list) in file_tests: if theSearch: for suffix in suffix_list: env.SideEffect(targetbase + suffix,target[0]) env.Clean(target[0],targetbase + suffix) # read fls file to get all other files that latex creates and will read on the next pass if os.path.exists(flsfilename): content = open(flsfilename, "rb").read() out_files = openout_re.findall(content) mysuffixes = ['.log' , '.fls' , targetext] for filename in out_files: base,ext = SCons.Util.splitext(filename) if ext in mysuffixes: out_files.remove(filename) env.SideEffect(out_files,target[0]) env.Clean(target[0],out_files) return (target, source) | 7e6341a1012201a5cd10465412ee4f950cd46983 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12817/7e6341a1012201a5cd10465412ee4f950cd46983/tex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16573,
67,
27529,
67,
3644,
12,
3299,
16,
1084,
16,
1550,
16,
17313,
67,
9489,
4672,
3536,
979,
11520,
364,
28602,
60,
471,
21072,
21575,
60,
5550,
18,
2457,
21072,
21575,
60,
5550,
732,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16573,
67,
27529,
67,
3644,
12,
3299,
16,
1084,
16,
1550,
16,
17313,
67,
9489,
4672,
3536,
979,
11520,
364,
28602,
60,
471,
21072,
21575,
60,
5550,
18,
2457,
21072,
21575,
60,
5550,
732,... |
'''Returns selected text if any. If not, returns the current line''' | """Returns selected text if any. If not, returns the current line""" | def GetSelectedTextOrLine(self): '''Returns selected text if any. If not, returns the current line''' selection = str(self.codeSubWin.GetSelectedText()) if selection == "": # get current line, return if not at an open '(' bracket currentLine = self.codeSubWin.GetLine(self.codeSubWin.GetCurrentLine()) selection = str(currentLine) # see if the cursor is at a matched bracket x, y = self.codeSubWin.CheckForMatchingBraces() if x != -1 and y != -1: if chr(self.codeSubWin.GetCharAt(x)) == "(": # make sure the open bracket is the first character in the line if currentLine.strip().find('(') == 0: # get all text up to and including the closing bracket selection = str(self.codeSubWin.GetTextRange(x, y+1)) return selection | cc443dd98e01d739acfd83b09946a7583c28ee2f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14712/cc443dd98e01d739acfd83b09946a7583c28ee2f/Psycollider.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
7416,
1528,
1162,
1670,
12,
2890,
4672,
3536,
1356,
3170,
977,
309,
1281,
18,
971,
486,
16,
1135,
326,
783,
980,
8395,
4421,
273,
609,
12,
2890,
18,
710,
1676,
18049,
18,
967,
741... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
7416,
1528,
1162,
1670,
12,
2890,
4672,
3536,
1356,
3170,
977,
309,
1281,
18,
971,
486,
16,
1135,
326,
783,
980,
8395,
4421,
273,
609,
12,
2890,
18,
710,
1676,
18049,
18,
967,
741... |
tmprec = get_record(recid_to_display) | tmprec = get_record(recid) | def print_records(req, recIDs, jrec=1, rg=10, format='hb', ot='', ln=CFG_SITE_LANG, relevances=[], relevances_prologue="(", relevances_epilogue="%%)", decompress=zlib.decompress, search_pattern='', print_records_prologue_p=True, print_records_epilogue_p=True, verbose=0, tab=''): """ Prints list of records 'recIDs' formatted according to 'format' in groups of 'rg' starting from 'jrec'. Assumes that the input list 'recIDs' is sorted in reverse order, so it counts records from tail to head. A value of 'rg=-9999' means to print all records: to be used with care. Print also list of RELEVANCES for each record (if defined), in between RELEVANCE_PROLOGUE and RELEVANCE_EPILOGUE. Print prologue and/or epilogue specific to 'format' if 'print_records_prologue_p' and/or print_records_epilogue_p' are True. """ # load the right message language _ = gettext_set_language(ln) # sanity checking: if req is None: return # get user_info (for formatting based on user) if isinstance(req, cStringIO.OutputType): user_info = {} else: user_info = collect_user_info(req) if len(recIDs): nb_found = len(recIDs) if rg == -9999: # print all records rg = nb_found else: rg = abs(rg) if jrec < 1: # sanity checks jrec = 1 if jrec > nb_found: jrec = max(nb_found-rg+1, 1) # will print records from irec_max to irec_min excluded: irec_max = nb_found - jrec irec_min = nb_found - jrec - rg if irec_min < 0: irec_min = -1 if irec_max >= nb_found: irec_max = nb_found - 1 #req.write("%s:%d-%d" % (recIDs, irec_min, irec_max)) if format.startswith('x'): # print header if needed if print_records_prologue_p: print_records_prologue(req, format) # print records recIDs_to_print = [recIDs[x] for x in range(irec_max, irec_min, -1)] format_records(recIDs_to_print, format, ln=ln, search_pattern=search_pattern, record_separator="\n", user_info=user_info, req=req) # print footer if needed if print_records_epilogue_p: print_records_epilogue(req, format) elif format.startswith('t') or str(format[0:3]).isdigit(): # we are doing plain text output: for irec in range(irec_max, irec_min, -1): x = print_record(recIDs[irec], format, ot, ln, search_pattern=search_pattern, user_info=user_info, verbose=verbose) req.write(x) if x: req.write('\n') elif format == 'excel': recIDs_to_print = [recIDs[x] for x in range(irec_max, irec_min, -1)] create_excel(recIDs=recIDs_to_print, req=req, ln=ln, ot=ot) else: # we are doing HTML output: if format == 'hp' or format.startswith("hb_") or format.startswith("hd_"): # portfolio and on-the-fly formats: for irec in range(irec_max, irec_min, -1): req.write(print_record(recIDs[irec], format, ot, ln, search_pattern=search_pattern, user_info=user_info, verbose=verbose)) elif format.startswith("hb"): # HTML brief format: display_add_to_basket = True if user_info: if user_info['email'] == 'guest': if CFG_ACCESS_CONTROL_LEVEL_ACCOUNTS > 4: display_add_to_basket = False else: if not user_info['precached_usebaskets']: display_add_to_basket = False req.write(websearch_templates.tmpl_record_format_htmlbrief_header( ln = ln)) for irec in range(irec_max, irec_min, -1): row_number = jrec+irec_max-irec recid = recIDs[irec] if relevances and relevances[irec]: relevance = relevances[irec] else: relevance = '' record = print_record(recIDs[irec], format, ot, ln, search_pattern=search_pattern, user_info=user_info, verbose=verbose) req.write(websearch_templates.tmpl_record_format_htmlbrief_body( ln = ln, recid = recid, row_number = row_number, relevance = relevance, record = record, relevances_prologue = relevances_prologue, relevances_epilogue = relevances_epilogue, display_add_to_basket = display_add_to_basket )) req.write(websearch_templates.tmpl_record_format_htmlbrief_footer( ln = ln, display_add_to_basket = display_add_to_basket)) elif format.startswith("hd"): # HTML detailed format: for irec in range(irec_max, irec_min, -1): if record_exists(recIDs[irec]) == -1: print_warning(req, _("The record has been deleted.")) continue unordered_tabs = get_detailed_page_tabs(get_colID(guess_primary_collection_of_a_record(recIDs[irec])), recIDs[irec], ln=ln) ordered_tabs_id = [(tab_id, values['order']) for (tab_id, values) in unordered_tabs.iteritems()] ordered_tabs_id.sort(lambda x,y: cmp(x[1],y[1])) link_ln = '' if ln != CFG_SITE_LANG: link_ln = '?ln=%s' % ln if CFG_WEBSEARCH_USE_ALEPH_SYSNOS: recid_to_display = get_fieldvalues(recIDs[irec], CFG_BIBUPLOAD_EXTERNAL_SYSNO_TAG)[0] else: recid_to_display = recIDs[irec] citedbynum = 0 #num of citations, to be shown in the cit tab references = -1 #num of references citedbynum = get_cited_by_count(recid_to_display) reftag = "" reftags = get_field_tags("reference") if reftags: reftag = reftags[0] tmprec = get_record(recid_to_display) if reftag and len(reftag) > 4: references = len(record_get_field_instances(tmprec, reftag[0:3], reftag[3], reftag[4])) tabs = [(unordered_tabs[tab_id]['label'], \ '%s/record/%s/%s%s' % (CFG_SITE_URL, recid_to_display, tab_id, link_ln), \ tab_id == tab, unordered_tabs[tab_id]['enabled']) \ for (tab_id, order) in ordered_tabs_id if unordered_tabs[tab_id]['visible'] == True] # load content if tab == 'usage': req.write(webstyle_templates.detailed_record_container_top(recIDs[irec], tabs, ln, citationnum=citedbynum, referencenum=references)) r = calculate_reading_similarity_list(recIDs[irec], "downloads") downloadsimilarity = None downloadhistory = None #if r: # downloadsimilarity = r if CFG_BIBRANK_SHOW_DOWNLOAD_GRAPHS: downloadhistory = create_download_history_graph_and_box(recIDs[irec], ln) r = calculate_reading_similarity_list(recIDs[irec], "pageviews") viewsimilarity = None if r: viewsimilarity = r content = websearch_templates.tmpl_detailed_record_statistics(recIDs[irec], ln, downloadsimilarity=downloadsimilarity, downloadhistory=downloadhistory, viewsimilarity=viewsimilarity) req.write(content) req.write(webstyle_templates.detailed_record_container_bottom(recIDs[irec], tabs, ln)) elif tab == 'citations': recid = recIDs[irec] req.write(webstyle_templates.detailed_record_container_top(recid, tabs, ln, citationnum=citedbynum, referencenum=references)) req.write(websearch_templates.tmpl_detailed_record_citations_prologue(recid, ln)) # Citing citinglist = calculate_cited_by_list(recid) req.write(websearch_templates.tmpl_detailed_record_citations_citing_list(recid, ln, citinglist=citinglist)) # Self-cited selfcited = get_self_cited_by(recid) req.write(websearch_templates.tmpl_detailed_record_citations_self_cited(recid, ln, selfcited=selfcited, citinglist=citinglist)) # Co-cited s = calculate_co_cited_with_list(recid) cociting = None if s: cociting = s req.write(websearch_templates.tmpl_detailed_record_citations_co_citing(recid, ln, cociting=cociting)) # Citation history, if needed citationhistory = None if citinglist: citationhistory = create_citation_history_graph_and_box(recid, ln) #debug if verbose > 3: print_warning(req, "Citation graph debug: " + \ str(len(citationhistory))) req.write(websearch_templates.tmpl_detailed_record_citations_citation_history(recid, ln, citationhistory)) req.write(websearch_templates.tmpl_detailed_record_citations_epilogue(recid, ln)) req.write(webstyle_templates.detailed_record_container_bottom(recid, tabs, ln)) elif tab == 'references': req.write(webstyle_templates.detailed_record_container_top(recIDs[irec], tabs, ln, citationnum=citedbynum, referencenum=references)) req.write(format_record(recIDs[irec], 'HDREF', ln=ln, user_info=user_info, verbose=verbose)) req.write(webstyle_templates.detailed_record_container_bottom(recIDs[irec], tabs, ln)) elif tab == 'keywords': from bibclassify_webinterface import \ record_get_keywords, get_sorting_options, \ generate_keywords, get_keywords_body from invenio.webinterface_handler import wash_urlargd form = req.form argd = wash_urlargd(form, { 'generate': (str, 'no'), 'sort': (str, 'occurrences'), 'type': (str, 'tagcloud'), 'numbering': (str, 'off'), }) recid = recIDs[irec] req.write(webstyle_templates.detailed_record_container_top(recid, tabs, ln, citationnum=citedbynum, referencenum=references)) if argd['generate'] == 'yes': # The user asked to generate the keywords. keywords = generate_keywords(req, recid) else: # Get the keywords contained in the MARC. keywords = record_get_keywords(recid, argd) if keywords: req.write(get_sorting_options(argd, keywords)) elif argd['sort'] == 'related' and not keywords: req.write('You may want to run BibIndex.') # Output the keywords or the generate button. get_keywords_body(keywords, req, recid, argd) req.write(webstyle_templates.detailed_record_container_bottom(recid, tabs, ln)) else: # Metadata tab req.write(webstyle_templates.detailed_record_container_top(recIDs[irec], tabs, ln, show_short_rec_p=False, citationnum=citedbynum, referencenum=references)) creationdate = None modificationdate = None if record_exists(recIDs[irec]) == 1: creationdate = get_creation_date(recIDs[irec]) modificationdate = get_modification_date(recIDs[irec]) content = print_record(recIDs[irec], format, ot, ln, search_pattern=search_pattern, user_info=user_info, verbose=verbose) content = websearch_templates.tmpl_detailed_record_metadata( recID = recIDs[irec], ln = ln, format = format, creationdate = creationdate, modificationdate = modificationdate, content = content) req.write(content) req.write(webstyle_templates.detailed_record_container_bottom(recIDs[irec], tabs, ln, creationdate=creationdate, modificationdate=modificationdate, show_short_rec_p=False)) if len(tabs) > 0: # Add the mini box at bottom of the page if CFG_WEBCOMMENT_ALLOW_REVIEWS: from invenio.webcomment import get_mini_reviews reviews = get_mini_reviews(recid = recIDs[irec], ln=ln) else: reviews = '' actions = format_record(recIDs[irec], 'HDACT', ln=ln, user_info=user_info, verbose=verbose) files = format_record(recIDs[irec], 'HDFILE', ln=ln, user_info=user_info, verbose=verbose) req.write(webstyle_templates.detailed_record_mini_panel(recIDs[irec], ln, format, files=files, reviews=reviews, actions=actions)) else: # Other formats for irec in range(irec_max, irec_min, -1): req.write(print_record(recIDs[irec], format, ot, ln, search_pattern=search_pattern, user_info=user_info, verbose=verbose)) else: print_warning(req, _("Use different search terms.")) | 768179383f6b818b3f13d15262059d26304c992f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2139/768179383f6b818b3f13d15262059d26304c992f/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
7094,
12,
3658,
16,
1950,
5103,
16,
525,
3927,
33,
21,
16,
14524,
33,
2163,
16,
740,
2218,
76,
70,
2187,
15835,
2218,
2187,
7211,
33,
19727,
67,
20609,
67,
10571,
16,
6707,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
7094,
12,
3658,
16,
1950,
5103,
16,
525,
3927,
33,
21,
16,
14524,
33,
2163,
16,
740,
2218,
76,
70,
2187,
15835,
2218,
2187,
7211,
33,
19727,
67,
20609,
67,
10571,
16,
6707,
... |
self.request.theme.add_msg(unicode(err), "error") | self.request.theme.add_msg(wikiutil.escape(unicode(err)), "error") | def execute(self): _ = self.request.getText try: self.setSlideNumber() language = self.page.pi['language'] self.request.setContentLanguage(language) self.request.write(self.template % self) except Error, err: self.request.theme.add_msg(unicode(err), "error") self.page.send_page() | f3aa7f2c7d8d8bbd8d1cbfbec1fedac8a0920ed5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/888/f3aa7f2c7d8d8bbd8d1cbfbec1fedac8a0920ed5/SlideShow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
389,
273,
365,
18,
2293,
18,
588,
1528,
775,
30,
365,
18,
542,
21068,
1854,
1435,
2653,
273,
365,
18,
2433,
18,
7259,
3292,
4923,
3546,
365,
18,
2293,
18,
542,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
389,
273,
365,
18,
2293,
18,
588,
1528,
775,
30,
365,
18,
542,
21068,
1854,
1435,
2653,
273,
365,
18,
2433,
18,
7259,
3292,
4923,
3546,
365,
18,
2293,
18,
542,
... |
warn ("field '%s'" % field_name) | def handle_exact_field (m): field_name = m.group (0) warn ("field '%s'" % field_name) def gen (r): yield field_name return gen | 2dc6cae27c55750383c97b249105ad8f1e12e949 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3913/2dc6cae27c55750383c97b249105ad8f1e12e949/parse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
17165,
67,
1518,
261,
81,
4672,
652,
67,
529,
273,
312,
18,
1655,
261,
20,
13,
225,
1652,
3157,
261,
86,
4672,
2824,
652,
67,
529,
327,
3157,
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,
1640,
67,
17165,
67,
1518,
261,
81,
4672,
652,
67,
529,
273,
312,
18,
1655,
261,
20,
13,
225,
1652,
3157,
261,
86,
4672,
2824,
652,
67,
529,
327,
3157,
2,
-100,
-100,
-100,
-100,
-10... | |
pieces.append(plural(self.hours, 'hour')) if minutes or len(pieces) == 0: self.pieces.append(self.plural(self.minutes, 'minute')) if len(self.pieces) == 1: return self.pieces[0] self.labelTime.set_text("Time: " + ", ".join(self.pieces[:-1]) + " and " + self.pieces[-1] + " ago") | self.pieces.append(self.__plural(self.hours, 'hour')) if self.minutes or len(self.pieces) == 0: self.pieces.append(self.__plural(self.minutes, 'minute')) self.labelTime.set_text("Time: " + ", ".join(self.pieces) + " ago") | def __calcsince(self, dtime): | 6b3b3f0c89bc99da68c6a9f4f5106064aa3c0ad1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/943/6b3b3f0c89bc99da68c6a9f4f5106064aa3c0ad1/uigtk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
771,
2143,
2410,
12,
2890,
16,
302,
957,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
771,
2143,
2410,
12,
2890,
16,
302,
957,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.disabled = False | self.disabled = 0 | def __init__(self, control, widget, attribute): self.control = control self.widget = widget self.disabled = False | 85741d6f825457214a1913669cf163505ff1d54e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/85741d6f825457214a1913669cf163505ff1d54e/OWGUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3325,
16,
3604,
16,
1566,
4672,
365,
18,
7098,
273,
3325,
365,
18,
6587,
273,
3604,
365,
18,
9278,
273,
1083,
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,
0,
0,
0,
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,
3325,
16,
3604,
16,
1566,
4672,
365,
18,
7098,
273,
3325,
365,
18,
6587,
273,
3604,
365,
18,
9278,
273,
1083,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
DATA_DIR="/usr/share/sinthgunt/" | DATA_DIR=sys.prefix+"/share/sinthgunt/" | def main(): #################### # System checks #################### # Check to see if ffmpeg is installed if os.path.exists("/usr/bin/ffmpeg"): print('ffmpeg found. Starting Sinthgunt...')# carry on else: print('It seems, that ffmpeg is not installed on this computer. \nSee http://www.sinthgunt.org for installation instructions.') # Display error message, then carry on # Define data and temp directories DATA_DIR="/usr/share/sinthgunt/" TEMP_DIR="/tmp/" # Opens the log file and write the name and curent data and time logfile_filename = os.path.expanduser("~/.sinthgunt.log") logfile = open(logfile_filename, 'a') logfile.writelines('****** Sinthgunt log file START - '+ str(time.ctime())+' *******\n') logo_filename=DATA_DIR+"logo.png" # Carry over variables to class sinthgunt.logo_filename = logo_filename sinthgunt.DATA_DIR = DATA_DIR sinthgunt.logfile = logfile sinthgunt.TEMP_DIR = TEMP_DIR # Run the main loop program = sinthgunt() gtk.main() | a41c0fa060f602f52cc8961cc779c8d4bc393441 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4607/a41c0fa060f602f52cc8961cc779c8d4bc393441/app.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
29570,
13151,
468,
2332,
4271,
29570,
13151,
468,
2073,
358,
2621,
309,
6875,
19951,
353,
5876,
309,
1140,
18,
803,
18,
1808,
2932,
19,
13640,
19,
4757,
19,
1403,
19951,
6,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
29570,
13151,
468,
2332,
4271,
29570,
13151,
468,
2073,
358,
2621,
309,
6875,
19951,
353,
5876,
309,
1140,
18,
803,
18,
1808,
2932,
19,
13640,
19,
4757,
19,
1403,
19951,
6,
... |
users = acl_folder.findUser(search_param='uid', search_term=p_username) if len(users) > 0: return unicode(users[0].get('cn', ''), 'iso-8859-1').encode('utf-8') | user = self._get_user_by_uid(p_username, acl_folder) if user is not None: return unicode(user.get('cn', ''), 'iso-8859-1').encode('utf-8') | def getUserFullName(self, p_username, acl_folder): #return the email of the given user id users = acl_folder.findUser(search_param='uid', search_term=p_username) if len(users) > 0: return unicode(users[0].get('cn', ''), 'iso-8859-1').encode('utf-8') else: return '' | 8f2bab37694f9821eb7fab0b3216ecb523a3707b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3287/8f2bab37694f9821eb7fab0b3216ecb523a3707b/plugLDAPUserFolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4735,
19223,
12,
2890,
16,
293,
67,
5053,
16,
7895,
67,
5609,
4672,
468,
2463,
326,
2699,
434,
326,
864,
729,
612,
729,
273,
365,
6315,
588,
67,
1355,
67,
1637,
67,
1911,
12,
84,
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,
4735,
19223,
12,
2890,
16,
293,
67,
5053,
16,
7895,
67,
5609,
4672,
468,
2463,
326,
2699,
434,
326,
864,
729,
612,
729,
273,
365,
6315,
588,
67,
1355,
67,
1637,
67,
1911,
12,
84,
67,... |
ttf_p =1 | ttf_p = 1 | def guess_fontinfo (filename): fi = { 'FontName' : filename, 'FamilyName' : filename, "Weight" : 'regular', "ItalicAngle" : 0, 'FullName' : filename} if re.search ('^cm', filename): fi.update (cm_guess_font_info (filename)) return fi global afmfile if not afmfile: afmfile = find_file (filename + '.afm') if afmfile: afmfile = os.path.abspath (afmfile) afm_struct = afm.read_afm_file (afmfile) fi.update (afm_struct.__dict__) return fi | d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7274,
67,
5776,
1376,
261,
3459,
4672,
225,
7314,
273,
288,
296,
5711,
461,
11,
294,
1544,
16,
296,
9203,
461,
11,
225,
294,
1544,
16,
315,
6544,
6,
294,
296,
16819,
2187,
315,
7193,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7274,
67,
5776,
1376,
261,
3459,
4672,
225,
7314,
273,
288,
296,
5711,
461,
11,
294,
1544,
16,
296,
9203,
461,
11,
225,
294,
1544,
16,
315,
6544,
6,
294,
296,
16819,
2187,
315,
7193,
... |
box.pack_start(label,False) | box.pack_start(label, False) | def validedChanges(*args): """Check for a least one selected kana portion (display of a message if not the case), catch parameters, then close the window. | 64cfb9e0b60a3a976c72fa9d5d722987641133b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3073/64cfb9e0b60a3a976c72fa9d5d722987641133b9/gtk_gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1244,
13898,
7173,
30857,
1968,
4672,
3536,
1564,
364,
279,
4520,
1245,
3170,
417,
13848,
14769,
261,
5417,
434,
279,
883,
309,
486,
326,
648,
3631,
1044,
1472,
16,
1508,
1746,
326,
2742,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1244,
13898,
7173,
30857,
1968,
4672,
3536,
1564,
364,
279,
4520,
1245,
3170,
417,
13848,
14769,
261,
5417,
434,
279,
883,
309,
486,
326,
648,
3631,
1044,
1472,
16,
1508,
1746,
326,
2742,
... |
timeList = timeVar.split( "/" ) dt = Time.fromString( "%s-%s-%s" % ( timeList[2], timeList[1], timeList[0] ) ) | dt = Time.fromString( timeVar ) | def __dateToSecs( self, timeVar ): timeList = timeVar.split( "/" ) dt = Time.fromString( "%s-%s-%s" % ( timeList[2], timeList[1], timeList[0] ) ) return int( Time.toEpoch( dt ) ) | d4def2ae2fd949e033267ed5bcac2c4b59881e0b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12767/d4def2ae2fd949e033267ed5bcac2c4b59881e0b/activitiesMonitoring.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
712,
774,
25059,
12,
365,
16,
813,
1537,
262,
30,
3681,
273,
2647,
18,
2080,
780,
12,
813,
1537,
262,
327,
509,
12,
2647,
18,
869,
14638,
12,
3681,
262,
262,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
712,
774,
25059,
12,
365,
16,
813,
1537,
262,
30,
3681,
273,
2647,
18,
2080,
780,
12,
813,
1537,
262,
327,
509,
12,
2647,
18,
869,
14638,
12,
3681,
262,
262,
2,
-100,
-100,
-10... |
if sys.platform!="win32": try: opts, args = getopt.getopt(sys.argv[1:], "a:dhn:s:v", ["affinity=", "debug", "help", "name=", "sleep=", "verbose"]) if len(args) > 0: serverUrl = args[0] except getopt.GetoptError, err: print str(err) | try: opts, args = getopt.getopt(sys.argv[1:], "a:dhn:s:v", ["affinity=", "debug", "help", "name=", "sleep=", "verbose"]) if len(args) > 0: serverUrl = args[0] except getopt.GetoptError, err: print str(err) usage() sys.exit(2) for o, a in opts: if o in ("-d", "--debug"): debug = True elif o in ("-h", "--help"): | def usage(): print ("Usage: worker [OPTIONS] [SERVER_URL]") print ("Start a Coalition worker using the server located at SERVER_URL.") print ("If no SERVER_URL is specified, the worker will try to locate the server using a broadcast.\n") print ("Options:") print (" -d, --debug\t\tRun without the main try/catch") print (" -h, --help\t\tShow this help") print (" -n, --name=NAME\tWorker name (default: "+name+")") print (" -s, --sleep=SLEEPTIME\tSleep time between two heart beats (default: "+str(sleepTime)+"s)") print (" -a, --affinity=AFFINITY\tAffinity words to jobs (default: \"\"") print (" -v, --verbose\t\tIncrease verbosity") print ("\nExample : worker -s 30 -v http://localhost:8080") | 9a13fc78c38b554162109d47862641b7215d28f8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11382/9a13fc78c38b554162109d47862641b7215d28f8/worker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
7566,
5357,
30,
4322,
306,
12422,
65,
306,
4370,
67,
1785,
4279,
13,
1172,
7566,
1685,
279,
7695,
287,
608,
4322,
1450,
326,
1438,
13801,
622,
15061,
67,
1785,
1199,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
7566,
5357,
30,
4322,
306,
12422,
65,
306,
4370,
67,
1785,
4279,
13,
1172,
7566,
1685,
279,
7695,
287,
608,
4322,
1450,
326,
1438,
13801,
622,
15061,
67,
1785,
1199,
1... |
print "configure: cygwin detected; path correction" srcdir = cmdOutput('cygpath -m ' + srcdir) print "srcdir = ", srcdir cygwin_path_fix = 'true' | print "configure: TeX engine needs windows-style paths in latex files" windows_style_tex_paths = 'true' | def checkCygwinPath(srcdir): ''' Adjust PATH for Win32 (Cygwin) ''' cygwin_path_fix = '' if os.name == 'nt': cygwin_path_fix = 'true' elif sys.platform == 'cygwin': from tempfile import mkstemp fd, tmpfname = mkstemp(suffix='.ltx', dir='/tmp') os.write(fd, r''' | 44a5cfc89ced180ed4411bf0f46d3df3756725e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7514/44a5cfc89ced180ed4411bf0f46d3df3756725e5/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
39,
4338,
8082,
743,
12,
4816,
1214,
4672,
9163,
17720,
7767,
364,
21628,
1578,
261,
39,
4338,
8082,
13,
9163,
276,
4338,
8082,
67,
803,
67,
904,
273,
875,
309,
1140,
18,
529,
422... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
39,
4338,
8082,
743,
12,
4816,
1214,
4672,
9163,
17720,
7767,
364,
21628,
1578,
261,
39,
4338,
8082,
13,
9163,
276,
4338,
8082,
67,
803,
67,
904,
273,
875,
309,
1140,
18,
529,
422... |
def export_getMask(self): | def export_getSiteMask(self): | def export_getMask(self): """ Get the site mask """ | a17b10268d5924113e5a235bf0450339b3e4d546 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/a17b10268d5924113e5a235bf0450339b3e4d546/WMSAdministratorHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
588,
4956,
5796,
12,
2890,
4672,
3536,
968,
326,
2834,
3066,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3359,
67,
588,
4956,
5796,
12,
2890,
4672,
3536,
968,
326,
2834,
3066,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.data = loads(data) | self.buffer += data | def feed(self, data): self.data = loads(data) | da7b064f5668525046a4109193b067aa28165775 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11734/da7b064f5668525046a4109193b067aa28165775/jsonrpclib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4746,
12,
2890,
16,
501,
4672,
365,
18,
892,
273,
6277,
12,
892,
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,
4746,
12,
2890,
16,
501,
4672,
365,
18,
892,
273,
6277,
12,
892,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"%d" % VERSION.tiny, VERSION.releaseType, cvsTag) | relNo, VERSION.releaseType, cvsTag) | def main(): shortargs = 'ho:i:s:t:v:p' longargs = ['help', 'outdir=', 'iconfile=', 'sourcedir=', 'tag=', 'version=', 'premature-exit'] try: opts, args = getopt.getopt(sys.argv[1:], shortargs, longargs) except getopt.GetoptError: usage() sys.exit(2) currentDir = os.getcwd() appName = "nanoENGINEER-1" rootDir = None if sys.platform == 'win32': iconFile = os.path.join(currentDir, 'nanorex_48x.ico') elif sys.platform == 'darwin': iconFile = os.path.join(currentDir, 'nanorex.icns') else: iconFile = None status = None cvsTag = None sourceDirectory = None specialVersion = None for o, a in opts: if o in ("-o", "--outdir"): rootDir = os.path.join(currentDir, a) elif o in ("-i", "--iconfile"): iconFile = os.path.join(currentDir, a) elif o in ("-t", "--tag"): cvsTag = a elif o in ("-s", "--sourcedir"): sourceDirectory = a elif o in ("-v", "--version"): specialVersion = a elif o in ("-p", "--premature-exit"): global prematureExit prematureExit = True elif o in ("-h", "--help"): usage() sys.exit() # Get the version information by checking out only the # version.py file like this: # # cvs -Q checkout cad/src/version.py # # Mark 051117 sp = sys.path cadDir = os.path.join(os.getcwd(), "cad") if sourceDirectory: system("rm -rf " + cadDir) system("cp -r %s %s" % (os.path.join(sourceDirectory, "cad"), cadDir)) elif cvsTag: system("cvs -Q checkout -r %s cad/src/version.py" % cvsTag) else: system("cvs -Q checkout cad/src/version.py") sys.path.append(os.path.join(cadDir, "src")) from version import Version global VERSION, PMMT VERSION = Version() PMMT = VERSION.product + "-" if specialVersion != None: PMMT += specialVersion else: PMMT += "%d.%d.%d" % (VERSION.major, VERSION.minor, VERSION.tiny) sys.path = sp #answer = "maybe" #while answer not in ['yes', 'no']: # answer = raw_input(("\nThis will create the installation package for %s? " + # "\nDo you want to continue (yes or no): ") % PMMT) # if answer == 'no': # sys.exit() if not rootDir: rootDir = os.path.join(currentDir, PMMT) if os.path.isdir(rootDir): answer = "maybe" while answer not in ['yes', 'no']: answer = raw_input(("Do you want to use the existing directory %s? " + "All its contents will be erased (yes or no): ") % rootDir) if answer == 'no': sys.exit() builder = NanoBuild(appName, iconFile, rootDir, "%d.%d" % (VERSION.major, VERSION.minor), "%d" % VERSION.tiny, VERSION.releaseType, cvsTag) builder.sourceDirectory = sourceDirectory builder.clean(cadDir, True) os.rmdir(cadDir) builder.build() # The clean() method chokes on the symbolic link that I needed to use for the partlib # on the Mac. It was already broken on Linux, possibly for the same reason. So only # do cleanup on Windows. if sys.platform == "win32": builder.clean(rootDir) if os.path.isdir(rootDir) and not os.listdir(rootDir): os.rmdir(rootDir) | 5467066082091151fda196867fcba1ae38aa6032 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/5467066082091151fda196867fcba1ae38aa6032/autoBuild.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3025,
1968,
273,
296,
15008,
30,
77,
30,
87,
30,
88,
30,
90,
30,
84,
11,
1525,
1968,
273,
10228,
5201,
2187,
296,
659,
1214,
33,
2187,
296,
3950,
768,
33,
2187,
296,
316... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3025,
1968,
273,
296,
15008,
30,
77,
30,
87,
30,
88,
30,
90,
30,
84,
11,
1525,
1968,
273,
10228,
5201,
2187,
296,
659,
1214,
33,
2187,
296,
3950,
768,
33,
2187,
296,
316... |
lallappsNewcorseNodeCombined[cat] = lalapps_newcorse_node(lalappsNewcorseJobCombined, dag, "vetoes", " ".join(db[cat]), n, [lallappsNewcorseNode[cat]], mass_bins=None, categories="oninstruments", rank="uncombined-ifar");n+=1 upperlimit_fnames = {} upperlimit_nodes = {} for cat in cats: upperlimit_fnames[cat] = [] upperlimit_nodes[cat] = [] for ifo_combination in ifo_combinations: ifo_combination = str(ifo_combination) fname = '2Dsearchvolume-' + timestr + '-' + ifo_combination.replace(',','') + '.xml' upperlimit_fnames[cat].append(fname) print fname, ifo_combination, ifo_combination hmUpperlimitNode[cat+ifo_combination] = hm_upperlimit_node(hmUpperlimitJob, dag, ifo_combination,timestr, "FULL_DATA_CAT_3_"+timestr+".sqlite", "*INJ_CAT_3_"+timestr+".sqlite", 10000, "vetoes", n, p_node=[lallappsNewcorseNodeCombined[cat]]);n+=1 hmUpperlimitPlotNode[cat+ifo_combination] = ul_plot_node(hmUpperlimitPlotJob, dag, fname, n, [hmUpperlimitNode[cat+ifo_combination]]);n+=1 upperlimit_nodes[cat].append(hmUpperlimitPlotNode[cat+ifo_combination]) for cat in cats: farPlotNode[cat] = far_plot_node(farPlotJob, dag, " ".join(db[cat]), n, [lallappsNewcorseNodeCombined[cat]]);n+=1 fstr = " ".join(upperlimit_fnames[cat]) hmUpperlimitPlotNode[cat] = ul_plot_node(hmUpperlimitPlotJob, dag, fstr, n, upperlimit_nodes[cat]);n+=1 | lalappsNewcorseNodeCombined[cat] = lalapps_newcorse_node(lalappsNewcorseJobCombined, dag, "vetoes", " ".join(db[cat]), n, [lalappsNewcorseNode[cat]], mass_bins=None, categories="oninstruments", rank="uncombined-ifar");n+=1 farPlotNode[cat] = far_plot_node(farPlotJob, dag, " ".join(db[cat]), n, [lalappsNewcorseNodeCombined[cat]], base="cbc_plotsummary_"+cat+"_"+timestr);n+=1 hmUpperlimitNode[cat] = hm_upperlimit_node(hmUpperlimitJob, dag, cat + "_" + timestr, " ".join(db[cat]), n p_node=[lalappsNewcorseNodeCombined[cat]]);n+=1 hmUpperlimitPlotNode[cat] = ul_plot_node(hmUpperlimitPlotJob, dag, hmUpperlimitNode[cat].output_by_combo(ifo_combinations[cat]), n, [hmUpperlimitNode[cat]]);n+=1 | def grep_pieces_and_append(string, inname, outname, append_cache=None): expr = re.compile(string) new_list = filter(expr.search,open(inname).readlines()) new_list.sort() print len(new_list) outnames = [] try: os.mkdir(outname) except: pass # To make sure that includes slides and zero lag for i in range(len(new_list)): if not i % 10: outnames.append(outname+"/"+outname+"_"+str(i)) o = open(outnames[-1]+".cache", "w") if append_cache: o.write(''.join(append_cache)) print "grepping " + inname + " for " + string + " and sending it to " + outnames[-1] + ".cache" o.write(new_list[i]) o.write(new_list[i].replace('THINCA_SECOND','THINCA_SLIDE_SECOND')) return outnames | 0b97313a1079214d63930999cbf916815e37ccaf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/0b97313a1079214d63930999cbf916815e37ccaf/highmass_post_process.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23366,
67,
31016,
67,
464,
67,
6923,
12,
1080,
16,
316,
529,
16,
596,
529,
16,
714,
67,
2493,
33,
7036,
4672,
3065,
273,
283,
18,
11100,
12,
1080,
13,
394,
67,
1098,
273,
1034,
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,
23366,
67,
31016,
67,
464,
67,
6923,
12,
1080,
16,
316,
529,
16,
596,
529,
16,
714,
67,
2493,
33,
7036,
4672,
3065,
273,
283,
18,
11100,
12,
1080,
13,
394,
67,
1098,
273,
1034,
12,
... |
self.hboxlayout9 = QtGui.QHBoxLayout() self.hboxlayout9.setMargin(0) self.hboxlayout9.setSpacing(6) self.hboxlayout9.setObjectName("hboxlayout9") self.vboxlayout8 = QtGui.QVBoxLayout() self.vboxlayout8.setMargin(0) self.vboxlayout8.setSpacing(6) self.vboxlayout8.setObjectName("vboxlayout8") self.fill_type_lbl = QtGui.QLabel(self.bg_groupbox) self.fill_type_lbl.setEnabled(True) self.fill_type_lbl.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.fill_type_lbl.setObjectName("fill_type_lbl") self.vboxlayout8.addWidget(self.fill_type_lbl) self.bg1_color_lbl = QtGui.QLabel(self.bg_groupbox) self.bg1_color_lbl.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.bg1_color_lbl.setObjectName("bg1_color_lbl") self.vboxlayout8.addWidget(self.bg1_color_lbl) self.hboxlayout9.addLayout(self.vboxlayout8) self.vboxlayout9 = QtGui.QVBoxLayout() self.vboxlayout9.setMargin(0) self.vboxlayout9.setSpacing(6) self.vboxlayout9.setObjectName("vboxlayout9") self.fill_type_combox = QtGui.QComboBox(self.bg_groupbox) self.fill_type_combox.setEnabled(True) self.fill_type_combox.setObjectName("fill_type_combox") self.vboxlayout9.addWidget(self.fill_type_combox) self.hboxlayout10 = QtGui.QHBoxLayout() self.hboxlayout10.setMargin(0) self.hboxlayout10.setSpacing(6) self.hboxlayout10.setObjectName("hboxlayout10") self.bg1_color_frame = QtGui.QFrame(self.bg_groupbox) self.bg1_color_frame.setMinimumSize(QtCore.QSize(25,0)) self.bg1_color_frame.setFrameShape(QtGui.QFrame.Box) self.bg1_color_frame.setFrameShadow(QtGui.QFrame.Plain) self.bg1_color_frame.setObjectName("bg1_color_frame") self.hboxlayout10.addWidget(self.bg1_color_frame) self.choose_bg1_color_btn = QtGui.QPushButton(self.bg_groupbox) self.choose_bg1_color_btn.setAutoDefault(False) self.choose_bg1_color_btn.setObjectName("choose_bg1_color_btn") self.hboxlayout10.addWidget(self.choose_bg1_color_btn) self.vboxlayout9.addLayout(self.hboxlayout10) self.hboxlayout9.addLayout(self.vboxlayout9) self.gridlayout10.addLayout(self.hboxlayout9,0,0,1,2) self.restore_bgcolor_btn = QtGui.QPushButton(self.bg_groupbox) self.restore_bgcolor_btn.setAutoDefault(False) self.restore_bgcolor_btn.setObjectName("restore_bgcolor_btn") self.gridlayout10.addWidget(self.restore_bgcolor_btn,1,1,1,1) spacerItem12 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) self.gridlayout10.addItem(spacerItem12,1,0,1,1) self.gridlayout1.addWidget(self.bg_groupbox,1,0,1,1) | self.perspective_radioButton = QtGui.QRadioButton(self.default_projection_grpBox) self.perspective_radioButton.setChecked(False) self.perspective_radioButton.setObjectName("perspective_radioButton") self.gridlayout10.addWidget(self.perspective_radioButton,0,0,1,1) self.orthographic_radioButton = QtGui.QRadioButton(self.default_projection_grpBox) self.orthographic_radioButton.setChecked(True) self.orthographic_radioButton.setObjectName("orthographic_radioButton") self.gridlayout10.addWidget(self.orthographic_radioButton,1,0,1,1) self.hboxlayout12.addWidget(self.default_projection_grpBox) spacerItem14 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) self.hboxlayout12.addItem(spacerItem14) self.gridlayout1.addLayout(self.hboxlayout12,0,0,1,1) | def setupUi(self, UserPrefsDialog): UserPrefsDialog.setObjectName("UserPrefsDialog") UserPrefsDialog.resize(QtCore.QSize(QtCore.QRect(0,0,609,642).size()).expandedTo(UserPrefsDialog.minimumSizeHint())) | 30deb2219e016847d91b37e801c50b75fbd1c3cf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/30deb2219e016847d91b37e801c50b75fbd1c3cf/UserPrefsDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13943,
12,
2890,
16,
2177,
1386,
2556,
6353,
4672,
2177,
1386,
2556,
6353,
18,
542,
16707,
2932,
1299,
1386,
2556,
6353,
7923,
2177,
1386,
2556,
6353,
18,
15169,
12,
23310,
4670,
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,
3875,
13943,
12,
2890,
16,
2177,
1386,
2556,
6353,
4672,
2177,
1386,
2556,
6353,
18,
542,
16707,
2932,
1299,
1386,
2556,
6353,
7923,
2177,
1386,
2556,
6353,
18,
15169,
12,
23310,
4670,
18,... |
if self.c.search(value): self.has_details = True | if self.c.search(value): self.has_differences = True if self.d.search(value): self.has_differences = True | def addmsg(self, value): if not self.data.has_key('msg'): self.data['msg'] = [] self.data['msg'].append(value) if self.r.search(value): self.has_details = True if self.c.search(value): self.has_details = True | 86fd67bcd60f0c6e3754d4313c994f1726dd05aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1296/86fd67bcd60f0c6e3754d4313c994f1726dd05aa/split_changelog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
3576,
12,
2890,
16,
460,
4672,
309,
486,
365,
18,
892,
18,
5332,
67,
856,
2668,
3576,
11,
4672,
365,
18,
892,
3292,
3576,
3546,
273,
5378,
365,
18,
892,
3292,
3576,
29489,
6923,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
3576,
12,
2890,
16,
460,
4672,
309,
486,
365,
18,
892,
18,
5332,
67,
856,
2668,
3576,
11,
4672,
365,
18,
892,
3292,
3576,
3546,
273,
5378,
365,
18,
892,
3292,
3576,
29489,
6923,
... |
def commit(message, files = [], parents = [], allowempty = False, | def commit(message, files = None, parents = None, allowempty = False, | def commit(message, files = [], parents = [], allowempty = False, cache_update = True, tree_id = None, author_name = None, author_email = None, author_date = None, committer_name = None, committer_email = None): """Commit the current tree to repository """ # Get the tree status if cache_update and parents != []: changes = update_cache(files) if not changes and not allowempty: raise GitException, 'No changes to commit' # get the commit message if message[-1:] != '\n': message += '\n' must_switch = True # write the index to repository if tree_id == None: tree_id = _output_one_line('git-write-tree') else: must_switch = False # the commit cmd = '' if author_name: cmd += 'GIT_AUTHOR_NAME="%s" ' % author_name if author_email: cmd += 'GIT_AUTHOR_EMAIL="%s" ' % author_email if author_date: cmd += 'GIT_AUTHOR_DATE="%s" ' % author_date if committer_name: cmd += 'GIT_COMMITTER_NAME="%s" ' % committer_name if committer_email: cmd += 'GIT_COMMITTER_EMAIL="%s" ' % committer_email cmd += 'git-commit-tree %s' % tree_id # get the parents for p in parents: cmd += ' -p %s' % p commit_id = _output_one_line(cmd, message) if must_switch: __set_head(commit_id) return commit_id | 9216b6023d6840c457172b375e14443189f7ef89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12366/9216b6023d6840c457172b375e14443189f7ef89/git.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3294,
12,
2150,
16,
1390,
273,
599,
16,
6298,
273,
599,
16,
1699,
5531,
273,
1083,
16,
1247,
67,
2725,
273,
1053,
16,
2151,
67,
350,
273,
599,
16,
2869,
67,
529,
273,
599,
16,
2869,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3294,
12,
2150,
16,
1390,
273,
599,
16,
6298,
273,
599,
16,
1699,
5531,
273,
1083,
16,
1247,
67,
2725,
273,
1053,
16,
2151,
67,
350,
273,
599,
16,
2869,
67,
529,
273,
599,
16,
2869,
... |
self.debugbuffer = gtk.TextBuffer() self.debug = gtk.TextView(self.debugbuffer) self.debug.set_editable(False) self.debug_sw = gtk.ScrolledWindow() self.debug_sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.debug_sw.add(self.debug) self.outputbox = gtk.VBox() self.output_sw = gtk.ScrolledWindow() self.output_sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.output_sw.add(self.output) self.input_entry = gtk.Entry() self.input_entry.set_sensitive(False) self.input_entry.show() self.input_entry.connect("activate", self.input_entry_activate) self.outputbox.pack_start(self.output_sw, True, True, 0) self.outputbox.pack_start(self.input_entry, True, True, 0) self.outputbox.show() self.notebook = gtk.Notebook() self.notebook.set_tab_pos(gtk.POS_TOP) self.output_tab_lbl = gtk.Label('Output') self.output_tab_lbl.show() self.debug_tab_lbl = gtk.Label('Debug') self.debug_tab_lbl.show() self.notebook.append_page(self.outputbox, self.output_tab_lbl) self.notebook.append_page(self.debug_sw, self.debug_tab_lbl) | def __init__(self, filename): self.filename = filename self.debuggee = pexpect.spawn("python3 -m epdb {0}".format(filename), timeout=None) self.running = True # create a new window self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_default_size(640,480) self.window.connect("delete_event", self.delete_event) self.window.connect("destroy", self.destroy) uimanager = gtk.UIManager() self.uimanager = uimanager self.font_dialog = None accelgroup = uimanager.get_accel_group() self.window.add_accel_group(accelgroup) actiongroup = gtk.ActionGroup('UIManagerExample') self.actiongroup = actiongroup # Create actions actiongroup.add_actions([('Quit', gtk.STOCK_QUIT, '_Quit', None, 'Quit the Program', self.destroy), ('Open', gtk.STOCK_OPEN, '_Open ...', None, 'Open a new file for debugging', self.open_clicked), ('File', None, '_File'), ('View', None, '_View'), ('ChangeFont', None, 'Change Font ...', None, 'Change Font', self.changefontdlg), ('RadioBand', None, '_Radio Band'), ('Breakpoint', None, '_Breakpoint', None, "Toggle Breakpoint", self.toggle_breakpoint)]) actiongroup.get_action('Quit').set_property('short-label', '_Quit') uimanager.insert_action_group(actiongroup, 0) uimanager.add_ui_from_string(self.ui) self.toplevelbox = gtk.VBox() #self.toplevelhbox = gtk.HBox() self.toplevelhpaned1 = gtk.HPaned() self.toplevelhpaned2 = gtk.HPaned() self.leftbox = gtk.VBox() self.lbvpane = gtk.VPaned() self.timelinebox = TimelineBox(self) self.varbox = Varbox(self) self.resourcebox = ResourceBox(self) self.leftbox.show() self.leftbox.pack_start(self.lbvpane, True, True, 0) self.lbvpane.pack1(self.timelinebox) self.lbvpane.pack2(self.varbox) self.lbvpane.show() self.rightbox = gtk.VBox() self.snapshotbox = SnapshotBox(self) self.rbvpane = gtk.VPaned() self.rbvpane.pack1(self.resourcebox, resize=True, shrink=True) self.rbvpane.pack2(self.snapshotbox, resize=True, shrink=True) self.rbvpane.show() self.rightbox.pack_start(self.rbvpane) self.rightbox.show() #self.leftbox.pack_start(self.timelinebox, True, True, 0) #self.leftbox.pack_start(self.varbox, True, True, 0) self.outputbuffer = gtk.TextBuffer() self.output = gtk.TextView(self.outputbuffer) #self.append_output('Blah') #self.outputbuffer.set_text("Hallo Welt") self.output.set_editable(False) #self.output.set_property("height-request", 80) self.mainbox = gtk.VBox() self.textbuffer = gtksourceview2.Buffer() self.text = gtksourceview2.View(self.textbuffer) #self.text.set_property("can-focus", False) self.text.connect("expose-event", self.textview_expose) self.text.connect("move-cursor", self.cursor_moved) self.text.connect("button-release-event", self.text_clicked) self.text.set_editable(False) #self.textbuffer = self.text.get_buffer() txt = open(filename, 'r').read() self.textbuffer.set_text(txt) self.lineiter = self.textbuffer.get_iter_at_line(0) self.languagemanager = gtksourceview2.LanguageManager() l = self.languagemanager.get_language("python") self.textbuffer.set_language(l) self.text.set_show_line_marks(True) self.text.set_show_line_numbers(True) self.text.set_highlight_current_line(True) self.text.scroll_mark_onscreen(self.textbuffer.get_insert()) self.vpaned = gtk.VPaned() | 17466ef0e62a97384363a1ba189f4b8c03f93b77 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4616/17466ef0e62a97384363a1ba189f4b8c03f93b77/gepdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1544,
4672,
365,
18,
3459,
273,
1544,
365,
18,
4148,
908,
73,
273,
293,
12339,
18,
1752,
9533,
2932,
8103,
23,
300,
81,
5529,
1966,
288,
20,
1532,
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,
1001,
2738,
972,
12,
2890,
16,
1544,
4672,
365,
18,
3459,
273,
1544,
365,
18,
4148,
908,
73,
273,
293,
12339,
18,
1752,
9533,
2932,
8103,
23,
300,
81,
5529,
1966,
288,
20,
1532,
18,
... | |
info.extend([ tag('div', _class='description')[ self.source.description ], ]) | def renderLatest(self): info = [] | 714af92c4e55d8eaedfe268d172fdad7a6d42f24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/714af92c4e55d8eaedfe268d172fdad7a6d42f24/web.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
18650,
12,
2890,
4672,
1123,
273,
5378,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1743,
18650,
12,
2890,
4672,
1123,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
validKeys = ( 'category', 'description', 'sourceId', 'bucketLength', 'type', 'unit', 'name' ) | validKeys = ( 'category', 'description', 'bucketLength', 'type', 'unit' ) | def __checkActivityDict( self, acDict ): """ Check that the dictionary is a valid activity one """ validKeys = ( 'category', 'description', 'sourceId', 'bucketLength', 'type', 'unit', 'name' ) for key in validKeys: if key not in acDict: return False return True | 6c7a0815aded0c9530c784cf56b39c4667232f86 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/6c7a0815aded0c9530c784cf56b39c4667232f86/ServiceInterface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1893,
6193,
5014,
12,
365,
16,
1721,
5014,
262,
30,
3536,
2073,
716,
326,
3880,
353,
279,
923,
5728,
1245,
3536,
923,
2396,
273,
261,
296,
4743,
2187,
296,
3384,
2187,
296,
7242,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1893,
6193,
5014,
12,
365,
16,
1721,
5014,
262,
30,
3536,
2073,
716,
326,
3880,
353,
279,
923,
5728,
1245,
3536,
923,
2396,
273,
261,
296,
4743,
2187,
296,
3384,
2187,
296,
7242,
... |
L = [] for k in xrange(icount): L.append(start) start += step if include_endpoint: L.append(end) return L def xsrange(start, end=None, step=1, universe=None, check=True, include_endpoint=False, endpoint_tolerance=1e-5): """ Return an iterator over numbers ``a, a+step, ..., a+k*step``, where ``a+k*step < b`` and ``a+(k+1)*step > b``. INPUT: universe -- Parent or type where all the elements should live (default: deduce from inputs) check -- make sure a, b, and step all lie in the same universe include_endpoint -- whether or not to include the endpoint (default: False) endpoint_tolerance -- used to determine whether or not the endpoint is hit for inexact rings (default 1e-5) - ``a`` - number - ``b`` - number - ``step`` - number (default: 1) OUTPUT: iterator Unlike range, a and b can be any type of numbers, and the resulting iterator involves numbers of that type. .. seealso:: :func:`srange` .. note:: This function is called ``xsrange`` to distinguish it from the builtin Python ``xrange`` command. EXAMPLES:: sage: list(xsrange(1,10)) [1, 2, 3, 4, 5, 6, 7, 8, 9] sage: Q = RationalField() sage: list(xsrange(1, 10, Q('1/2'))) [1, 3/2, 2, 5/2, 3, 7/2, 4, 9/2, 5, 11/2, 6, 13/2, 7, 15/2, 8, 17/2, 9, 19/2] sage: list(xsrange(1, 5, 0.5)) [1.00000000000000, 1.50000000000000, 2.00000000000000, 2.50000000000000, 3.00000000000000, 3.50000000000000, 4.00000000000000, 4.50000000000000] sage: list(xsrange(0, 1, 0.4)) [0.000000000000000, 0.400000000000000, 0.800000000000000] Negative ranges are also allowed:: sage: list(xrange(4,1,-1)) [4, 3, 2] sage: list(sxrange(4,1,-1)) [4, 3, 2] sage: list(sxrange(4,1,-1/2)) [4, 7/2, 3, 5/2, 2, 3/2] """ from sage.structure.sequence import Sequence from sage.rings.all import ZZ if end is None: end = start start = 0 if check: if universe is None: universe = Sequence([start, end, step]).universe() start, end, step = universe(start), universe(end), universe(step) if universe in [int, long, ZZ]: if include_endpoint and (end-start) % step == 0: end += step include_endpoint = False if universe is not ZZ: return xrange(start, end, step) count = (end-start)/step if universe is long or not isinstance(universe, type) and universe.is_exact(): icount = int(math.ceil(float(count))) if icount != count: include_endpoint = False else: icount = int(math.ceil(float(count) - endpoint_tolerance)) if abs(float(count) - icount) > endpoint_tolerance: include_endpoint = False | def srange(start, end=None, step=1, universe=None, check=True, include_endpoint=False, endpoint_tolerance=1e-5): r""" Return list of numbers ``a, a+step, ..., a+k*step``, where ``a+k*step < b`` and ``a+(k+1)*step >= b`` over exact rings, and makes a best attempt for inexact rings (see note below). This provides one way to iterate over Sage integers as opposed to Python int's. It also allows you to specify step sizes for such an iteration. Note, however, that what is returned is a full list of Integers and not an iterator. It is potentially much slower than the Python range function, depending on the application. The function xsrange() provides an iterator with similar functionality which would usually be more efficient than using srange(). INPUT: - ``a`` - number - ``b`` - number (default: None) - ``step`` - number (default: 1) - ``universe`` - Parent or type where all the elements should live (default: deduce from inputs) - ``check`` - make sure a, b, and step all lie in the same universe - ``include_endpoint`` - whether or not to include the endpoint (default: False) - ``endpoint_tolerance`` - used to determine whether or not the endpoint is hit for inexact rings (default 1e-5) OUTPUT: - list If b is None, then b is set equal to a and a is set equal to the 0 in the parent of b. Unlike range, a and b can be any type of numbers, and the resulting list involves numbers of that type. .. note:: The list elements are computed via repeated addition rather than multiplication, which may produce slightly different results with inexact rings. For example:: sage: sum([1.1] * 10) == 1.1 * 10 False Also, the question of whether the endpoint is hit exactly for a given ``a + k*step`` is fuzzy for an inexact ring. If ``a + k*step = b`` for some k within ``endpoint_tolerance`` of being integral, it is considered an exact hit, thus avoiding spurious values falling just below the endpoint. .. note:: This function is called ``srange`` to distinguish it from the built-in Python ``range`` command. The s at the beginning of the name stands for "Sage". .. seealso: :func:`xsrange` -- iterator version EXAMPLES:: sage: v = srange(5); v [0, 1, 2, 3, 4] sage: type(v[2]) <type 'sage.rings.integer.Integer'> sage: srange(1, 10) [1, 2, 3, 4, 5, 6, 7, 8, 9] sage: srange(10, 1, -1) [10, 9, 8, 7, 6, 5, 4, 3, 2] sage: srange(10,1,-1, include_endpoint=True) [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] sage: srange(1, 10, universe=RDF) [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] sage: srange(1, 10, 1/2) [1, 3/2, 2, 5/2, 3, 7/2, 4, 9/2, 5, 11/2, 6, 13/2, 7, 15/2, 8, 17/2, 9, 19/2] sage: srange(1, 5, 0.5) [1.00000000000000, 1.50000000000000, 2.00000000000000, 2.50000000000000, 3.00000000000000, 3.50000000000000, 4.00000000000000, 4.50000000000000] sage: srange(0, 1, 0.4) [0.000000000000000, 0.400000000000000, 0.800000000000000] sage: srange(1.0, 5.0, include_endpoint=True) [1.00000000000000, 2.00000000000000, 3.00000000000000, 4.00000000000000, 5.00000000000000] sage: srange(1.0, 1.1) [1.00000000000000] sage: srange(1.0, 1.0) [] sage: V = VectorSpace(QQ, 2) sage: srange(V([0,0]), V([5,5]), step=V([2,2])) [(0, 0), (2, 2), (4, 4)] Including the endpoint:: sage: srange(0, 10, step=2, include_endpoint=True) [0, 2, 4, 6, 8, 10] sage: srange(0, 10, step=3, include_endpoint=True) [0, 3, 6, 9] Try some inexact rings:: sage: srange(0.5, 1.1, 0.1, universe=RDF, include_endpoint=False) [0.5, 0.6, 0.7, 0.8, 0.9, 1.0] sage: srange(0.5, 1, 0.1, universe=RDF, include_endpoint=False) [0.5, 0.6, 0.7, 0.8, 0.9] sage: srange(0.5, 0.9, 0.1, universe=RDF, include_endpoint=False) [0.5, 0.6, 0.7, 0.8] sage: srange(0, 1.1, 0.1, universe=RDF, include_endpoint=True) [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1] sage: srange(0, 0.2, 0.1, universe=RDF, include_endpoint=True) [0.0, 0.1, 0.2] sage: srange(0, 0.3, 0.1, universe=RDF, include_endpoint=True) [0.0, 0.1, 0.2, 0.3] """ from sage.structure.sequence import Sequence from sage.rings.all import ZZ if end is None: end = start start = 0 if check: if universe is None: universe = Sequence([start, end, step]).universe() start, end, step = universe(start), universe(end), universe(step) if universe in [int, long, ZZ]: if include_endpoint and (end-start) % step == 0: end += step if universe is ZZ: return ZZ.range(start, end, step) else: # universe is int or universe is long: return range(start, end, step) count = (end-start)/step if not isinstance(universe, type) and universe.is_exact(): icount = int(math.ceil(float(count))) if icount != count: include_endpoint = False else: icount = int(math.ceil(float(count) - endpoint_tolerance)) if abs(float(count) - icount) > endpoint_tolerance: include_endpoint = False L = [] for k in xrange(icount): L.append(start) start += step if include_endpoint: L.append(end) return L | 057c66005bb245d6d0e905819d69011d02c772a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/057c66005bb245d6d0e905819d69011d02c772a5/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
3676,
12,
1937,
16,
679,
33,
7036,
16,
2235,
33,
21,
16,
29235,
33,
7036,
16,
866,
33,
5510,
16,
2341,
67,
8003,
33,
8381,
16,
2494,
67,
25456,
33,
21,
73,
17,
25,
4672,
436,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
3676,
12,
1937,
16,
679,
33,
7036,
16,
2235,
33,
21,
16,
29235,
33,
7036,
16,
866,
33,
5510,
16,
2341,
67,
8003,
33,
8381,
16,
2494,
67,
25456,
33,
21,
73,
17,
25,
4672,
436,
... | |
ret = ce.submitJob( pilot['pilotFile'], resourceJDL, pilot['proxyString'], '0', [self.diracInstallPath, self.diracPilotPath] ) | ret = ce.submitJob( pilot['pilotFile'], resourceJDL, pilot['proxyString'], '0', [self.diracInstallPath, self.diracPilotPath] ) | def __submitPilots( self, pilots, ce ): resourceJDL = '' while len( pilots ) > 0: pilot = pilots.pop( 0 ) ret = ce.submitJob( pilot['pilotFile'], resourceJDL, pilot['proxyString'], '0', [self.diracInstallPath, self.diracPilotPath] ) if not ret['OK']: self.log.warn( ret['Message'] ) return ret self.log.debug( "Result of Pilot submission:", ret ) | 0bd90b0eab10b2108384fa9fd724e81211bc1a92 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/0bd90b0eab10b2108384fa9fd724e81211bc1a92/DiracSiteAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9297,
52,
330,
6968,
12,
365,
16,
24970,
6968,
16,
5898,
262,
30,
1058,
46,
8914,
273,
875,
1323,
562,
12,
24970,
6968,
262,
405,
374,
30,
293,
22797,
273,
24970,
6968,
18,
5120,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9297,
52,
330,
6968,
12,
365,
16,
24970,
6968,
16,
5898,
262,
30,
1058,
46,
8914,
273,
875,
1323,
562,
12,
24970,
6968,
262,
405,
374,
30,
293,
22797,
273,
24970,
6968,
18,
5120,... |
else: raise ValueError("Unsupported scrap_type: %r" % (scrap_type,)) | elif scrap_type in board.types: return board.stringForType_(scrap_type) | def get(scrap_type): board = NSPasteboard.generalPasteboard() if scrap_type == SCRAP_TEXT: content = board.stringForType_(NSStringPboardType) return content elif scrap_type == SCRAP_BMP: # We could try loading directly but I don't trust pygame's TIFF # loading. This is slow and stupid but it does happen to work. if not NSImage.canInitWithPasteboard_(board): return None img = NSImage.alloc().initWithPasteboard_(board) data = img.TIFFRepresentation() rep = NSBitmapImageRep.alloc().initWithData_(data) if rep is None: return None data = rep.representationUsingType_properties_(NSBMPFileType, None) bmp = StringIO(data) return pygame.image.load(bmp, "scrap.bmp") else: raise ValueError("Unsupported scrap_type: %r" % (scrap_type,)) | bd6e0badd3e5bbf24d517ef0c768e2c1534a6350 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1298/bd6e0badd3e5bbf24d517ef0c768e2c1534a6350/mac_scrap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
1017,
1266,
67,
723,
4672,
11094,
273,
423,
3118,
14725,
3752,
18,
12259,
52,
14725,
3752,
1435,
309,
888,
1266,
67,
723,
422,
348,
5093,
2203,
67,
5151,
30,
913,
273,
11094,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
1017,
1266,
67,
723,
4672,
11094,
273,
423,
3118,
14725,
3752,
18,
12259,
52,
14725,
3752,
1435,
309,
888,
1266,
67,
723,
422,
348,
5093,
2203,
67,
5151,
30,
913,
273,
11094,
... |
blockname = "%s/%s" % (match.group(0), blockname) | blockname = "%s/%s" % (match.group(1), blockname) | def template(self, name): if isinstance(name, document.Document) or callable(name): return name shortname = name prefix = None providers = None if isinstance(name, str): template = self.BLOCKS.get(name) if template: return template for blocks in self.BLKSTACK: if blocks: template = blocks.get(name) if template: return template regex = "\w{%d,}:" % (int(os.name == "nt") + 1) match = re.match(regex, name) if match: prefix = match.group(1) if prefix is not None: providers = self.PREFIX_MAP.get(prefix) if not providers: self.throw(constants.ERROR_FILE, "no providers for template prefix '%s'" % prefix) if not providers: providers = self.PREFIX_MAP.get("default") or self.LOAD_TEMPLATES | ee91d8fafaaeb0531affcff79e64c250f94fe3ad /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1390/ee91d8fafaaeb0531affcff79e64c250f94fe3ad/context.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1542,
12,
2890,
16,
508,
4672,
309,
1549,
12,
529,
16,
1668,
18,
2519,
13,
578,
4140,
12,
529,
4672,
327,
508,
23879,
273,
508,
1633,
273,
599,
9165,
273,
599,
309,
1549,
12,
529,
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,
1542,
12,
2890,
16,
508,
4672,
309,
1549,
12,
529,
16,
1668,
18,
2519,
13,
578,
4140,
12,
529,
4672,
327,
508,
23879,
273,
508,
1633,
273,
599,
9165,
273,
599,
309,
1549,
12,
529,
16... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.