rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
treeview.get_model().append(parent, [track, icon, tt, td, tip]) | treeview.get_model().append(parent, [DictWrapper(track), icon, tt, td, tip]) | def add_treeview_item(self, treeview, album): if not isinstance(album['image'], GdkPixbuf.Pixbuf): # album image pixbuf is not yet built try: pb = GdkPixbuf.Pixbuf.new_from_file(album['image']) os.unlink(album['image']) album['image'] = pb except: # do not fail for this, just display a dummy pixbuf album['image'] = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, 8, 1, 1) # format title title = '<b>%s</b>\n' % self._format_str(album['name']) title += _('Artist: %s') % self._format_str(album['artist_name']) # format duration dur = self._format_duration(album['duration']) # format tooltip try: # Translators: this is the release date of an album in Python strptime format release = time.strptime(album['dates']['release'][0:10], _('%Y-%m-%d')) # Translators: this is the release time of an album in Python strftime format release = time.strftime(_('%x'), release) except: release = '' tip = '\n'.join([ '<b>%s</b>' % self._format_str(album['name']), _('Artist: %s') % self._format_str(album['artist_name']), _('Genre: %s') % self._format_str(album['genre']), _('Released on: %s') % release, _('License: %s') % self._format_str(album['license'][0]), ]) # append album row parent = treeview.get_model().append(None, [album, album['image'], title, dur, tip] ) # append track rows icon = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, 8, 1, 1) for i, track in enumerate(album['tracks']): # track title # Translators: this is the title of a track in Python format # (first argument is the track number, second is the track title) tt = ('<small>%s</small>' % _('%02d. %s')) % \ (i+1, self._format_str(track['name'])) # track duration td = self._format_duration(track['duration']) # track tooltip tip = '\n'.join([ '<b>%s</b>' % self._format_str(track['name']), _('Album: %s') % self._format_str(album['name']), _('Artist: %s') % self._format_str(album['artist_name']), _('Duration: %s') % td, ]) # append track treeview.get_model().append(parent, [track, icon, tt, td, tip]) # update current album count pindex = self.treeviews.index(treeview) self.album_count[pindex] += 1 | 5033d6449aaae55df4b41faf1b43c2944c7c7eba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11070/5033d6449aaae55df4b41faf1b43c2944c7c7eba/jamendo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
3413,
1945,
67,
1726,
12,
2890,
16,
2151,
1945,
16,
14844,
4672,
309,
486,
1549,
12,
25090,
3292,
2730,
17337,
611,
2883,
21816,
4385,
18,
21816,
4385,
4672,
468,
14844,
1316,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
3413,
1945,
67,
1726,
12,
2890,
16,
2151,
1945,
16,
14844,
4672,
309,
486,
1549,
12,
25090,
3292,
2730,
17337,
611,
2883,
21816,
4385,
18,
21816,
4385,
4672,
468,
14844,
1316,
1... |
crack_slab, width, height, E, v, v2, bulk = crack_make_slab(params, classicalpot, classicalpot) | crack_slab, width, height, E, v, v2, bulk = crack_make_slab(params, classicalpot) | def makecrack(params): """Given a CrackParams object `param`, construct and return a new crack slab Atoms object.""" print_title('Initialisation') verbosity_push(params.io_verbosity) params.print_() print("Initialising classical potential with args " + params.classical_args.strip() + " from file " + xmlfilename) xmlfile.rewind() classicalpot = Potential(params.classical_args, xmlfile) classicalpot.print_() mpi_glob = MPI_context() crack_slab, width, height, E, v, v2, bulk = crack_make_slab(params, classicalpot, classicalpot) # Save bulk cube (used for qm_rescale_r parameter in crack code) bulk.write(stem+'_bulk.xyz') crack_slab.params['OrigWidth'] = width crack_slab.params['OrigHeight'] = height crack_slab.params['YoungsModulus'] = E crack_slab.params['PoissonRatio_yx'] = v crack_slab.params['PoissonRatio_yz'] = v2 # Open surfaces, remain periodic in z direction (normal to plane) # and optionally also in x direction if crack_double_ended is true if not params.crack_double_ended: crack_slab.lattice[1,1] = crack_slab.lattice[1,1] + params.crack_vacuum_size crack_slab.lattice[2,2] = crack_slab.lattice[2,2] + params.crack_vacuum_size crack_slab.set_lattice(crack_slab.lattice, False) # 3D crack with free surfaces at z = +/- depth/2 if params.crack_free_surfaces: crack_slab.lattice[3,3] = crack_slab.lattice[3,3] + params.crack_vacuum_size crack_slab.set_lattice(crack_slab.lattice, False) # Add various properties to crack_slab crack_slab.add_property('hybrid', 0) crack_slab.add_property('hybrid_mark', HYBRID_NO_MARK) crack_slab.add_property('changed_nn', 0) crack_slab.add_property('move_mask', 0) crack_slab.add_property('nn', 0) crack_slab.add_property('old_nn', 0) crack_slab.add_property('md_old_changed_nn', 0) crack_slab.add_property('edge_mask', 0) print_title('Fixing Atoms') # Fix top and bottom edges - anything within crack_edge_fix_tol of ymax or ymin is fixed miny, maxy = crack_slab.pos[2,:].min(), crack_slab.pos[2,:].max() crack_slab.move_mask[:] = 1 crack_slab.move_mask[logical_or(abs(crack_slab.pos[2,:]-maxy) < params.crack_edge_fix_tol, abs(crack_slab.pos[2,:]-miny) < params.crack_edge_fix_tol)] = 0 print('%d atoms. %d fixed atoms' % (crack_slab.n, crack_slab.n - crack_slab.move_mask.count())) print_title('Setting edge mask') crack_setup_marks(crack_slab, params) crack_slab.edge_mask[:] = 0 minx, maxx = crack_slab.pos[1,:].min(), crack_slab.pos[1,:].max() crack_slab.edge_mask[logical_or(abs(crack_slab.pos[1,:]-minx) < params.selection_edge_tol, abs(crack_slab.pos[1,:]-maxx) < params.selection_edge_tol)] = 1 miny, maxy = crack_slab.pos[2,:].min(), crack_slab.pos[2,:].max() crack_slab.edge_mask[logical_or(abs(crack_slab.pos[2,:]-miny) < params.selection_edge_tol, abs(crack_slab.pos[2,:]-maxy) < params.selection_edge_tol)] = 1 if params.crack_free_surfaces: # Open surfaces at +/- z minz, maxz = crack_slab.pos[3,:].min(), crack_slab.pos[3,:].max() crack_slab.edge_mask[logical_or(abs(crack_slab.pos[3,:]-minz) < params.selection_edge_tol, abs(crack_slab.pos[3,:]-maxz) < params.selection_edge_tol)] = 1 crack_make_seed(crack_slab, params) if (params.crack_apply_initial_load): crack_calc_load_field(crack_slab, params, classicalpot, params.crack_loading, overwrite_pos=True, mpi=mpi_glob) crack_update_connect(crack_slab, params) if (not params.simulation_classical): crack_update_selection(crack_slab, params) return crack_slab | 84c73f9745c40e24a583bc83f1ca8ed0d2eddf8b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8914/84c73f9745c40e24a583bc83f1ca8ed0d2eddf8b/makecrack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29796,
557,
21580,
12,
2010,
4672,
3536,
6083,
279,
385,
21580,
1370,
733,
1375,
891,
9191,
4872,
471,
327,
279,
394,
276,
21580,
27679,
7149,
87,
733,
12123,
225,
1172,
67,
2649,
2668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29796,
557,
21580,
12,
2010,
4672,
3536,
6083,
279,
385,
21580,
1370,
733,
1375,
891,
9191,
4872,
471,
327,
279,
394,
276,
21580,
27679,
7149,
87,
733,
12123,
225,
1172,
67,
2649,
2668,
... |
this = apply(_quickfix.new_HandlInst, args) | this = _quickfix.new_HandlInst(*args) | def __init__(self, *args): this = apply(_quickfix.new_HandlInst, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
1144,
80,
10773,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
1144,
80,
10773,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
3... |
expected = """ | preamble = """ | def test_sub_ovf_before(self): ops = """ [i0, i1] i2 = int_and(i0, 255) i3 = int_sub_ovf(i2, i1) guard_no_overflow() [] i4 = int_le(i3, 10) guard_true(i4) [] i5 = int_ge(i3, 2) guard_true(i5) [] i6 = int_lt(i1, -10) guard_false(i6) [] i7 = int_gt(i1, 253) guard_false(i7) [] jump(i0, i1) """ expected = """ [i0, i1] i2 = int_and(i0, 255) i3 = int_sub_ovf(i2, i1) guard_no_overflow() [] i4 = int_le(i3, 10) guard_true(i4) [] i5 = int_ge(i3, 2) guard_true(i5) [] jump(i0, i1) """ self.optimize_loop(ops, expected) | addc2b77177b49468137a20034ac27db7b4ba464 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/addc2b77177b49468137a20034ac27db7b4ba464/test_optimizeopt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1717,
67,
1527,
74,
67,
5771,
12,
2890,
4672,
6727,
273,
3536,
306,
77,
20,
16,
277,
21,
65,
277,
22,
273,
509,
67,
464,
12,
77,
20,
16,
4561,
13,
277,
23,
273,
509,
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,
1842,
67,
1717,
67,
1527,
74,
67,
5771,
12,
2890,
4672,
6727,
273,
3536,
306,
77,
20,
16,
277,
21,
65,
277,
22,
273,
509,
67,
464,
12,
77,
20,
16,
4561,
13,
277,
23,
273,
509,
67... |
wakeupCallKind = Globals.repository.findPath('//parcels/osaf/framework/wakeup/WakeupCall') | wakeupCallKind = self.__getKind() | def __populate(self): wakeupCallKind = Globals.repository.findPath('//parcels/osaf/framework/wakeup/WakeupCall') | ed35102bbff3365db6217a5bcdbe9765f8560d80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/ed35102bbff3365db6217a5bcdbe9765f8560d80/WakeupCaller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
19936,
12,
2890,
4672,
19891,
416,
1477,
5677,
273,
18901,
1031,
18,
9071,
18,
4720,
743,
2668,
759,
1065,
2183,
87,
19,
538,
1727,
19,
12303,
19,
91,
911,
416,
19,
59,
911,
416,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
19936,
12,
2890,
4672,
19891,
416,
1477,
5677,
273,
18901,
1031,
18,
9071,
18,
4720,
743,
2668,
759,
1065,
2183,
87,
19,
538,
1727,
19,
12303,
19,
91,
911,
416,
19,
59,
911,
416,... |
self._cancel_bt = wx.Button(self, wx.ID_CANCEL) | self._cancel_bt = wx.Button(self._panel, wx.ID_CANCEL) | def __init__(self, parent, id, title, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE | wx.MINIMIZE_BOX): """Creates a standalone window that is used for downloading updates for the editor. """ wx.Frame.__init__(self, parent, id, title, pos, size, style) try: if wx.Platform == "__WXMSW__": ed_icon = ed_glob.CONFIG['SYSPIX_DIR'] + u"editra.ico" self.SetIcon(wx.Icon(ed_icon, wx.BITMAP_TYPE_ICO)) else: ed_icon = ed_glob.CONFIG['SYSPIX_DIR'] + u"editra.png" self.SetIcon(wx.Icon(ed_icon, wx.BITMAP_TYPE_PNG)) finally: pass | 843e5a514f51011229f95772d2def38c61b1b96d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3530/843e5a514f51011229f95772d2def38c61b1b96d/updater.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
612,
16,
2077,
16,
949,
273,
7075,
18,
1868,
2555,
16,
963,
273,
7075,
18,
1868,
1225,
16,
2154,
273,
7075,
18,
5280,
67,
2565,
18683,
67,
150... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
612,
16,
2077,
16,
949,
273,
7075,
18,
1868,
2555,
16,
963,
273,
7075,
18,
1868,
1225,
16,
2154,
273,
7075,
18,
5280,
67,
2565,
18683,
67,
150... |
fp = open(fss.as_pathname(), 'w') fss.SetCreatorType('Pyth', 'TEXT') fp.write('"""Suite %s: %s\n' % (name, desc)) fp.write("Level %d, version %d\n\n" % (level, version)) fp.write("Generated from %s\n"%fname) fp.write("AETE/AEUT resource version %d/%d, language %d, script %d\n" % \ (major, minor, language, script)) fp.write('"""\n\n') fp.write('import aetools\n') fp.write('import MacOS\n\n') fp.write("_code = %s\n\n"% `code`) | def compilesuite(suite, major, minor, language, script, fname, basepackage=None): """Generate code for a single suite""" [name, desc, code, level, version, events, classes, comps, enums] = suite modname = identify(name) if len(modname) > 28: modname = modname[:27] fss, ok = macfs.StandardPutFile('Python output file', modname+'.py') if not ok: return None, None pathname = fss.as_pathname() modname = os.path.splitext(os.path.split(pathname)[1])[0] fp = open(fss.as_pathname(), 'w') fss.SetCreatorType('Pyth', 'TEXT') fp.write('"""Suite %s: %s\n' % (name, desc)) fp.write("Level %d, version %d\n\n" % (level, version)) fp.write("Generated from %s\n"%fname) fp.write("AETE/AEUT resource version %d/%d, language %d, script %d\n" % \ (major, minor, language, script)) fp.write('"""\n\n') fp.write('import aetools\n') fp.write('import MacOS\n\n') fp.write("_code = %s\n\n"% `code`) if basepackage and basepackage._code_to_module.has_key(code): # We are an extension of a baseclass (usually an application extending # Standard_Suite or so). Import everything from our base module fp.write('from %s import *\n'%basepackage._code_to_fullname[code]) basemodule = basepackage._code_to_module[code] else: # We are not an extension. basemodule = None compileclassheader(fp, modname, basemodule) enumsneeded = {} if events: for event in events: compileevent(fp, event, enumsneeded) else: fp.write("\tpass\n\n") objc = ObjectCompiler(fp, basemodule) for cls in classes: objc.compileclass(cls) for cls in classes: objc.fillclasspropsandelems(cls) for comp in comps: objc.compilecomparison(comp) for enum in enums: objc.compileenumeration(enum) for enum in enumsneeded.keys(): objc.checkforenum(enum) objc.dumpindex() return code, modname | 42eee53a968a82394c0e1946ffbb8abc26471a5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/42eee53a968a82394c0e1946ffbb8abc26471a5d/gensuitemodule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1161,
1449,
9519,
12,
30676,
16,
7888,
16,
8439,
16,
2653,
16,
2728,
16,
5299,
16,
1026,
5610,
33,
7036,
4672,
3536,
4625,
981,
364,
279,
2202,
11371,
8395,
306,
529,
16,
3044,
16,
981... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1161,
1449,
9519,
12,
30676,
16,
7888,
16,
8439,
16,
2653,
16,
2728,
16,
5299,
16,
1026,
5610,
33,
7036,
4672,
3536,
4625,
981,
364,
279,
2202,
11371,
8395,
306,
529,
16,
3044,
16,
981... | |
peer_nodes = sync(old_peer_nodes, nodes_at_peer, Node) | peer_nodes = sync(old_peer_nodes, nodes_at_peer, Node, columns) | def trace (message): if classname == trace_type and peer_object_id in trace_ids: message_verbose('TRACE>>'+message) | be959d0158ffaff6d50158269f03ba7f2c1da56f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7598/be959d0158ffaff6d50158269f03ba7f2c1da56f/RefreshPeer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2606,
261,
2150,
4672,
309,
7479,
422,
2606,
67,
723,
471,
4261,
67,
1612,
67,
350,
316,
2606,
67,
2232,
30,
883,
67,
11369,
2668,
23827,
34,
1870,
15,
2150,
13,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2606,
261,
2150,
4672,
309,
7479,
422,
2606,
67,
723,
471,
4261,
67,
1612,
67,
350,
316,
2606,
67,
2232,
30,
883,
67,
11369,
2668,
23827,
34,
1870,
15,
2150,
13,
2,
-100,
-100,
-100,
... |
"""Returns the SVN base URL. | """Returns base URL for current diff. | def _GuessBase(self, required): """Returns the SVN base URL. | f1a1421aef0b4c5d48e921c69f1856ba8323c2d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/476/f1a1421aef0b4c5d48e921c69f1856ba8323c2d4/upload.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
15977,
2171,
12,
2890,
16,
1931,
4672,
3536,
1356,
326,
29537,
50,
1026,
1976,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
15977,
2171,
12,
2890,
16,
1931,
4672,
3536,
1356,
326,
29537,
50,
1026,
1976,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def quit_(self, sender): print sender.title() NSQuitCommand() | def enableUp_(self, sender): idx=self.aliasesListTable.selectedRow() return (idx != 0) @IBAction def moveUp_(self, sender): self.moveUpDown(step=1) @IBAction def moveDown_(self, sender): self.moveUpDown(step=-1) def moveUpDown(self, step): idx=self.aliasesListTable.selectedRow() aliases=self.selectedAccount.aliases if idx-step > -1: item=aliases.pop(idx) aliases.insert(idx-step, item) self.populateTable_(self) self.aliasesListTable.selectRowIndexes_byExtendingSelection_(NSIndexSet.indexSetWithIndex_(idx-step), False) | def quit_(self, sender): print sender.title() NSQuitCommand() | 4d0396e72248f9dfadf5902fb8bbb8f6275852ff /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4895/4d0396e72248f9dfadf5902fb8bbb8f6275852ff/mailVirtualAppDelegate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9706,
67,
12,
2890,
16,
5793,
4672,
1172,
5793,
18,
2649,
1435,
11472,
25365,
2189,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9706,
67,
12,
2890,
16,
5793,
4672,
1172,
5793,
18,
2649,
1435,
11472,
25365,
2189,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if not os.path.exists(self.relPath): os.mkdir(self.relPath) if not os.path.exists(self.relPath+'/logs'): os.mkdir(self.relPath+'/logs') if not os.path.exists(self.relPath+'/Images'): os.mkdir(self.relPath+'/Images') if not os.path.exists(self.relPath+'/DataProducts'): os.mkdir(self.relPath+'/DataProducts') self.tag_base = tag_base self.add_condor_cmd('environment',"KMP_LIBRARY=serial;MKL_SERIAL=yes") self.set_sub_file(name+'.sub') self.set_stdout_file(self.outputPath+'/logs/'+name+'-$(macroid).out') self.set_stderr_file(self.outputPath+'/logs/'+name+'-$(macroid).err') if cp: if cp.has_section("condor-memory-requirement") and cp.has_option("condor-memory-requirement",name): requirement = cp.getint("condor-memory-requirement",name) self.add_condor_cmd("Requirements", "(Memory > " + str(requirement) + ")") | if not os.path.exists(self.relPath): os.mkdir(self.relPath) if not os.path.exists(self.relPath+'/logs'): os.mkdir(self.relPath+'/logs') if not os.path.exists(self.relPath+'/Images'): os.mkdir(self.relPath+'/Images') if not os.path.exists(self.relPath+'/DataProducts'): os.mkdir(self.relPath+'/DataProducts') self.tag_base = tag_base self.add_condor_cmd('environment',"KMP_LIBRARY=serial;MKL_SERIAL=yes") self.set_sub_file(name+'.sub') self.set_stdout_file(self.outputPath+'/logs/'+name+'-$(macroid).out') self.set_stderr_file(self.outputPath+'/logs/'+name+'-$(macroid).err') if cp: if cp.has_section("condor-memory-requirement") and cp.has_option("condor-memory-requirement",name): requirement = cp.getint("condor-memory-requirement",name) self.add_condor_cmd("Requirements", "(Memory > " + str(requirement) + ")") | def setupJob(self, name, dir= '', tag_base=None, cp=None): # Give this job a name. Then make directories for the log files and such # This name is important since these directories will be included in # the web tree. | cbd6ac162cb6bf2eb4ad5ce9c3d03753b881f67f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/cbd6ac162cb6bf2eb4ad5ce9c3d03753b881f67f/stfu_pipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
2278,
12,
2890,
16,
508,
16,
1577,
33,
10226,
1047,
67,
1969,
33,
7036,
16,
3283,
33,
7036,
4672,
468,
22374,
333,
1719,
279,
508,
18,
225,
9697,
1221,
6402,
364,
326,
613,
1390,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2278,
12,
2890,
16,
508,
16,
1577,
33,
10226,
1047,
67,
1969,
33,
7036,
16,
3283,
33,
7036,
4672,
468,
22374,
333,
1719,
279,
508,
18,
225,
9697,
1221,
6402,
364,
326,
613,
1390,... |
if k == 0: k = int(math.ceil(sqrtN)) | if k == 0: k = int(ceil(sqrtN)) | def deriv_at1(self, k=0): r""" Compute $L'(E,1)$ using$ k$ terms of the series for $L'(E,1)$. | 9ed7d60098e737e2d62d27e0654d4c98df87bdd6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/9ed7d60098e737e2d62d27e0654d4c98df87bdd6/lseries_ell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9630,
67,
270,
21,
12,
2890,
16,
417,
33,
20,
4672,
436,
8395,
8155,
271,
48,
11,
12,
41,
16,
21,
21877,
1450,
8,
417,
8,
6548,
434,
326,
4166,
364,
271,
48,
11,
12,
41,
16,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9630,
67,
270,
21,
12,
2890,
16,
417,
33,
20,
4672,
436,
8395,
8155,
271,
48,
11,
12,
41,
16,
21,
21877,
1450,
8,
417,
8,
6548,
434,
326,
4166,
364,
271,
48,
11,
12,
41,
16,
21,
... |
log.error(eventDict['failure'].getTrackback()) | log.error(eventDict.get('why') or 'Unhandled exception' + '\n' + str(eventDict['failure'].getTraceback())) | def twisted_log(eventDict): log = logging.getLogger('twisted') if 'failure' in eventDict: log.error(eventDict['failure'].getTrackback()) elif 'warning' in eventDict: log.warning(eventDict['warning']) else: log.debug(' '.join([str(m) for m in eventDict['message']])) | 9544792b1334788a0295974a5729c4da9526ae8f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12048/9544792b1334788a0295974a5729c4da9526ae8f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2339,
25444,
67,
1330,
12,
2575,
5014,
4672,
613,
273,
2907,
18,
588,
3328,
2668,
11246,
25444,
6134,
309,
296,
12251,
11,
316,
871,
5014,
30,
613,
18,
1636,
12,
2575,
5014,
18,
588,
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,
2339,
25444,
67,
1330,
12,
2575,
5014,
4672,
613,
273,
2907,
18,
588,
3328,
2668,
11246,
25444,
6134,
309,
296,
12251,
11,
316,
871,
5014,
30,
613,
18,
1636,
12,
2575,
5014,
18,
588,
2... |
value = str(value).encode("utf-8") | value = str(value) | def post_to_server(self, data, auth=None): ''' Post a query to the server, and return a string response. ''' self.announce('Registering %s to %s' % (data['name'], self.repository), log.INFO) # Build up the MIME payload for the urllib2 POST data boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254' sep_boundary = '\n--' + boundary end_boundary = sep_boundary + '--' body = io.StringIO() for key, value in data.items(): # handle multiple entries for the same name if type(value) not in (type([]), type( () )): value = [value] for value in value: value = str(value).encode("utf-8") body.write(sep_boundary) body.write('\nContent-Disposition: form-data; name="%s"'%key) body.write("\n\n") body.write(value) if value and value[-1] == '\r': body.write('\n') # write an extra newline (lurve Macs) body.write(end_boundary) body.write("\n") body = body.getvalue() | 2d1ca2dbabde2ed69e06b50ddb2e87b12958d696 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/2d1ca2dbabde2ed69e06b50ddb2e87b12958d696/register.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
67,
869,
67,
3567,
12,
2890,
16,
501,
16,
1357,
33,
7036,
4672,
9163,
5616,
279,
843,
358,
326,
1438,
16,
471,
327,
279,
533,
766,
18,
9163,
365,
18,
1072,
8386,
2668,
3996,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
67,
869,
67,
3567,
12,
2890,
16,
501,
16,
1357,
33,
7036,
4672,
9163,
5616,
279,
843,
358,
326,
1438,
16,
471,
327,
279,
533,
766,
18,
9163,
365,
18,
1072,
8386,
2668,
3996,
31... |
'uCov,gCov,rCov,iCov,zCov,yCov', '-f', 'objectId,ra,dec,epoch']) | 'uCov,gCov,rCov,iCov,zCov,yCov', '-f', 'objectId,ra,decl,epoch']) | def referenceMatch(inputRoot, outputRoot, database, refCatalog, radius, tableSuffix=""): objectCsv = os.path.abspath(os.path.join(outputRoot, 'objDump.csv')) filtCsv = os.path.abspath(os.path.join(outputRoot, 'refFilt.csv')) matchCsv = os.path.abspath(os.path.join(outputRoot, 'refObjMatch.csv')) # Filter reference catalog subprocess.call(['python', refCcdFilter, refCatalog, filtCsv, inputRoot, '-F', 'refObjectId,isStar,ra,decl,gLat,gLon,sedName,' + 'uMag,gMag,rMag,iMag,zMag,yMag,muRa,muDecl,parallax,vRad,isVar,redshift']) # Dump object table execStmt("""SELECT o.objectId, o.ra_PS, o.decl_PS, AVG(s.taiMidPoint) FROM %s.Object%s AS o INNER JOIN %s.Source%s AS s ON (s.objectId = o.objectId) GROUP BY o.objectId ORDER BY o.decl_PS INTO OUTFILE '%s' FIELDS TERMINATED BY ','; """ % (database, tableSuffix, database, tableSuffix, objectCsv)) # Match reference objects to objects subprocess.call(['python', refPosMatch, filtCsv, objectCsv, matchCsv, '-s', '-r', str(radius), '-F', 'refObjectId,isStar,ra,decl,gLat,gLon,sedName,' + 'uMag,gMag,rMag,iMag,zMag,yMag,muRa,muDecl,parallax,vRad,isVar,redshift,' + 'uCov,gCov,rCov,iCov,zCov,yCov', '-f', 'objectId,ra,dec,epoch']) # Load filtered reference catalog and matches execStmt("""LOAD DATA INFILE '%s' INTO TABLE %s.SimRefObject%s FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';""" % (filtCsv, database, tableSuffix)) execStmt("""LOAD DATA INFILE '%s' INTO TABLE %s.RefObjMatch%s FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';""" % (matchCsv, database, tableSuffix)) execStmt("ALTER TABLE %s.SimRefObject%s ADD PRIMARY KEY (refObjectId);" % (database, tableSuffix)) execStmt("ALTER TABLE %s.SimRefObject%s ADD KEY (decl);" % (database, tableSuffix)) execStmt("ALTER TABLE %s.RefObjMatch%s ADD KEY (refObjectId);" % (database, tableSuffix)) execStmt("ALTER TABLE %s.RefObjMatch%s ADD KEY (objectId);" % (database, tableSuffix)) | a0698795c77f2f8cc53a15c4c9130db151f9c963 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6538/a0698795c77f2f8cc53a15c4c9130db151f9c963/ingestSourceAssoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2114,
2060,
12,
2630,
2375,
16,
876,
2375,
16,
2063,
16,
1278,
9769,
16,
5725,
16,
1014,
5791,
1546,
6,
4672,
733,
16759,
273,
1140,
18,
803,
18,
5113,
803,
12,
538,
18,
803,
18,
570... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2114,
2060,
12,
2630,
2375,
16,
876,
2375,
16,
2063,
16,
1278,
9769,
16,
5725,
16,
1014,
5791,
1546,
6,
4672,
733,
16759,
273,
1140,
18,
803,
18,
5113,
803,
12,
538,
18,
803,
18,
570... |
gnome20.addmod('mrproject', cvsroot=codefactory_cvsroot, | gnome20.addmod('mrproject', | def sfcvsroot(project): return ':pserver:anonymous@cvs.%s.sourceforge.net:/cvsroot/%s' % \ (project, project) | a270c3b70c1dd30bb825912fe2136ef983d02130 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4596/a270c3b70c1dd30bb825912fe2136ef983d02130/moduleinfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
7142,
6904,
3085,
12,
4406,
4672,
327,
4290,
84,
3567,
30,
19070,
36,
71,
6904,
7866,
87,
18,
3168,
1884,
908,
18,
2758,
27824,
71,
6904,
3085,
5258,
87,
11,
738,
521,
261,
4406,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
7142,
6904,
3085,
12,
4406,
4672,
327,
4290,
84,
3567,
30,
19070,
36,
71,
6904,
7866,
87,
18,
3168,
1884,
908,
18,
2758,
27824,
71,
6904,
3085,
5258,
87,
11,
738,
521,
261,
4406,
... |
if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN): | if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN, ssl.SSL_ERROR_WANT_READ, ssl.SSL_ERROR_WANT_WRITE): | def send(self, data): try: return super(SSLConnection, self).send(data) except ssl.SSLError, err: if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN): return 0 raise | 1762099e6a24c825ecd624a4ee090b1ad863e86c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/1762099e6a24c825ecd624a4ee090b1ad863e86c/test_ftplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
12,
2890,
16,
501,
4672,
775,
30,
327,
2240,
12,
6745,
1952,
16,
365,
2934,
4661,
12,
892,
13,
1335,
5832,
18,
6745,
668,
16,
393,
30,
309,
393,
18,
1968,
63,
20,
65,
316,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
12,
2890,
16,
501,
4672,
775,
30,
327,
2240,
12,
6745,
1952,
16,
365,
2934,
4661,
12,
892,
13,
1335,
5832,
18,
6745,
668,
16,
393,
30,
309,
393,
18,
1968,
63,
20,
65,
316,
26... |
clause = '' | if context is None: context = {} | def _order_calc(self, cursor, user, field, otype, context=None): order_by = [] tables = [] field_name = None table_name = None link_field = None clause = '' | 6355baff406cd491895e75541e7f8188f68d5687 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9266/6355baff406cd491895e75541e7f8188f68d5687/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1019,
67,
12448,
12,
2890,
16,
3347,
16,
729,
16,
652,
16,
320,
723,
16,
819,
33,
7036,
4672,
1353,
67,
1637,
273,
5378,
4606,
273,
5378,
652,
67,
529,
273,
599,
1014,
67,
529,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1019,
67,
12448,
12,
2890,
16,
3347,
16,
729,
16,
652,
16,
320,
723,
16,
819,
33,
7036,
4672,
1353,
67,
1637,
273,
5378,
4606,
273,
5378,
652,
67,
529,
273,
599,
1014,
67,
529,
... |
self._overlay_bridge.connect(permid, _after_connect) | if channel_id == 0: if DEBUG: print >>sys.stderr, "crawler: send_request: Can not acquire channel-id", show_permid_short(permid) else: self._overlay_bridge.connect(permid, _after_connect) | def _after_connect(exc, dns, permid, selversion): if exc: # could not connect. if DEBUG: print >>sys.stderr, "crawler: could not connect", dns, show_permid_short(permid), exc self._release_channel_id(permid, channel_id) if callback: callback(exc, permid) else: self._send_request(permid, message_id, channel_id, payload, frequency=frequency, callback=callback) | 1a756a891e14660826a25bba2bbf8634ea99d4ae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9686/1a756a891e14660826a25bba2bbf8634ea99d4ae/Crawler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5205,
67,
3612,
12,
10075,
16,
6605,
16,
4641,
350,
16,
357,
1589,
4672,
309,
3533,
30,
468,
3377,
486,
3077,
18,
309,
6369,
30,
1172,
1671,
9499,
18,
11241,
16,
315,
71,
10644,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5205,
67,
3612,
12,
10075,
16,
6605,
16,
4641,
350,
16,
357,
1589,
4672,
309,
3533,
30,
468,
3377,
486,
3077,
18,
309,
6369,
30,
1172,
1671,
9499,
18,
11241,
16,
315,
71,
10644,
... |
assert_raises(SystemExit,cron_util.getProcessingDates,{'startDate':start},self.tableName,cursor,me.fileLogger) assert_raises(SystemExit,cron_util.getProcessingDates,{'endDate':end},self.tableName,cursor,me.fileLogger) assert_raises(SystemExit,cron_util.getProcessingDates,{'deltaDate':delta},self.tableName,cursor,me.fileLogger) | assert_raises(SystemExit,cron_util.getProcessingDates,{'startDate':start},self.tableName,None,cursor,me.fileLogger) assert_raises(SystemExit,cron_util.getProcessingDates,{'endDate':end},self.tableName,None,cursor,me.fileLogger) assert_raises(SystemExit,cron_util.getProcessingDates,{'deltaDate':delta},self.tableName,None,cursor,me.fileLogger) | def testGetProcessingDates(self): config = {} config['processingDelay'] = datetime.timedelta(0) cursor = self.connection.cursor() self.connection.rollback() self.createBunny() now = datetime.datetime.now() midnight = now.replace(hour=0,minute=0,second=0,microsecond=0) defStart = midnight - cron_util.globalInitialDeltaDate defEnd = midnight while defEnd + cron_util.globalDefaultDeltaWindow < now: defEnd += cron_util.globalDefaultDeltaWindow | cafbae83143e839351f7e00f20999c211cfa9fdb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12383/cafbae83143e839351f7e00f20999c211cfa9fdb/testUtil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
967,
7798,
15578,
12,
2890,
4672,
642,
273,
2618,
642,
3292,
10632,
6763,
3546,
273,
3314,
18,
31295,
12,
20,
13,
3347,
273,
365,
18,
4071,
18,
9216,
1435,
365,
18,
4071,
18,
200... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
967,
7798,
15578,
12,
2890,
4672,
642,
273,
2618,
642,
3292,
10632,
6763,
3546,
273,
3314,
18,
31295,
12,
20,
13,
3347,
273,
365,
18,
4071,
18,
9216,
1435,
365,
18,
4071,
18,
200... |
return "<h%d>%s</h%d>\n\n" \ % (n, self._run_span_gamut(match.group(1)), n) | header_id_attr = "" if "header-ids" in self.extras: header_id = self.header_id_from_text(match.group(1), prefix=self.extras["header-ids"]) header_id_attr = ' id="%s"' % header_id html = self._run_span_gamut(match.group(1)) if "toc" in self.extras: self._toc_add_entry(n, header_id, html) return "<h%d%s>%s</h%d>\n\n" % (n, header_id_attr, html, n) | def _setext_h_sub(self, match): n = {"=": 1, "-": 2}[match.group(2)[0]] demote_headers = self.extras.get("demote-headers") if demote_headers: n = min(n + demote_headers, 6) return "<h%d>%s</h%d>\n\n" \ % (n, self._run_span_gamut(match.group(1)), n) | 0019d4d8e1b0abb438cd1a7862e2e6730c37aaa2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8838/0019d4d8e1b0abb438cd1a7862e2e6730c37aaa2/markdown2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
408,
67,
76,
67,
1717,
12,
2890,
16,
845,
4672,
290,
273,
12528,
1546,
30,
404,
16,
3701,
6877,
576,
20294,
1916,
18,
1655,
12,
22,
25146,
20,
13563,
9626,
1168,
67,
2485,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
408,
67,
76,
67,
1717,
12,
2890,
16,
845,
4672,
290,
273,
12528,
1546,
30,
404,
16,
3701,
6877,
576,
20294,
1916,
18,
1655,
12,
22,
25146,
20,
13563,
9626,
1168,
67,
2485,
... |
price_unit = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom})[pricelist] real_price=get_real_price(pricelist, product.id) | if not pricelist: raise osv.except_osv(_('No Purchase Pricelist Found !'),_("You must first define a pricelist for Supplier !")) price_unit_res = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom})[pricelist] price_unit = price_unit_res[pricelist] real_price= get_real_price(price_unit_res, product.id, pricelist) | def get_real_price(pricelist_id, product_id): product_tmpl_id = self.pool.get('product.product').browse(cr, uid, product_id, context).product_tmpl_id.id pricetype_id = self.pool.get('product.pricelist').browse(cr, uid, pricelist_id).version_id[0].items_id[0].base field_name = self.pool.get('product.price.type').browse(cr, uid, pricetype_id).field product_read = self.pool.get('product.template').read(cr, uid, product_tmpl_id, [field_name], context) return product_read[field_name] | 09263c29730891dba703fcb1a2bfb60b2db55bf7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/09263c29730891dba703fcb1a2bfb60b2db55bf7/product.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7688,
67,
8694,
12,
683,
335,
5449,
67,
350,
16,
3017,
67,
350,
4672,
3017,
67,
24717,
67,
350,
273,
365,
18,
6011,
18,
588,
2668,
5896,
18,
5896,
16063,
25731,
12,
3353,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7688,
67,
8694,
12,
683,
335,
5449,
67,
350,
16,
3017,
67,
350,
4672,
3017,
67,
24717,
67,
350,
273,
365,
18,
6011,
18,
588,
2668,
5896,
18,
5896,
16063,
25731,
12,
3353,
16... |
gLogger.debug(infoStr) except Exception,x: errStr = "SRM2Storage.__init__: Failed to import gfalthr: %s." % (x) gLogger.warn(errStr) | gLogger.debug( infoStr ) except Exception, x: errStr = "SRM2Storage.__init__: Failed to import gfalthr: %s." % ( x ) gLogger.warn( errStr ) | def __importExternals(self): if (self.lcg_util) and (self.gfal): return S_OK() try: import lcg_util infoStr = 'Using lcg_util from: %s' % lcg_util.__file__ gLogger.debug(infoStr) infoStr = "The version of lcg_utils is %s" % lcg_util.lcg_util_version() gLogger.debug(infoStr) except Exception,x: errStr = "SRM2Storage.__init__: Failed to import lcg_util" gLogger.exception(errStr,'',x) ISOK = False return S_ERROR(errStr) try: import gfalthr as gfal infoStr = "Using gfalthr from: %s" % gfal.__file__ gLogger.debug(infoStr) infoStr = "The version of gfalthr is %s" % gfal.gfal_version() gLogger.debug(infoStr) except Exception,x: errStr = "SRM2Storage.__init__: Failed to import gfalthr: %s." % (x) gLogger.warn(errStr) try: import gfal infoStr = "Using gfal from: %s" % gfal.__file__ gLogger.debug(infoStr) infoStr = "The version of gfal is %s" % gfal.gfal_version() gLogger.debug(infoStr) except Exception,x: errStr = "SRM2Storage.__init__: Failed to import gfal" gLogger.exception(errStr,'',x) ISOK = False return S_ERROR(errStr) self.lcg_util = lcg_util self.gfal = gfal return S_OK() | 70e66af095cb6701e39b1e701e4a2ce4d012b4f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/70e66af095cb6701e39b1e701e4a2ce4d012b4f7/SRM2Storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
5666,
29764,
1031,
12,
2890,
4672,
309,
261,
2890,
18,
17704,
75,
67,
1367,
13,
471,
261,
2890,
18,
75,
74,
287,
4672,
327,
348,
67,
3141,
1435,
775,
30,
1930,
9109,
75,
67,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
5666,
29764,
1031,
12,
2890,
4672,
309,
261,
2890,
18,
17704,
75,
67,
1367,
13,
471,
261,
2890,
18,
75,
74,
287,
4672,
327,
348,
67,
3141,
1435,
775,
30,
1930,
9109,
75,
67,
13... |
xNorm2 = 0.0 | xNorm2 = 0.0 | def Solve( self ): if self.A is not None: if self.factorize and not self.factorized: self.Factorize() if self.b is not None: self.FindFeasible() | aaeba3373d0375cd9447e5d6a6205e7f4114f313 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13857/aaeba3373d0375cd9447e5d6a6205e7f4114f313/ppcg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
348,
5390,
12,
365,
262,
30,
309,
365,
18,
37,
353,
486,
599,
30,
309,
365,
18,
6812,
554,
471,
486,
365,
18,
6812,
1235,
30,
365,
18,
6837,
554,
1435,
309,
365,
18,
70,
353,
486,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
348,
5390,
12,
365,
262,
30,
309,
365,
18,
37,
353,
486,
599,
30,
309,
365,
18,
6812,
554,
471,
486,
365,
18,
6812,
1235,
30,
365,
18,
6837,
554,
1435,
309,
365,
18,
70,
353,
486,
... |
ProductCategory(name='T-Shirt', description='Please choose how many t-shirts you would like.', note='One t-shirt is free with your registration, any others are $25.00 each. More details and measurements on t-shirt sizes can be found on the <a href="/register/shirts" popup="True">registration information</a>.', display='shirt', min_qty=1, max_qty=100, display_order=10), ProductCategory(name='Penguin Dinner Ticket', description='Please indicate how many Penguin Dinner tickets you wish to purchase.', note='You should include yourself in this number, even if you register as a Professional. Adult ticket is an adult meal, infant ticket is no meal and sit on your knee, child ticket is a childs meal. If your child requires an adult meal, then please purchase an adult ticket for them.', display='qty', min_qty=0, max_qty=5, display_grid='t', display_order=20), | ProductCategory(name='T-Shirt', description='Please choose how many t-shirts you would like.', note='One t-shirt is free with your registration, any others are $25.00 each. More details and measurements on t-shirt sizes can be found on the <a href="/register/shirts" popup="True">registration information</a>.', display='qty', display_mode='shirt', min_qty=1, max_qty=100, display_order=10), ProductCategory(name='Penguin Dinner Ticket', description='Please indicate how many Penguin Dinner tickets you wish to purchase.', note='You should include yourself in this number, even if you register as a Professional. Adult ticket is an adult meal, infant ticket is no meal and sit on your knee, child ticket is a childs meal. If your child requires an adult meal, then please purchase an adult ticket for them.', display='qty', min_qty=0, max_qty=5, display_mode='grid', display_order=20), | def setup(meta): meta.Session.add_all( [ ProductCategory(name='Ticket', description='Please choose your registration type.', display='radio', min_qty=1, max_qty=1, display_order=1), ProductCategory(name='T-Shirt', description='Please choose how many t-shirts you would like.', note='One t-shirt is free with your registration, any others are $25.00 each. More details and measurements on t-shirt sizes can be found on the <a href="/register/shirts" popup="True">registration information</a>.', display='shirt', min_qty=1, max_qty=100, display_order=10), ProductCategory(name='Penguin Dinner Ticket', description='Please indicate how many Penguin Dinner tickets you wish to purchase.', note='You should include yourself in this number, even if you register as a Professional. Adult ticket is an adult meal, infant ticket is no meal and sit on your knee, child ticket is a childs meal. If your child requires an adult meal, then please purchase an adult ticket for them.', display='qty', min_qty=0, max_qty=5, display_grid='t', display_order=20), ProductCategory(name='Accommodation', description='Please consider where you are going to stay during the conference.', display='select', min_qty=0, max_qty=10, display_order=30), ProductCategory(name="Partners Programme", description="Please register your partner for the Partners Programme.", display='qty', min_qty=0, max_qty=50, display_grid='t', display_order=40), ProductCategory(name="Speakers Dinner Ticket", description='Please indicate how many speaker dinner tickets you need.', note='These are for you, your significant other, and your children. Adult ticket is an adult meal, infant ticket is no meal and sit on your knee, child ticket is a childs meal. If your child requires an adult meal, then purchase an adult ticket for them.', display='qty', min_qty=0, max_qty=200, display_grid='t', display_order=25), ] ) | bb17b4fa2675e95c10d31d1e1628553d762894ad /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12856/bb17b4fa2675e95c10d31d1e1628553d762894ad/product_category.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
3901,
4672,
2191,
18,
2157,
18,
1289,
67,
454,
12,
306,
8094,
4457,
12,
529,
2218,
13614,
2187,
2477,
2218,
8496,
9876,
3433,
7914,
618,
1093,
16,
2562,
2218,
17006,
2187,
1131... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
3901,
4672,
2191,
18,
2157,
18,
1289,
67,
454,
12,
306,
8094,
4457,
12,
529,
2218,
13614,
2187,
2477,
2218,
8496,
9876,
3433,
7914,
618,
1093,
16,
2562,
2218,
17006,
2187,
1131... |
elif self.ref in ('ome',): | elif self.ref in ('ome', 'phi', 'psi', 'chi', 'zeta',): | def Plot(self): binVals = [] width = round(self.xbin / self.xPixelSize) height = round(self.ybin / self.yPixelSize) | 5b85d4b7cee3ebafc70b413e441b63e7e8639989 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6163/5b85d4b7cee3ebafc70b413e441b63e7e8639989/ConfDistFuncs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15211,
12,
2890,
4672,
225,
4158,
13169,
273,
5378,
1835,
282,
273,
3643,
12,
2890,
18,
92,
4757,
342,
365,
18,
92,
9037,
1225,
13,
2072,
225,
273,
3643,
12,
2890,
18,
93,
4757,
342,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15211,
12,
2890,
4672,
225,
4158,
13169,
273,
5378,
1835,
282,
273,
3643,
12,
2890,
18,
92,
4757,
342,
365,
18,
92,
9037,
1225,
13,
2072,
225,
273,
3643,
12,
2890,
18,
93,
4757,
342,
... |
cty.c_int, cty.c_int], | cty.c_int, cty.c_int], | def fl_glwincreate(config, context, w, h): """ fl_glwincreate(config, context, w, h) -> window """ retval = _fl_glwincreate(config, context, w, h) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
7043,
8082,
2640,
12,
1425,
16,
819,
16,
341,
16,
366,
4672,
3536,
1183,
67,
7043,
8082,
2640,
12,
1425,
16,
819,
16,
341,
16,
366,
13,
317,
2742,
3536,
225,
5221,
273,
389... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1183,
67,
7043,
8082,
2640,
12,
1425,
16,
819,
16,
341,
16,
366,
4672,
3536,
1183,
67,
7043,
8082,
2640,
12,
1425,
16,
819,
16,
341,
16,
366,
13,
317,
2742,
3536,
225,
5221,
273,
389... |
def finish_test(self, secDB): | def finish_test(self, secDB, txn=None): | def finish_test(self, secDB): # 'Blues' should not be in the secondary database vals = secDB.pget('Blues') assert vals == None, vals | 4a1088c2f2437fbec26e363210956a0f8109e7cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/4a1088c2f2437fbec26e363210956a0f8109e7cd/test_associate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
67,
3813,
12,
2890,
16,
1428,
2290,
16,
7827,
33,
7036,
4672,
468,
296,
4802,
3610,
11,
1410,
486,
506,
316,
326,
9946,
2063,
5773,
273,
1428,
2290,
18,
84,
588,
2668,
4802,
3610... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
67,
3813,
12,
2890,
16,
1428,
2290,
16,
7827,
33,
7036,
4672,
468,
296,
4802,
3610,
11,
1410,
486,
506,
316,
326,
9946,
2063,
5773,
273,
1428,
2290,
18,
84,
588,
2668,
4802,
3610... |
self.posnoise = config.config[self.color+'_posnoise'] | self.posnoise = config[self.color+'_posnoise'] | def __init__(self, map, color, base): self.color = color self.map = map ntanks = config.config[self.color+'_tanks'] if ntanks is None: ntanks = config.config['default_tanks'] | 514bd7bd8178ee4371240d9315e3fd7d459ce673 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9601/514bd7bd8178ee4371240d9315e3fd7d459ce673/game.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
852,
16,
2036,
16,
1026,
4672,
365,
18,
3266,
273,
2036,
365,
18,
1458,
273,
852,
9513,
19965,
273,
642,
18,
1425,
63,
2890,
18,
3266,
6797,
67,
88,
19... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
852,
16,
2036,
16,
1026,
4672,
365,
18,
3266,
273,
2036,
365,
18,
1458,
273,
852,
9513,
19965,
273,
642,
18,
1425,
63,
2890,
18,
3266,
6797,
67,
88,
19... |
(r'0c[0-9]+', Number.Octal), | (r'0c[0-9]+', Number.Oct), | # ``cdef foo from "header"``, or ``for foo from 0 < i < 10`` | 9373613f5108606db3a06bd7b2a0fd02239b8f76 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6148/9373613f5108606db3a06bd7b2a0fd02239b8f76/compiled.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
12176,
71,
536,
8431,
628,
315,
3374,
8366,
9191,
578,
12176,
1884,
8431,
628,
374,
411,
277,
411,
1728,
10335,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
12176,
71,
536,
8431,
628,
315,
3374,
8366,
9191,
578,
12176,
1884,
8431,
628,
374,
411,
277,
411,
1728,
10335,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def resize(self): | def resize(self, refresh=True): | def resize(self): """This method exists simply to keep it straight forward when initialising a window and resizing it.""" self.size() self.win.mvwin(self.y, self.x) self.win.resize(self.h, self.w) self.refresh() | 4a82f5f09bb7e653a67c969608ad51544e4ab12c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6932/4a82f5f09bb7e653a67c969608ad51544e4ab12c/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7041,
12,
2890,
16,
4460,
33,
5510,
4672,
3536,
2503,
707,
1704,
8616,
358,
3455,
518,
21251,
5104,
1347,
2172,
13734,
279,
2742,
471,
400,
6894,
518,
12123,
365,
18,
1467,
1435,
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,
7041,
12,
2890,
16,
4460,
33,
5510,
4672,
3536,
2503,
707,
1704,
8616,
358,
3455,
518,
21251,
5104,
1347,
2172,
13734,
279,
2742,
471,
400,
6894,
518,
12123,
365,
18,
1467,
1435,
365,
18... |
return "alias %s='%s';" % ( key, value) | return "%(key)s() { %(value)s; };\nexport -f %(key)s;" % locals() | def alias(self, key, value): return "alias %s='%s';" % ( key, value) | 37bdc004f013b078cea6ac285e18932f97141c40 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14112/37bdc004f013b078cea6ac285e18932f97141c40/setpkg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2308,
12,
2890,
16,
498,
16,
460,
4672,
327,
315,
4930,
738,
87,
28713,
87,
11,
4868,
738,
261,
498,
16,
460,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2308,
12,
2890,
16,
498,
16,
460,
4672,
327,
315,
4930,
738,
87,
28713,
87,
11,
4868,
738,
261,
498,
16,
460,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
ymin = min(-100,ymin) ymax = max(-100,ymax) | def reasonable_yscale(data): """Examine the data and return a reasonable y scale as a min and max value.""" tick = 50 # Ensures subsequent divisions are in floating point. tick = float(tick) allvalues = [v for _,v in itertools.chain(*data) if v is not None] datamin = min(allvalues) datamax = max(allvalues) ymin = int(tick * math.floor(datamin/tick)) ymax = int(tick * math.ceil(datamax/tick)) ymin = min(-100,ymin) ymax = max(-100,ymax) return ymin,ymax | f48f5e90a10c46dc1af612da90b8566080e2297e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6890/f48f5e90a10c46dc1af612da90b8566080e2297e/vischeck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23589,
67,
1900,
1869,
12,
892,
4672,
3536,
424,
301,
558,
326,
501,
471,
327,
279,
23589,
677,
3159,
487,
279,
1131,
471,
943,
460,
12123,
225,
4024,
273,
6437,
468,
1374,
8421,
10815,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23589,
67,
1900,
1869,
12,
892,
4672,
3536,
424,
301,
558,
326,
501,
471,
327,
279,
23589,
677,
3159,
487,
279,
1131,
471,
943,
460,
12123,
225,
4024,
273,
6437,
468,
1374,
8421,
10815,
... | |
textureCoords += [(0.1, 0.1), (0.9, 0.9)] | textureCoords += [(0.9, 0.9), (0.1, 0.1)] | def __init__(self, *args, **keywordArgs): Shape.__init__(self, *args, **keywordArgs) # TODO: use VBO's so all instances share the same data? steps = 32 angleStep = 2.0 * pi / steps topVertices = [] bottomVertices = [] sideNormals = [] for step in range(0, steps): angle = step * angleStep x, z = (sin(angle) * 0.5, cos(angle) * 0.5) topVertices += [(x, 0.5, z)] bottomVertices += [(x, -0.5, z)] sideNormals += [(x / 0.5, 0.0, z / 0.5)] vertices = [(0.0, 0.5, 0.0)] + topVertices vertexNormals = [(0.0, 1.0, 0.0)] * (steps + 1) textureCoords = [(0.0, 0.0)] + [(0.1, 0.1)] * steps for step in range(0, steps): vertices += [topVertices[step], bottomVertices[step]] vertexNormals += [sideNormals[step], sideNormals[step]] textureCoords += [(0.1, 0.1), (0.9, 0.9)] vertices += bottomVertices + [(0.0, -0.5, 0.0)] vertexNormals += [(0.0, -1.0, 0.0)] * (steps + 1) textureCoords += [(0.9, 0.9)] * steps + [(1.0, 1.0)] self.geometry().setVertexArray(Shape.vectorArrayFromList(vertices)) faceSet = Shape.primitiveSetFromList(osg.PrimitiveSet.TRIANGLE_FAN, range(0, steps + 1) + [1, 0]) self.geometry().addPrimitiveSet(faceSet) faceSet = Shape.primitiveSetFromList(osg.PrimitiveSet.QUAD_STRIP, range(steps + 1, 3 * steps + 1) + [steps + 1, steps + 2]) self.geometry().addPrimitiveSet(faceSet) faceSet = Shape.primitiveSetFromList(osg.PrimitiveSet.TRIANGLE_FAN, [4 * steps + 1] + range(3 * steps + 1, 4 * steps + 1) + [3 * steps + 1, 4 * steps + 1]) self.geometry().addPrimitiveSet(faceSet) self.geometry().setNormalArray(Shape.vectorArrayFromList(vertexNormals)) self.geometry().setNormalBinding(osg.Geometry.BIND_PER_VERTEX) self.geometry().setTexCoordArray(0, Shape.vectorArrayFromList(textureCoords)) | 7b509b137e52784cf7a2a0a366e2596c401a05af /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6368/7b509b137e52784cf7a2a0a366e2596c401a05af/Cylinder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
11041,
2615,
4672,
12383,
16186,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
11041,
2615,
13,
225,
468,
2660,
30,
999,
776,
5315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
380,
1968,
16,
2826,
11041,
2615,
4672,
12383,
16186,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
11041,
2615,
13,
225,
468,
2660,
30,
999,
776,
5315,
... |
if self.gcomprisBoard.mode == 'draw': self.object_set_size_and_pos(self.newitemgroup, x1=points['x1'], y1=points['y1'], x2=points['x2'], y2=points['y2'] ) self.select_item(self.newitemgroup) self.newitem = None self.newitemgroup = None | self.newitem = None self.newitemgroup = None elif self.gcomprisBoard.mode == 'draw': self.object_set_size_and_pos(self.newitemgroup, x1=points['x1'], y1=points['y1'], x2=points['x2'], y2=points['y2'] ) self.select_item(self.newitemgroup) self.newitem = None self.newitemgroup = None | def create_item_event(self, item, event): if(event.type == gtk.gdk.BUTTON_PRESS and self.running==True): self.playing_stop() return gtk.FALSE # Right button is a shortcup to Shot if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3: self.Anim2Shot() return gtk.FALSE if (not (self.tools[self.current_tool][0] == "RECT" or self.tools[self.current_tool][0] == "CIRCLE" or self.tools[self.current_tool][0] == "FILL_RECT" or self.tools[self.current_tool][0] == "FILL_CIRCLE" or self.tools[self.current_tool][0] == "IMAGE" or self.tools[self.current_tool][0] == "TEXT" or self.tools[self.current_tool][0] == "LINE")): return gtk.FALSE | fa29ef858cec4fcf69afdcd6be6172a962d99eac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11306/fa29ef858cec4fcf69afdcd6be6172a962d99eac/anim.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
1726,
67,
2575,
12,
2890,
16,
761,
16,
871,
4672,
309,
12,
2575,
18,
723,
422,
22718,
18,
75,
2883,
18,
20068,
67,
22526,
471,
365,
18,
8704,
631,
5510,
4672,
365,
18,
1601,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1726,
67,
2575,
12,
2890,
16,
761,
16,
871,
4672,
309,
12,
2575,
18,
723,
422,
22718,
18,
75,
2883,
18,
20068,
67,
22526,
471,
365,
18,
8704,
631,
5510,
4672,
365,
18,
1601,... |
return self.resource.get_mimetype() | return vfs.get_mimetype(self.uri) | def get_mimetype(self): return self.resource.get_mimetype() | 0b1c72a13c7a6c88c1422b4f663b5895d7726e71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/0b1c72a13c7a6c88c1422b4f663b5895d7726e71/base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
22571,
12,
2890,
4672,
327,
365,
18,
3146,
18,
588,
67,
22571,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
22571,
12,
2890,
4672,
327,
365,
18,
3146,
18,
588,
67,
22571,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
pat = getstring(x, _("file wants a pattern")) | pat = getstring(x, _("contains wants a pattern")) | def contains(repo, subset, x): pat = getstring(x, _("file wants a pattern")) m = _match.match(repo.root, repo.getcwd(), [pat]) s = [] if m.files() == [pat]: for r in subset: if pat in repo[r]: s.append(r) continue else: for r in subset: for f in repo[r].manifest(): if m(f): s.append(r) continue return s | 3de03448cbc2250eda25d6fe0ab01b0973319f0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/3de03448cbc2250eda25d6fe0ab01b0973319f0c/revset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1914,
12,
7422,
16,
7931,
16,
619,
4672,
9670,
273,
336,
1080,
12,
92,
16,
389,
2932,
12298,
14805,
279,
1936,
6,
3719,
312,
273,
389,
1916,
18,
1916,
12,
7422,
18,
3085,
16,
3538,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1914,
12,
7422,
16,
7931,
16,
619,
4672,
9670,
273,
336,
1080,
12,
92,
16,
389,
2932,
12298,
14805,
279,
1936,
6,
3719,
312,
273,
389,
1916,
18,
1916,
12,
7422,
18,
3085,
16,
3538,
1... |
""" | r""" | def __init__(self, succ, generators): """ TESTS:: | 313d220b6fdafe559d2ec1a83c493f5f01a31167 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/313d220b6fdafe559d2ec1a83c493f5f01a31167/backtrack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
21043,
16,
13327,
4672,
436,
8395,
22130,
55,
2866,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
21043,
16,
13327,
4672,
436,
8395,
22130,
55,
2866,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
homedir = os.getenv("APPDATA").replace("\\", "/") if not os.path.exists(homedir): | if os.getenv("APPDATA") != "": homedir = os.getenv("APPDATA").replace("\\", "/") else: | def main(): # Some globals and variables global config global homedir config = {} options = [ "--config", "--configdump", "--daemon", "--debug", "--verbose", "--version" ] shortoptions = { "c":"--config", "d":"--debug", "D":"--daemon", "v":"--verbose", "V":"--version" } overwrite = [ "--daemon", "--debug", "--verbose" ] # Scan for commandline options. This is like the handling # of Gentoo's (http://www.gentoo.org) "emerge". # Thanks vor this inspiration guys! tmpcmd = sys.argv[1:] cmd = [] opts = [] for x in tmpcmd: if x[0:1] == "-" and x[1:2] != "-": for y in x[1:]: if shortoptions.has_key(y): if shortoptions[y] in cmd: print "*** Warning: Redundant use of "+shortoptions[y] else: cmd.append(shortoptions[y]) else: print "!!! Error: -"+y+" is an invalid option." sys.exit(1) else: cmd.append(x) for x in cmd: if len(x) >= 2 and x[0:2] != "--": opts.append(x) elif len(x) >= 2 and x[0:2] == "--": opts.append(x) elif x not in options: print "!!! Error: "+x+" is an invalid option." sys.exit(1) # Some error handling if "--daemon" in opts and "--nodaemon" in opts: print "!!! Error: You can not use --daemon and --nodaemon at the same time" sys.exit(1) # "One option, one output and die" (tm) if "--help" in opts: print "I guess you need help. That's bad at the moment! ;)" sys.exit() elif "--version" in opts: # Some easy release-checkin' headinfo = string.split(__headurl__, "/") if "tags" in headinfo: print "Stable release: "+headinfo[headinfo.index("tags")+1] else: print "This is a development version. Expect bugs!" print __revision__ sys.exit() # Get the users application data directory from environment variables and "~/" # Try windows path first, as windows has a special application data directory # The last fallback is to use the current working directory homedir = os.getenv("APPDATA").replace("\\", "/") if not os.path.exists(homedir): homedir = os.path.expanduser("~") if not os.path.exists(homedir): homedir = os.getenv("HOME") if not os.path.exists(homedir): homedir = os.getcwd() # Get the systems global settings directory # Try both /etc and the windows "all users" diretory if os.path.isdir("/etc/"): etcdir = "/etc" elif os.getenv("ALLUSERSPROFILE") != "": etcdir = os.getenv("ALLUSERSPROFILE").replace("\\", "/") + os.getenv("APPDATA")[len(os.getenv("USERPROFILE")):].replace("\\", "/") else: etcdir = "" if "--config" in opts: if opts[opts.index("--config")+1][0:2] == "--": print "!!! Error: You specified --config but no file was appended!" sys.exit(1) config['config'] = opts[opts.index("--config")+1] else: if os.path.isfile(homedir+"/dirt.xml"): config['config'] = homedir+"/dirt.xml" elif os.path.isfile(etcdir+"/dirt.xml"): config['config'] = etcdir+"/dirt.xml" else: print "!!! Error: No configuration file found!" sys.exit(1) configuration = xml.dom.minidom.parse(config['config']) # Validate XML # TODO general_config = configuration.getElementsByTagName('general') for node in general_config: for general in node.childNodes: if general.nodeType == Node.ELEMENT_NODE: setname = general.nodeName for set in general.childNodes: # TODO: We really have to find a nice way to check for bool's. # This is ugly. if string.lower(set.data) == "true": config[setname] = True elif string.lower(set.data) == "false": config[setname] = False else: config[setname] = set.data for set in opts: if set in overwrite: config[set[2:]] = True if "--configdump" in opts: pprint.pprint(config) sys.exit() | 56c98d40dd9af7764ce86d010b92c1ea43fcdd1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2615/56c98d40dd9af7764ce86d010b92c1ea43fcdd1c/dirteater.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
10548,
10941,
471,
3152,
2552,
642,
2552,
13995,
23210,
225,
642,
273,
2618,
225,
702,
273,
306,
5238,
1425,
3113,
5238,
1425,
8481,
3113,
5238,
21511,
3113,
5238,
4148,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
10548,
10941,
471,
3152,
2552,
642,
2552,
13995,
23210,
225,
642,
273,
2618,
225,
702,
273,
306,
5238,
1425,
3113,
5238,
1425,
8481,
3113,
5238,
21511,
3113,
5238,
4148,
... |
"install_sh1header": [269, RPM_STRING, None, 0], "installtime": [1008, RPM_INT32, None, 0], | "install_sha1header": [269, RPM_STRING, None, 0], "installtime": [1008, RPM_INT32, 1, 0], | def __del__(self): (crc32, isize) = unpack("2i", self.enddata) if crc32 != self.crcval: print "CRC check failed." if isize != self.length: print "Incorrect length of data produced." if isize != self.length2 and self.length2 != None: print "Incorrect length of data produced." | ad4f89af913d4c98e3df65eed839fd44235193aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/ad4f89af913d4c98e3df65eed839fd44235193aa/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
12,
2890,
4672,
261,
22988,
1578,
16,
353,
554,
13,
273,
6167,
2932,
22,
77,
3113,
365,
18,
409,
892,
13,
309,
10619,
1578,
480,
365,
18,
22988,
1125,
30,
1172,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
12,
2890,
4672,
261,
22988,
1578,
16,
353,
554,
13,
273,
6167,
2932,
22,
77,
3113,
365,
18,
409,
892,
13,
309,
10619,
1578,
480,
365,
18,
22988,
1125,
30,
1172,
315,
... |
return re.sub(r'[^/._a-zA-Z0-9]', lambda c: '\\'+c.group(), s) if cmd.strip() == "[NEXT]": | return re.sub(r'[^/._a-zA-Z0-9-]', lambda c: '\\'+c.group(), s) cmd = cmd.strip() if cmd == "[NEXT]": | def sh_esc(s): import re return re.sub(r'[^/._a-zA-Z0-9]', lambda c: '\\'+c.group(), s) | ec01c931628f4b4bfb4121aaf5cef42c37e46614 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2291/ec01c931628f4b4bfb4121aaf5cef42c37e46614/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
699,
67,
742,
12,
87,
4672,
1930,
283,
327,
283,
18,
1717,
12,
86,
11,
5969,
19,
6315,
69,
17,
9600,
17,
62,
20,
17,
29,
65,
2187,
3195,
276,
30,
5282,
15,
71,
18,
1655,
9334,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
699,
67,
742,
12,
87,
4672,
1930,
283,
327,
283,
18,
1717,
12,
86,
11,
5969,
19,
6315,
69,
17,
9600,
17,
62,
20,
17,
29,
65,
2187,
3195,
276,
30,
5282,
15,
71,
18,
1655,
9334,
27... |
exec(""" global_x = 1 def f(): global_x += 1 try: f() except UnboundLocalError: pass else: fail('scope of global_x not correctly determined') """, {'fail': self.fail}) | exec("""if 1: global_x = 1 def f(): global_x += 1 try: f() except UnboundLocalError: pass else: fail('scope of global_x not correctly determined') """, {'fail': self.fail}) | def inner(): return y | 7852a8fbd757e019f9fdf827a6f3e9c5d64ad638 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/7852a8fbd757e019f9fdf827a6f3e9c5d64ad638/test_scope.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3443,
13332,
327,
677,
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,
0... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3443,
13332,
327,
677,
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,
-100,
... |
keys = self.modules.keys() keys.sort() | keys = sorted(self.modules.keys()) | def report(self): """Print a report to stdout, listing the found modules with their paths, as well as modules that are missing, or seem to be missing. """ print() print(" %-25s %s" % ("Name", "File")) print(" %-25s %s" % ("----", "----")) # Print modules found keys = self.modules.keys() keys.sort() for key in keys: m = self.modules[key] if m.__path__: print("P", end=' ') else: print("m", end=' ') print("%-25s" % key, m.__file__ or "") | 2dc2e1024e51e3ee8daf1129d1ef2162336c67ae /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/2dc2e1024e51e3ee8daf1129d1ef2162336c67ae/modulefinder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2605,
12,
2890,
4672,
3536,
5108,
279,
2605,
358,
3909,
16,
11591,
326,
1392,
4381,
598,
3675,
2953,
16,
487,
5492,
487,
4381,
716,
854,
3315,
16,
578,
19264,
358,
506,
3315,
18,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2605,
12,
2890,
4672,
3536,
5108,
279,
2605,
358,
3909,
16,
11591,
326,
1392,
4381,
598,
3675,
2953,
16,
487,
5492,
487,
4381,
716,
854,
3315,
16,
578,
19264,
358,
506,
3315,
18,
3536,
... |
logfile, 0, '') | logfile, 0, '') | def CreateDir(DEBUGON, dirl, logfile): 'Create directories from a passed dirlist' if DEBUGON: printlog('o2tf.CreateDir: Started.', logfile, 0, '') dirlist = string.split(dirl,',') ndir = len(dirlist) if DEBUGON: printlog('o2tf.CreateDir: dirlist = (%s)' % dirlist, logfile, 0, '') printlog('o2tf.CreateDir: dirlen = (%s)' % ndir, logfile, 0, '') from os import access,F_OK for i in range(ndir): | 657bfc37c22ea26052b0df161170cb3df469efec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1915/657bfc37c22ea26052b0df161170cb3df469efec/o2tf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
1621,
12,
9394,
673,
16,
1577,
80,
16,
15204,
4672,
296,
1684,
6402,
628,
279,
2275,
1577,
1098,
11,
309,
6369,
673,
30,
1172,
1330,
2668,
83,
22,
6632,
18,
1684,
1621,
30,
29386... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
1621,
12,
9394,
673,
16,
1577,
80,
16,
15204,
4672,
296,
1684,
6402,
628,
279,
2275,
1577,
1098,
11,
309,
6369,
673,
30,
1172,
1330,
2668,
83,
22,
6632,
18,
1684,
1621,
30,
29386... |
except: | except : | def collectionJdlFile ( self, task, requirements='' ): """ build a collection jdl easy to be handled by the wmproxy API interface and gives back the list of input files for a better handling """ | 55a0d373215e2d2c4f99fe71353cbd62af3d7838 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8886/55a0d373215e2d2c4f99fe71353cbd62af3d7838/SchedulerGLite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1849,
46,
5761,
812,
261,
365,
16,
1562,
16,
8433,
2218,
11,
262,
30,
3536,
1361,
279,
1849,
525,
5761,
12779,
358,
506,
7681,
635,
326,
18200,
5656,
1491,
1560,
471,
14758,
1473,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1849,
46,
5761,
812,
261,
365,
16,
1562,
16,
8433,
2218,
11,
262,
30,
3536,
1361,
279,
1849,
525,
5761,
12779,
358,
506,
7681,
635,
326,
18200,
5656,
1491,
1560,
471,
14758,
1473,
326,
... |
[(1, 3, 2), (4, 6, 5), (7, 9, 8), (10, 12, 11), (13, 15, 14), (16, 18, 17), (19, 21, 20)] | [(1, 2, 3), (4, 5, 6), (7, 8, 9), (10, 11, 12), (13, 14, 15), (16, 17, 18), (19, 20, 21)] | def tau123(T1, T2): """ Compute the tau_i representation for a bitrade (T1, T2). See the functions tau1, tau2, and tau3 for the mathematical definitions. RETURNS: (cells_map, t1, t2, t3) where cells_map is a map to/from the filled cells of T1, and t1, t2, t3 are the tau1, tau2, tau3 permutations. EXAMPLES: sage: from sage.combinat.matrices.latin import * sage: (a, b, c, G) = pq_group_bitrade_generators(3, 7) sage: (T1, T2) = bitrade_from_group(a, b, c, G) sage: print T1 [0 6 4] [1 0 5] [2 1 6] [3 2 0] [4 3 1] [5 4 2] [6 5 3] sage: print T2 [6 4 0] [0 5 1] [1 6 2] [2 0 3] [3 1 4] [4 2 5] [5 3 6] sage: (cells_map, t1, t2, t3) = tau123(T1, T2) sage: print cells_map {1: (0, 0), 2: (0, 1), 3: (0, 2), 4: (1, 0), 5: (1, 1), 6: (1, 2), 7: (2, 0), 8: (2, 1), 9: (2, 2), 10: (3, 0), 11: (3, 1), 12: (3, 2), 13: (4, 0), (2, 1): 8, 15: (4, 2), 16: (5, 0), 17: (5, 1), 18: (5, 2), 19: (6, 0), 20: (6, 1), 21: (6, 2), (5, 1): 17, (4, 0): 13, (1, 2): 6, (3, 0): 10, (5, 0): 16, (2, 2): 9, (4, 1): 14, (1, 1): 5, (3, 2): 12, (0, 0): 1, (6, 0): 19, 14: (4, 1), (4, 2): 15, (1, 0): 4, (0, 1): 2, (6, 1): 20, (3, 1): 11, (2, 0): 7, (6, 2): 21, (5, 2): 18, (0, 2): 3} sage: print cells_map_as_square(cells_map, max(T1.nrows(), T1.ncols())) [ 1 2 3 -1 -1 -1 -1] [ 4 5 6 -1 -1 -1 -1] [ 7 8 9 -1 -1 -1 -1] [10 11 12 -1 -1 -1 -1] [13 14 15 -1 -1 -1 -1] [16 17 18 -1 -1 -1 -1] [19 20 21 -1 -1 -1 -1] sage: t1 [3, 1, 2, 6, 4, 5, 9, 7, 8, 12, 10, 11, 15, 13, 14, 18, 16, 17, 21, 19, 20] sage: t2 [19, 17, 12, 1, 20, 15, 4, 2, 18, 7, 5, 21, 10, 8, 3, 13, 11, 6, 16, 14, 9] sage: print t3 [5, 9, 13, 8, 12, 16, 11, 15, 19, 14, 18, 1, 17, 21, 4, 20, 3, 7, 2, 6, 10] sage: t1.to_cycles() [(1, 3, 2), (4, 6, 5), (7, 9, 8), (10, 12, 11), (13, 15, 14), (16, 18, 17), (19, 21, 20)] sage: t2.to_cycles() [(1, 19, 16, 13, 10, 7, 4), (2, 17, 11, 5, 20, 14, 8), (3, 12, 21, 9, 18, 6, 15)] sage: t3.to_cycles() [(1, 5, 12), (2, 9, 19), (3, 13, 17), (4, 8, 15), (6, 16, 20), (7, 11, 18), (10, 14, 21)] The product t1*t2*t3 is the identity, i.e. it fixes every point: sage: len((t1*t2*t3).fixed_points()) == T1.nr_filled_cells() True """ assert is_bitrade(T1, T2) cells_map = T1.filled_cells_map() t1 = tau1(T1, T2, cells_map) t2 = tau2(T1, T2, cells_map) t3 = tau3(T1, T2, cells_map) return (cells_map, t1, t2, t3) | 494f2bd1cd82ea9dcc25f8e258b7375812aed1c9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/494f2bd1cd82ea9dcc25f8e258b7375812aed1c9/latin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12284,
12936,
12,
56,
21,
16,
399,
22,
4672,
3536,
8155,
326,
12284,
67,
77,
4335,
364,
279,
2831,
354,
323,
261,
56,
21,
16,
399,
22,
2934,
2164,
326,
4186,
12284,
21,
16,
12284,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12284,
12936,
12,
56,
21,
16,
399,
22,
4672,
3536,
8155,
326,
12284,
67,
77,
4335,
364,
279,
2831,
354,
323,
261,
56,
21,
16,
399,
22,
2934,
2164,
326,
4186,
12284,
21,
16,
12284,
22... |
content = (Combine(OneOrMore(~ignoreExpr + CharsNotIn(opener+closer+ParserElement.DEFAULT_WHITE_CHARS,exact=1)) | content = (Combine(OneOrMore(~ignoreExpr + ~Literal(opener) + ~Literal(closer) + CharsNotIn(ParserElement.DEFAULT_WHITE_CHARS,exact=1)) | def nestedExpr(opener="(", closer=")", content=None, ignoreExpr=quotedString): """Helper method for defining nested lists enclosed in opening and closing delimiters ("(" and ")" are the default). Parameters: - opener - opening character for a nested list (default="("); can also be a pyparsing expression - closer - closing character for a nested list (default=")"); can also be a pyparsing expression - content - expression for items within the nested lists (default=None) - ignoreExpr - expression for ignoring opening and closing delimiters (default=quotedString) If an expression is not provided for the content argument, the nested expression will capture all whitespace-delimited content between delimiters as a list of separate values. Use the ignoreExpr argument to define expressions that may contain opening or closing characters that should not be treated as opening or closing characters for nesting, such as quotedString or a comment expression. Specify multiple expressions using an Or or MatchFirst. The default is quotedString, but if no expressions are to be ignored, then pass None for this argument. """ if opener == closer: raise ValueError("opening and closing strings cannot be the same") if content is None: if isinstance(opener,basestring) and isinstance(closer,basestring): if ignoreExpr is not None: content = (Combine(OneOrMore(~ignoreExpr + CharsNotIn(opener+closer+ParserElement.DEFAULT_WHITE_CHARS,exact=1)) ).setParseAction(lambda t:t[0].strip())) else: content = (empty+CharsNotIn(opener+closer+ParserElement.DEFAULT_WHITE_CHARS).setParseAction(lambda t:t[0].strip())) else: raise ValueError("opening and closing arguments must be strings if no content expression is given") ret = Forward() if ignoreExpr is not None: ret << Group( Suppress(opener) + ZeroOrMore( ignoreExpr | ret | content ) + Suppress(closer) ) else: ret << Group( Suppress(opener) + ZeroOrMore( ret | content ) + Suppress(closer) ) return ret | 74a7dafc0faf9f5636a8160c0fe31430bcecd826 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12364/74a7dafc0faf9f5636a8160c0fe31430bcecd826/pyparsing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4764,
4742,
12,
25098,
1546,
2932,
16,
13306,
1546,
2225,
16,
913,
33,
7036,
16,
2305,
4742,
33,
15179,
780,
4672,
3536,
2276,
707,
364,
9364,
4764,
6035,
25636,
316,
10890,
471,
7647,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4764,
4742,
12,
25098,
1546,
2932,
16,
13306,
1546,
2225,
16,
913,
33,
7036,
16,
2305,
4742,
33,
15179,
780,
4672,
3536,
2276,
707,
364,
9364,
4764,
6035,
25636,
316,
10890,
471,
7647,
1... |
while 8 <= end - stream.tell(): | while 8 < end - stream.tell(): | def __init__(self, stream, parent): Filter.__init__(self, "avi_chunk", "AVI chunk", stream, parent) tag = self.read("tag", "4s", "Tag").value size = stream.getSize()-4 end = stream.tell() + size if tag in ("hdrl", "INFO"): while 8 <= end - stream.tell(): chunk = self.readChild("chunk[]", AVI_Chunk) elif tag == "strl": stype = None while 8 <= end - stream.tell(): stag = self.read("stag[]", "4s", "String tag").value size = self.read("ssize[]", "<L", "String size").value if stag == "strh" and size >= 56: # Stream header hend = stream.tell() + size stype = self.read("type_fourcc", "4s", "Stream type four character code").value self.read("fourcc", "4s", "Stream four character code") self.read("flags", "<L", "Stream flags") self.read("priority", "<H", "Stream priority") self.read("langage", "2s", "Stream language") self.read("init_frames", "<L", "InitialFrames") self.read("scale", "<L", "Time scale") self.read("rate", "<L", "Divide by scale to give frame rate") self.read("start", "<L", "Stream start time (unit: rate/scale)") self.read("length", "<L", "Stream length (unit: rate/scale)") self.read("buf_size", "<L", "Suggested buffer size") self.read("quality", "<L", "Stream quality") self.read("sample_size", "<L", "Size of samples") self.read("left", "<H", "Destination rectangle (left)") self.read("top", "<H", "Destination rectangle (top)") self.read("right", "<H", "Destination rectangle (right)") self.read("bottom", "<H", "Destination rectangle (bottom)") diff = hend-stream.tell() if 0 < diff: self.read("h_extra", "%us" % diff, "Extra junk") assert stream.tell() == hend elif stag == "strf" and stype == "vids" and size == 40: # Video header self.read("v_size", "<L", "Video format: Size") self.read("v_width", "<L", "Video format: Width") self.read("v_height", "<L", "Video format: Height") self.read("v_panes", "<H", "Video format: Panes") self.read("v_depth", "<H", "Video format: Depth") self.read("v_tag1", "<L", "Video format: Tag1") self.read("v_img_size", "<L", "Video format: Image size") self.read("v_xpels_meter", "<L", "Video format: XPelsPerMeter") self.read("v_ypels_meter", "<L", "Video format: YPelsPerMeter") self.read("v_clr_used", "<L", "Video format: ClrUsed") self.read("v_clr_importand", "<L", "Video format: ClrImportant") elif stag == "strf" and stype == "auds": # Audio (wav) header aend = stream.tell() + size self.read("a_id", "<H", "Audio format: Codec id") a_chan = self.read("a_channel", "<H", "Audio format: Channels").value self.read("a_sample_rate", "<L", "Audio format: Sample rate") self.read("a_bit_rate", "<L", "Audio format: Bit rate") self.read("a_block_align", "<H", "Audio format: Block align") if size >= 16: self.read("a_bits_per_sample", "<H", "Audio format: Bits per sample") if size >= 18: self.read("ext_size", "<H", "Audio format: Size of extra information") if a_chan > 2 and size >= 28: self.read("reserved", "<H", "Audio format: ") self.read("channel_mask", "<L", "Audio format: channels placement bitmask") self.read("subformat", "<L", "Audio format: Subformat id") diff = aend-stream.tell() if 0 < diff: self.read("a_extra", "%us" % diff, "Audio format: Extra") assert stream.tell() == aend elif stag == "strn": # Stream description self.read("desc", "%us" % size, "Stream description") else: self.read("svalue[]", "%us" % size, "String value") else: self.read("raw", "%us" % size, "Raw data") padding = end - stream.tell() if padding != 0: self.read("padding", "%us" % padding, "Padding") assert stream.tell() == end | 39f4b1926960597d99aee2fe07909c84411a0bf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2280/39f4b1926960597d99aee2fe07909c84411a0bf8/avi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1407,
16,
982,
4672,
4008,
16186,
2738,
972,
12,
2890,
16,
315,
69,
522,
67,
6551,
3113,
315,
37,
4136,
2441,
3113,
1407,
16,
982,
13,
1047,
273,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1407,
16,
982,
4672,
4008,
16186,
2738,
972,
12,
2890,
16,
315,
69,
522,
67,
6551,
3113,
315,
37,
4136,
2441,
3113,
1407,
16,
982,
13,
1047,
273,
365,
... |
if capab(user, 'botmsg'): if target.split('!', 1)[0] != '*': irc.reply("%s/bans.cgi?log=%s&mark=%s" % (self.registryValue('bansite'), i[1], target.split('!')[0]), private=True) else: irc.reply("%s/bans.cgi?log=%s" % (self.registryValue('bansite'), i[1]), private=True) bansearch = wrap(bansearch, ['something', optional('anything', default=None)]) | bansearch = wrap(real_bansearch, ['something', optional('anything', default=None)]) | def format_entry(entry): ret = list(entry[:-1]) t = cPickle.loads(entry[-1]).astimezone(pytz.timezone('UTC')).strftime("%b %d %Y %H:%M:%S") ret.append(t) return tuple(ret) | 353e8a3cb6570f78f25b8d8c4070231630fbefe3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3106/353e8a3cb6570f78f25b8d8c4070231630fbefe3/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
4099,
12,
4099,
4672,
325,
273,
666,
12,
4099,
10531,
17,
21,
5717,
268,
273,
276,
17968,
298,
18,
17135,
12,
4099,
18919,
21,
65,
2934,
689,
494,
3486,
12,
2074,
12994,
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,
740,
67,
4099,
12,
4099,
4672,
325,
273,
666,
12,
4099,
10531,
17,
21,
5717,
268,
273,
276,
17968,
298,
18,
17135,
12,
4099,
18919,
21,
65,
2934,
689,
494,
3486,
12,
2074,
12994,
18,
... |
return log.error("%s is not a directory" % options.target) | log.error("%s is not a directory" % options.target) sys.exit(1) | def main(options, names): # Set the debug flag, if '--debug' was specified. if options.debug: epydoc.DEBUG = True ## [XX] Did this serve a purpose? Commenting out for now: #if options.action == 'text': # if options.parse and options.introspect: # options.parse = False # Set up the logger if options.simple_term: TerminalController.FORCE_SIMPLE_TERM = True if options.action == 'text': logger = None # no logger for text output. elif options.verbosity > 1: logger = ConsoleLogger(options.verbosity) log.register_logger(logger) else: # Each number is a rough approximation of how long we spend on # that task, used to divide up the unified progress bar. stages = [40, # Building documentation 7, # Merging parsed & introspected information 1, # Linking imported variables 3, # Indexing documentation 30, # Parsing Docstrings 1, # Inheriting documentation 2] # Sorting & Grouping if options.load_pickle: stages = [30] # Loading pickled documentation if options.action == 'html': stages += [100] elif options.action == 'text': stages += [30] elif options.action == 'latex': stages += [60] elif options.action == 'dvi': stages += [60,30] elif options.action == 'ps': stages += [60,40] elif options.action == 'pdf': stages += [60,50] elif options.action == 'check': stages += [10] elif options.action == 'pickle': stages += [10] else: raise ValueError, '%r not supported' % options.action if options.parse and not options.introspect: del stages[1] # no merging if options.introspect and not options.parse: del stages[1:3] # no merging or linking logger = UnifiedProgressConsoleLogger(options.verbosity, stages) log.register_logger(logger) # check the output directory. if options.action not in ('text', 'check', 'pickle'): if os.path.exists(options.target): if not os.path.isdir(options.target): return log.error("%s is not a directory" % options.target) # Set the default docformat from epydoc import docstringparser docstringparser.DEFAULT_DOCFORMAT = options.docformat # Set the dot path if options.dotpath: from epydoc.docwriter import dotgraph dotgraph.DOT_COMMAND = options.dotpath # Set the default graph font & size if options.graph_font: from epydoc.docwriter import dotgraph fontname = options.graph_font dotgraph.DotGraph.DEFAULT_NODE_DEFAULTS['fontname'] = fontname dotgraph.DotGraph.DEFAULT_EDGE_DEFAULTS['fontname'] = fontname if options.graph_font_size: from epydoc.docwriter import dotgraph fontsize = options.graph_font_size dotgraph.DotGraph.DEFAULT_NODE_DEFAULTS['fontsize'] = fontsize dotgraph.DotGraph.DEFAULT_EDGE_DEFAULTS['fontsize'] = fontsize # If the input name is a pickle file, then read the docindex that # it contains. Otherwise, build the docs for the input names. if options.load_pickle: assert len(names) == 1 log.start_progress('Deserializing') log.progress(0.1, 'Loading %r' % names[0]) t0 = time.time() unpickler = pickle.Unpickler(open(names[0], 'rb')) unpickler.persistent_load = pickle_persistent_load docindex = unpickler.load() log.debug('deserialization time: %.1f sec' % (time.time()-t0)) log.end_progress() else: # Build docs for the named values. from epydoc.docbuilder import build_doc_index docindex = build_doc_index(names, options.introspect, options.parse, add_submodules=(options.action!='text'), exclude_introspect=options.exclude_introspect, exclude_parse=options.exclude_parse) if docindex is None: return # docbuilder already logged an error. # Load profile information, if it was given. if options.pstat_files: try: import pstats except ImportError: log.error("Could not import pstats -- ignoring pstat files.") try: profile_stats = pstats.Stats(options.pstat_files[0]) for filename in options.pstat_files[1:]: profile_stats.add(filename) except KeyboardInterrupt: raise except Exception, e: log.error("Error reading pstat file: %s" % e) profile_stats = None if profile_stats is not None: docindex.read_profiling_info(profile_stats) # Perform the specified action. if options.action == 'html': write_html(docindex, options) elif options.action in ('latex', 'dvi', 'ps', 'pdf'): write_latex(docindex, options, options.action) elif options.action == 'text': write_text(docindex, options) elif options.action == 'check': check_docs(docindex, options) elif options.action == 'pickle': write_pickle(docindex, options) else: print >>sys.stderr, '\nUnsupported action %s!' % options.action # If we supressed docstring warnings, then let the user know. if logger is not None and logger.supressed_docstring_warning: if logger.supressed_docstring_warning == 1: prefix = '1 markup error was found' else: prefix = ('%d markup errors were found' % logger.supressed_docstring_warning) log.warning("%s while processing docstrings. Use the verbose " "switch (-v) to display markup errors." % prefix) # Basic timing breakdown: if options.verbosity >= 2 and logger is not None: logger.print_times() | 463d2f2b5087993ba833c8d8f2e314cd4fadd111 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3512/463d2f2b5087993ba833c8d8f2e314cd4fadd111/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2116,
16,
1257,
4672,
468,
1000,
326,
1198,
2982,
16,
309,
3534,
4148,
11,
1703,
1269,
18,
309,
702,
18,
4148,
30,
425,
2074,
2434,
18,
9394,
273,
1053,
225,
7541,
306,
5619,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2116,
16,
1257,
4672,
468,
1000,
326,
1198,
2982,
16,
309,
3534,
4148,
11,
1703,
1269,
18,
309,
702,
18,
4148,
30,
425,
2074,
2434,
18,
9394,
273,
1053,
225,
7541,
306,
5619,... |
return round(amount / currency.rounding) * currency.rounding | return round(amount / currency.rounding,6) * currency.rounding | def round(self, cr, uid, currency, amount): if currency.rounding == 0: return 0.0 else: return round(amount / currency.rounding) * currency.rounding | 0bec8a95fc94f487b5b6ef66a8c4e981152a93bd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/0bec8a95fc94f487b5b6ef66a8c4e981152a93bd/res_currency.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3643,
12,
2890,
16,
4422,
16,
4555,
16,
5462,
16,
3844,
4672,
309,
5462,
18,
17376,
422,
374,
30,
327,
374,
18,
20,
469,
30,
327,
3643,
12,
8949,
342,
5462,
18,
17376,
13,
380,
5462,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3643,
12,
2890,
16,
4422,
16,
4555,
16,
5462,
16,
3844,
4672,
309,
5462,
18,
17376,
422,
374,
30,
327,
374,
18,
20,
469,
30,
327,
3643,
12,
8949,
342,
5462,
18,
17376,
13,
380,
5462,... |
cmdline = "%s -u %s" % (interp, cmdline) if '=' not in query and '"' not in query: cmdline = '%s "%s"' % (cmdline, query) self.log_message("command: %s", cmdline) | cmdline = [interp, '-u'] + cmdline if '=' not in query: cmdline.append(query) self.log_message("command: %s", subprocess.list2cmdline(cmdline)) | def run_cgi(self): """Execute a CGI script.""" path = self.path dir, rest = self.cgi_info | e868b2a04ca14a7ea789345b2efec716cf34bfd1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/e868b2a04ca14a7ea789345b2efec716cf34bfd1/CGIHTTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
19062,
12,
2890,
4672,
3536,
5289,
279,
385,
13797,
2728,
12123,
589,
273,
365,
18,
803,
1577,
16,
3127,
273,
365,
18,
19062,
67,
1376,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
19062,
12,
2890,
4672,
3536,
5289,
279,
385,
13797,
2728,
12123,
589,
273,
365,
18,
803,
1577,
16,
3127,
273,
365,
18,
19062,
67,
1376,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
@unittest.skipIf(Value is None, "requires ctypes.Value") | def _double(self, x, y, foo, arr, string): x.value *= 2 y.value *= 2 foo.x *= 2 foo.y *= 2 string.value *= 2 for i in range(len(arr)): arr[i] *= 2 | dad42569e252396b4d652d82b52b091aabe761cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/dad42569e252396b4d652d82b52b091aabe761cb/test_multiprocessing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9056,
12,
2890,
16,
619,
16,
677,
16,
8431,
16,
2454,
16,
533,
4672,
619,
18,
1132,
6413,
576,
677,
18,
1132,
6413,
576,
8431,
18,
92,
6413,
576,
8431,
18,
93,
6413,
576,
533,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9056,
12,
2890,
16,
619,
16,
677,
16,
8431,
16,
2454,
16,
533,
4672,
619,
18,
1132,
6413,
576,
677,
18,
1132,
6413,
576,
8431,
18,
92,
6413,
576,
8431,
18,
93,
6413,
576,
533,
... | |
refspec = ".".join([remote_table, remote_column]) | refspec = ".".join(x for x in [remote_owner, remote_table, remote_column] if x) | def reflecttable(self, connection, table, include_columns): preparer = self.identifier_preparer | 869f9e0a2a177a246e7d20205634ea9584b1ee59 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1074/869f9e0a2a177a246e7d20205634ea9584b1ee59/oracle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3037,
2121,
12,
2890,
16,
1459,
16,
1014,
16,
2341,
67,
5112,
4672,
675,
21804,
273,
365,
18,
5644,
67,
1484,
21804,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3037,
2121,
12,
2890,
16,
1459,
16,
1014,
16,
2341,
67,
5112,
4672,
675,
21804,
273,
365,
18,
5644,
67,
1484,
21804,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
RESPONSE.setBase(None) | RESPONSE.setBase(None) | def index_html(self, REQUEST, RESPONSE): """ The default view of the contents of a File or Image. | da718a07cc402b667f53b7c4ba586b417ae3e131 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/da718a07cc402b667f53b7c4ba586b417ae3e131/Image.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
67,
2620,
12,
2890,
16,
12492,
16,
20645,
4672,
3536,
1021,
805,
1476,
434,
326,
2939,
434,
279,
1387,
578,
3421,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
67,
2620,
12,
2890,
16,
12492,
16,
20645,
4672,
3536,
1021,
805,
1476,
434,
326,
2939,
434,
279,
1387,
578,
3421,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
""" fl_set_select_text_color(p1, p2) -> color ref. | """ fl_set_select_text_color(p1, p2) -> color | def fl_set_select_text_color(p1, p2): """ fl_set_select_text_color(p1, p2) -> color ref. """ retval = _fl_set_select_text_color(p1, p2) return retval | 8765c710f695de392f6fc7c664c746ec98668b1d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/8765c710f695de392f6fc7c664c746ec98668b1d/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
67,
4025,
67,
955,
67,
3266,
12,
84,
21,
16,
293,
22,
4672,
3536,
1183,
67,
542,
67,
4025,
67,
955,
67,
3266,
12,
84,
21,
16,
293,
22,
13,
317,
2036,
3536,
225,
52... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
67,
4025,
67,
955,
67,
3266,
12,
84,
21,
16,
293,
22,
4672,
3536,
1183,
67,
542,
67,
4025,
67,
955,
67,
3266,
12,
84,
21,
16,
293,
22,
13,
317,
2036,
3536,
225,
52... |
def format(self, indent): | def gen_content(self, indent): | def format(self, indent): if self.count <= 0: self.add_line("%sGame Count: %d" % (header, self.count), Color.PURPLE) return | 283f84a599e91b44ddef3cd069338c91e25bcb65 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/600/283f84a599e91b44ddef3cd069338c91e25bcb65/process.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
67,
1745,
12,
2890,
16,
3504,
4672,
309,
365,
18,
1883,
1648,
374,
30,
365,
18,
1289,
67,
1369,
27188,
87,
12496,
6974,
30,
738,
72,
6,
738,
261,
3374,
16,
365,
18,
1883,
3631,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
67,
1745,
12,
2890,
16,
3504,
4672,
309,
365,
18,
1883,
1648,
374,
30,
365,
18,
1289,
67,
1369,
27188,
87,
12496,
6974,
30,
738,
72,
6,
738,
261,
3374,
16,
365,
18,
1883,
3631,... |
'OVERVIEW' : overview, 'ALIGNMENT_VIEW' : alignment_view, | 'FORMAT_OBJECT' : format_object, 'FORMAT_TYPE' : format_type, | def blast(program, datalib, sequence, input_type='Sequence in FASTA format', double_window=None, gi_list='(None)', list_org = None, expect='10', filter='L', genetic_code='Standard (1)', mat_param='PAM30 9 1', other_advanced=None, ncbi_gi=None, overview=None, alignment_view='0', descriptions=None, alignments=None, email=None, path=None, html=None, cgi='http://www.ncbi.nlm.nih.gov/blast/blast.cgi', timeout=20 ): """blast(program, datalib, sequence, input_type='Sequence in FASTA format', double_window=None, gi_list='(None)', list_org = None, expect='10', filter='L', genetic_code='Standard (1)', mat_param='PAM30 9 1', other_advanced=None, ncbi_gi=None, overview=None, alignment_view='0', descriptions=None, alignments=None, email=None, path=None, html=None, cgi='http://www.ncbi.nlm.nih.gov/blast/blast.cgi', timeout=20) -> handle Do a BLAST search against NCBI. Returns a handle to the results. timeout is the number of seconds to wait for the results before timing out. The other parameters are provided to BLAST. A description can be found online at: http://www.ncbi.nlm.nih.gov/BLAST/newoptions.html """ # NCBI Blast is hard to work with. The user enters a query, and then # it returns a "reference" page which contains a button that the user # clicks to retrieve the results. This will retrieve the "results" # page. However, this page may not contain BLAST results if the # search isn't done. # This function will send off the query and parse the reference # page to figure out how to retrieve the results. Then, it needs to # check the results to see if the search has been finished. params = {'PROGRAM' : program, 'DATALIB' : datalib, 'SEQUENCE' : sequence, 'DOUBLE_WINDOW' : double_window, 'GI_LIST' : gi_list, 'LIST_ORG' : list_org, 'INPUT_TYPE' : input_type, 'EXPECT' : expect, 'FILTER' : filter, 'GENETIC_CODE' : genetic_code, 'MAT_PARAM' : mat_param, 'OTHER_ADVANCED' : other_advanced, 'NCBI_GI' : ncbi_gi, 'OVERVIEW' : overview, 'ALIGNMENT_VIEW' : alignment_view, 'DESCRIPTIONS' : descriptions, 'ALIGNMENTS' : alignments, 'EMAIL' : email, 'PATH' : path, 'HTML' : html } variables = {} for k in params.keys(): if params[k] is not None: variables[k] = str(params[k]) # This returns a handle to the HTML file that points to the results. handle = NCBI._open(cgi, variables, get=0) # Now parse the HTML from the handle and figure out how to retrieve # the results. refcgi, params = _parse_blast_ref_page(handle, cgi) start = time.time() while 1: # Sometimes the BLAST results aren't done yet. Look at the page # to see if the results are there. If not, then try again later. handle = NCBI._open(cgi, params, get=0) ready, results, refresh_delay = _parse_blast_results_page(handle) if ready: break # Time out if it's not done after timeout minutes. if time.time() - start > timeout*60: raise IOError, "timed out after %d minutes" % timeout # pause and try again. time.sleep(refresh_delay) return File.UndoHandle(File.StringHandle(results)) | 76982ed31bca5dfbd407975181dc8b02d445ece9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/76982ed31bca5dfbd407975181dc8b02d445ece9/NCBIWWW.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19047,
12,
12890,
16,
18462,
495,
16,
3102,
16,
810,
67,
723,
2218,
4021,
316,
24239,
37,
740,
2187,
1645,
67,
5668,
33,
7036,
16,
16221,
67,
1098,
2218,
12,
7036,
13,
2187,
666,
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,
19047,
12,
12890,
16,
18462,
495,
16,
3102,
16,
810,
67,
723,
2218,
4021,
316,
24239,
37,
740,
2187,
1645,
67,
5668,
33,
7036,
16,
16221,
67,
1098,
2218,
12,
7036,
13,
2187,
666,
67,
... |
if (len(d_mins) > 1 or degenerate): | print >> log, " Requested number of resolution zones: %d" % number_of_zones if (len(d_mins) != 1 or degenerate): | def split_resolution_range( d_spacings, n_bodies, n_ref_first, multi_body_factor_n_ref_first, d_low, d_high, number_of_zones, zone_exp_factor, log = None): assert n_bodies > 0 assert multi_body_factor_n_ref_first is None or multi_body_factor_n_ref_first > 0 assert n_ref_first is None or n_ref_first > 0 assert d_low is None or d_low > 0 assert d_high is None or d_high > 0 assert n_ref_first is not None or d_low is not None if (d_low is not None and d_high is not None): assert d_low > d_high assert number_of_zones is None or number_of_zones > 0 assert zone_exp_factor > 0 if (log is None): log = sys.stdout n_refl_data = d_spacings.size() d_spacings = d_spacings.select( flex.sort_permutation(d_spacings, reverse = True)) d_max, d_min = d_spacings[0], d_spacings[-1] if (d_high is not None and d_min < d_high): d_spacings = d_spacings.select(d_spacings >= d_high) d_high = d_spacings[-1] m_ref_first = n_ref_first if (n_ref_first is None): final_n_ref_first = (d_spacings >= d_low).count(True) else: if (multi_body_factor_n_ref_first is not None): m_ref_first += iround( m_ref_first * (n_bodies-1) * multi_body_factor_n_ref_first) assert m_ref_first > 0 if ( d_low is not None and m_ref_first <= d_spacings.size() and d_spacings[m_ref_first-1] > d_low): final_n_ref_first = (d_spacings >= d_low).count(True) else: final_n_ref_first = m_ref_first d_mins = [] if (number_of_zones is not None and number_of_zones > 1): degenerate = final_n_ref_first > d_spacings.size() if (not degenerate): f = math.pow( d_spacings.size()/final_n_ref_first, 1/((number_of_zones-1)*zone_exp_factor)) d_mins.append(d_spacings[final_n_ref_first-1]) for i_zone in range(1, number_of_zones): n = iround(final_n_ref_first * f**(i_zone*zone_exp_factor)) if (i_zone == number_of_zones - 1): assert n == d_spacings.size() # sanity check d_mins.append(d_spacings[n-1]) else: final_n_ref_first = min(final_n_ref_first, d_spacings.size()) degenerate = False d_mins.append(d_high) print >> log, "Rigid body refinement:" if (len(d_mins) > 1 or degenerate): print >> log, " Calculation for first resolution zone:" print >> log, " Requested number of reflections per body:", n_ref_first print >> log, " Requested factor per body:", \ multi_body_factor_n_ref_first print >> log, " Number of bodies:", n_bodies print >> log, " Resulting number of reflections:", m_ref_first print >> log, " Requested low-resolution limit:", d_low, if (final_n_ref_first != m_ref_first): print >> log, "(determines final number)", print >> log print >> log, " Final number of reflections:", final_n_ref_first print >> log, " Data resolution: %6.2f - %6.2f" \ " (%d reflections)" % (d_max, d_min, n_refl_data) print >> log, " Resolution for rigid body refinement: %6.2f - %6.2f" \ " (%d reflections)" % (d_max, d_high, d_spacings.size()) if (degenerate): raise Sorry("Final number of reflections > number of reflections: %d > %d" % (final_n_ref_first, d_spacings.size())) print >> log, " Number of resolution zones: %d" % number_of_zones if (len(d_mins) > 1): print >> log, " Resolution cutoffs for multiple zones: " print >> log, " number of" print >> log, " zone resolution reflections" for i, d_i in enumerate(d_mins): n_ref = (d_spacings >= d_i).count(True) print >> log, " %3d %6.2f -%6.2f %11d" % ( i+1, d_max, d_i, n_ref) return d_mins | b10578fa116e23726f8619225eeef0c075f5a11f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/696/b10578fa116e23726f8619225eeef0c075f5a11f/rigid_body.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
67,
19182,
67,
3676,
12,
302,
67,
1752,
1077,
899,
16,
290,
67,
70,
18134,
16,
290,
67,
1734,
67,
3645,
16,
3309,
67,
3432,
67,
6812,
67,
82,
67,
1734,
67,
3645,
16,
302,
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,
1416,
67,
19182,
67,
3676,
12,
302,
67,
1752,
1077,
899,
16,
290,
67,
70,
18134,
16,
290,
67,
1734,
67,
3645,
16,
3309,
67,
3432,
67,
6812,
67,
82,
67,
1734,
67,
3645,
16,
302,
67,... |
parser.parser(open(spec)) | parser.parse(open(spec)) | def __init__(self, spec): DevHelpBook.__init__(self) | c60623948fcebfbbb0546f8b9ac9efe3612d792c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2448/c60623948fcebfbbb0546f8b9ac9efe3612d792c/DevHelp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
857,
4672,
9562,
6696,
9084,
16186,
2738,
972,
12,
2890,
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,
1001,
2738,
972,
12,
2890,
16,
857,
4672,
9562,
6696,
9084,
16186,
2738,
972,
12,
2890,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
msg['subject'] = msg_txt.get('Subject') | msg['subject'] = ' '.join(map(lambda (x, y): unicode(x, y or 'ascii'), decode_header(msg_txt.get('Subject')))) | def _process_email(self, cr, uid, server, message, context={}): context.update({ 'server_id':server.id }) history_pool = self.pool.get('mail.server.history') msg_txt = email.message_from_string(message) message_id = msg_txt.get('Message-ID', False) msg = {} if not message_id: return False fields = msg_txt.keys() msg['id'] = message_id msg['message-id'] = message_id if 'Subject' in fields: msg['subject'] = msg_txt.get('Subject') if 'Content-Type' in fields: msg['content-type'] = msg_txt.get('Content-Type') if 'From' in fields: msg['from'] = msg_txt.get('From') if 'Delivered-To' in fields: msg['to'] = msg_txt.get('Delivered-To') if 'Cc' in fields: msg['cc'] = msg_txt.get('Cc') if 'Reply-To' in fields: msg['reply'] = msg_txt.get('Reply-To') if 'Date' in fields: msg['date'] = msg_txt.get('Date') if 'Content-Transfer-Encoding' in fields: msg['encoding'] = msg_txt.get('Content-Transfer-Encoding') if 'References' in fields: msg['references'] = msg_txt.get('References') | 9697f8b04341af6e76937c14d38255813219660b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9697f8b04341af6e76937c14d38255813219660b/fetchmail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
67,
3652,
12,
2890,
16,
4422,
16,
4555,
16,
1438,
16,
883,
16,
819,
12938,
4672,
819,
18,
2725,
12590,
296,
3567,
67,
350,
4278,
3567,
18,
350,
289,
13,
4927,
67,
6011,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
67,
3652,
12,
2890,
16,
4422,
16,
4555,
16,
1438,
16,
883,
16,
819,
12938,
4672,
819,
18,
2725,
12590,
296,
3567,
67,
350,
4278,
3567,
18,
350,
289,
13,
4927,
67,
6011,
27... |
cr.execute("""select p.id, p.name from account_fiscalyear y, account_period p where y.id=p.fiscalyear_id \ | cr.execute("""select p.id from account_fiscalyear y, account_period p where y.id=p.fiscalyear_id \ | def compute_refund(self, cr, uid, ids, mode='refund', context=None): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: the account invoice refund’s ID or list of IDs | bcb30ec9c070cb47a98de3493a655ad105df8328 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bcb30ec9c070cb47a98de3493a655ad105df8328/account_invoice_refund.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
67,
1734,
1074,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
1965,
2218,
1734,
1074,
2187,
819,
33,
7036,
4672,
3536,
632,
891,
4422,
30,
326,
783,
1027,
16,
628,
326,
2063,
3347,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
67,
1734,
1074,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
1965,
2218,
1734,
1074,
2187,
819,
33,
7036,
4672,
3536,
632,
891,
4422,
30,
326,
783,
1027,
16,
628,
326,
2063,
3347,... |
""" fl_create_round3dbutton(type, x, y, w, h, label) -> object ref. | """ fl_create_round3dbutton(type, x, y, w, h, label) -> object | def fl_create_round3dbutton(type, x, y, w, h, label): """ fl_create_round3dbutton(type, x, y, w, h, label) -> object ref. """ retval = _fl_create_round3dbutton(type, x, y, w, h, label) return retval | 8765c710f695de392f6fc7c664c746ec98668b1d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/8765c710f695de392f6fc7c664c746ec98668b1d/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
2640,
67,
2260,
23,
1966,
2644,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
16,
1433,
4672,
3536,
1183,
67,
2640,
67,
2260,
23,
1966,
2644,
12,
723,
16,
619,
16,
677,
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,
1183,
67,
2640,
67,
2260,
23,
1966,
2644,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
16,
1433,
4672,
3536,
1183,
67,
2640,
67,
2260,
23,
1966,
2644,
12,
723,
16,
619,
16,
677,
16... |
print ("\nExample : worker -s 30 -v http://localhost:8080") | print ("\nExample : worker -s 30 -v http://localhost:19211") | 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") | 1b1c5f278e1f3d81e65744ef2993f3fc440316d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1233/1b1c5f278e1f3d81e65744ef2993f3fc440316d3/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... |
def __init__(self): | def __init__(self, debug=False): self.debug = debug | def __init__(self): self.hostname = '' self.username = '' self.password = '' self.connection = None | 72cd99ba1e9fbbf50eca8b7f5d17d2d633ee5616 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3069/72cd99ba1e9fbbf50eca8b7f5d17d2d633ee5616/FileTransfer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1198,
33,
8381,
4672,
365,
18,
4148,
273,
1198,
225,
365,
18,
10358,
273,
875,
365,
18,
5053,
273,
875,
365,
18,
3664,
273,
875,
225,
365,
18,
4071,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1198,
33,
8381,
4672,
365,
18,
4148,
273,
1198,
225,
365,
18,
10358,
273,
875,
365,
18,
5053,
273,
875,
365,
18,
3664,
273,
875,
225,
365,
18,
4071,
27... |
def write_index_pointers(self, out, indices): | def write_indexpage_header(self, out, indices, title, url): | def write_index_pointers(self, out, indices): """ A helper for the index page generation functions, which generates a header that can be used to navigate between the different indices. """ if len(indices) > 1: out('<center><b>[\n') out(' <a href="identifier-index.html">Identifier Index</a>\n') if indices['term']: out('| <a href="term-index.html">Term Definition Index</a>\n') if indices['bug']: out('| <a href="bug-index.html">Bug List</a>\n') if indices['todo']: out('| <a href="todo-index.html">To Do List</a>\n') out(']</b></center>\n') | 5c410b5b6e25df3bdbc6da266f7773518165cb02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/5c410b5b6e25df3bdbc6da266f7773518165cb02/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
1615,
2433,
67,
3374,
12,
2890,
16,
596,
16,
4295,
16,
2077,
16,
880,
4672,
3536,
432,
4222,
364,
326,
770,
1363,
9377,
4186,
16,
1492,
6026,
279,
1446,
716,
848,
506,
1399,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1615,
2433,
67,
3374,
12,
2890,
16,
596,
16,
4295,
16,
2077,
16,
880,
4672,
3536,
432,
4222,
364,
326,
770,
1363,
9377,
4186,
16,
1492,
6026,
279,
1446,
716,
848,
506,
1399,
... |
self.stationid=StationCode self.stationid=self.stationid.upper() self.reporturl="%s%s.TXT" % (self.baseurl, self.stationid) | self.stationid = StationCode self.stationid = self.stationid.upper() self.reporturl = "%s%s.TXT" % (self.baseurl, self.stationid) | def FetchReport(self, StationCode=None, proxy=None): """ Fetch a report for a given station ID from the baseurl given upon creation of the ReportFetcher instance. If proxy is not None, a proxy URL of the form protocol://user:password@host.name.tld:port/ is expected, for example: http://squid.somenet.com:3128/ If no proxy is specified, the environment variable http_proxy is inspected. If it isn't set, a direct connection is tried. """ if self.stationid is None and StationCode is None: raise EmptyIDException, \ "No ID given on init and FetchReport()." elif StationCode is not None: self.stationid=StationCode | fe1cdcd11658fbbfba6d30dfe37a2f9dfce6a1a8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4602/fe1cdcd11658fbbfba6d30dfe37a2f9dfce6a1a8/pymetar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8065,
4820,
12,
2890,
16,
934,
367,
1085,
33,
7036,
16,
2889,
33,
7036,
4672,
3536,
8065,
279,
2605,
364,
279,
864,
13282,
1599,
628,
326,
25427,
864,
12318,
6710,
434,
326,
8706,
16855,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8065,
4820,
12,
2890,
16,
934,
367,
1085,
33,
7036,
16,
2889,
33,
7036,
4672,
3536,
8065,
279,
2605,
364,
279,
864,
13282,
1599,
628,
326,
25427,
864,
12318,
6710,
434,
326,
8706,
16855,... |
if opts.inspiral and type == 'plot': dag.addNode(self,'inspiral') self.validate() else: self.invalidate() if opts.inspiral_head and type == 'head': dag.addNode(self,'inspiral-head') self.validate() else: self.invalidate() else: | if type == 'plot': if opts.inspiral: dag.addNode(self,'inspiral') self.validate() else: self.invalidate() if type == 'head' if opts.inspiral_head: dag.addNode(self,'inspiral-head') self.validate() else: self.invalidate() except: | def __init__(self, inspJob, procParams, ifo, trig, cp,opts,dag, type='plot',sngl_table = None): if 1: #try: inspiral.InspiralNode.__init__(self, inspJob) injFile = self.checkInjections(cp) | d20e66180c4109b3f462595ae5f5b7ade7ea81c1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/d20e66180c4109b3f462595ae5f5b7ade7ea81c1/fu_Condor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
316,
1752,
2278,
16,
5418,
1370,
16,
21479,
16,
23142,
16,
3283,
16,
4952,
16,
30204,
16,
618,
2218,
4032,
2187,
87,
3368,
80,
67,
2121,
273,
599,
4672,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
316,
1752,
2278,
16,
5418,
1370,
16,
21479,
16,
23142,
16,
3283,
16,
4952,
16,
30204,
16,
618,
2218,
4032,
2187,
87,
3368,
80,
67,
2121,
273,
599,
4672,
... |
if save: try: iter = self.vcard.iter path = os.path.expanduser("~/Contacts") filename = os.path.join(path, unescape(self.vcard.fn.value) + ".vcf") | try: iter = self.vcard.iter path = os.path.expanduser("~/.config/Contacts") filename = os.path.join(path, unescape(self.vcard.fn.value) + ".vcf") if self.vcard.filename is not None: | def switch_mode(self, edit=False, save=False): self.edit = edit self.addButton.set_sensitive(edit) self.saveButton.set_property("visible", edit) self.editButton.set_property("visible", not edit) self.imagechangeButton.set_property("visible", edit) self.imageremoveButton.set_property("visible", edit and self.hasphoto) self.changeButton.set_property("visible", edit) | 337e2628519817abde9df50dbed69c769add8439 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2651/337e2628519817abde9df50dbed69c769add8439/arkadas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1620,
67,
3188,
12,
2890,
16,
3874,
33,
8381,
16,
1923,
33,
8381,
4672,
365,
18,
4619,
273,
3874,
365,
18,
1289,
3616,
18,
542,
67,
23481,
12,
4619,
13,
365,
18,
5688,
3616,
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,
1620,
67,
3188,
12,
2890,
16,
3874,
33,
8381,
16,
1923,
33,
8381,
4672,
365,
18,
4619,
273,
3874,
365,
18,
1289,
3616,
18,
542,
67,
23481,
12,
4619,
13,
365,
18,
5688,
3616,
18,
542,... |
if "nr_maps" not in kw or kw["nr_maps"] > len(inputs): nr_maps = len(inputs) else: nr_maps = kw["nr_maps"] | def _run(self, **kw): d = lambda x: kw.get(x, Job.defaults[x]) # -- check parametets -- | 5b23327b757949c1d8542c1ef9d1e5fdfad474fc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/373/5b23327b757949c1d8542c1ef9d1e5fdfad474fc/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2681,
12,
2890,
16,
2826,
9987,
4672,
302,
273,
3195,
619,
30,
5323,
18,
588,
12,
92,
16,
3956,
18,
7606,
63,
92,
5717,
225,
468,
1493,
866,
29866,
2413,
1493,
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,
389,
2681,
12,
2890,
16,
2826,
9987,
4672,
302,
273,
3195,
619,
30,
5323,
18,
588,
12,
92,
16,
3956,
18,
7606,
63,
92,
5717,
225,
468,
1493,
866,
29866,
2413,
1493,
2,
-100,
-100,
-1... | |
printed_event = False if event.eventtype() in ['pubmsg', 'action', 'privmsg', 'quit', 'part', 'nick', 'kick']: if nickname == None: return handled = False if event.eventtype() in ['quit', 'part'] and nickname == self.nickname: return if event.eventtype() in ['quit', 'part', 'nick', 'kick']: if connection.real_nickname != self.nickname: self.error(1, 'ignoring IRC '+event.eventtype()+' not received on bot connection', debug=True) return else: self.error(2, debug_str, debug=True) printed_event = True if event.eventtype() == 'kick' and len(event.arguments()) < 1: self.error(say_levels.debug, 'at least 1 argument is needed for a '+event.eventtype()+' event', no_debug_add=event_str) return if event.eventtype() in ['pubmsg', 'action']: if connection.real_nickname != self.nickname: self.error(1, 'ignoring IRC '+event.eventtype()+' not received on bot connection', debug=True) return if nickname == self.nickname: self.error(1, 'ignoring IRC '+event.eventtype()+' sent by self', debug=True) return for bridge in self.bridges: if connection.server != bridge.irc_server: continue try: from_ = bridge.get_participant(nickname) except Bridge.NoSuchParticipantException: continue if event.eventtype() == 'privmsg': if event.target() == None: return | handled = False if event.eventtype() in ['privmsg', 'action']: if event.target() == self.nickname: connection.privmsg(source_nickname, self.respond(event.arguments()[0])) return elif not irclib.is_channel(event.target()[0]): for bridge in self.iter_bridges(irc_server=connection.server): | def _irc_event_handler(self, connection, event): """[Internal] Manage IRC events""" # Answer ping if event.eventtype() == 'ping': connection.pong(connection.get_server_name()) return # Events we always want to ignore if 'all' in event.eventtype() or 'motd' in event.eventtype() or event.eventtype() in ['nicknameinuse', 'nickcollision', 'erroneusnickname']: return if event.eventtype() in ['pong', 'privnotice', 'ctcp', 'nochanmodes', 'notexttosend', 'currenttopic', 'topicinfo', '328', 'pubnotice', '042', 'umode', 'welcome', 'yourhost', 'created', 'myinfo', 'featurelist', 'luserclient', 'luserop', 'luserchannels', 'luserme', 'n_local', 'n_global', 'endofnames', 'luserunknown', 'luserconns', 'inviteonlychan', 'bannedfromchan', 'channelisfull', 'badchannelkey']: self.error(1, 'ignoring IRC '+event.eventtype(), debug=True) return nickname = None if event.source() and '!' in event.source(): nickname = event.source().split('!')[0] # A string representation of the event event_str = '\nconnection='+connection.__str__()+'\neventtype='+event.eventtype()+'\nsource='+repr(event.source())+'\ntarget='+repr(event.target())+'\narguments='+repr(event.arguments()) debug_str = 'Received IRC event.'+event_str printed_event = False if event.eventtype() in ['pubmsg', 'action', 'privmsg', 'quit', 'part', 'nick', 'kick']: if nickname == None: return handled = False if event.eventtype() in ['quit', 'part'] and nickname == self.nickname: return if event.eventtype() in ['quit', 'part', 'nick', 'kick']: if connection.real_nickname != self.nickname: self.error(1, 'ignoring IRC '+event.eventtype()+' not received on bot connection', debug=True) return else: self.error(2, debug_str, debug=True) printed_event = True if event.eventtype() == 'kick' and len(event.arguments()) < 1: self.error(say_levels.debug, 'at least 1 argument is needed for a '+event.eventtype()+' event', no_debug_add=event_str) return if event.eventtype() in ['pubmsg', 'action']: if connection.real_nickname != self.nickname: self.error(1, 'ignoring IRC '+event.eventtype()+' not received on bot connection', debug=True) return if nickname == self.nickname: self.error(1, 'ignoring IRC '+event.eventtype()+' sent by self', debug=True) return for bridge in self.bridges: if connection.server != bridge.irc_server: continue try: from_ = bridge.get_participant(nickname) except Bridge.NoSuchParticipantException: continue # Private message if event.eventtype() == 'privmsg': if event.target() == None: return try: to_ = bridge.get_participant(event.target().split('!')[0]) self.error(2, debug_str, debug=True) from_.say_on_xmpp_to(to_.nickname, event.arguments()[0]) return except Bridge.NoSuchParticipantException: if event.target().split('!')[0] == self.nickname: # Message is for the bot self.error(2, debug_str, debug=True) connection.privmsg(from_.nickname, self.respond(event.arguments()[0])) return else: continue # kick handling if event.eventtype() == 'kick': if event.target().lower() == bridge.irc_room: try: kicked = bridge.get_participant(event.arguments()[0]) if isinstance(kicked.irc_connection, irclib.ServerConnection): kicked.irc_connection.join(bridge.irc_room) else: if len(event.arguments()) > 1: bridge.remove_participant('irc', kicked.nickname, 'Kicked by '+nickname+' with reason: '+event.arguments()[1]) else: bridge.remove_participant('irc', kicked.nickname, 'Kicked by '+nickname+' (no reason was given)') return except Bridge.NoSuchParticipantException: self.error(say_levels.debug, 'a participant that was not here has been kicked ? WTF ?', no_debug_add=event_str) return else: continue # Leaving events if event.eventtype() == 'quit' or event.eventtype() == 'part' and event.target().lower() == bridge.irc_room: if len(event.arguments()) > 0: leave_message = event.arguments()[0] elif event.eventtype() == 'quit': leave_message = 'Left server.' elif event.eventtype() == 'part': leave_message = 'Left channel.' else: leave_message = '' bridge.remove_participant('irc', from_.nickname, leave_message) handled = True continue # Nickname change if event.eventtype() == 'nick': from_.change_nickname(event.target(), 'xmpp') handled = True continue # Chan message if event.eventtype() in ['pubmsg', 'action']: if bridge.irc_room == event.target().lower() and bridge.irc_server == connection.server: self.error(2, debug_str, debug=True) message = event.arguments()[0] if event.eventtype() == 'action': action = True else: action = False from_.say_on_xmpp(message, action=action) return else: continue if handled: return if event.eventtype() in ['disconnect', 'kill', 'error']: if len(event.arguments()) > 0 and event.arguments()[0] == 'Connection reset by peer': self.error(2, debug_str, debug=True) else: self.error(say_levels.debug, debug_str, send_to_admins=True) return # Chan errors if event.eventtype() in ['cannotsendtochan', 'notonchannel']: self.error(2, debug_str, debug=True) bridge = self.get_bridge(irc_room=event.arguments()[0], irc_server=connection.server) if event.eventtype() == 'cannotsendtochan': if connection.real_nickname == self.nickname: bridge._join_irc_failed(event.eventtype()) else: p = bridge.get_participant(connection.real_nickname) p._close_irc_connection(event.eventtype()) p.irc_connection = event.eventtype() elif event.eventtype() == 'notonchannel': if connection.real_nickname == self.nickname: bridge.restart(message='Restarting bridge because we received the IRC event '+event.eventtype()) else: p = bridge.get_participant(connection.real_nickname) p.irc_connection.join(bridge.irc_room) return # Ignore events not received on bot connection if connection.real_nickname != self.nickname: self.error(1, 'ignoring IRC '+event.eventtype()+' not received on bridge connection', debug=True) return # Joining events if event.eventtype() in ['namreply', 'join']: if event.eventtype() == 'namreply': bridge = self.get_bridge(irc_room=event.arguments()[1].lower(), irc_server=connection.server) for nickname in re.split('(?:^[&@\+%]?|(?: [&@\+%]?)*)', event.arguments()[2].strip()): if nickname == '' or nickname == self.nickname: continue bridge.add_participant('irc', nickname) return elif event.eventtype() == 'join': bridge = self.get_bridge(irc_room=event.target().lower(), irc_server=connection.server) bridge.add_participant('irc', nickname) return # Mode event if event.eventtype() == 'mode': if len(event.arguments()) < 2: self.error(2, debug_str, debug=True) self.error(1, '2 arguments are needed for a '+event.eventtype()+' event', debug=True) return if event.arguments()[1] != self.nickname or not 'o' in event.arguments()[0]: self.error(1, 'ignoring IRC mode "'+event.arguments()[0]+'" for "'+event.arguments()[1]+'"', debug=True) return self.error(2, debug_str, debug=True) bridges = self.iter_bridges(irc_room=event.target(), irc_server=connection.server) if len(bridges) > 1: raise Exception, 'more than one bridge for one irc chan, WTF ?' bridge = bridges[0] if re.search('\+[^\-]*o', event.arguments()[0]): # bot is channel operator bridge.irc_op = True self.error(say_levels.notice, 'bot has IRC operator privileges in '+event.target()) elif re.search('\-[^\+]*o', event.arguments()[0]): # bot lost channel operator privileges if bridge.irc_op: self.error(say_levels.notice, 'bot lost IRC operator privileges in '+event.target(), send_to_admins=True) bridge.irc_op = False return # Unhandled events if not printed_event: self.error(say_levels.debug, 'The following IRC event was not handled:'+event_str+'\n', send_to_admins=True) else: self.error(1, 'event not handled', debug=True) self._send_message_to_admins(say_levels.debug, 'The following IRC event was not handled:'+event_str) | 7af2a8a810665cc96ac01e14451dec4dfa2e27ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9915/7af2a8a810665cc96ac01e14451dec4dfa2e27ba/bot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
481,
71,
67,
2575,
67,
4176,
12,
2890,
16,
1459,
16,
871,
4672,
3536,
63,
3061,
65,
24247,
467,
11529,
2641,
8395,
225,
468,
21019,
10087,
309,
871,
18,
2575,
723,
1435,
422,
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,
389,
481,
71,
67,
2575,
67,
4176,
12,
2890,
16,
1459,
16,
871,
4672,
3536,
63,
3061,
65,
24247,
467,
11529,
2641,
8395,
225,
468,
21019,
10087,
309,
871,
18,
2575,
723,
1435,
422,
296,... |
class Repl: | class Repl( object ): | def writetb( self, l ): """This outputs the traceback and should be overridden for anything fancy.""" map( self.write, [ "\x01y\x03%s" % i for i in l ] ) | addea38e11a3b7d7443eb3712609d94c5cc07c1b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6932/addea38e11a3b7d7443eb3712609d94c5cc07c1b/bpython.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2518,
278,
70,
12,
365,
16,
328,
262,
30,
3536,
2503,
6729,
326,
10820,
471,
1410,
506,
11000,
364,
6967,
31701,
12123,
852,
12,
365,
18,
2626,
16,
306,
1548,
92,
1611,
93,
64,
92,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2518,
278,
70,
12,
365,
16,
328,
262,
30,
3536,
2503,
6729,
326,
10820,
471,
1410,
506,
11000,
364,
6967,
31701,
12123,
852,
12,
365,
18,
2626,
16,
306,
1548,
92,
1611,
93,
64,
92,
4... |
time.sleep(0.01) | def server(evt, buf): try: serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) serv.settimeout(3) serv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) serv.bind(("", 0)) global PORT PORT = serv.getsockname()[1] serv.listen(5) conn, addr = serv.accept() except socket.timeout: pass else: n = 500 while buf and n > 0: r, w, e = select.select([], [conn], []) if w: sent = conn.send(buf) buf = buf[sent:] n -= 1 time.sleep(0.01) conn.close() finally: serv.close() PORT = None evt.set() | 722bd0439a8b328434c4d722d07e5b73ba495a45 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/722bd0439a8b328434c4d722d07e5b73ba495a45/test_smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1438,
12,
73,
11734,
16,
1681,
4672,
775,
30,
13515,
273,
2987,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
16,
2987,
18,
3584,
3507,
67,
13693,
13,
13515,
18,
542,
4538,
12,
23,
13,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1438,
12,
73,
11734,
16,
1681,
4672,
775,
30,
13515,
273,
2987,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
16,
2987,
18,
3584,
3507,
67,
13693,
13,
13515,
18,
542,
4538,
12,
23,
13,
13... | |
if self.entry: | if self.entry is not None: | def handle_endtag(self, tag): if tag == 'object': if self.entry: self.book.index.append(self.entry) self.entry = None | 5b4c40008641c5b87f7596e72f903a3b00d5bad4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2448/5b4c40008641c5b87f7596e72f903a3b00d5bad4/MSHH.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
409,
2692,
12,
2890,
16,
1047,
4672,
309,
1047,
422,
296,
1612,
4278,
309,
365,
18,
4099,
353,
486,
599,
30,
365,
18,
3618,
18,
1615,
18,
6923,
12,
2890,
18,
4099,
13,
365,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
409,
2692,
12,
2890,
16,
1047,
4672,
309,
1047,
422,
296,
1612,
4278,
309,
365,
18,
4099,
353,
486,
599,
30,
365,
18,
3618,
18,
1615,
18,
6923,
12,
2890,
18,
4099,
13,
365,... |
e = L[0][1] | e = L[0][1] | sage: def my_carmichael(n): | 77ebae1a86dce84d33186edca61d6dcae77b09f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/77ebae1a86dce84d33186edca61d6dcae77b09f0/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
272,
410,
30,
1652,
3399,
67,
71,
4610,
1354,
69,
292,
12,
82,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
272,
410,
30,
1652,
3399,
67,
71,
4610,
1354,
69,
292,
12,
82,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
_LIGOTimeGPS.__init__(self, seconds, 0) | xlal.date.LIGOTimeGPS.__init__(self, seconds, 0) | def __init__(self, seconds, nanoseconds = None): if type(seconds) in [int, long]: if nanoseconds: if type(nanoseconds) not in [int, long]: raise TypeError, repr(nanoseconds) _LIGOTimeGPS.__init__(self, seconds, nanoseconds) else: _LIGOTimeGPS.__init__(self, seconds, 0) elif nanoseconds != None: raise TypeError, "LIGOTimeGPS(x): function takes exactly 1 argument with non-integer x (2 given)" elif type(seconds) == LIGOTimeGPS: self.seconds, self.nanoseconds = seconds.seconds, seconds.nanoseconds elif type(seconds) == float: t = XLALREAL8ToGPS(seconds) self.seconds, self.nanoseconds = t.seconds, t.nanoseconds elif type(seconds) == str: t = XLALStrToGPS(seconds) self.seconds, self.nanoseconds = t.seconds, t.nanoseconds else: raise TypeError, repr(seconds) | b3db593c4835e8181b34fe8d728b6db116182e48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/b3db593c4835e8181b34fe8d728b6db116182e48/date.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3974,
16,
6468,
23272,
273,
599,
4672,
309,
618,
12,
7572,
13,
316,
306,
474,
16,
1525,
14542,
309,
6468,
23272,
30,
309,
618,
12,
13569,
23272,
13,
486,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3974,
16,
6468,
23272,
273,
599,
4672,
309,
618,
12,
7572,
13,
316,
306,
474,
16,
1525,
14542,
309,
6468,
23272,
30,
309,
618,
12,
13569,
23272,
13,
486,... |
ret = None | def show_user(email, arg=None, autoescape=None, memcache_results=None): """Render a link to the user's dashboard, with text being the nickname.""" if isinstance(email, users.User): email = email.email() if not arg: user = users.get_current_user() if user is not None and email == user.email(): return 'me' ret = None if memcache_results is not None: if email in memcache_results: ret = memcache_results[email] else: logging.debug('memcache miss for %r', email) if ret is None: nick = nickname(email, True) account = models.Account.get_account_for_email(email) if account: if len(models.Account.get_accounts_for_nickname(account.nickname)) > 1: # The nickname is not unique, fallback to email as key. user_key = email else: user_key = nick # Cache for a longer time, this is likely to remain valid. cache_timeout = 300 else: user_key = nick # Cache likely to become invalid due to user sign up. cache_timeout = 30 memcache.add('show_user:%s' % email, ret, cache_timeout) # populate the dict with the results, so same user in the list later # will have a memcache "hit" on "read". if memcache_results is not None: memcache_results[email] = ret ret = ('<a href="/user/%(key)s" onMouseOver="M_showUserInfoPopup(this)">' '%(key)s</a>' % {'key': cgi.escape(user_key)}) return django.utils.safestring.mark_safe(ret) | 19b3d737ff7c4d7ae891275966d796d7506780f7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/476/19b3d737ff7c4d7ae891275966d796d7506780f7/library.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
1355,
12,
3652,
16,
1501,
33,
7036,
16,
3656,
6939,
33,
7036,
16,
20549,
67,
4717,
33,
7036,
4672,
3536,
3420,
279,
1692,
358,
326,
729,
1807,
11825,
16,
598,
977,
3832,
326,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
1355,
12,
3652,
16,
1501,
33,
7036,
16,
3656,
6939,
33,
7036,
16,
20549,
67,
4717,
33,
7036,
4672,
3536,
3420,
279,
1692,
358,
326,
729,
1807,
11825,
16,
598,
977,
3832,
326,... | |
out = "%s <marc:subfield code=\"%s\">%s</marc:subfield>\n" % (out, encode_for_xml(field[-1:]), value) if (format == "marcxml") and field_number_old != -999: if field_old[0:2] == "00": out = out + " </marc:controlfield>\n" else: out = out + " </marc:datafield>\n" out = out + " </marc:record>\n" | out = out + " </marc:datafield>\n" out = out + " </marc:record>\n" | def print_record(sysno, format='marcxml', record_exists_result=None): """Prints record 'sysno' formatted according to 'format'. - if record does not exist, return nothing. - if record has been deleted and CFG_OAI_DELETED_POLICY is 'transient' or 'deleted', then return only header, with status 'deleted'. - if record has been deleted and CFG_OAI_DELETED_POLICY is 'no', then return nothing. Optional parameter 'record_exists_result' has the value of the result of the record_exists(sysno) function (in order not to call that function again if already done.) """ out = "" # sanity check: if record_exists_result is not None: _record_exists = record_exists_result else: _record_exists = record_exists(sysno) if not _record_exists: return if (format == "dc") or (format == "oai_dc"): format = "xd" # print record opening tags: out = out + " <record>\n" if _record_exists == -1: # Deleted? if CFG_OAI_DELETED_POLICY == "persistent" or \ CFG_OAI_DELETED_POLICY == "transient": out = out + " <header status=\"deleted\">\n" else: return else: out = out + " <header>\n" for ident in get_field(sysno, CFG_OAI_ID_FIELD): out = "%s <identifier>%s</identifier>\n" % (out, escape_space(ident)) out = "%s <datestamp>%s</datestamp>\n" % (out, get_modification_date(sysno)) for set in get_field(sysno, CFG_OAI_SET_FIELD): out = "%s <setSpec>%s</setSpec>\n" % (out, set) out = out + " </header>\n" if _record_exists == -1: # Deleted? pass else: out = out + " <metadata>\n" if format == "marcxml": out = out + " <marc:record xmlns:marc=\"http://www.loc.gov/MARC21/slim\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd\" type=\"Bibliographic\">" out = out + " <marc:leader>00000coc 2200000uu 4500</marc:leader>" ## MARC21 and XML formats, possibley OAI -- they are not in "bibfmt" table; so fetch all the data from "bibXXx" tables: if format == "marcxml": out = "%s <marc:controlfield tag=\"001\">%d</marc:controlfield>\n" % (out, int(sysno)) for digit1 in range(0, 10): for digit2 in range(0, 10): bibbx = "bib%d%dx" % (digit1, digit2) bibx = "bibrec_bib%d%dx" % (digit1, digit2) query = "SELECT b.tag,b.value,bb.field_number FROM %s AS b, %s AS bb "\ "WHERE bb.id_bibrec='%s' AND b.id=bb.id_bibxxx AND b.tag LIKE '%s%%' "\ "ORDER BY bb.field_number, b.tag ASC" % (bibbx, bibx, sysno, str(digit1)+str(digit2)) res = run_sql(query) field_number_old = -999 field_old = "" for row in res: field, value, field_number = row[0], row[1], row[2] ind1, ind2 = field[3], field[4] if ind1 == "_": ind1 = " " if ind2 == "_": ind2 = " " # print field tag if field_number != field_number_old or field[:-1] != field_old[:-1]: if format == "marcxml": if field_number_old != -999: if field_old[0:2] == "00": out = out + " </marc:controlfield>\n" else: out = out + " </marc:datafield>\n" if field[0:2] == "00": out = "%s <marc:controlfield tag=\"%s\">\n" % (out, encode_for_xml(field[0:3])) else: out = "%s <marc:datafield tag=\"%s\" ind1=\"%s\" ind2=\"%s\">\n" % (out, encode_for_xml(field[0:3]), encode_for_xml(ind1).lower(), encode_for_xml(ind2).lower()) field_number_old = field_number field_old = field # print subfield value if format == "marcxml": value = encode_for_xml(value) if(field[0:2] == "00"): out = "%s %s\n" % (out, value) else: out = "%s <marc:subfield code=\"%s\">%s</marc:subfield>\n" % (out, encode_for_xml(field[-1:]), value) # fetch next subfield # all fields/subfields printed in this run, so close the tag: if (format == "marcxml") and field_number_old != -999: if field_old[0:2] == "00": out = out + " </marc:controlfield>\n" else: out = out + " </marc:datafield>\n" out = out + " </marc:record>\n" elif format == "xd": # XML Dublin Core format, possibly OAI -- select only some bibXXx fields: out = out + " <oaidc:dc xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:oaidc=\"http://www.openarchives.org/OAI/2.0/oai_dc/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd\">\n" for field_ in get_field(sysno, "041__a"): out = "%s <dc:language>%s</dc:language>\n" % (out, field_) for field_ in get_field(sysno, "100__a"): out = "%s <dc:creator>%s</dc:creator>\n" % (out, encode_for_xml(field_)) for field_ in get_field(sysno, "700__a"): out = "%s <dc:creator>%s</dc:creator>\n" % (out, encode_for_xml(field_)) for field_ in get_field(sysno, "245__a"): out = "%s <dc:title>%s</dc:title>\n" % (out, encode_for_xml(field_)) for field_ in get_field(sysno, "111__a"): out = "%s <dc:title>%s</dc:title>\n" % (out, encode_for_xml(field_)) for field_ in get_field(sysno, "65017a"): out = "%s <dc:subject>%s</dc:subject>\n" % (out, encode_for_xml(field_)) for field_ in get_field(sysno, "8564_u"): out = "%s <dc:identifier>%s</dc:identifier>\n" % (out, encode_for_xml(escape_space(field_))) for field_ in get_field(sysno, "520__a"): out = "%s <dc:description>%s</dc:description>\n" % (out, encode_for_xml(field_)) date = get_creation_date(sysno) out = "%s <dc:date>%s</dc:date>\n" % (out, date) out = out + " </oaidc:dc>\n" # print record closing tags: out = out + " </metadata>\n" out = out + " </record>\n" return out | f634c6df34cfde29316a6d343d7dda6d4b78c289 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/f634c6df34cfde29316a6d343d7dda6d4b78c289/oai_repository.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
3366,
12,
9499,
2135,
16,
740,
2218,
3684,
71,
2902,
2187,
1409,
67,
1808,
67,
2088,
33,
7036,
4672,
3536,
15402,
1409,
296,
9499,
2135,
11,
4955,
4888,
358,
296,
2139,
10332,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3366,
12,
9499,
2135,
16,
740,
2218,
3684,
71,
2902,
2187,
1409,
67,
1808,
67,
2088,
33,
7036,
4672,
3536,
15402,
1409,
296,
9499,
2135,
11,
4955,
4888,
358,
296,
2139,
10332,
... |
l = min(l, (x1 - p[0]) / diff[0]) | l = max(l, (x1 - p[0]) / diff[0]) | def clipPoly(polygon, clipRect, closeAtBorder = None): """clipPoly(polygon, clipRect) Clips away those parts of polygon which are not in clipRect. Returns a list of polygons (since the polygon may leave clipRect, enter again, leave, ...). Polygon segments crossing clipRect's borders are cut, such that the resulting polyons get new endpoints exactly on the border.""" result = [] | f7c055e35a4129e660ddacbabed3bce5b9813b14 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10394/f7c055e35a4129e660ddacbabed3bce5b9813b14/polytools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6807,
12487,
12,
20917,
16,
6807,
6120,
16,
1746,
861,
8107,
273,
599,
4672,
3536,
14161,
12487,
12,
20917,
16,
6807,
6120,
13,
225,
385,
11693,
10804,
5348,
2140,
434,
7154,
1492,
854,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6807,
12487,
12,
20917,
16,
6807,
6120,
16,
1746,
861,
8107,
273,
599,
4672,
3536,
14161,
12487,
12,
20917,
16,
6807,
6120,
13,
225,
385,
11693,
10804,
5348,
2140,
434,
7154,
1492,
854,
... |
return [] | return gettext_noop | def get_translations(): return [] | 7bb673ffe92301bd52df9df79d8b87482a551fc4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2831/7bb673ffe92301bd52df9df79d8b87482a551fc4/translation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
13457,
13332,
327,
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,
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,
336,
67,
13457,
13332,
327,
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,
-100,
-100,
-... |
if url.startswith('/') or url.startswith('\\'): url = path_to_url(url) | if self._is_file_url_scheme(url): url = path_to_url2(url) | def get_url(self, location): url = call_subprocess( [self.cmd, 'showconfig', 'paths.default'], show_stdout=False, cwd=location).strip() if url.startswith('/') or url.startswith('\\'): url = path_to_url(url) return url.strip() | 3126a19e1724ba33ff1251250a2555b0c79efb99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12982/3126a19e1724ba33ff1251250a2555b0c79efb99/mercurial.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
718,
12,
2890,
16,
2117,
4672,
880,
273,
745,
67,
1717,
2567,
12,
306,
2890,
18,
4172,
16,
296,
4500,
1425,
2187,
296,
4481,
18,
1886,
17337,
2405,
67,
10283,
33,
8381,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
718,
12,
2890,
16,
2117,
4672,
880,
273,
745,
67,
1717,
2567,
12,
306,
2890,
18,
4172,
16,
296,
4500,
1425,
2187,
296,
4481,
18,
1886,
17337,
2405,
67,
10283,
33,
8381,
16,
... |
return self.parseCountry(string)[0] | return self.getCountry(string)[0] def getCountry(self, string=None): if string == None: return [self.countryName, self.countryCode] else: country = self.parseCountry(string) if country != None and len(country) >= 2: self.countryName = country[0] self.countryCode = country[1] return[country[0], country[1]] else: return [None, None] | def getCountryName(self, string=None): if string == None: return self.countryName else: return self.parseCountry(string)[0] | 98989b07b0230ba18963a391489fadd8b2c866eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14361/98989b07b0230ba18963a391489fadd8b2c866eb/zcw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22669,
461,
12,
2890,
16,
533,
33,
7036,
4672,
309,
533,
422,
599,
30,
327,
365,
18,
9082,
461,
469,
30,
327,
365,
18,
2670,
8142,
12,
1080,
25146,
20,
65,
2,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22669,
461,
12,
2890,
16,
533,
33,
7036,
4672,
309,
533,
422,
599,
30,
327,
365,
18,
9082,
461,
469,
30,
327,
365,
18,
2670,
8142,
12,
1080,
25146,
20,
65,
2,
-100,
-100,
-100,
-100,... |
print("\n_____ %s%s" % (self.relpath, rev_str)) | options.stdout.write("\n_____ %s%s\n" % (self.relpath, rev_str)) | def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy. | e603c688da503d6a6db9690684aa49a1b2a54706 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/e603c688da503d6a6db9690684aa49a1b2a54706/gclient_scm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
702,
16,
833,
16,
585,
67,
1098,
4672,
3536,
9361,
5071,
358,
1089,
578,
17270,
715,
13926,
326,
5960,
1610,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
702,
16,
833,
16,
585,
67,
1098,
4672,
3536,
9361,
5071,
358,
1089,
578,
17270,
715,
13926,
326,
5960,
1610,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
replace_minus_button = Tkinter.Checkbutton( common_page, text=_('Replace hyphens with minus in SVG export?'), variable=self.replace_minus) | def draw( self): self.pages = Pmw.NoteBook( self.body) self.pages.pack( anchor='w', pady=0, padx=0, fill='both', expand=1) # COMMON common_page = self.pages.add( _('Common')) # use real minus ? replace_minus_button = Tkinter.Checkbutton( common_page, text=_('Use real minus character (instead of hyphen)?'), variable=self.use_real_minus) replace_minus_button.pack( anchor='w', padx=10, pady=10) | a0f9756f31ac9dffec6665ca16caa85820f7ed5e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4298/a0f9756f31ac9dffec6665ca16caa85820f7ed5e/dialogs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
365,
4672,
365,
18,
7267,
273,
453,
81,
91,
18,
8067,
9084,
12,
365,
18,
3432,
13,
365,
18,
7267,
18,
2920,
12,
6984,
2218,
91,
2187,
4627,
93,
33,
20,
16,
4627,
92,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
365,
4672,
365,
18,
7267,
273,
453,
81,
91,
18,
8067,
9084,
12,
365,
18,
3432,
13,
365,
18,
7267,
18,
2920,
12,
6984,
2218,
91,
2187,
4627,
93,
33,
20,
16,
4627,
92,
33,
... | |
group = models.ForeignKey(Group, verbose_name=_('group')) | group = models.ForeignKey(Group, verbose_name=_('group'), related_name='real_transaction_set') | def get_query_set(self): return super(TransactionManager,self).get_query_set().extra( select={ 'entry_count_sql': """ SELECT COUNT(*) FROM accounting_transactionentry WHERE accounting_transactionentry.transaction_id = accounting_transaction.id """ } ) | dd21905328d5180b4ef777fea89801f8d126a803 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12178/dd21905328d5180b4ef777fea89801f8d126a803/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2271,
67,
542,
12,
2890,
4672,
327,
2240,
12,
3342,
1318,
16,
2890,
2934,
588,
67,
2271,
67,
542,
7675,
7763,
12,
2027,
5899,
296,
4099,
67,
1883,
67,
4669,
4278,
3536,
9111,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2271,
67,
542,
12,
2890,
4672,
327,
2240,
12,
3342,
1318,
16,
2890,
2934,
588,
67,
2271,
67,
542,
7675,
7763,
12,
2027,
5899,
296,
4099,
67,
1883,
67,
4669,
4278,
3536,
9111,
... |
glyphnumber=k+(5*j)+(25*i)+(256*liquescentiae[liquescentia])+(512*shapes[shape]) | glyphnumber=i+(5*j)+(25*k)+(256*liquescentiae[liquescentia])+(512*shapes[shape]) | def name(i, j, k, shape, liquescentia): if shortglyphs==0: glyphnumber=k+(5*j)+(25*i)+(256*liquescentiae[liquescentia])+(512*shapes[shape]) else : glyphnumber=k+(5*j)+(25*i)+(64*liquescentiae[liquescentia])+(512*shapes[shape]) return "_%04d" % (glyphnumber) | 3476babc235eee7e0f876eaf20ec2cdd45f09a8b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7096/3476babc235eee7e0f876eaf20ec2cdd45f09a8b/squarize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
508,
12,
77,
16,
525,
16,
417,
16,
2179,
16,
4501,
372,
742,
319,
1155,
4672,
309,
3025,
19426,
87,
631,
20,
30,
9440,
2696,
33,
77,
15,
12,
25,
14,
78,
27921,
12,
2947,
14,
79,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
508,
12,
77,
16,
525,
16,
417,
16,
2179,
16,
4501,
372,
742,
319,
1155,
4672,
309,
3025,
19426,
87,
631,
20,
30,
9440,
2696,
33,
77,
15,
12,
25,
14,
78,
27921,
12,
2947,
14,
79,
... |
menuList = ConfigList(list) | menuList = ConfigList(self.list) | def __init__(self, session): Screen.__init__(self, session) | eb2804ab0205fd9204cd745feb840fdb4bc56216 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/eb2804ab0205fd9204cd745feb840fdb4bc56216/Ci.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1339,
4672,
10146,
16186,
2738,
972,
12,
2890,
16,
1339,
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,
1001,
2738,
972,
12,
2890,
16,
1339,
4672,
10146,
16186,
2738,
972,
12,
2890,
16,
1339,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
def __init__(self, fpath): | def __init__(self, fpath, enc=default_encoding): | def __init__(self, fpath): """ Constructor. | 07a4cb8a83c09e047deff4f5200ca5b150ca7505 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/07a4cb8a83c09e047deff4f5200ca5b150ca7505/polib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
13543,
16,
2446,
33,
1886,
67,
5999,
4672,
3536,
11417,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
13543,
16,
2446,
33,
1886,
67,
5999,
4672,
3536,
11417,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
yield path def get_walk_files(top): for path in FileUtilities.children_in_directory(top, True): | def get_walk_all(top): for path in FileUtilities.children_in_directory(top, False): yield path | 0b04c114276cb44971f600e6e5f3c1bb2c55c135 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7853/0b04c114276cb44971f600e6e5f3c1bb2c55c135/Action.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
11348,
67,
454,
12,
3669,
4672,
364,
589,
316,
1387,
11864,
18,
5906,
67,
267,
67,
5149,
12,
3669,
16,
1083,
4672,
2824,
589,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
11348,
67,
454,
12,
3669,
4672,
364,
589,
316,
1387,
11864,
18,
5906,
67,
267,
67,
5149,
12,
3669,
16,
1083,
4672,
2824,
589,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
I = self.index_set() J = other.index_set() | I = self.index_object() J = other.index_object() | def convolution_periodic(self, other): """ Convolves two collections indexed by a range(...) of the same length (automatically expands the shortest one by extending it by 0 if they have different lengths). If {a_n} and {b_n} are sequences of length N (n=0,1,...,N-1), extended periodically for all n in ZZ, then the convolution is | 837c0b7c218776beb9f35f10fe4f0b231105b3a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/837c0b7c218776beb9f35f10fe4f0b231105b3a3/dft.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26828,
67,
6908,
335,
12,
2890,
16,
1308,
4672,
3536,
735,
15416,
3324,
2795,
6980,
8808,
635,
279,
1048,
5825,
13,
434,
326,
1967,
769,
261,
5854,
20271,
4542,
87,
326,
20579,
1245,
635... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26828,
67,
6908,
335,
12,
2890,
16,
1308,
4672,
3536,
735,
15416,
3324,
2795,
6980,
8808,
635,
279,
1048,
5825,
13,
434,
326,
1967,
769,
261,
5854,
20271,
4542,
87,
326,
20579,
1245,
635... |
if dist.author: if not dist.author_email: | if metadata.author: if not metadata.author_email: | def check_metadata (self): | 20b4376838dcd2673d5f93274981d152b6081ce7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/20b4376838dcd2673d5f93274981d152b6081ce7/sdist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
4165,
261,
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,
866,
67,
4165,
261,
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,
-10... |
sim.getRNG().setSeed(12345) | sim.getRNG().set(seed=12345) | def passInfo(x, y, anc): 'Parental fields will be passed as tuples' off_anc = (anc[0] + anc[1])/2. off_x = (x[0] + x[1])/2 + random.normalvariate(off_anc - 0.5, 0.1) off_y = (y[0] + y[1])/2 + random.normalvariate(0, 0.1) return off_x, off_y, off_anc | 205f55f8c6cd28aed704d70838912648f07ac340 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/401/205f55f8c6cd28aed704d70838912648f07ac340/userGuide.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1342,
966,
12,
92,
16,
677,
16,
392,
71,
4672,
296,
3054,
287,
1466,
903,
506,
2275,
487,
10384,
11,
3397,
67,
19292,
273,
261,
19292,
63,
20,
65,
397,
392,
71,
63,
21,
5717,
19,
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,
1342,
966,
12,
92,
16,
677,
16,
392,
71,
4672,
296,
3054,
287,
1466,
903,
506,
2275,
487,
10384,
11,
3397,
67,
19292,
273,
261,
19292,
63,
20,
65,
397,
392,
71,
63,
21,
5717,
19,
2... |
parsed = format_parser(formats, names, titles, aligned, byteorder) | parsed = format_parser(formats, names, titles, aligned) | def fromfile(fd, formats, shape=None, names=None, titles=None, byteorder=_sysbyte, aligned=0, offset=0): """Create an array from binary file data If file is a string then that file is opened, else it is assumed to be a file object. No options at the moment, all file positioning must be done prior to this function call with a file object >>> import testdata, sys >>> fd=open(testdata.filename) >>> fd.seek(2880*2) >>> r=fromfile(fd, formats='f8,i4,a5', shape=3, byteorder='big') >>> print r[0] (5.1000000000000005, 61, 'abcde') >>> r._shape (3,) """ if (shape is None or shape == 0): shape = (-1,) elif isinstance(shape, (int, long)): shape = (shape,) name = 0 if isinstance(fd, str): name = 1 fd = open(fd, 'rb') if (offset > 0): fd.seek(offset, 1) try: size = os.fstat(fd.fileno())[stat.ST_SIZE] - fd.tell() except: size = os.path.getsize(fd.name) - fd.tell() parsed = format_parser(formats, names, titles, aligned, byteorder) itemsize = parsed._descr.itemsize shapeprod = sb.array(shape).prod() shapesize = shapeprod*itemsize if shapesize < 0: shape = list(shape) shape[ shape.index(-1) ] = size / -shapesize shape = tuple(shape) shapeprod = sb.array(shape).prod() nbytes = shapeprod*itemsize if nbytes > size: raise ValueError( "Not enough bytes left in file for specified shape and type") # create the array _array = recarray(shape, parsed._descr) nbytesread = fd.readinto(_array.data) if nbytesread != nbytes: raise IOError("Didn't read as many bytes as expected") if name: fd.close() return _array | 532fb2946faec74c3f5bb47a9f7f796eb26624b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/532fb2946faec74c3f5bb47a9f7f796eb26624b9/records.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
768,
12,
8313,
16,
6449,
16,
2179,
33,
7036,
16,
1257,
33,
7036,
16,
14693,
33,
7036,
16,
1160,
1019,
33,
67,
9499,
7229,
16,
13939,
33,
20,
16,
1384,
33,
20,
4672,
3536,
1684,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
768,
12,
8313,
16,
6449,
16,
2179,
33,
7036,
16,
1257,
33,
7036,
16,
14693,
33,
7036,
16,
1160,
1019,
33,
67,
9499,
7229,
16,
13939,
33,
20,
16,
1384,
33,
20,
4672,
3536,
1684,
... |
BindMenu(self.helpMenu.Append(wx.ID_ANY, "&About"), self.OnHelpMenuAbout) | BindMenu(self.helpMenu.Append(wx.ID_ANY, "&About\tCTRL+A"), self.OnHelpMenuAbout) | def BindMenu(item, handler): self.Bind(wx.EVT_MENU, handler, item) | 0773769b1e5700839d0fe7ffe63c352f8d4bb085 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2145/0773769b1e5700839d0fe7ffe63c352f8d4bb085/prompter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6936,
4599,
12,
1726,
16,
1838,
4672,
365,
18,
3357,
12,
27226,
18,
24427,
56,
67,
29227,
16,
1838,
16,
761,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6936,
4599,
12,
1726,
16,
1838,
4672,
365,
18,
3357,
12,
27226,
18,
24427,
56,
67,
29227,
16,
1838,
16,
761,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.include_namespace = False | self.include_namespace = self.get_include_namespace() | def __init__ (self): """ Constructor """ self.include_namespace = False | cf3926916324c2bce9a56acca57788606ca5d5ce /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11338/cf3926916324c2bce9a56acca57788606ca5d5ce/pkgmanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
4672,
3536,
11417,
3536,
225,
365,
18,
6702,
67,
4937,
273,
1083,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
4672,
3536,
11417,
3536,
225,
365,
18,
6702,
67,
4937,
273,
1083,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
default="codereview.appspot.com", | default=DEFAULT_REVIEW_SERVER, | def _GetOpener(self): """Returns an OpenerDirector that supports cookies and ignores redirects. | 219d39e126a37c691b8e3dfe6c6bd918c5d24faa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/219d39e126a37c691b8e3dfe6c6bd918c5d24faa/upload.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
967,
3817,
708,
12,
2890,
4672,
3536,
1356,
392,
6066,
708,
28280,
716,
6146,
7237,
471,
17868,
18064,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
967,
3817,
708,
12,
2890,
4672,
3536,
1356,
392,
6066,
708,
28280,
716,
6146,
7237,
471,
17868,
18064,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if self.nattype == 'good' or self.nattype == 'bad': | if _debug: print 'getting local candidates for nattype=', self.nattype if self.nattype == 'good' or self.nattype == 'bad' or self.nat and (self.nattype is None): | def _getLocalCandidates(self, mediasock): local = [getlocaladdr(mediasock)] # first element is local-addr if self.nattype == 'good' or self.nattype == 'bad': # get STUN address for media response, external = yield stun.request(mediasock) local.append(external) raise StopIteration(local) | aab2af81ac31ff006c7d2fa7fb2cc9dfab0bdfbe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8022/aab2af81ac31ff006c7d2fa7fb2cc9dfab0bdfbe/voip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
2042,
18455,
12,
2890,
16,
6735,
1795,
975,
4672,
1191,
273,
306,
588,
3729,
4793,
12,
2937,
1795,
975,
25887,
468,
1122,
930,
353,
1191,
17,
4793,
309,
389,
4148,
30,
1172,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
2042,
18455,
12,
2890,
16,
6735,
1795,
975,
4672,
1191,
273,
306,
588,
3729,
4793,
12,
2937,
1795,
975,
25887,
468,
1122,
930,
353,
1191,
17,
4793,
309,
389,
4148,
30,
1172,
... |
def copyFuncRecursive(self, block, namePrefix, newBlock, illegalBlocks): | def copyFuncRecursive(self, block, namePrefix, newBlock, illegalBlocks, recursionDepth=0): | def copyFuncRecursive(self, block, namePrefix, newBlock, illegalBlocks): ''' Copy block into newBlock recursively. Copies all statements of block and all statements of blocks that are executed in this block, recursively. block : A block definition namePrefix : a tuple of strings. prefix for all variable names. newBlock : the statements are copied here illegalBlocks : blocks (functions) that can not be called (included) in this context. ''' #TODO:Protect against infinite recursion for statement in block: #Block execution statement: include the called blocks variables if isinstance(statement, NodeFuncExecute): subBlockName = namePrefix + statement.funcName #dotted block name subModelName = subBlockName[:-1] #name of model, where block is defined | bbd1e75a7efad5139e664cf3d01186028f01338e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2720/bbd1e75a7efad5139e664cf3d01186028f01338e/simlparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
2622,
10483,
12,
2890,
16,
1203,
16,
508,
2244,
16,
28482,
16,
16720,
6450,
16,
13917,
6148,
33,
20,
4672,
9163,
5631,
1203,
1368,
28482,
8536,
18,
28506,
606,
777,
6317,
434,
1203... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
2622,
10483,
12,
2890,
16,
1203,
16,
508,
2244,
16,
28482,
16,
16720,
6450,
16,
13917,
6148,
33,
20,
4672,
9163,
5631,
1203,
1368,
28482,
8536,
18,
28506,
606,
777,
6317,
434,
1203... |
this = apply(_quickfix.new_MDEntryRefID, args) | this = _quickfix.new_MDEntryRefID(*args) | def __init__(self, *args): this = apply(_quickfix.new_MDEntryRefID, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
6188,
1622,
1957,
734,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
6188,
1622,
1957,
734,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... |
if encoding: try: text = _encode(text, encoding) except UnicodeError: return _encode_entity(text) | def _escape_cdata(text, encoding=None): # escape character data try: if encoding: try: text = _encode(text, encoding) except UnicodeError: return _encode_entity(text) text = text.replace("&", "&") text = text.replace("<", "<") text = text.replace(">", ">") return text except (TypeError, AttributeError): _raise_serialization_error(text) | d7657fbd21edb2a284db95beac93d0fb6cf519f0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/d7657fbd21edb2a284db95beac93d0fb6cf519f0/ElementTree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6939,
67,
71,
892,
12,
955,
16,
2688,
33,
7036,
4672,
468,
4114,
3351,
501,
775,
30,
977,
273,
977,
18,
2079,
2932,
10,
3113,
7830,
931,
4868,
13,
977,
273,
977,
18,
2079,
2932,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6939,
67,
71,
892,
12,
955,
16,
2688,
33,
7036,
4672,
468,
4114,
3351,
501,
775,
30,
977,
273,
977,
18,
2079,
2932,
10,
3113,
7830,
931,
4868,
13,
977,
273,
977,
18,
2079,
2932,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.