rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
mode = 'rb' mode = '*' + mode return open(name, mode)
mode = '*' + mode[0] return openrf(name, mode)
def openrsrc(name, *mode):
d9300e7ae7f704ad263013ec13346104b4bba7ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9300e7ae7f704ad263013ec13346104b4bba7ba/binhex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 86, 4816, 12, 529, 16, 380, 3188, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 86, 4816, 12, 529, 16, 380, 3188, 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, ...
print "Error: Got less than 2 P-S Pairs."
err = "Error: Less than 2 P-S Pairs!" appendTextview(self.textviewStdErr, err)
def showWadati(self): """ Shows a Wadati diagram plotting P time in (truncated) Julian seconds against S-P time for every station and doing a linear regression using rpy. An estimate of Vp/Vs is given by the slope + 1. """ import rpy pTimes = [] spTimes = [] stations = [] for i in range(len(self.dicts)): if self.dicts[i].has_key('P') and self.dicts[i].has_key('S'): p = self.streams[i][0].stats.starttime p += self.dicts[i]['P'] p = "%.3f" % p.getTimeStamp() p = float(p[-7:]) pTimes.append(p) sp = self.dicts[i]['S'] - self.dicts[i]['P'] spTimes.append(sp) stations.append(self.dicts[i]['Station']) else: continue if len(pTimes) < 2: print "Error: Got less than 2 P-S Pairs." return my_lsfit = rpy.r.lsfit(pTimes, spTimes) gradient = my_lsfit['coefficients']['X'] intercept = my_lsfit['coefficients']['Intercept'] vpvs = gradient + 1. ressqrsum = 0. for res in my_lsfit['residuals']: ressqrsum += (res ** 2) y0 = 0. x0 = - (intercept / gradient) x1 = max(pTimes) y1 = (gradient * float(x1)) + intercept fig = plt.figure(1001) fig.canvas.set_window_title("Wadati Diagram") ax = fig.add_subplot(111) ax.scatter(pTimes, spTimes) for i in range(len(stations)): ax.text(pTimes[i], spTimes[i], stations[i], va = "top") ax.plot([x0, x1], [y0, y1]) ax.axhline(0, color = "blue", ls = ":") # origin time estimated by wadati plot ax.axvline(x0, color = "blue", ls = ":", label = "origin time from wadati diagram") # origin time from event location if self.dictOrigin.has_key('Time'): otime = "%.3f" % self.dictOrigin['Time'].getTimeStamp() otime = float(otime[-7:]) ax.axvline(otime, color = "red", ls = ":", label = "origin time from event location") ax.text(0.1, 0.7, "Vp/Vs: %.2f\nSum of squared residuals: %.3f" % (vpvs, ressqrsum), transform = ax.transAxes) ax.text(0.1, 0.1, "Origin time from event location", color = "red", transform = ax.transAxes) #ax.axis("auto") ax.set_xlim(min(x0 - 1, otime - 1), max(pTimes) + 1) ax.set_ylim(-1, max(spTimes) + 1) ax.set_xlabel("absolute P times (julian seconds, truncated)") ax.set_xlabel("P-S times (seconds)") fig.canvas.draw() plt.show()
b822b77814749ba0fa0b0a638d2c2e8ccf514f6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/b822b77814749ba0fa0b0a638d2c2e8ccf514f6c/obspyck.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 59, 361, 270, 77, 12, 2890, 4672, 3536, 9674, 87, 279, 678, 361, 270, 77, 19750, 20947, 453, 813, 316, 261, 23558, 690, 13, 30294, 3974, 5314, 348, 17, 52, 813, 364, 3614, 13282,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 59, 361, 270, 77, 12, 2890, 4672, 3536, 9674, 87, 279, 678, 361, 270, 77, 19750, 20947, 453, 813, 316, 261, 23558, 690, 13, 30294, 3974, 5314, 348, 17, 52, 813, 364, 3614, 13282,...
reader = itk.ImageFileReader.IUC3.New()
pipe_in, pipe_out = multiprocessing.Pipe() sp = ItktoVtk(pipe_in, filename) sp.start() while 1: msg = pipe_out.recv() if(msg is None): break filename = pipe_out.recv() reader = vtk.vtkXMLImageDataReader()
def ReadAnalyze(filename): reader = itk.ImageFileReader.IUC3.New() reader.SetFileName(filename) reader.Update() x_spacing = reader.GetOutput().GetSpacing().GetElement(0) y_spacing = reader.GetOutput().GetSpacing().GetElement(1) z_spacing = reader.GetOutput().GetSpacing().GetElement(2) spacing = (x_spacing, y_spacing, z_spacing) glue = ItkVtkGlue.ImageToVTKImageFilter.IUC3.New() glue.SetInput(reader.GetOutput()) glue.Update() imagedata = vtk.vtkImageData() imagedata.DeepCopy(glue.GetOutput()) imagedata.SetSpacing(spacing) return imagedata
55dd5d8d1e6f5ee614eb8988f1b865435c5ff492 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10228/55dd5d8d1e6f5ee614eb8988f1b865435c5ff492/analyze_reader.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2720, 31984, 12, 3459, 4672, 225, 6010, 67, 267, 16, 6010, 67, 659, 273, 21828, 18, 11546, 1435, 225, 1694, 273, 2597, 79, 869, 58, 16099, 12, 14772, 67, 267, 16, 1544, 13, 1694, 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, 2720, 31984, 12, 3459, 4672, 225, 6010, 67, 267, 16, 6010, 67, 659, 273, 21828, 18, 11546, 1435, 225, 1694, 273, 2597, 79, 869, 58, 16099, 12, 14772, 67, 267, 16, 1544, 13, 1694, 18, ...
print input_lines, output_lines
def simple_parser(lines): """ Parse a docstring for parameters and returns with unit notation Parameters ---------- lines : list of str The lines of the text with the whitespace stripped. Returns ------- input_lines : list of str output_lines : list of str The lines of the 'parameters' and 'returns' sections which contain ':' Notes ----- This is a fast alternative to using docutils to parse restructured text in docstrings, which is a comparatively expensive operation. This version is about 15 times faster. This passes the same unit tests as the original. """ last_line = '' section = '' input_lines = [] output_lines = [] for line in lines: section_match = section_marker.match(line) if section_match is not None: if section_match.end() - section_match.start() >= len(last_line): section = last_line.lower() elif ':' in line: if section == 'parameters': input_lines.append(line) elif section == 'returns': output_lines.append(line) last_line = line print input_lines, output_lines return input_lines, output_lines
2be86f466d5af9a5a2b127457951cf8588eaac7d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13168/2be86f466d5af9a5a2b127457951cf8588eaac7d/has_units.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4143, 67, 4288, 12, 3548, 4672, 3536, 2884, 279, 14525, 364, 1472, 471, 1135, 598, 2836, 12155, 225, 7012, 12181, 225, 2362, 294, 666, 434, 609, 1021, 2362, 434, 326, 977, 598, 326, 7983...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4143, 67, 4288, 12, 3548, 4672, 3536, 2884, 279, 14525, 364, 1472, 471, 1135, 598, 2836, 12155, 225, 7012, 12181, 225, 2362, 294, 666, 434, 609, 1021, 2362, 434, 326, 977, 598, 326, 7983...
shared['date'] = album.getEarliestReleaseDate() or '' if shared['date'] and config_get('year_only', False): shared['date'] = shared['date'].split('-')[0]
def __save(self, widget=None, response=None): """Writes values to Song objects.""" self._qthread.stop() if response != gtk.RESPONSE_ACCEPT: self.destroy() return
f02dd4bee6a524e5136471a21a81e079fe6300c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4764/f02dd4bee6a524e5136471a21a81e079fe6300c2/brainz.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 5688, 12, 2890, 16, 3604, 33, 7036, 16, 766, 33, 7036, 4672, 3536, 8368, 924, 358, 348, 932, 2184, 12123, 365, 6315, 85, 5930, 18, 5681, 1435, 309, 766, 480, 22718, 18, 14508, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 5688, 12, 2890, 16, 3604, 33, 7036, 16, 766, 33, 7036, 4672, 3536, 8368, 924, 358, 348, 932, 2184, 12123, 365, 6315, 85, 5930, 18, 5681, 1435, 309, 766, 480, 22718, 18, 14508, 67...
return apply(Chooser, (), options).show()
global _chooser if not _chooser: _chooser = apply(Chooser, (), options) return _chooser.show(color)
def askcolor(color = None, **options): """Ask for a color""" return apply(Chooser, (), options).show()
2be858230a1253b773a7e0d004ac84fae785d8b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2be858230a1253b773a7e0d004ac84fae785d8b9/pyColorChooser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6827, 3266, 12, 3266, 273, 599, 16, 2826, 2116, 4672, 3536, 23663, 364, 279, 2036, 8395, 2552, 389, 2599, 13164, 309, 486, 389, 2599, 13164, 30, 389, 2599, 13164, 273, 2230, 12, 17324, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6827, 3266, 12, 3266, 273, 599, 16, 2826, 2116, 4672, 3536, 23663, 364, 279, 2036, 8395, 2552, 389, 2599, 13164, 309, 486, 389, 2599, 13164, 30, 389, 2599, 13164, 273, 2230, 12, 17324, 1...
self.dns_send (request, when)
self.dns_send (request, time.time ())
def dns_timedout (self, uid): try: request = self.dns_pending.pop (uid) except KeyError: return request.dns_failover += 1 if request.dns_failover < ( len (request.dns_servers) * self.dns_failover ): # continue with the next peer and a new time request.dns_peer = ( request.dns_servers[ request.dns_failover % len ( request.dns_servers ) ], 53 ) self.dns_send (request, when) else: # ... or finalize ... self.dns_finalize (request)
249fd63c5c2ea738b638f06952e522ff8d1fc1e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2577/249fd63c5c2ea738b638f06952e522ff8d1fc1e7/dns_client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6605, 67, 20905, 659, 261, 2890, 16, 4555, 4672, 775, 30, 590, 273, 365, 18, 14926, 67, 9561, 18, 5120, 261, 1911, 13, 1335, 4999, 30, 327, 225, 590, 18, 14926, 67, 6870, 1643, 1011, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6605, 67, 20905, 659, 261, 2890, 16, 4555, 4672, 775, 30, 590, 273, 365, 18, 14926, 67, 9561, 18, 5120, 261, 1911, 13, 1335, 4999, 30, 327, 225, 590, 18, 14926, 67, 6870, 1643, 1011, ...
index = os.path.join(self.publicDir(), "status.html")
index = join(self.publicDir(), "status.html")
def saveStatus(self, items, done=False): """Write out an HTML file with the status for this wiki's dump and links to completed files.""" html = self.reportStatus(items, done) index = os.path.join(self.publicDir(), "index.html") dumpFile(index, html) # Short line for report extraction html = self.reportDatabase(items, done) index = os.path.join(self.publicDir(), "status.html") dumpFile(index, html)
c1e41d0df268fd361b14ee90cb5a928232b4e8fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9870/c1e41d0df268fd361b14ee90cb5a928232b4e8fb/WikiBackup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 1482, 12, 2890, 16, 1516, 16, 2731, 33, 8381, 4672, 3536, 3067, 596, 392, 3982, 585, 598, 326, 1267, 364, 333, 9050, 1807, 4657, 471, 4716, 358, 5951, 1390, 12123, 1729, 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, 1923, 1482, 12, 2890, 16, 1516, 16, 2731, 33, 8381, 4672, 3536, 3067, 596, 392, 3982, 585, 598, 326, 1267, 364, 333, 9050, 1807, 4657, 471, 4716, 358, 5951, 1390, 12123, 1729, 273, 365, ...
"""Add mod group links.""" def __init__(self): """Initialize.""" self.column = 'group' self.setKey = 'bash.mods.groups' self.editMenu = _('Edit Groups...') self.editWindow = _('Groups') self.addPrompt = _('Add group:') self.idList = ID_GROUPS Mod_Labels.__init__(self) def AppendToMenu(self,menu,window,data): """Append label list to menu.""" if not settings.get('bash.balo.full'): Mod_Labels.AppendToMenu(self,menu,window,data)
"""Add mod group links.""" def __init__(self): """Initialize.""" self.column = 'group' self.setKey = 'bash.mods.groups' self.editMenu = _('Edit Groups...') self.editWindow = _('Groups') self.addPrompt = _('Add group:') self.idList = ID_GROUPS Mod_Labels.__init__(self) def AppendToMenu(self,menu,window,data): """Append label list to menu.""" if not settings.get('bash.balo.full'): Mod_Labels.AppendToMenu(self,menu,window,data)
def DoEdit(self,event): """Show label editing dialog.""" data = Mod_LabelsData(self.window,self) dialog = balt.ListEditor(self.window,-1,self.editWindow,data) dialog.ShowModal() dialog.Destroy()
3ac43907fa076fea1e8d682219e2b28fc7419f7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/3ac43907fa076fea1e8d682219e2b28fc7419f7b/basher.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2256, 4666, 12, 2890, 16, 2575, 4672, 3536, 5706, 1433, 15755, 6176, 12123, 501, 273, 3431, 67, 5888, 751, 12, 2890, 18, 5668, 16, 2890, 13, 6176, 273, 324, 2390, 18, 682, 6946, 12, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2256, 4666, 12, 2890, 16, 2575, 4672, 3536, 5706, 1433, 15755, 6176, 12123, 501, 273, 3431, 67, 5888, 751, 12, 2890, 18, 5668, 16, 2890, 13, 6176, 273, 324, 2390, 18, 682, 6946, 12, 28...
return self._run_cmd([self.exe, 'identify', '-t']).strip() or None
params = ['identify', '-t'] params.extend(['--config', 'defaults.identify=']) return self._run_cmd([self.exe, *params]).strip() or None
def get_tag(self): return self._run_cmd([self.exe, 'identify', '-t']).strip() or None
4e1180ae701f791152c3f2e1e49a01286e369106 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/833/4e1180ae701f791152c3f2e1e49a01286e369106/managers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2692, 12, 2890, 4672, 327, 365, 6315, 2681, 67, 4172, 3816, 2890, 18, 14880, 16, 296, 31079, 2187, 2400, 88, 3546, 2934, 6406, 1435, 578, 599, 2, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2692, 12, 2890, 4672, 327, 365, 6315, 2681, 67, 4172, 3816, 2890, 18, 14880, 16, 296, 31079, 2187, 2400, 88, 3546, 2934, 6406, 1435, 578, 599, 2, -100, -100, -100, -100, -100, ...
self.hdf['ticket'] = self.ticket self.hdf['ticket.new'] = self.newticket and '1' or '0'
self.hdf['ticket'] = self.ticket.values self.hdf['ticket.new'] = self.newticket
def notify(self, ticket, newticket=1, modtime=0): self.ticket = ticket self.modtime = modtime self.newticket = newticket self.ticket['description'] = wrap(self.ticket.values.get('description', ''), self.COLS, initial_indent=' ', subsequent_indent=' ', linesep=CRLF) self.ticket['link'] = self.env.abs_href.ticket(ticket.id) self.hdf['email.ticket_props'] = self.format_props() self.hdf['email.ticket_body_hdr'] = self.format_hdr() self.hdf['ticket'] = self.ticket self.hdf['ticket.new'] = self.newticket and '1' or '0' subject = self.format_subj() if not self.newticket: subject = 'Re: ' + subject self.hdf['email.subject'] = subject changes = '' if not self.newticket and modtime: # Ticket change changelog = ticket.get_changelog(modtime) for date, author, field, old, new in changelog: self.hdf['ticket.change.author'] = author pfx = 'ticket.change.%s' % field newv = '' if field == 'comment': newv = wrap(new, self.COLS, ' ', ' ', CRLF) elif field == 'description': new_descr = wrap(new, self.COLS, ' ', ' ', CRLF) old_descr = wrap(old, self.COLS, '> ', '> ', CRLF) old_descr = old_descr.replace(2*CRLF, CRLF + '>' + CRLF) cdescr = CRLF cdescr += 'Old description:' + 2*CRLF + old_descr + 2*CRLF cdescr += 'New description:' + 2*CRLF + new_descr + CRLF self.hdf['email.changes_descr'] = cdescr else: newv = new l = 7 + len(field) chg = wrap('%s => %s' % (old, new), self.COLS-l,'', l*' ', CRLF) changes += ' * %s: %s%s' % (field, chg, CRLF) if newv: self.hdf['%s.oldvalue' % pfx] = old self.hdf['%s.newvalue' % pfx] = newv if field == 'cc': self.prev_cc += old and self.parse_cc(old) or [] self.hdf['%s.author' % pfx] = author if changes: self.hdf['email.changes_body'] = changes NotifyEmail.notify(self, ticket.id, subject)
15362435211f6b9ceaf2f6e80d6555e1f9c0ae6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/15362435211f6b9ceaf2f6e80d6555e1f9c0ae6e/Notify.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5066, 12, 2890, 16, 9322, 16, 394, 16282, 33, 21, 16, 681, 957, 33, 20, 4672, 365, 18, 16282, 273, 9322, 365, 18, 1711, 957, 273, 681, 957, 365, 18, 2704, 16282, 273, 394, 16282, 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, 5066, 12, 2890, 16, 9322, 16, 394, 16282, 33, 21, 16, 681, 957, 33, 20, 4672, 365, 18, 16282, 273, 9322, 365, 18, 1711, 957, 273, 681, 957, 365, 18, 2704, 16282, 273, 394, 16282, 365...
Faster without Pysco.
Faster without Psyco.
def getPercent(img, nbpix) : """Extracts the percents per color component from a picture. Faster without Pysco. """ result = {} bands = img.split() for (i, bandname) in enumerate(img.getbands()) : result[bandname] = 100.0 * (reduce(lambda current, next: current + (next[1] * next[0]), enumerate(bands[i].histogram()), 0) / 255.0) / nbpix return result
d7d0aa95aaf557a06e597a46ad2c05354b4c894a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/486/d7d0aa95aaf557a06e597a46ad2c05354b4c894a/inkcoverage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22612, 2998, 12, 6081, 16, 4264, 14861, 13, 294, 3536, 12809, 326, 5551, 87, 1534, 2036, 1794, 628, 279, 15406, 18, 225, 478, 2440, 2887, 453, 9009, 2894, 18, 3536, 563, 273, 2618, 18960...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22612, 2998, 12, 6081, 16, 4264, 14861, 13, 294, 3536, 12809, 326, 5551, 87, 1534, 2036, 1794, 628, 279, 15406, 18, 225, 478, 2440, 2887, 453, 9009, 2894, 18, 3536, 563, 273, 2618, 18960...
cursor.execute("SELECT privkey FROM `keys` WHERE pubkey = %s", (pubkey)) except MySQLdb.Error: raise InternalError("Failed getting private key: " + traceback.format_exc()) if cursor.rowcount != 1: raise DoesNotExistError("No private key corresponding to the public key: " + pubkey)
try: cursor.execute("SELECT privkey FROM `keys` WHERE pubkey = %s", (pubkey)) except MySQLdb.Error: raise InternalError("Failed getting private key: " + traceback.format_exc()) if cursor.rowcount != 1: raise DoesNotExistError("No private key corresponding to the public key: " + pubkey) return cursor.fetchone()[0]
def get_private_key(pubkey): """ <Purpose> Get a private key from the key database. <Arguments> pubkey The public key whose corresponding private key should be returned. <Exceptions> DoesNotExistError If there is no private key stored that corresponds to pubkey. <Side Effects> None <Returns> The private key that corresponds to pubkey. """ assert_str(pubkey) cursor = connection.cursor() try: # Note: `keys` is a reserved mysql keyword so must be quoted. cursor.execute("SELECT privkey FROM `keys` WHERE pubkey = %s", (pubkey)) except MySQLdb.Error: raise InternalError("Failed getting private key: " + traceback.format_exc()) if cursor.rowcount != 1: raise DoesNotExistError("No private key corresponding to the public key: " + pubkey) privkey = cursor.fetchone()[0] cursor.close() return privkey
33e3a0fa590d7f026bfc2344ebf735b4c41060b5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/33e3a0fa590d7f026bfc2344ebf735b4c41060b5/keydb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1152, 67, 856, 12, 23428, 4672, 3536, 411, 10262, 4150, 34, 968, 279, 3238, 498, 628, 326, 498, 2063, 18, 411, 4628, 34, 15649, 1021, 1071, 498, 8272, 4656, 3238, 498, 1410, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1152, 67, 856, 12, 23428, 4672, 3536, 411, 10262, 4150, 34, 968, 279, 3238, 498, 628, 326, 498, 2063, 18, 411, 4628, 34, 15649, 1021, 1071, 498, 8272, 4656, 3238, 498, 1410, 5...
' '.join (xml_utf8.xml_cdatas (e))
' '.join (xml_utf8.xml_cdatas (dom.xml_root))
def articulate_enclosure (self, dom): # validate the CDATA as an XML string, use the default # XML_element class only and do not even try to articulate # unknown "foreign" markup (derived class may cleanse or # recode the original CDATA first, for instance HTML using # Tidy and some UNICODE magic ... but that's another story). # valid = xml_dom.XML_dom () valid.xml_unicoding = 0 valid.xml_parser_reset () e = valid.xml_parse_string (self.xml_first) if not e: self.xml_first = self.xml_children = None return # drop any markup, add whitespaces between CDATAs SAT_STRIP = self.SAT_STRIP or dom.SAT_STRIP self.pns_object = ( ' '.join (xml_utf8.xml_cdatas (e)) ).strip (SAT_STRIP) if not self.pns_object: self.xml_first = self.xml_children = None return # articulate cleansed CDATA SAT_RE = self.SAT_RE or dom.SAT_RE SAT_HORIZON = self.SAT_HORIZON or dom.SAT_HORIZON pns_sat.pns_sat_chunk ( self.pns_object, self.pns_horizon, self.pns_sats, SAT_STRIP, SAT_RE, SAT_HORIZON, ) if ( len (self.pns_sats) > 1 and len (self.pns_horizon) < SAT_HORIZON ): self.pns_subject = pns_model.pns_name ( netstring.encode (self.pns_sats), set () ) elif len (self.pns_sats) > 0: self.pns_subject = self.pns_sats[0][0] if self.pns_subject == self.pns_object: self.pns_object = '' # get a valid XML string, prefixed and with namespace # declarations but without processing intstructions. # this *is* <?xml version="1.0" encoding="UTF-8"?> # self.xml_string = xml_utf8.xml_string ( e, valid.xml_prefixes, '' ) self.xml_first = self.xml_children = None # # Note that it writes back *valid* XML, complete with # namespace declaration. this will quickly overflow the # PNS/UDP datagram limit (1024 8-bit bytes), but that's a # feature not a bug. PNS is made to articulate microformat, # it is not and XML database ... yet. # # A true Metabase should use 4KBytes PNS/UDP datagrams. # # That's more than enough room to store a quite large and # undispersed XML "porte-manteaux".
6e7bd7d11a8445f0bdfd6fd933998ba0813b79f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2577/6e7bd7d11a8445f0bdfd6fd933998ba0813b79f7/pns_xml.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3688, 335, 6243, 67, 1331, 5919, 261, 2890, 16, 4092, 4672, 468, 1954, 326, 28294, 487, 392, 3167, 533, 16, 999, 326, 805, 468, 3167, 67, 2956, 667, 1338, 471, 741, 486, 5456, 775, 358...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3688, 335, 6243, 67, 1331, 5919, 261, 2890, 16, 4092, 4672, 468, 1954, 326, 28294, 487, 392, 3167, 533, 16, 999, 326, 805, 468, 3167, 67, 2956, 667, 1338, 471, 741, 486, 5456, 775, 358...
'th': u'ไร้ภาพ', 'zh-hk': u'書面語', 'zh-tw': u'書面語'
'th': u'ไร้ภาพ', 'zh-hk': u'書面語', 'zh-tw': u'書面語'
def __init__(self): family.Family.__init__(self) self.name = 'uncyclopedia'
5291e54d99c50e05679c62b06fbab03ab3f57e0d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/5291e54d99c50e05679c62b06fbab03ab3f57e0d/uncyclopedia_family.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 6755, 18, 9203, 16186, 2738, 972, 12, 2890, 13, 365, 18, 529, 273, 296, 551, 93, 7550, 1845, 1155, 11, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 6755, 18, 9203, 16186, 2738, 972, 12, 2890, 13, 365, 18, 529, 273, 296, 551, 93, 7550, 1845, 1155, 11, 2, -100, -100, -100, -100, -100, -100, -100, -10...
self.assert_(isinstance(fstype, _ped.FileSystemType)
self.assert_(isinstance(fstype, _ped.FileSystemType))
def runTest(self): fstype = _ped.file_system_type_get("ext3")
aab2b98f1a5e552a9e7610f35aea687a73c8db33 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5978/aab2b98f1a5e552a9e7610f35aea687a73c8db33/test_filesystemtype.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 4709, 12, 2890, 4672, 20223, 388, 273, 389, 1845, 18, 768, 67, 4299, 67, 723, 67, 588, 2932, 408, 23, 7923, 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, 1086, 4709, 12, 2890, 4672, 20223, 388, 273, 389, 1845, 18, 768, 67, 4299, 67, 723, 67, 588, 2932, 408, 23, 7923, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
>>> element = ET.Element("tag", key="value")
>>> element = ET.Element("t\xe4g", key="value")
def interface(): """ Test element tree interface. >>> element = ET.Element("tag") >>> check_element(element) >>> tree = ET.ElementTree(element) >>> check_element(tree.getroot()) >>> element = ET.Element("tag", key="value") >>> tree = ET.ElementTree(element) >>> repr(element) # doctest: +ELLIPSIS "<Element 'tag' at 0x...>" Make sure all standard element methods exist. >>> check_method(element.append) >>> check_method(element.extend) >>> check_method(element.insert) >>> check_method(element.remove) >>> check_method(element.getchildren) >>> check_method(element.find) >>> check_method(element.iterfind) >>> check_method(element.findall) >>> check_method(element.findtext) >>> check_method(element.clear) >>> check_method(element.get) >>> check_method(element.set) >>> check_method(element.keys) >>> check_method(element.items) >>> check_method(element.iter) >>> check_method(element.itertext) >>> check_method(element.getiterator) These methods return an iterable. See bug 6472. >>> check_method(element.iter("tag").next) >>> check_method(element.iterfind("tag").next) >>> check_method(element.iterfind("*").next) >>> check_method(tree.iter("tag").next) >>> check_method(tree.iterfind("tag").next) >>> check_method(tree.iterfind("*").next) These aliases are provided: >>> assert ET.XML == ET.fromstring >>> assert ET.PI == ET.ProcessingInstruction >>> assert ET.XMLParser == ET.XMLTreeBuilder """
e2e81e8fcd41413d31a1a4a078128c478bc73b9a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/e2e81e8fcd41413d31a1a4a078128c478bc73b9a/test_xml_etree.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1560, 13332, 3536, 7766, 930, 2151, 1560, 18, 225, 4080, 930, 273, 4518, 18, 1046, 2932, 2692, 7923, 4080, 866, 67, 2956, 12, 2956, 13, 4080, 2151, 273, 4518, 18, 1046, 2471, 12, 2956, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1560, 13332, 3536, 7766, 930, 2151, 1560, 18, 225, 4080, 930, 273, 4518, 18, 1046, 2932, 2692, 7923, 4080, 866, 67, 2956, 12, 2956, 13, 4080, 2151, 273, 4518, 18, 1046, 2471, 12, 2956, ...
self.config.read(fp)
self.config.readfp(fp)
def _fetch(self): """ Update memory stucture using our cache file """ try: self.log.info("Reading my UUID Cache File %s" % (self.cachePath)) fp = open(self.cachePath, 'rb') self.config.read(fp) fp.close() except Exception, e: self.log.warn("Can't read my UUID Cache File %s : %s" % (self.cachePath, e)) return False return True
5a724544bf3c6bf74803eec515ff94ed45bf1a09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5988/5a724544bf3c6bf74803eec515ff94ed45bf1a09/cache.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5754, 12, 2890, 4672, 3536, 2315, 3778, 384, 853, 594, 1450, 3134, 1247, 585, 3536, 775, 30, 365, 18, 1330, 18, 1376, 2932, 15714, 3399, 5866, 4379, 1387, 738, 87, 6, 738, 261, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5754, 12, 2890, 4672, 3536, 2315, 3778, 384, 853, 594, 1450, 3134, 1247, 585, 3536, 775, 30, 365, 18, 1330, 18, 1376, 2932, 15714, 3399, 5866, 4379, 1387, 738, 87, 6, 738, 261, 28...
if uninst_builddir: path = os.path.join(uninst_builddir, 'girepository', 'libgirepository-1.0.la') args.append(path)
def _link(self, output, *sources): args = [] libtool = get_libtool_command(self._options) if libtool: args.extend(libtool) args.append('--mode=link') args.append('--tag=CC') args.append('--silent')
82e08ec5f5f2440ed5be2e5ca5954ebac2eb7775 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2770/82e08ec5f5f2440ed5be2e5ca5954ebac2eb7775/dumper.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1232, 12, 2890, 16, 876, 16, 380, 10141, 4672, 833, 273, 5378, 2561, 6738, 273, 336, 67, 2941, 6738, 67, 3076, 12, 2890, 6315, 2116, 13, 309, 2561, 6738, 30, 833, 18, 14313, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1232, 12, 2890, 16, 876, 16, 380, 10141, 4672, 833, 273, 5378, 2561, 6738, 273, 336, 67, 2941, 6738, 67, 3076, 12, 2890, 6315, 2116, 13, 309, 2561, 6738, 30, 833, 18, 14313, 12, ...
except Exception:
except Exception, e: if isinstance(e, FatalError): raise e
def load(self): config = self._config try: execfile(self.filename, config) except Exception: traceback.print_exc() raise FatalError(_('could not load config file'))
9f97cb52d1241253bac24ff6151350cb49d74b5e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4596/9f97cb52d1241253bac24ff6151350cb49d74b5e/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 12, 2890, 4672, 642, 273, 365, 6315, 1425, 775, 30, 1196, 768, 12, 2890, 18, 3459, 16, 642, 13, 1335, 1185, 16, 425, 30, 309, 1549, 12, 73, 16, 10375, 668, 4672, 565, 1002, 425...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1262, 12, 2890, 4672, 642, 273, 365, 6315, 1425, 775, 30, 1196, 768, 12, 2890, 18, 3459, 16, 642, 13, 1335, 1185, 16, 425, 30, 309, 1549, 12, 73, 16, 10375, 668, 4672, 565, 1002, 425...
items += [ MenuItem(title, function, item) ]
items += [ MenuItem(title, function) ]
def make_submenu(self, menu_name, actions, item): items = [] for function, title in actions: items += [ MenuItem(title, function, item) ] xml_file = None if hasattr(item, 'xml_file'): xml_file = item.xml_file
58489e00eb667af124fb965e83a6e2f5617c7a14 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/58489e00eb667af124fb965e83a6e2f5617c7a14/menu.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 1717, 5414, 12, 2890, 16, 3824, 67, 529, 16, 4209, 16, 761, 4672, 1516, 273, 5378, 364, 445, 16, 2077, 316, 4209, 30, 1516, 1011, 306, 25085, 12, 2649, 16, 445, 13, 308, 20...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 1717, 5414, 12, 2890, 16, 3824, 67, 529, 16, 4209, 16, 761, 4672, 1516, 273, 5378, 364, 445, 16, 2077, 316, 4209, 30, 1516, 1011, 306, 25085, 12, 2649, 16, 445, 13, 308, 20...
if host: self.connect(host, port)
if host: (code, msg) = self.connect(host, port) if code != 220: raise SMTPConnectError(code, msg)
def __init__(self, host = '', port = 0): """Initialize a new instance.
053a07b597f875016b8bc478c8a905c8baf4efe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/053a07b597f875016b8bc478c8a905c8baf4efe4/smtplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1479, 273, 10226, 1756, 273, 374, 4672, 3536, 7520, 279, 394, 791, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1479, 273, 10226, 1756, 273, 374, 4672, 3536, 7520, 279, 394, 791, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
raise MailUsageError, '''
raise MailUsageError, _("""
def handle_message(self, message): ''' message - a Message instance
f9457e5e409c6363bf37d5634a3c77d621f1a603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f9457e5e409c6363bf37d5634a3c77d621f1a603/mailgw.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 2150, 12, 2890, 16, 883, 4672, 9163, 883, 300, 279, 2350, 791, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 2150, 12, 2890, 16, 883, 4672, 9163, 883, 300, 279, 2350, 791, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
label.setAttribute("x", "-45")
label.setAttribute("x", "-%s" % (44 + len("%s" % (element._units,)) * 23,))
def visitRackElement(self, element, pos): """ @param element the element to render @param pos position in the rack of this element """ # e is our rack element e = self._image.createElement("g") title = self._image.createElement("title") title.appendChild(self._image.createTextNode("rack element")) e.appendChild(title)
864e40830e50f320c5491647f8febfe0c8a58ee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5639/864e40830e50f320c5491647f8febfe0c8a58ee7/rackview.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 54, 484, 1046, 12, 2890, 16, 930, 16, 949, 4672, 3536, 632, 891, 930, 326, 930, 358, 1743, 632, 891, 949, 1754, 316, 326, 19495, 434, 333, 930, 3536, 468, 425, 353, 3134, 19495, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 54, 484, 1046, 12, 2890, 16, 930, 16, 949, 4672, 3536, 632, 891, 930, 326, 930, 358, 1743, 632, 891, 949, 1754, 316, 326, 19495, 434, 333, 930, 3536, 468, 425, 353, 3134, 19495, ...
if buf is None:
if not buf:
def read_value(addr_space, value_type, vaddr): """ Read the low-level value for a built-in type. """ if not builtin_types.has_key(value_type): raise Exception('Invalid built-in type %s' % (value_type)) type_unpack_char = builtin_types[value_type][1] type_size = builtin_types[value_type][0] buf = addr_space.read(vaddr, type_size) if buf is None: return None (val, ) = struct.unpack('='+type_unpack_char, buf) return val
f9f48e7b60a1e30cf24b4557967082f056e2f8e5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6927/f9f48e7b60a1e30cf24b4557967082f056e2f8e5/object.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 1132, 12, 4793, 67, 2981, 16, 460, 67, 723, 16, 331, 4793, 4672, 3536, 2720, 326, 4587, 17, 2815, 460, 364, 279, 6650, 17, 267, 618, 18, 3536, 225, 309, 486, 15273, 67, 2352...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 1132, 12, 4793, 67, 2981, 16, 460, 67, 723, 16, 331, 4793, 4672, 3536, 2720, 326, 4587, 17, 2815, 460, 364, 279, 6650, 17, 267, 618, 18, 3536, 225, 309, 486, 15273, 67, 2352...
self._encoding_combo.set_active(0)
def _init_encoding_data(self): """Initialize encoding combo box data."""
bcde01d42b6f1ada4a089d0435d8eeea8d068f3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12852/bcde01d42b6f1ada4a089d0435d8eeea8d068f3e/filechooser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2738, 67, 5999, 67, 892, 12, 2890, 4672, 3536, 7520, 2688, 16778, 3919, 501, 12123, 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, 2738, 67, 5999, 67, 892, 12, 2890, 4672, 3536, 7520, 2688, 16778, 3919, 501, 12123, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.cu.execute("""UPDATE tmpSha1s SET sha1=? WHERE streamId=?""", sha1, streamId, start_transaction=False)
self.cu.execute("INSERT INTO tmpSha1s (streamId, sha1) VALUES (?,?)", (sha1, streamId), start_transaction=False)
def migrate(self): self.message('WARNING: do NOT try to interrupt this migration, you will leave your DB in a messy state')
03e40c53e137197d582f524aa5e66be4e0a87a5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/03e40c53e137197d582f524aa5e66be4e0a87a5d/schema.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13187, 12, 2890, 4672, 365, 18, 2150, 2668, 9511, 30, 741, 4269, 775, 358, 13123, 333, 6333, 16, 1846, 903, 8851, 3433, 2383, 316, 279, 12755, 93, 919, 6134, 2, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 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, 13187, 12, 2890, 4672, 365, 18, 2150, 2668, 9511, 30, 741, 4269, 775, 358, 13123, 333, 6333, 16, 1846, 903, 8851, 3433, 2383, 316, 279, 12755, 93, 919, 6134, 2, -100, -100, -100, -100, ...
class KeepaliveServerTestCase(BaseServerTestCase):
class BaseKeepaliveServerTestCase(BaseServerTestCase):
def test_dotted_attribute(self): # Raises an AttributeError because private methods are not allowed. self.assertRaises(AttributeError, SimpleXMLRPCServer.resolve_dotted_attribute, str, '__add')
0369ba2a4a921fc32d611b4bbd5eefe32f3b0f22 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/0369ba2a4a921fc32d611b4bbd5eefe32f3b0f22/test_xmlrpc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 9811, 2344, 67, 4589, 12, 2890, 4672, 468, 20497, 392, 6394, 2724, 3238, 2590, 854, 486, 2935, 18, 365, 18, 11231, 12649, 6141, 12, 1499, 668, 16, 4477, 4201, 8087, 2081, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 9811, 2344, 67, 4589, 12, 2890, 4672, 468, 20497, 392, 6394, 2724, 3238, 2590, 854, 486, 2935, 18, 365, 18, 11231, 12649, 6141, 12, 1499, 668, 16, 4477, 4201, 8087, 2081, 18, ...
if patch.get('url'): curl_process = subprocess.Popen(['curl', '--silent', '--show-error', patch['url']], stdout=subprocess.PIPE) patch_apply_process = subprocess.Popen(args, stdin=curl_process.stdout) elif patch.get('diff'): patch_apply_process = subprocess.Popen(args, stdin=subprocess.PIPE) patch_apply_process.communicate(patch['diff']) else: error("Unknown patch object.")
patch_apply_process = subprocess.Popen(args, stdin=curl_process.stdout)
def apply_patch(self, patch, force=False): # It's possible that the patch was not made from the root directory. # We should detect and handle that case. patch_apply_process = None args = [self.script_path('svn-apply'), '--reviewer', patch['reviewer']] if force: args.append('--force') if patch.get('url'): curl_process = subprocess.Popen(['curl', '--silent', '--show-error', patch['url']], stdout=subprocess.PIPE) patch_apply_process = subprocess.Popen(args, stdin=curl_process.stdout) elif patch.get('diff'): patch_apply_process = subprocess.Popen(args, stdin=subprocess.PIPE) patch_apply_process.communicate(patch['diff']) else: error("Unknown patch object.")
30f0b38c3cf88026d652f293a0cdd85809b6db76 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/30f0b38c3cf88026d652f293a0cdd85809b6db76/scm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2230, 67, 2272, 12, 2890, 16, 4729, 16, 2944, 33, 8381, 4672, 468, 2597, 1807, 3323, 716, 326, 4729, 1703, 486, 7165, 628, 326, 1365, 1867, 18, 468, 1660, 1410, 5966, 471, 1640, 716, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2230, 67, 2272, 12, 2890, 16, 4729, 16, 2944, 33, 8381, 4672, 468, 2597, 1807, 3323, 716, 326, 4729, 1703, 486, 7165, 628, 326, 1365, 1867, 18, 468, 1660, 1410, 5966, 471, 1640, 716, 6...
subscribe(key, system['base_channel'], system['system_channel'], system['id'])
if not subscribe(key, system['base_channel'], system['system_channel'], system['id'], system['name']): system['no_child'] = True else: system['no_child'] = False
def get_action_results(key, systems): '''Gets action results that have been scheduled''' if options.debug: wait = 5 elif options.verbose: wait = 15 else: wait = 30 complete = False while not complete: for system in systems: if system['skip']: continue if not system['complete']: if options.verbose: print "checking system:", system['name'] script_result = client.system.get_script_results(key, system['action_id']) if options.verbose: print "Script result:", script_result if not script_result == []: if options.verbose: print "%s script result:" % (system['name']) if options.debug: print script_result system['output'] = script_result[0]['output'] system['return_code'] = script_result[0]['returnCode'] system['complete'] = True else: system['complete'] = False if options.verbose: print "%s not done yet" % (system['name']) complete = True for system in systems: if system['skip']: continue if not system['complete']: complete = False if not complete: print "waiting %i seconds for results ..." % (wait) time.sleep(wait) for system in systems: if system['skip']: continue data = system['output'].split('\n') if options.debug: print "DEBUG: Raw output from %s script: %s" %(system['name'], data) for line in data: if options.debug: print "DEBUG: %s checking '%s'" % (system['name'], line) if 'System ID:' in line: if options.verbose: print "Found system_id of:", line.split()[-1] system['system_id'] = line.split()[-1].lower() break else: system['system_id'] = False for system in systems: if system['skip']: continue if options.verbose: print "Output for %s is: %s" % (system['name'], system['system_id']) new_channel = DELL_INFO['label'] + '-' + SYSTEM_VENDOR_ID + '.dev_' + system['system_id'] + '-' + system['base_channel'] system['system_channel'] = new_channel if options.verbose: print "Subscribing %s to channel %s" % (system['name'], system['system_channel']) subscribe(key, system['base_channel'], system['system_channel'], system['id']) return systems
a505c3724245a7ab265bfa6c2d81e21adace87b1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3457/a505c3724245a7ab265bfa6c2d81e21adace87b1/dell-satellite-sync.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1128, 67, 4717, 12, 856, 16, 14908, 4672, 9163, 3002, 1301, 1686, 716, 1240, 2118, 9755, 26418, 309, 702, 18, 4148, 30, 2529, 273, 1381, 1327, 702, 18, 11369, 30, 2529, 273, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1128, 67, 4717, 12, 856, 16, 14908, 4672, 9163, 3002, 1301, 1686, 716, 1240, 2118, 9755, 26418, 309, 702, 18, 4148, 30, 2529, 273, 1381, 1327, 702, 18, 11369, 30, 2529, 273, 4...
""" S = self.star_involution().matrix() - sign
EXAMPLES: sage: ModularSymbols(1,12,0,GF(5)).minus_submodule() Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 3 for Gamma_0(1) of weight 12 with sign 0 over Finite Field of size 5 """ S = self.star_involution().matrix() - self.base_ring()(sign)
def _compute_sign_submodule(self, sign, compute_dual=True): """ Return the subspace of self that is fixed under the star involution.
0e85b58b1d36d7f378b014ec4622522c1c0727c5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/0e85b58b1d36d7f378b014ec4622522c1c0727c5/ambient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9200, 67, 2977, 67, 1717, 2978, 12, 2890, 16, 1573, 16, 3671, 67, 72, 1462, 33, 5510, 4672, 3536, 2000, 326, 720, 2981, 434, 365, 716, 353, 5499, 3613, 326, 10443, 2198, 5889, 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, 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, 9200, 67, 2977, 67, 1717, 2978, 12, 2890, 16, 1573, 16, 3671, 67, 72, 1462, 33, 5510, 4672, 3536, 2000, 326, 720, 2981, 434, 365, 716, 353, 5499, 3613, 326, 10443, 2198, 5889, 18,...
Abelian variety factor of dimension 6 of J0(100)
Abelian subvariety of dimension 6 of J0(100)
def old_quotient(self, p=None): """ Return the old or $p$-old quotient variety of self.
231a556974015ed454b20c5783447e82495d8183 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/231a556974015ed454b20c5783447e82495d8183/abvar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1592, 67, 9270, 1979, 12, 2890, 16, 293, 33, 7036, 4672, 3536, 2000, 326, 1592, 578, 271, 84, 8, 17, 1673, 26708, 1394, 14369, 434, 365, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1592, 67, 9270, 1979, 12, 2890, 16, 293, 33, 7036, 4672, 3536, 2000, 326, 1592, 578, 271, 84, 8, 17, 1673, 26708, 1394, 14369, 434, 365, 18, 2, -100, -100, -100, -100, -100, -100, -100...
msg += "tinderbox: starttime: %s\n" % nowTime
msg += "tinderbox: starttime: %s\n" % startTime
def run(options): treeName = options.tree buildName = options.build fromAddr = "builds@osafoundation.org" toAddr = options.toAddr toDomain = options.toDomain smtpOutbound = "smtp.osafoundation.org" logFile = options.logfile logPath = options.logpath status = options.status logData = None if treeName is None: print "Tree name must be specified" return if buildName is None: print "Build name must be specified" return if logPath is None: logPath = os.getcwd() if logFile: filename = os.path.join(logPath, logFile) if os.path.isfile(filename): try: hFile = file(os.path.join(logPath, logFile), 'r') logData = hFile.readlines() hFile.close() except Exception, e: logData = None print "[silk_tbox] - Unable to import %s%s [%s]\n" % (logPath, logFile, str(e)) else: print "Log file %s not found" % filename nowTime = str(int(time.time())) subject = "[tinderbox] %s from %s" % (status, buildName) msg = ("From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % (fromAddr, toAddr, subject)) msg += "tinderbox: tree: %s\n" % treeName msg += "tinderbox: buildname: %s\n" % buildName msg += "tinderbox: starttime: %s\n" % nowTime msg += "tinderbox: timenow: %s\n" % nowTime msg += "tinderbox: errorparser: unix\n" msg += "tinderbox: status: %s\n" % status msg += "tinderbox: END\n\n" if logData: msg += "".join(logData) print "Sending email to tinderbox server at %s" % toAddr try: server = smtplib.SMTP(smtpOutbound) server.sendmail(fromAddr, toAddr, msg) server.quit() except Exception, e: print "SendMail error", e
bb903968ee455c13648efa39dae22d08776cc05c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/bb903968ee455c13648efa39dae22d08776cc05c/tbox_update.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2116, 4672, 2151, 461, 377, 273, 702, 18, 3413, 1361, 461, 565, 273, 702, 18, 3510, 628, 3178, 377, 273, 315, 27324, 36, 538, 1727, 772, 367, 18, 3341, 6, 358, 3178, 4202, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2116, 4672, 2151, 461, 377, 273, 702, 18, 3413, 1361, 461, 565, 273, 702, 18, 3510, 628, 3178, 377, 273, 315, 27324, 36, 538, 1727, 772, 367, 18, 3341, 6, 358, 3178, 4202, ...
flags = 0x57
flags = 0x07
def _StandardPutFile(prompt, default=None): args = {} flags = 0x57 if prompt: args['message'] = prompt args['preferenceKey'] = 'PyMC' if _movablemodal: args['eventProc'] = None try: rr = Nav.NavPutFile(args) good = 1 except Nav.error, arg: good = 0 fss = macfs.FSSpec(':cancelled') else: fss = rr.selection[0] return fss, good
40a1d8435290b90239f2641431e137f041a0853e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/40a1d8435290b90239f2641431e137f041a0853e/macfsn.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8336, 6426, 812, 12, 13325, 16, 805, 33, 7036, 4672, 833, 273, 2618, 2943, 273, 374, 92, 8642, 309, 6866, 30, 833, 3292, 2150, 3546, 273, 6866, 833, 3292, 19141, 653, 3546, 273, 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, 389, 8336, 6426, 812, 12, 13325, 16, 805, 33, 7036, 4672, 833, 273, 2618, 2943, 273, 374, 92, 8642, 309, 6866, 30, 833, 3292, 2150, 3546, 273, 6866, 833, 3292, 19141, 653, 3546, 273, 2...
for m in required_modules: fun_map.func_globals.setdefault(m, __import__(m)) if 'map_init' in job: fun_init.func_code = marshal.loads(job['map_init'])
def op_map(job): global job_name job_input = this_inputs() msg("Received a new map job!") if len(job_input) != 1: err("Map can only handle one input. Got: %s" % " ".join(job_input)) nr_reduces = int(job['nr_reduces']) required_modules = job['required_modules'].split() fun_map_reader.func_code = marshal.loads(job['map_reader']) fun_map_writer.func_code = marshal.loads(job['map_writer']) fun_partition.func_code = marshal.loads(job['partition']) for m in required_modules: fun_map_reader.func_globals.setdefault(m, __import__(m)) fun_partition.func_globals.setdefault(m, __import__(m)) if 'ext_map' in job: if 'ext_params' in job: map_params = job['ext_params'] else: map_params = "0\n" external.prepare(job['ext_map'], map_params, EXT_MAP % job_name) fun_map.func_code = external.ext_map.func_code else: map_params = cPickle.loads(job['params']) fun_map.func_code = marshal.loads(job['map']) for m in required_modules: fun_map.func_globals.setdefault(m, __import__(m)) if 'map_init' in job: fun_init.func_code = marshal.loads(job['map_init']) if 'combiner' in job: fun_combiner.func_code = marshal.loads(job['combiner']) for m in required_modules: fun_combiner.func_globals.setdefault(m, __import__(m)) partitions = [MapOutput(i, map_params, fun_combiner)\ for i in range(nr_reduces)] else: partitions = [MapOutput(i, map_params) for i in range(nr_reduces)] run_map(job_input[0], partitions, map_params) for p in partitions: p.close() if 'chunked' in job: merge_chunks(partitions) out = "chunk://%s/%s/map-chunk-%d" %\ (this_host(), job_name, this_partition()) else: out = partitions[0].disco_address() external.close_ext() msg("%d %s" % (this_partition(), out), "OUT")
a5b9fcd970850ba1876b80a96249705c508e072a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/373/a5b9fcd970850ba1876b80a96249705c508e072a/disco_worker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1061, 67, 1458, 12, 4688, 4672, 2552, 1719, 67, 529, 225, 1719, 67, 2630, 273, 333, 67, 10029, 1435, 1234, 2932, 8872, 279, 394, 852, 1719, 4442, 13, 225, 309, 562, 12, 4688, 67, 2630,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1061, 67, 1458, 12, 4688, 4672, 2552, 1719, 67, 529, 225, 1719, 67, 2630, 273, 333, 67, 10029, 1435, 1234, 2932, 8872, 279, 394, 852, 1719, 4442, 13, 225, 309, 562, 12, 4688, 67, 2630,...
INPUT:
INPUT::
def explain_picklejar(dir, catch_exceptions=True): r""" Given a directory or a .tar.bz2 of pickles, we unpickle each of them three times: once with cPickle, once with explain_pickle with in_current_sage=True, and once with explain_pickle with in_current_sage=False. We verify that each of these gives the same answer (where we check using repr(a)==repr(b), in case equality is not defined on all of these objects). INPUT: dir -- string; a directory or name of a .tar.bz2 file that decompresses to give a directory full of pickles. catch_exceptions -- boolean; default True: if True, then unpickling exceptions will be caught (and if all three unpicklers raise an exception, then that will be counted as a match). If False, then exceptions will not be caught, and will terminate this function. EXAMPLES: sage: std = os.environ['SAGE_DATA'] + '/extcode/pickle_jar/pickle_jar.tar.bz2' sage: from sage.misc.explain_pickle import * sage: explain_picklejar(std) # long time (~45s on my computer) doctest:...: DeprecationWarning: Your data is stored in an old format. Please use the save() function to store your data in a more recent format. doctest:...: DeprecationWarning: Your data is stored in an old format. Please use the save() function to store your data in a more recent format. doctest:...: DeprecationWarning: RQDF is deprecated; use RealField(212) instead. doctest:...: DeprecationWarning: RQDF is deprecated; use RealField(212) instead. doctest:...: DeprecationWarning: RQDF is deprecated; use RealField(212) instead. 4... matches; 0 mismatches """ # Largely copied from unpickle_all in sage_object.pyx from sage.structure.sage_object import load obj_at = re.compile('object at 0x[0-9a-f]+') n_success = 0 failed = [] if dir.endswith('.tar.bz2'): # create a temporary directory from sage.misc.all import tmp_dir T = tmp_dir() # extract tarball to it os.system('cd "%s"; bunzip2 -c "%s" | tar fx - '%(T, os.path.abspath(dir))) # Now use the directory in the tarball instead of dir dir = T + "/" + os.listdir(T)[0] for A in os.listdir(dir): if A.endswith('.sobj'): fn = dir + '/' + A try: v1 = load(fn) v1r = repr(v1) except Exception, msg: # if not catch_exceptions: raise v1r = 'error' try: exp_current = explain_pickle(file=fn, in_current_sage=True) import sys sys.stderr.write(exp_current) v2 = sage_eval(exp_current) v2r = repr(v2) except Exception, msg: if not catch_exceptions: raise v2r = 'error' try: exp_generic = explain_pickle(file=fn) import sys sys.stderr.write(exp_generic) v3 = sage_eval(exp_generic) v3r = repr(v3) except Exception, msg: if not catch_exceptions: raise v3r = 'error' v1r = obj_at.sub('object at 0x...', v1r) v2r = obj_at.sub('object at 0x...', v2r) v3r = obj_at.sub('object at 0x...', v3r) if v1r == v2r == v3r: n_success += 1 else: print "Mismatch on %s" % fn print v1r, v2r, v3r failed.append(A) print "%d matches; %d mismatches" % (n_success, len(failed)) print '\n'.join(failed)
a4aad1557cdf06ed8562711534ca467dff85c855 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/a4aad1557cdf06ed8562711534ca467dff85c855/explain_pickle.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19765, 67, 20847, 11930, 12, 1214, 16, 1044, 67, 11855, 33, 5510, 4672, 436, 8395, 16803, 279, 1867, 578, 279, 263, 11718, 18, 25292, 22, 434, 6002, 1040, 16, 732, 640, 20847, 1517, 434,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19765, 67, 20847, 11930, 12, 1214, 16, 1044, 67, 11855, 33, 5510, 4672, 436, 8395, 16803, 279, 1867, 578, 279, 263, 11718, 18, 25292, 22, 434, 6002, 1040, 16, 732, 640, 20847, 1517, 434,...
itemList.append('Good')
itemList.append('Good')
def getPilotSummaryWeb(self,selectDict,sortList,startItem,maxItems): """ Get summary of the pilot jobs status by CE/site in a standard structure """
4281b6ebd17e9e6456de007d4a03f9fe1ab6a236 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/4281b6ebd17e9e6456de007d4a03f9fe1ab6a236/PilotAgentsDB.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1689, 22797, 4733, 4079, 12, 2890, 16, 4025, 5014, 16, 3804, 682, 16, 1937, 1180, 16, 1896, 3126, 4672, 3536, 968, 4916, 434, 326, 293, 22797, 6550, 1267, 635, 29538, 19, 4256, 316, 279,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1689, 22797, 4733, 4079, 12, 2890, 16, 4025, 5014, 16, 3804, 682, 16, 1937, 1180, 16, 1896, 3126, 4672, 3536, 968, 4916, 434, 326, 293, 22797, 6550, 1267, 635, 29538, 19, 4256, 316, 279,...
line.unlink(cr, uid, toremove, context=context)
analytic_line_obj.unlink(cr, uid, toremove, context=context)
def create_analytic_lines(self, cr, uid, ids, context={}): super(account_move_line, self).create_analytic_lines(cr, uid, ids, context) for line in self.browse(cr, uid, ids, context): if line.analytics_id: if not line.journal_id.analytic_journal_id: raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (line.journal_id.name,))
f2ee21bc8725b1d69b176d44233f6629ac8894b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f2ee21bc8725b1d69b176d44233f6629ac8894b1/account_analytic_plans.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 304, 7834, 335, 67, 3548, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 12938, 4672, 2240, 12, 4631, 67, 8501, 67, 1369, 16, 365, 2934, 2640, 67, 304, 7834, 335, 67, 3548...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 304, 7834, 335, 67, 3548, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 12938, 4672, 2240, 12, 4631, 67, 8501, 67, 1369, 16, 365, 2934, 2640, 67, 304, 7834, 335, 67, 3548...
if Target == "NT386GNU" or (Target == "NT386" and GCC_BACKEND and OSType == "POSIX"):
if Host == "NT386GNU" or (Host == "NT386" and GCC_BACKEND and TargetOS == "POSIX"):
def SetupEnvironment(): SystemDrive = os.environ.get("SystemDrive", "") if os.environ.get("OS") == "Windows_NT": HostIsNT = True else: HostIsNT = False SystemDrive = os.environ.get("SYSTEMDRIVE") if SystemDrive: SystemDrive += os.path.sep # Do this earlier so that its link isn't a problem. # Looking in the registry HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2 # would be reasonable here. if CM3IsCygwin: _SetupEnvironmentVariableAll( "PATH", ["cygwin1.dll"], os.path.join(SystemDrive, "cygwin", "bin")) # some host/target confusion here.. if Target == "NT386" and HostIsNT and Config == "NT386" and (not GCC_BACKEND) and OSType == "WIN32": VCBin = "" VCInc = "" VCLib = "" MspdbDir = "" # 4.0 e:\MSDEV # 5.0 E:\Program Files\DevStudio\SharedIDE MSDevDir = os.environ.get("MSDEVDIR") # 5.0 MSVCDir = os.environ.get("MSVCDIR") # E:\Program Files\DevStudio\VC # 7.1 Express VCToolkitInstallDir = os.environ.get("VCTOOLKITINSTALLDIR") # E:\Program Files\Microsoft Visual C++ Toolkit 2003 (not set by vcvars32) # 8.0 Express # E:\Program Files\Microsoft Visual Studio 8\VC # E:\Program Files\Microsoft Visual Studio 8\Common7\Tools DevEnvDir = os.environ.get("DevEnvDir") # E:\Program Files\Microsoft Visual Studio 8\Common7\IDE VSInstallDir = os.environ.get("VSINSTALLDIR") # E:\Program Files\Microsoft Visual Studio 8 # VS80CommonTools = os.environ.get("VS80COMNTOOLS") # E:\Program Files\Microsoft Visual Studio 8\Common7\Tools VCInstallDir = os.environ.get("VCINSTALLDIR") # E:\Program Files\Microsoft Visual Studio 8\VC # 9.0 Express # always, global #VS90COMNTOOLS=D:\msdev\90\Common7\Tools\ # after running the shortcut #VCINSTALLDIR=D:\msdev\90\VC #VSINSTALLDIR=D:\msdev\90 VSCommonTools = os.environ.get("VS90COMNTOOLS") if VSCommonTools and not VSInstallDir: VSInstallDir = RemoveLastPathElement(RemoveLastPathElement(VSCommonTools)) # The Windows SDK is carried with the express edition and tricky to find. # Best if folks just run the installed shortcut probably. # We do a pretty good job now of finding it, be need to encode # more paths to known versions. # This is not yet finished. # # Probe the partly version-specific less-polluting environment variables, # from newest to oldest. # That is, having setup alter PATH, INCLUDE, and LIB system-wide is not # a great idea, but having setup set DevEnvDir, VSINSTALLDIR, VS80COMNTOOLS, etc. # isn't so bad and we can temporarily establish the first set from the second # set. if VSInstallDir: # Visual C++ 2005/8.0, at least the Express Edition, free download # also Visual C++ 2008/9.0 Express Edition if not VCInstallDir: VCInstallDir = os.path.join(VSInstallDir, "VC") #print("VCInstallDir:" + VCInstallDir) if not DevEnvDir: DevEnvDir = os.path.join(VSInstallDir, "Common7", "IDE") #print("DevEnvDir:" + DevEnvDir) MspdbDir = DevEnvDir elif VCToolkitInstallDir: # free download Visual C++ 2003; no longer available VCInstallDir = VCToolkitInstallDir elif MSVCDir and MSDevDir: # Visual C++ 5.0 pass # do more research # VCInstallDir = MSVCDir elif MSDevDir: # Visual C++ 4.0, 5.0 pass # do more research # VCInstallDir = MSDevDir else: # This is what really happens on my machine, for 8.0. # It might be good to guide pylib.py to other versions, # however setting things up manually suffices and I have, um, # well automated. Msdev = os.path.join(SystemDrive, "msdev", "80") VCInstallDir = os.path.join(Msdev, "VC") DevEnvDir = os.path.join(Msdev, "Common7", "IDE") if VCInstallDir: VCBin = os.path.join(VCInstallDir, "bin") VCLib = os.path.join(VCInstallDir, "lib") VCInc = os.path.join(VCInstallDir, "include") if DevEnvDir: MspdbDir = DevEnvDir #elif VCBin: # MspdbDir = VCBin # Look for SDKs. # expand this as they are released/discovered # ordering is from newest to oldest PossibleSDKs = [os.path.join("Microsoft SDKs", "Windows", "v6.0A"), "Microsoft Platform SDK for Windows Server 2003 R2"] SDKs = [] for a in GetProgramFiles(): #print("checking " + a) for b in PossibleSDKs: c = os.path.join(a, b) #print("checking " + c) if isdir(c) and not (c in SDKs): SDKs.append(c) # Make sure %INCLUDE% contains errno.h and windows.h. # This doesn't work correctly for Cygwin Python, ok. if _CheckSetupEnvironmentVariableAll("INCLUDE", ["errno.h", "windows.h"], VCInc): for a in SDKs: b = os.path.join(a, "include") if isfile(os.path.join(b, "windows.h")): _SetupEnvironmentVariableAll("INCLUDE", ["errno.h", "windows.h"], VCInc + ";" + b, ";") break # Make sure %LIB% contains kernel32.lib and libcmt.lib. # We carry our own kernel32.lib so we don't look in the SDKs. # We usually use msvcrt.lib and not libcmt.lib, but Express 2003 had libcmt.lib and not msvcrt.lib # I think, and libcmt.lib is always present. _SetupEnvironmentVariableAll( "LIB", ["kernel32.lib", "libcmt.lib"], VCLib + ";" + os.path.join(InstallRoot, "lib")) # Check that cl.exe and link.exe are in path, and if not, add VCBin to it, # checking that they are in it. # # Do this before mspdb*dll because it sometimes gets it in the path. # (Why do we care?) _SetupEnvironmentVariableAll("PATH", ["cl", "link"], VCBin) # If none of mspdb*.dll are in PATH, add MpsdbDir to PATH, and check that one of them is in it. _SetupEnvironmentVariableAny( "PATH", ["mspdb80.dll", "mspdb71.dll", "mspdb70.dll", "mspdb60.dll", "mspdb50.dll", "mspdb41.dll", "mspdb40.dll", "dbi.dll"], MspdbDir) # Try to get mt.exe in %PATH% if it isn't already. # We only need this for certain toolsets. if not SearchPath("mt.exe", os.environ.get("PATH")): for a in SDKs: b = os.path.join(a, "bin") if isfile(os.path.join(b, "mt.exe")): SetEnvironmentVariable("PATH", os.environ.get("PATH") + os.pathsep + b) break # sys.exit(1) # The free Visual C++ 2003 has neither delayimp.lib nor msvcrt.lib. # Very old toolsets have no delayimp.lib. # The Quake config file checks these environment variables. Lib = os.environ.get("LIB") if not SearchPath("delayimp.lib", Lib): os.environ["USE_DELAYLOAD"] = "0" print("set USE_DELAYLOAD=0") if not SearchPath("msvcrt.lib", Lib): os.environ["USE_MSVCRT"] = "0" print("set USE_MSVCRT=0") # some host/target confusion here.. if Target == "NT386MINGNU" or (Target == "NT386" and GCC_BACKEND and OSType == "WIN32"): _ClearEnvironmentVariable("LIB") _ClearEnvironmentVariable("INCLUDE") _SetupEnvironmentVariableAll( "PATH", ["gcc", "as", "ld"], os.path.join(SystemDrive, "mingw", "bin")) # need to probe for ld that accepts response files. # For example, this version does not: # C:\dev2\cm3\scripts\python>ld -v # GNU ld version 2.15.91 20040904 # This comes with Qt I think (free Windows version) # # This version works: # C:\dev2\cm3\scripts\python>ld -v # GNU ld version 2.17.50 20060824 # Ensure msys make is ahead of mingwin make, by adding # msys to the start of the path after adding mingw to the # start of the path. Modula-3 does not generally use # make, but this might matter when building m3cg, and # is usually the right thing. _SetupEnvironmentVariableAll( "PATH", ["sh", "sed", "gawk", "make"], os.path.join(SystemDrive, "msys", "1.0", "bin")) # some host/target confusion here.. if Target == "NT386GNU" or (Target == "NT386" and GCC_BACKEND and OSType == "POSIX"): #_ClearEnvironmentVariable("LIB") #_ClearEnvironmentVariable("INCLUDE") #if HostIsNT: # _SetupEnvironmentVariableAll( # "PATH", # ["cygX11-6.dll"], # os.path.join(SystemDrive, "cygwin", "usr", "X11R6", "bin")) _SetupEnvironmentVariableAll( "PATH", ["gcc", "as", "ld"], os.path.join(SystemDrive, "cygwin", "bin"))
db8d35f4811ca40e51ced085ca93d6f9596c5d5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9328/db8d35f4811ca40e51ced085ca93d6f9596c5d5f/pylib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10939, 5494, 13332, 2332, 24681, 273, 1140, 18, 28684, 18, 588, 2932, 3163, 24681, 3113, 1408, 13, 309, 1140, 18, 28684, 18, 588, 2932, 4618, 7923, 422, 315, 10399, 67, 1784, 6877, 4893, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10939, 5494, 13332, 2332, 24681, 273, 1140, 18, 28684, 18, 588, 2932, 3163, 24681, 3113, 1408, 13, 309, 1140, 18, 28684, 18, 588, 2932, 4618, 7923, 422, 315, 10399, 67, 1784, 6877, 4893, ...
searchEntities = self._getTonalForms(searchStr, **options)
searchEntities = self._getAllTonalForms(searchStr, **options)
def getWhereClause(self, column, searchStr, **options): # if reading is tonal and includes support for missing tones, handle if self._hasTonlessSupport(): if self._dictInstance.READING in self.READINGS_HAVE_TONE_APPENDED: # look for missing tone information and use wildcards, with # better performance # TODO that's not generally true searchEntities = self._getWildcardForms(searchStr, **options)
33c7bd3387c933504796661bab3ca4ab548a02ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11128/33c7bd3387c933504796661bab3ca4ab548a02ff/dictionary.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 5262, 7044, 12, 2890, 16, 1057, 16, 1623, 1585, 16, 2826, 2116, 4672, 468, 309, 6453, 353, 268, 9528, 471, 6104, 2865, 364, 3315, 268, 5322, 16, 1640, 309, 365, 6315, 5332, 56, 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, 336, 5262, 7044, 12, 2890, 16, 1057, 16, 1623, 1585, 16, 2826, 2116, 4672, 468, 309, 6453, 353, 268, 9528, 471, 6104, 2865, 364, 3315, 268, 5322, 16, 1640, 309, 365, 6315, 5332, 56, 26...
test_main()
test_main(verbose=True)
def test_main(): test.test_support.run_unittest(BuiltinTest, TestSorted)
4c83bb2088c829a0de2cda2af7b30f2fc7780675 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/4c83bb2088c829a0de2cda2af7b30f2fc7780675/test_builtin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5254, 13332, 1842, 18, 3813, 67, 13261, 18, 2681, 67, 4873, 3813, 12, 28032, 4709, 16, 7766, 11739, 13, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5254, 13332, 1842, 18, 3813, 67, 13261, 18, 2681, 67, 4873, 3813, 12, 28032, 4709, 16, 7766, 11739, 13, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
if exe == "ui_tests": cmd.append("--trace_children") cmd.append("--indirect")
if valgrind_test_args != None: for arg in valgrind_test_args: cmd.append(arg)
def _DefaultCommand(self, module, exe=None): '''Generates the default command array that most tests will use.''' module_dir = os.path.join(self._source_dir, module)
2014142d5e9ff025d569d5249ff7790f0a31aa0f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/2014142d5e9ff025d569d5249ff7790f0a31aa0f/chrome_tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1868, 2189, 12, 2890, 16, 1605, 16, 15073, 33, 7036, 4672, 9163, 6653, 326, 805, 1296, 526, 716, 4486, 7434, 903, 999, 1093, 6309, 1605, 67, 1214, 273, 1140, 18, 803, 18, 5701, 12...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1868, 2189, 12, 2890, 16, 1605, 16, 15073, 33, 7036, 4672, 9163, 6653, 326, 805, 1296, 526, 716, 4486, 7434, 903, 999, 1093, 6309, 1605, 67, 1214, 273, 1140, 18, 803, 18, 5701, 12...
where.append('(_%s._%s in (%s))'%(cn, k, s))
l.append('(_%s._%s in (%s))'%(cn, k, s))
def filter(self, search_matches, filterspec, sort=(None,None), group=(None,None)): '''Return a list of the ids of the active nodes in this class that match the 'filter' spec, sorted by the group spec and then the sort spec
8abcf2fcb72a8ff60bab69bd7ca3c519f051a883 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8abcf2fcb72a8ff60bab69bd7ca3c519f051a883/rdbms_common.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1034, 12, 2890, 16, 1623, 67, 8436, 16, 1034, 2793, 16, 1524, 28657, 7036, 16, 7036, 3631, 1041, 28657, 7036, 16, 7036, 3719, 30, 9163, 990, 279, 666, 434, 326, 3258, 434, 326, 2695, 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, 1034, 12, 2890, 16, 1623, 67, 8436, 16, 1034, 2793, 16, 1524, 28657, 7036, 16, 7036, 3631, 1041, 28657, 7036, 16, 7036, 3719, 30, 9163, 990, 279, 666, 434, 326, 3258, 434, 326, 2695, 2...
if dependency.find(':') = -1:
if dependency.find(':') == -1:
def installGSDependencies(context): """Install dependend profiles.""" # XXX this one needs testing and review! dependencies = [<dtml-var "', '.join(dependend_profiles)">] if not dependencies: return site = context.getSite() setup_tool = getToolByName(site, 'portal_setup') for dependency in dependencies: if dependency.find(':') = -1: dependency += ':default' old_context = setup_tool.getImportContextID() setup_tool.setImportContext(dependency) setup_tool.runAllImportSteps() setup_tool.setImportContext(old_context)
84a00727419df2e2459075dcfcea7268bb24c7ee /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11941/84a00727419df2e2459075dcfcea7268bb24c7ee/setuphandlers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 16113, 8053, 12, 2472, 4672, 3536, 6410, 2447, 409, 11788, 12123, 468, 11329, 333, 1245, 4260, 7769, 471, 10725, 5, 5030, 273, 306, 32, 72, 1419, 17, 1401, 14912, 2418, 5701, 12, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 16113, 8053, 12, 2472, 4672, 3536, 6410, 2447, 409, 11788, 12123, 468, 11329, 333, 1245, 4260, 7769, 471, 10725, 5, 5030, 273, 306, 32, 72, 1419, 17, 1401, 14912, 2418, 5701, 12, 5...
sage: abelian_2group(4).is_latin_square()
sage: elementary_abelian_2group(4).is_latin_square()
def is_latin_square(self): """ self is a latin square if it is an n by n matrix, and each symbol in [0, 1, ..., n-1] appears exactly once in each row, and exactly once in each column.
940ac7fc9c99ff948cd46103f8ba7e338a7354d6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/940ac7fc9c99ff948cd46103f8ba7e338a7354d6/latin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 26578, 67, 19719, 12, 2890, 4672, 3536, 365, 353, 279, 30486, 8576, 309, 518, 353, 392, 290, 635, 290, 3148, 16, 471, 1517, 3273, 316, 306, 20, 16, 404, 16, 1372, 16, 290, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 26578, 67, 19719, 12, 2890, 4672, 3536, 365, 353, 279, 30486, 8576, 309, 518, 353, 392, 290, 635, 290, 3148, 16, 471, 1517, 3273, 316, 306, 20, 16, 404, 16, 1372, 16, 290, 1...
else: if len(users) > 0: event.Skip() return else:
else:
def txt_edit_evt_char(self, event): """Called when the user enter some text in the entry widget.""" key = event.GetKeyCode() if key == 13: # enter # Enter pressed value = self.txt_edit.GetValue() if not value: # ignore event if nothing typed event.Skip() return self.command_buffer.append(value) self.txt_edit.SetValue("") self.current_area_up = 0 self.current_area_down = 0 self.tmp_buffer = "" self.server.text_command(value,self) # Do nothing after this! We might be destroyed!
27fbeb2ff1603a38af53d47f26e78175c77bddc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2718/27fbeb2ff1603a38af53d47f26e78175c77bddc4/window_base.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6463, 67, 4619, 67, 73, 11734, 67, 3001, 12, 2890, 16, 871, 4672, 3536, 8185, 1347, 326, 729, 6103, 2690, 977, 316, 326, 1241, 3604, 12123, 498, 273, 871, 18, 967, 653, 1085, 1435, 309...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6463, 67, 4619, 67, 73, 11734, 67, 3001, 12, 2890, 16, 871, 4672, 3536, 8185, 1347, 326, 729, 6103, 2690, 977, 316, 326, 1241, 3604, 12123, 498, 273, 871, 18, 967, 653, 1085, 1435, 309...
root = context.root if context.status == 500: context.entity = root.internal_server_error(context)
def handle_request(cls, server, context): # (1) Initialize 'context.commit' (true if the method is not safe) context.commit = (cls.is_safe is False)
c2b053496d5daff15ef8e1af3fd35ea8d5f3fb5c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/c2b053496d5daff15ef8e1af3fd35ea8d5f3fb5c/server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 2293, 12, 6429, 16, 1438, 16, 819, 4672, 468, 261, 21, 13, 9190, 296, 2472, 18, 7371, 11, 261, 3767, 309, 326, 707, 353, 486, 4183, 13, 819, 18, 7371, 273, 261, 6429, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 2293, 12, 6429, 16, 1438, 16, 819, 4672, 468, 261, 21, 13, 9190, 296, 2472, 18, 7371, 11, 261, 3767, 309, 326, 707, 353, 486, 4183, 13, 819, 18, 7371, 273, 261, 6429, 18, ...
server = troveTuple[1].trailingLabel().getHost() filePaths = self.c[server].getFileContentsFromTrove((n,v,f), pathList)
filePaths = self.c[server].getFileContentsFromTrove(n,v,f, pathList)
def getFileContentsFromTrove(self, n, v, f, pathList, callback = None, compressed = False): pathList = [self.fromPath(x) for x in pathList] v = self.fromVersion(v) f = self.fromFlavor(f) server = troveTuple[1].trailingLabel().getHost() filePaths = self.c[server].getFileContentsFromTrove((n,v,f), pathList) fileObjList = [] for path in filePaths: if compressed: fileObjList.append( filecontents.FromFilesystem(path, compressed = True)) else: f = gzip.GzipFile(path, "r") fileObjList.append(filecontents.FromFile(f)) return fileObjList
fcf3acc76412753990c96ffa5391154a8ea5bde4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8747/fcf3acc76412753990c96ffa5391154a8ea5bde4/shimclient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6034, 6323, 1265, 56, 303, 537, 12, 2890, 16, 290, 16, 331, 16, 284, 16, 589, 682, 16, 1348, 273, 599, 16, 8968, 273, 1083, 4672, 589, 682, 273, 306, 2890, 18, 2080, 743, 12, 92, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6034, 6323, 1265, 56, 303, 537, 12, 2890, 16, 290, 16, 331, 16, 284, 16, 589, 682, 16, 1348, 273, 599, 16, 8968, 273, 1083, 4672, 589, 682, 273, 306, 2890, 18, 2080, 743, 12, 92, 1...
if type(alias) in StringTypes:
if isinstance(alias, basestring):
def _resolve_alias(self, alias): if type(alias) in StringTypes: try: return self.aliases[alias] except KeyError: pass raise ValueError
af959cb080815162dfaa581798ee4a3fd27510e9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7408/af959cb080815162dfaa581798ee4a3fd27510e9/connectioncache.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 10828, 67, 4930, 12, 2890, 16, 2308, 4672, 309, 1549, 12, 4930, 16, 10699, 4672, 775, 30, 327, 365, 18, 13831, 63, 4930, 65, 1335, 4999, 30, 1342, 1002, 2068, 2, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 10828, 67, 4930, 12, 2890, 16, 2308, 4672, 309, 1549, 12, 4930, 16, 10699, 4672, 775, 30, 327, 365, 18, 13831, 63, 4930, 65, 1335, 4999, 30, 1342, 1002, 2068, 2, -100, -100, -100,...
self.assertEqual(str(math.pi**-100), jython and '1.927581416056e-50' or '1.92758141606e-50')
self.assertEqual(str(math.pi**-100), '1.92758141606e-50')
def test_float_str(self): self.assertEqual(str(12345678.000005), '12345678.0') self.assertEqual(str(12345678.00005), jython and '12345678.0' or '12345678.0001') self.assertEqual(str(12345678.00005), jython and '12345678.0' or '12345678.0001') self.assertEqual(str(12345678.0005), '12345678.0005') self.assertEqual(str(math.pi**-100), jython and '1.927581416056e-50' or '1.92758141606e-50') self.assertEqual(str(0.0), '0.0') self.assertEqual(str(-1.0), '-1.0') self.assertEqual(str(-9876.543210), '-9876.54321') self.assertEqual(str(23456789012E666), 'inf') self.assertEqual(str(-23456789012E666), '-inf')
2fbf5e9fa71fd755bfd0f4d25422dba222a1afbe /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6753/2fbf5e9fa71fd755bfd0f4d25422dba222a1afbe/test_float_jy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5659, 67, 701, 12, 2890, 4672, 365, 18, 11231, 5812, 12, 701, 12, 28462, 4313, 8285, 18, 2787, 6260, 3631, 296, 28462, 4313, 8285, 18, 20, 6134, 365, 18, 11231, 5812, 12, 701...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5659, 67, 701, 12, 2890, 4672, 365, 18, 11231, 5812, 12, 701, 12, 28462, 4313, 8285, 18, 2787, 6260, 3631, 296, 28462, 4313, 8285, 18, 20, 6134, 365, 18, 11231, 5812, 12, 701...
def test_search_local_users(self):
def test_aaaasearch_local_users(self):
def test_search_local_users(self): """Search users using jquery ui autocomplete and normal search using form
86303dc63816cf1e2a9fa04c1e0c110d6dda88f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/86303dc63816cf1e2a9fa04c1e0c110d6dda88f7/test_user_management.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 26676, 448, 991, 67, 3729, 67, 5577, 12, 2890, 4672, 3536, 2979, 3677, 1450, 22977, 5915, 21429, 471, 2212, 1623, 1450, 646, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 26676, 448, 991, 67, 3729, 67, 5577, 12, 2890, 4672, 3536, 2979, 3677, 1450, 22977, 5915, 21429, 471, 2212, 1623, 1450, 646, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
logger.debug("Currently active sessions: {}".format(self.__sessions))
logger.debug("Currently active sessions: {}".format(self.__callids))
def sip_INVITE(self, requestLine, headers, body): global g_sipconfig
d995da2606eccd46f73ea5846930ead736911f1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8801/d995da2606eccd46f73ea5846930ead736911f1a/sip.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10341, 67, 706, 58, 5398, 12, 2890, 16, 590, 1670, 16, 1607, 16, 1417, 4672, 2552, 314, 67, 28477, 1425, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10341, 67, 706, 58, 5398, 12, 2890, 16, 590, 1670, 16, 1607, 16, 1417, 4672, 2552, 314, 67, 28477, 1425, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.exit_code = reason.value.exitCode or reason.value.signal + 128
self.exit_code = reason.value.exitCode or (reason.value.signal and reason.value.signal + 128) or 0
def processEnded(self, reason): self.done = True # reason.value contain: # exitCode # signal # status # as we leave under unix, error code is <exit status>, or <sig> + 128)
9d283a86fab3829c1c7fe3ae2854783b55ab578b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5988/9d283a86fab3829c1c7fe3ae2854783b55ab578b/process_control.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 28362, 12, 2890, 16, 3971, 4672, 365, 18, 8734, 273, 1053, 468, 3971, 18, 1132, 912, 30, 468, 16067, 468, 4277, 468, 1267, 468, 487, 732, 8851, 3613, 9753, 16, 555, 981, 353, 411...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1207, 28362, 12, 2890, 16, 3971, 4672, 365, 18, 8734, 273, 1053, 468, 3971, 18, 1132, 912, 30, 468, 16067, 468, 4277, 468, 1267, 468, 487, 732, 8851, 3613, 9753, 16, 555, 981, 353, 411...
TODO: sometimes the server won't exit on Conrol-C, and continue to run with few threads (you can kill it with kill -9). Same problem exist with the twisted server. When the problem is finally solved, remove the commented debug prints.
def process_request_thread(self, request, client_address): """ Called for each request on a new thread
90d0ff1549752bb91a49244efff67aa664272c5e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/90d0ff1549752bb91a49244efff67aa664272c5e/server_standalone.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 2293, 67, 5930, 12, 2890, 16, 590, 16, 1004, 67, 2867, 4672, 3536, 11782, 364, 1517, 590, 603, 279, 394, 2650, 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, 1207, 67, 2293, 67, 5930, 12, 2890, 16, 590, 16, 1004, 67, 2867, 4672, 3536, 11782, 364, 1517, 590, 603, 279, 394, 2650, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
"""Return the metadata as an entry"""
""" Return the metadata as an entry: >>> import polib >>> po = polib.pofile('tests/test_fuzzy_header.po') >>> unicode(po) == unicode(open('tests/test_fuzzy_header.po').read()) True """
def metadata_as_entry(self): """Return the metadata as an entry""" e = POEntry(msgid='') mdata = self.ordered_metadata() if mdata: strs = [] for name, value in mdata: # Strip whitespace off each line in a multi-line entry value = '\n'.join([v.strip() for v in value.split('\n')]) strs.append('%s: %s' % (name, value)) e.msgstr = '\n'.join(strs) + '\n' return e
fdae1a53a6c23e4a80a5a0a920057e7c54b6080b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9209/fdae1a53a6c23e4a80a5a0a920057e7c54b6080b/polib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1982, 67, 345, 67, 4099, 12, 2890, 4672, 3536, 2000, 326, 1982, 487, 392, 1241, 30, 225, 4080, 1930, 2952, 495, 4080, 8275, 273, 2952, 495, 18, 1631, 768, 2668, 16341, 19, 3813, 67, 74...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1982, 67, 345, 67, 4099, 12, 2890, 4672, 3536, 2000, 326, 1982, 487, 392, 1241, 30, 225, 4080, 1930, 2952, 495, 4080, 8275, 273, 2952, 495, 18, 1631, 768, 2668, 16341, 19, 3813, 67, 74...
import parser
def runParserTest(self, input, output, errors): import parser #XXX - move this out into the setup function #concatenate all consecutive character tokens into a single token p = parser.HTMLParser() document = p.parse(StringIO.StringIO(input)) errorMsg = "\n".join(["\n\nExpected:", output, "\nRecieved:", convertTreeDump(document.printTree())]) self.assertEquals(output, convertTreeDump(document.printTree()), errorMsg) errorMsg2 = "\n".join(["\n\nInput errors:\n" + "\n".join(errors), "Actual errors:\n" + "\n".join(p.errors)]) self.assertEquals(len(p.errors), len(errors), errorMsg2)
001f783015c0c6acb0e00a6c4e1077d0ed1436b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9368/001f783015c0c6acb0e00a6c4e1077d0ed1436b6/test_parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 2678, 4709, 12, 2890, 16, 810, 16, 876, 16, 1334, 4672, 468, 15639, 300, 3635, 333, 596, 1368, 326, 3875, 445, 468, 16426, 275, 340, 777, 18221, 3351, 2430, 1368, 279, 2202, 1147, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 2678, 4709, 12, 2890, 16, 810, 16, 876, 16, 1334, 4672, 468, 15639, 300, 3635, 333, 596, 1368, 326, 3875, 445, 468, 16426, 275, 340, 777, 18221, 3351, 2430, 1368, 279, 2202, 1147, ...
raise u'Suspects must be the same size'
raise ValueError(u'Suspects must be the same size') try: self.wikilog = codecs.open(self.wikilogfile, 'a', 'utf-8') except IOError: self.wikilog = codecs.open(self.wikilogfile, 'w', 'utf-8')
def __init__(self): for arg in wikipedia.handleArgs(): if arg.startswith('-from'): if arg.startswith('-from:'): self.apfrom = arg[6:] else: self.apfrom = wikipedia.input(u'Which page to start from: ') elif arg.startswith('-reqsize:'): self.aplimit = int(arg[9:]) elif arg == '-links': self.links = True elif arg == '-linksonly': self.links = True self.titles = False elif arg == '-replace': self.replace = True elif arg.startswith('-limit:'): self.stopAfter = int(arg[7:]) elif arg == '-verbose': self.verbose = True elif arg == '-autonomous': self.autonomous = True elif arg.startswith('-ns:'): self.namespaces.append( int(arg[4:]) ) elif arg.startswith('-wikilog:'): try: self.wikilog = codecs.open(arg[9:], 'a', 'utf-8') except IOError: self.wikilog = codecs.open(arg[9:], 'w', 'utf-8') else: wikipedia.output(u'Unknown argument %s.' % arg) wikipedia.showHelp() sys.exit()
ab9d478f34cfd6a362913f5c362599b2477e5c5e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/ab9d478f34cfd6a362913f5c362599b2477e5c5e/casechecker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 225, 364, 1501, 316, 21137, 18, 4110, 2615, 13332, 309, 1501, 18, 17514, 1918, 2668, 17, 2080, 11, 4672, 309, 1501, 18, 17514, 1918, 2668, 17, 2080, 2497...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4672, 225, 364, 1501, 316, 21137, 18, 4110, 2615, 13332, 309, 1501, 18, 17514, 1918, 2668, 17, 2080, 11, 4672, 309, 1501, 18, 17514, 1918, 2668, 17, 2080, 2497...
slef.xmlnode.setProp("node",to_utf8(xmlnode_or_node))
self.xmlnode.setProp("node",to_utf8(xmlnode_or_node))
def __init__(self,xmlnode_or_node=None): self.xmlnode=None self.xpath_ctxt=None if isinstance(xmlnode_or_node,libxml2.xmlNode): ns=xmlnode.ns() if ns.getContent() != DISCO_INFO_NS: raise RosterError,"Bad disco-info namespace" self.xmlnode=xmlnode.docCopyNode(common_doc,1) common_root.addChild(self.xmlnode) self.ns=self.xmlnode.ns() else: self.xmlnode=common_root.newChild(None,"query",None) self.ns=self.xmlnode.newNs(DISCO_INFO_NS,None) self.xmlnode.setNs(self.ns) if xmlnode_or_node: slef.xmlnode.setProp("node",to_utf8(xmlnode_or_node))
7144b012d4971308bdb2d0e53b997fbbd281c31a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12769/7144b012d4971308bdb2d0e53b997fbbd281c31a/disco.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2902, 2159, 67, 280, 67, 2159, 33, 7036, 4672, 365, 18, 2902, 2159, 33, 7036, 365, 18, 18644, 67, 20364, 33, 7036, 309, 1549, 12, 2902, 2159, 67, 280, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2902, 2159, 67, 280, 67, 2159, 33, 7036, 4672, 365, 18, 2902, 2159, 33, 7036, 365, 18, 18644, 67, 20364, 33, 7036, 309, 1549, 12, 2902, 2159, 67, 280, ...
return [self._eval(i) for i in srange(Integer(1),n+1)]
return [self._eval(i) for i in srange(self.offset, n+self.offset)]
def list(self, n): return [self._eval(i) for i in srange(Integer(1),n+1)]
da9c7077d971928cf55f4cb1660269f1a93e0d92 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/da9c7077d971928cf55f4cb1660269f1a93e0d92/sloane_functions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 12, 2890, 16, 290, 4672, 327, 306, 2890, 6315, 8622, 12, 77, 13, 364, 277, 316, 272, 3676, 12, 4522, 12, 21, 3631, 82, 15, 21, 25887, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 12, 2890, 16, 290, 4672, 327, 306, 2890, 6315, 8622, 12, 77, 13, 364, 277, 316, 272, 3676, 12, 4522, 12, 21, 3631, 82, 15, 21, 25887, 2, -100, -100, -100, -100, -100, -100, -100...
__all__ = ['env', 'issequence',
__all__ = ['env', 'issequence', 'panic',
def instantiate(root): instance = root.instantiate('root') instance.fixup() instance.display() if not noDot: dot = pydot.Dot() instance.outputDot(dot) dot.orientation = "portrait" dot.size = "8.5,11" dot.ranksep="equally" dot.rank="samerank" dot.write("config.dot") dot.write_ps("config.ps")
82964b2705b892f5d36522f7b7c5472975a5d873 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/82964b2705b892f5d36522f7b7c5472975a5d873/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10275, 12, 3085, 4672, 791, 273, 1365, 18, 24628, 3840, 2668, 3085, 6134, 791, 18, 904, 416, 1435, 791, 18, 5417, 1435, 309, 486, 1158, 10412, 30, 3928, 273, 2395, 9811, 18, 10412, 1435,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10275, 12, 3085, 4672, 791, 273, 1365, 18, 24628, 3840, 2668, 3085, 6134, 791, 18, 904, 416, 1435, 791, 18, 5417, 1435, 309, 486, 1158, 10412, 30, 3928, 273, 2395, 9811, 18, 10412, 1435,...
sage: contour_plot(f, (-2, 2), (-2, 2), contours=(1.0,), fill=False)
sage: contour_plot(f, (-2, 2), (-2, 2), contours=(1.0,), fill=False, aspect_ratio=1) We can change the style of the lines:: sage: contour_plot(f, (-2,2), (-2,2), fill=False, linewidths=10) sage: contour_plot(f, (-2,2), (-2,2), fill=False, linestyles='dashdot') We can add labels and play with them:: sage: contour_plot(y^2 + 1 - x^3 - x, (x,-pi,pi), (y,-pi,pi), fill=False, cmap='hsv', labels=True) sage: contour_plot(y^2 + 1 - x^3 - x, (x,-pi,pi), (y,-pi,pi), fill=False, cmap='hsv', labels=True, label_fmt="%1.0f", label_colors='black') sage: contour_plot(y^2 + 1 - x^3 - x, (x,-pi,pi), (y,-pi,pi), fill=False, cmap='hsv', labels=True, label_fontsize=18) If we do not specify fill=False, then the label and line options are ignored:: sage: contour_plot(f, (-2,2), (-2,2), labels=True, linestyles='dashed')
def contour_plot(f, xrange, yrange, **options): r""" ``contour_plot`` takes a function of two variables, `f(x,y)` and plots contour lines of the function over the specified ``xrange`` and ``yrange`` as demonstrated below. ``contour_plot(f, (xmin, xmax), (ymin, ymax), ...)`` INPUT: - ``f`` -- a function of two variables - ``(xmin, xmax)`` -- 2-tuple, the range of ``x`` values OR 3-tuple ``(x,xmin,xmax)`` - ``(ymin, ymax)`` -- 2-tuple, the range of ``y`` values OR 3-tuple ``(y,ymin,ymax)`` The following inputs must all be passed in as named parameters: - ``plot_points`` -- integer (default: 100); number of points to plot in each direction of the grid. For old computers, 25 is fine, but should not be used to verify specific intersection points. - ``fill`` -- bool (default: ``True``), whether to color in the area between contour lines - ``cmap`` -- a colormap (default: ``'gray'``), the name of a predefined colormap, a list of colors or an instance of a matplotlib Colormap. Type: ``import matplotlib.cm; matplotlib.cm.datad.keys()`` for available colormap names. - ``contours`` -- integer or list of numbers (default: ``None``): If a list of numbers is given, then this specifies the contour levels to use. If an integer is given, then this many contour lines are used, but the exact levels are determined automatically. If ``None`` is passed (or the option is not given), then the number of contour lines is determined automatically, and is usually about 5. EXAMPLES: Here we plot a simple function of two variables. Note that since the input function is an expression, we need to explicitly declare the variables in 3-tuples for the range:: sage: x,y = var('x,y') sage: contour_plot(cos(x^2+y^2), (x, -4, 4), (y, -4, 4)) Here we change the ranges and add some options:: sage: x,y = var('x,y') sage: contour_plot((x^2)*cos(x*y), (x, -10, 5), (y, -5, 5), fill=False, plot_points=150) An even more complicated plot:: sage: x,y = var('x,y') sage: contour_plot(sin(x^2 + y^2)*cos(x)*sin(y), (x, -4, 4), (y, -4, 4),plot_points=150) Some elliptic curves, but with symbolic endpoints. In the first example, the plot is rotated 90 degrees because we switch the variables x,y:: sage: x,y = var('x,y') sage: contour_plot(y^2 + 1 - x^3 - x, (y,-pi,pi), (x,-pi,pi)) sage: contour_plot(y^2 + 1 - x^3 - x, (x,-pi,pi), (y,-pi,pi)) We can play with the contour levels:: sage: x,y = var('x,y') sage: f(x,y) = x^2 + y^2 sage: contour_plot(f, (-2, 2), (-2, 2)) sage: contour_plot(f, (-2, 2), (-2, 2), contours=2, cmap=[(1,0,0), (0,1,0), (0,0,1)]) sage: contour_plot(f, (-2, 2), (-2, 2), contours=(0.1, 1.0, 1.2, 1.4), cmap='hsv') sage: contour_plot(f, (-2, 2), (-2, 2), contours=(1.0,), fill=False) This should plot concentric circles centered at the origin:: sage: x,y = var('x,y') sage: contour_plot(x^2+y^2-2,(x,-1,1), (y,-1,1)).show(aspect_ratio=1) Extra options will get passed on to show(), as long as they are valid:: sage: f(x, y) = cos(x) + sin(y) sage: contour_plot(f, (0, pi), (0, pi), axes=True) sage: contour_plot(f, (0, pi), (0, pi)).show(axes=True) # These are equivalent Note that with ``fill=False`` and grayscale contours, there is the possibility of confusion between the contours and the axes, so use ``fill=False`` together with ``axes=True`` with caution:: sage: contour_plot(f, (-pi, pi), (-pi, pi), fill=False, axes=True) TESTS: To check that ticket 5221 is fixed, note that this has three curves, not two:: sage: x,y = var('x,y') sage: contour_plot(x-y^2,(x,-5,5),(y,-3,3),contours=[-4,-2,0], fill=False) """ from sage.plot.plot import Graphics from sage.plot.misc import setup_for_eval_on_grid g, ranges = setup_for_eval_on_grid([f], [xrange, yrange], options['plot_points']) g = g[0] xrange,yrange=[r[:2] for r in ranges] xy_data_array = [[g(x, y) for x in xsrange(*ranges[0], include_endpoint=True)] for y in xsrange(*ranges[1], include_endpoint=True)] g = Graphics() g._set_extra_kwds(Graphics._extract_kwds_for_show(options, ignore=['xmin', 'xmax'])) g.add_primitive(ContourPlot(xy_data_array, xrange, yrange, options)) return g
193e4ecc8643b94b550be6610365db125959929a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/193e4ecc8643b94b550be6610365db125959929a/contour_plot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15332, 67, 4032, 12, 74, 16, 12314, 16, 677, 3676, 16, 2826, 2116, 4672, 436, 8395, 12176, 1213, 477, 67, 4032, 10335, 5530, 279, 445, 434, 2795, 3152, 16, 1375, 74, 12, 92, 16, 93, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15332, 67, 4032, 12, 74, 16, 12314, 16, 677, 3676, 16, 2826, 2116, 4672, 436, 8395, 12176, 1213, 477, 67, 4032, 10335, 5530, 279, 445, 434, 2795, 3152, 16, 1375, 74, 12, 92, 16, 93, ...
"exclude=", "include=", "package=", "strip")
"exclude=", "include=", "package=", "strip", "iconfile=")
def main(builder=None): if builder is None: builder = AppBuilder(verbosity=1) shortopts = "b:n:r:e:m:c:p:lx:i:hvq" longopts = ("builddir=", "name=", "resource=", "executable=", "mainprogram=", "creator=", "nib=", "plist=", "link", "link-exec", "help", "verbose", "quiet", "standalone", "exclude=", "include=", "package=", "strip") try: options, args = getopt.getopt(sys.argv[1:], shortopts, longopts) except getopt.error: usage() for opt, arg in options: if opt in ('-b', '--builddir'): builder.builddir = arg elif opt in ('-n', '--name'): builder.name = arg elif opt in ('-r', '--resource'): builder.resources.append(arg) elif opt in ('-e', '--executable'): builder.executable = arg elif opt in ('-m', '--mainprogram'): builder.mainprogram = arg elif opt in ('-c', '--creator'): builder.creator = arg elif opt == "--nib": builder.nibname = arg elif opt in ('-p', '--plist'): builder.plist = Plist.fromFile(arg) elif opt in ('-l', '--link'): builder.symlink = 1 elif opt == '--link-exec': builder.symlink_exec = 1 elif opt in ('-h', '--help'): usage() elif opt in ('-v', '--verbose'): builder.verbosity += 1 elif opt in ('-q', '--quiet'): builder.verbosity -= 1 elif opt == '--standalone': builder.standalone = 1 elif opt in ('-x', '--exclude'): builder.excludeModules.append(arg) elif opt in ('-i', '--include'): builder.includeModules.append(arg) elif opt == '--package': builder.includePackages.append(arg) elif opt == '--strip': builder.strip = 1 if len(args) != 1: usage("Must specify one command ('build', 'report' or 'help')") command = args[0] if command == "build": builder.setup() builder.build() elif command == "report": builder.setup() builder.report() elif command == "help": usage() else: usage("Unknown command '%s'" % command)
16fe93d54e250ebf43c6f36a78bc8fbf4ba3a0d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/16fe93d54e250ebf43c6f36a78bc8fbf4ba3a0d4/bundlebuilder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 9574, 33, 7036, 4672, 309, 2089, 353, 599, 30, 2089, 273, 4677, 1263, 12, 16629, 8807, 33, 21, 13, 225, 3025, 4952, 273, 315, 70, 30, 82, 30, 86, 30, 73, 30, 81, 30, 71, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9574, 33, 7036, 4672, 309, 2089, 353, 599, 30, 2089, 273, 4677, 1263, 12, 16629, 8807, 33, 21, 13, 225, 3025, 4952, 273, 315, 70, 30, 82, 30, 86, 30, 73, 30, 81, 30, 71, ...
name = current_thread().get_name()
name = current_thread().name
def _writerThread(self, d, howMany, writerNum): name = current_thread().get_name() start = howMany * writerNum stop = howMany * (writerNum + 1) - 1 if verbose: print("%s: creating records %d - %d" % (name, start, stop))
8215b77b3c5060e898e5fd23b1340edcc225871c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/8215b77b3c5060e898e5fd23b1340edcc225871c/test_thread.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6299, 3830, 12, 2890, 16, 302, 16, 3661, 5594, 16, 2633, 2578, 4672, 508, 273, 783, 67, 5930, 7675, 529, 787, 273, 3661, 5594, 380, 2633, 2578, 2132, 273, 3661, 5594, 380, 261, 62...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6299, 3830, 12, 2890, 16, 302, 16, 3661, 5594, 16, 2633, 2578, 4672, 508, 273, 783, 67, 5930, 7675, 529, 787, 273, 3661, 5594, 380, 2633, 2578, 2132, 273, 3661, 5594, 380, 261, 62...
print "will execute (from %s; %d lines):\n%s" % (source, nlines, command)
msg = "will execute (from %s; %d lines):\n%s" % (source, nlines, command) print msg try: import env from HistoryWidget import _graymsg, quote_html env.history.message( _graymsg( quote_html( msg))) except: print_compact_traceback("exception in printing that to history: ")
def debug_run_command(command, source = "user debug input"): #bruce 040913-16 in GLPane.py; modified 040928 """Execute a python command, supplied by the user via some sort of debugging interface (named by source), in debug.py's globals. Return 1 for ok (incl empty command), 0 for any error. Caller should not print exception diagnostics -- this function does that (and does not reraise the exception). """ #e someday we might record time, history, etc command = "" + command # i.e. assert it's a string #k what's a better way to do the following? while command and command[0] == '\n': command = command[1:] while command and command[-1] == '\n': command = command[:-1] if not command: print "empty command (from %s), nothing executed" % (source,) return 1 if '\n' not in command: print "will execute (from %s): %s" % (source, command) else: nlines = command.count('\n')+1 print "will execute (from %s; %d lines):\n%s" % (source, nlines, command) command = command + '\n' #k probably not needed try: ## exec command in globals() legally_exec_command_in_globals( command, globals() ) except: print_compact_traceback("exception from that: ") return 0 else: print "did it!" return 1 pass
600e4a9b0c3fe0e8fcfd7cdc7f070e5fa6d8102c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/600e4a9b0c3fe0e8fcfd7cdc7f070e5fa6d8102c/debug.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1198, 67, 2681, 67, 3076, 12, 3076, 16, 1084, 273, 315, 1355, 1198, 810, 6, 4672, 468, 2848, 3965, 16486, 5908, 3437, 17, 2313, 316, 10252, 8485, 18, 2074, 31, 4358, 16486, 5908, 6030, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1198, 67, 2681, 67, 3076, 12, 3076, 16, 1084, 273, 315, 1355, 1198, 810, 6, 4672, 468, 2848, 3965, 16486, 5908, 3437, 17, 2313, 316, 10252, 8485, 18, 2074, 31, 4358, 16486, 5908, 6030, ...
return "The PermutationGroup of all legal moves of the Rubik's cube."
return "The PermutationGroup of all legal moves of the Rubik's cube."
def __repr__(self):
d6e55544eeb2c8853758824e2c33afd9265928af /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/d6e55544eeb2c8853758824e2c33afd9265928af/cubegroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12715, 972, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12715, 972, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
else:
else:
def get_diff(self): """Compute a diff between old and new values, and return a sequence of dictionaries with 'text' and 'style' keys. """ diff_styles = { '-': 'removed', '+': 'added', ' ': 'same', }
8cd4ba9bf358476036b3b8b4dafd8dead6801f4e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9478/8cd4ba9bf358476036b3b8b4dafd8dead6801f4e/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 5413, 12, 2890, 4672, 3536, 7018, 279, 3122, 3086, 1592, 471, 394, 924, 16, 471, 327, 279, 3102, 434, 16176, 598, 296, 955, 11, 471, 296, 4060, 11, 1311, 18, 3536, 3122, 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, 336, 67, 5413, 12, 2890, 4672, 3536, 7018, 279, 3122, 3086, 1592, 471, 394, 924, 16, 471, 327, 279, 3102, 434, 16176, 598, 296, 955, 11, 471, 296, 4060, 11, 1311, 18, 3536, 3122, 67, ...
this = apply(_quickfix.new_AllocRejCode, args)
this = _quickfix.new_AllocRejCode(*args)
def __init__(self, *args): this = apply(_quickfix.new_AllocRejCode, 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, 8763, 426, 78, 1085, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8763, 426, 78, 1085, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 3...
pre=r['URL']
pre=r['URLPATH0']
def manage_options(self): """Return a manage option data structure for me instance """ try: r=self.REQUEST except: r=None if r is None: pre='../' else: pre=r['URL'] for i in (1,2): l=pre.rfind('/') if l >= 0: pre=pre[:l] pre=pre+'/'
94603fc92aaaea303d2f1c60e52011a01b1deb28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/94603fc92aaaea303d2f1c60e52011a01b1deb28/PropertySheets.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10680, 67, 2116, 12, 2890, 4672, 3536, 990, 279, 10680, 1456, 501, 3695, 364, 1791, 791, 3536, 775, 30, 436, 33, 2890, 18, 5519, 1335, 30, 436, 33, 7036, 309, 436, 353, 599, 30, 675, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10680, 67, 2116, 12, 2890, 4672, 3536, 990, 279, 10680, 1456, 501, 3695, 364, 1791, 791, 3536, 775, 30, 436, 33, 2890, 18, 5519, 1335, 30, 436, 33, 7036, 309, 436, 353, 599, 30, 675, ...
setText(str(j), cel)
self.applyTextToFrame(str(j), cel)
def createMonthCalendar(self, month): cal = calendar.monthcalendar(self.year, month + 1) for i in cal: self.createLayout() self.createHeader(self.months[month]) rowCnt = 1 for j in i: # days cel = createText(self.gmean + self.marginl, self.margint + rowCnt * self.rowSize, self.width - self.gmean, self.rowSize) setStyle(self.pStyle, cel) rowCnt += 1 if j != 0: setText(str(j), cel)
65dce40946c1279b11de5770a1c36f312663cb8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3910/65dce40946c1279b11de5770a1c36f312663cb8b/CalendarWizard.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 5445, 7335, 12, 2890, 16, 3138, 4672, 1443, 273, 5686, 18, 7496, 11650, 12, 2890, 18, 6874, 16, 3138, 397, 404, 13, 364, 277, 316, 1443, 30, 365, 18, 2640, 3744, 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, 752, 5445, 7335, 12, 2890, 16, 3138, 4672, 1443, 273, 5686, 18, 7496, 11650, 12, 2890, 18, 6874, 16, 3138, 397, 404, 13, 364, 277, 316, 1443, 30, 365, 18, 2640, 3744, 1435, 365, 18, ...
None, [cty.POINTER(FL_OBJECT), cty.c_float, cty.c_float, cty.c_int],
None, [cty.POINTER(FL_OBJECT), cty.c_float, cty.c_float, cty.c_int],
def fl_set_xyplot_key(obj, id, key): """ fl_set_xyplot_key(obj, id, key) """ _fl_set_xyplot_key(obj, id, key)
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, 542, 67, 1698, 4032, 67, 856, 12, 2603, 16, 612, 16, 498, 4672, 3536, 1183, 67, 542, 67, 1698, 4032, 67, 856, 12, 2603, 16, 612, 16, 498, 13, 3536, 225, 389, 2242, 67, 54...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 542, 67, 1698, 4032, 67, 856, 12, 2603, 16, 612, 16, 498, 4672, 3536, 1183, 67, 542, 67, 1698, 4032, 67, 856, 12, 2603, 16, 612, 16, 498, 13, 3536, 225, 389, 2242, 67, 54...
self[k] = self[k].e(i)
self = self.set_index(k, self[k].f(i))
def f(self, i):
549f7e68534e471b15e27040787328464875cebe /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/549f7e68534e471b15e27040787328464875cebe/crystals.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 12, 2890, 16, 277, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 284, 12, 2890, 16, 277, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
fp = open(progname) try: script = fp.read() finally: fp.close() t.run('exec(%r)' % (script,))
with open(progname) as fp: code = compile(fp.read(), progname, 'exec') t.run(code)
def main(argv=None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:lTg", ["help", "version", "trace", "count", "report", "no-report", "summary", "file=", "missing", "ignore-module=", "ignore-dir=", "coverdir=", "listfuncs", "trackcalls", "timing"]) except getopt.error as msg: sys.stderr.write("%s: %s\n" % (sys.argv[0], msg)) sys.stderr.write("Try `%s --help' for more information\n" % sys.argv[0]) sys.exit(1) trace = 0 count = 0 report = 0 no_report = 0 counts_file = None missing = 0 ignore_modules = [] ignore_dirs = [] coverdir = None summary = 0 listfuncs = False countcallers = False timing = False for opt, val in opts: if opt == "--help": usage(sys.stdout) sys.exit(0) if opt == "--version": sys.stdout.write("trace 2.0\n") sys.exit(0) if opt == "-T" or opt == "--trackcalls": countcallers = True continue if opt == "-l" or opt == "--listfuncs": listfuncs = True continue if opt == "-g" or opt == "--timing": timing = True continue if opt == "-t" or opt == "--trace": trace = 1 continue if opt == "-c" or opt == "--count": count = 1 continue if opt == "-r" or opt == "--report": report = 1 continue if opt == "-R" or opt == "--no-report": no_report = 1 continue if opt == "-f" or opt == "--file": counts_file = val continue if opt == "-m" or opt == "--missing": missing = 1 continue if opt == "-C" or opt == "--coverdir": coverdir = val continue if opt == "-s" or opt == "--summary": summary = 1 continue if opt == "--ignore-module": for mod in val.split(","): ignore_modules.append(mod.strip()) continue if opt == "--ignore-dir": for s in val.split(os.pathsep): s = os.path.expandvars(s) # should I also call expanduser? (after all, could use $HOME) s = s.replace("$prefix", os.path.join(sys.prefix, "lib", "python" + sys.version[:3])) s = s.replace("$exec_prefix", os.path.join(sys.exec_prefix, "lib", "python" + sys.version[:3])) s = os.path.normpath(s) ignore_dirs.append(s) continue assert 0, "Should never get here" if listfuncs and (count or trace): _err_exit("cannot specify both --listfuncs and (--trace or --count)") if not (count or trace or report or listfuncs or countcallers): _err_exit("must specify one of --trace, --count, --report, " "--listfuncs, or --trackcalls") if report and no_report: _err_exit("cannot specify both --report and --no-report") if report and not counts_file: _err_exit("--report requires a --file") if no_report and len(prog_argv) == 0: _err_exit("missing name of file to run") # everything is ready if report: results = CoverageResults(infile=counts_file, outfile=counts_file) results.write_results(missing, summary=summary, coverdir=coverdir) else: sys.argv = prog_argv progname = prog_argv[0] sys.path[0] = os.path.split(progname)[0] t = Trace(count, trace, countfuncs=listfuncs, countcallers=countcallers, ignoremods=ignore_modules, ignoredirs=ignore_dirs, infile=counts_file, outfile=counts_file, timing=timing) try: fp = open(progname) try: script = fp.read() finally: fp.close() t.run('exec(%r)' % (script,)) except IOError as err: _err_exit("Cannot run file %r because: %s" % (sys.argv[0], err)) except SystemExit: pass results = t.results() if not no_report: results.write_results(missing, summary=summary, coverdir=coverdir)
aa0de9f9dd484b64064a7a3b78f2875da38d39f6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/aa0de9f9dd484b64064a7a3b78f2875da38d39f6/trace.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 33, 7036, 4672, 1930, 336, 3838, 225, 309, 5261, 353, 599, 30, 5261, 273, 2589, 18, 19485, 775, 30, 1500, 16, 11243, 67, 19485, 273, 336, 3838, 18, 588, 3838, 12, 1948...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 19485, 33, 7036, 4672, 1930, 336, 3838, 225, 309, 5261, 353, 599, 30, 5261, 273, 2589, 18, 19485, 775, 30, 1500, 16, 11243, 67, 19485, 273, 336, 3838, 18, 588, 3838, 12, 1948...
req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search))
out = """<table width="100%%" cellspacing="0" cellpadding="0" border="0"> <tr valign="top"> <td> %s </td> <td class="pagestriperight"> %s </td> </tr> </table>""" % \ (create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search), create_google_box(p, f, p1, p2, p3)) req.write(out)
def perform_request_search(req=None, cc=cdsname, c=None, p="", f="", rg="10", sf="", so="d", sp="", of="hb", ot="", as="0", p1="", f1="", m1="", op1="", p2="", f2="", m2="", op2="", p3="", f3="", m3="", sc="0", jrec="0", id="-1", idb="-1", sysnb="", search="SEARCH", d1y="", d1m="", d1d="", d2y="", d2m="", d2d=""): """Perform search, without checking for authentication. Return list of recIDs found, if of=id. Otherwise create web page.""" # wash all passed arguments: cc = wash_url_argument(cc, 'str') p = wash_url_argument(p, 'str') f = wash_url_argument(f, 'str') rg = wash_url_argument(rg, 'int') sf = wash_url_argument(sf, 'str') so = wash_url_argument(so, 'str') sp = wash_url_argument(sp, 'string') of = wash_url_argument(of, 'str') if type(ot) is list: ot = string.join(ot,",") ot = wash_url_argument(ot, 'str') as = wash_url_argument(as, 'int') p1 = wash_url_argument(p1, 'str') f1 = wash_url_argument(f1, 'str') m1 = wash_url_argument(m1, 'str') op1 = wash_url_argument(op1, 'str') p2 = wash_url_argument(p2, 'str') f2 = wash_url_argument(f2, 'str') m2 = wash_url_argument(m2, 'str') op2 = wash_url_argument(op2, 'str') p3 = wash_url_argument(p3, 'str') f3 = wash_url_argument(f3, 'str') m3 = wash_url_argument(m3, 'str') sc = wash_url_argument(sc, 'int') jrec = wash_url_argument(jrec, 'int') id = wash_url_argument(id, 'int') idb = wash_url_argument(idb, 'int') sysnb = wash_url_argument(sysnb, 'int') search = wash_url_argument(search, 'str') d1y = wash_url_argument(d1y, 'str') d1m = wash_url_argument(d1m, 'str') d1d = wash_url_argument(d1d, 'str') d2y = wash_url_argument(d2y, 'str') d2m = wash_url_argument(d2m, 'str') d2d = wash_url_argument(d2d, 'str') day1, day2 = wash_dates(d1y, d1m, d1d, d2y, d2m, d2d) # start output if of.startswith('x'): # we are doing XML output: req.content_type = "text/xml" req.send_http_header() req.write("""<?xml version="1.0" encoding="UTF-8"?>\n""") if of.startswith("xm"): req.write("""<collection xmlns="http://www.loc.gov/MARC21/slim">\n""") else: req.write("""<collection>\n""") elif of.startswith('t') or str(of[0:3]).isdigit(): # we are doing plain text output: req.content_type = "text/plain" req.send_http_header() elif of == "id": # we are passing list of recIDs pass else: # we are doing HTML output: req.content_type = "text/html" req.send_http_header() # detect user: try: uid = getUid(req) req.write(create_header(cc, as, create_user_infobox(uid))) except: # ignore user personalisation, needed e.g. for command-line req.write(create_header(cc, as)) if sysnb or id>0: ## 1 - detailed record display if sysnb: # ALEPH sysnb is passed, so deduce MySQL id for the record: id = get_mysql_recid_from_aleph_sysno(sysnb) if of=="hb": of = "hd" if record_exists(id): if idb<=id: # sanity check idb=id+1 print_records(req, range(id,idb), -1, -9999, of, ot) else: # record does not exist if of.startswith("h"): (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) p = wash_pattern(p) f = wash_field(f) req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search)) print_warning(req, "Requested record does not seem to exist.", None, "<p>") elif search == "Browse": ## 2 - browse needed (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) p = wash_pattern(p) f = wash_field(f) # write search box: if of.startswith("h"): req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search)) if as==1 or (p1 or p2 or p3): browse_pattern(req, colls_to_search, p1, f1, rg) browse_pattern(req, colls_to_search, p2, f2, rg) browse_pattern(req, colls_to_search, p3, f3, rg) else: browse_pattern(req, colls_to_search, p, f, rg) else: ## 3 - search needed # wash passed collection arguments: (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) p = wash_pattern(p) f = wash_field(f) # write search box: if of.startswith("h"): req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search)) # run search: t1 = os.times()[4] if as == 1 or (p1 or p2 or p3): # 3A - advanced search results_final = search_pattern(req, "", "", colls_to_search) if p1: results_tmp = search_pattern(req, p1, f1, colls_to_search, m1) for coll in colls_to_search: # join results for first advanced search boxen results_final[coll].intersect(results_tmp[coll]) if p2: results_tmp = search_pattern(req, p2, f2, colls_to_search, m2) for coll in colls_to_search: # join results for first and second advanced search boxen if op1 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op1 == "o": # or results_final[coll].union(results_tmp[coll]) elif op1 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op1, "Error") if p3: results_tmp = search_pattern(req, p3, f3, colls_to_search, m3) for coll in colls_to_search: # join results for second and third advanced search boxen if op2 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op2 == "o": # or results_final[coll].union(results_tmp[coll]) elif op2 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op1, "Error") for coll in colls_to_search: results_final[coll].calculate_nbhits() else: # 3B - simple search search_cache_key = p+"@"+f+"@"+string.join(colls_to_search,",") if search_cache.has_key(search_cache_key): # is the result in search cache? results_final = search_cache[search_cache_key] else: results_final = search_pattern(req, p, f, colls_to_search) search_cache[search_cache_key] = results_final if len(search_cache) > cfg_search_cache_size: # is the cache full? (sanity cleaning) search_cache.clear() # search done; was there a time restriction? if yes, apply it now: if day1 != "": results_of_time_restriction = search_in_bibrec(day1, day2) for coll in colls_to_search: results_final[coll].intersect(results_of_time_restriction) results_final[coll].calculate_nbhits() t2 = os.times()[4] cpu_time = t2 - t1 # find total number of records found in each collection results_final_nb_total = 0 results_final_nb = {} for coll in colls_to_search: results_final_nb[coll] = results_final[coll]._nbhits results_final_nb_total += results_final_nb[coll] # was there at least one hit? if results_final_nb_total == 0: # nope, so try similar queries: if of.startswith('h'): print_warning(req, "No match found. Trying similar queries...", "", "<p>","<p>") req.write("<p>") if as==1 or (p1 or p2 or p3): if p1: search_pattern(req, p1, f1, colls_to_search, m1, 1) if p2: search_pattern(req, p2, f2, colls_to_search, m2, 1) if p3: search_pattern(req, p3, f3, colls_to_search, m3, 1) else: search_pattern(req, p, f, colls_to_search, None, 1) else: # yes, some hits found, so print results overview: if of == "id": # we have been asked to return list of recIDs results_final_for_all_colls = HitList() for coll in colls_to_search: results_final_for_all_colls.union(results_final[coll]) return results_final_for_all_colls.items() elif of.startswith("h"): req.write(print_results_overview(colls_to_search, results_final_nb_total, results_final_nb, cpu_time)) # print records: if len(colls_to_search)>1: cpu_time = -1 # we do not want to have search time printed on each collection for coll in colls_to_search: if results_final[coll]._nbhits: if of.startswith("h"): req.write(print_search_info(p, f, sf, so, sp, of, ot, coll, results_final_nb[coll], jrec, rg, as, p1, p2, p3, f1, f2, f3, m1, m2, m3, op1, op2, d1y, d1m, d1d, d2y, d2m, d2d, cpu_time)) results_final_sorted = results_final[coll].items() if sf: results_final_sorted = sort_records(req, results_final_sorted, sf, so, sp) print_records(req, results_final_sorted, jrec, rg, of, ot) if of.startswith("h"): req.write(print_search_info(p, f, sf, so, sp, of, ot, coll, results_final_nb[coll], jrec, rg, as, p1, p2, p3, f1, f2, f3, m1, m2, m3, op1, op2, d1y, d1m, d1d, d2y, d2m, d2d, cpu_time, 1)) # log query: try: log_query(req.get_remote_host(), req.args, uid) except: # do not log query if req is None (used by CLI interface) pass log_query_info("ss", p, f, colls_to_search, results_final_nb_total) # 4 -- write footer: if of.startswith('h'): req.write(create_footer()) elif of.startswith('x'): req.write("""</collection>\n""") # 5 - return value if of == "id": return [] else: return "\n"
0aec736283882ec36ab3010d663d9be625f4d852 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/0aec736283882ec36ab3010d663d9be625f4d852/search_engine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3073, 67, 2293, 67, 3072, 12, 3658, 33, 7036, 16, 4946, 33, 71, 2377, 529, 16, 276, 33, 7036, 16, 293, 1546, 3113, 284, 1546, 3113, 14524, 1546, 2163, 3113, 9033, 1546, 3113, 1427, 154...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3073, 67, 2293, 67, 3072, 12, 3658, 33, 7036, 16, 4946, 33, 71, 2377, 529, 16, 276, 33, 7036, 16, 293, 1546, 3113, 284, 1546, 3113, 14524, 1546, 2163, 3113, 9033, 1546, 3113, 1427, 154...
except CifFile.CifError: pass
except (StarFile.StarError,CifFile.CifError): pass
def testTooLongSet(self): """test setting overlong data names""" dataname = '_a_long_long_'*7 try: self.cf[dataname] = 1.0 except CifFile.CifError: pass else: self.fail()
a65d099e46f5afda94b5df0a69c7bb8d7605c42c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3057/a65d099e46f5afda94b5df0a69c7bb8d7605c42c/TestPyCifRW.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 10703, 3708, 694, 12, 2890, 4672, 3536, 3813, 3637, 1879, 5748, 501, 1257, 8395, 1150, 304, 339, 273, 2070, 69, 67, 5748, 67, 5748, 4623, 14, 27, 775, 30, 365, 18, 8522, 63, 3404...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10703, 3708, 694, 12, 2890, 4672, 3536, 3813, 3637, 1879, 5748, 501, 1257, 8395, 1150, 304, 339, 273, 2070, 69, 67, 5748, 67, 5748, 4623, 14, 27, 775, 30, 365, 18, 8522, 63, 3404...
import gzip
def createRepo(self, baseurl): import gzip # Strip trailing slashes. while len(self.filename) > 1 and self.filename[-1] == "/": self.filename = self.filename[:-1] rt = {} for i in ("name", "epoch", "version", "release", "arch", "requirename"): rt[i] = rpmtag[i] filename = self.filename self.filerequires = [] filenames = findRpms(filename) i = 0 while i < len(filenames): path = filenames[i] pkg = ReadRpm(path) if pkg.readHeader({}, rt): print "Cannot read %s.\n" % path continue pkg.closeFd() if self.excludes and self.__isExcluded(pkg): filenames.pop(i) continue for reqname in pkg.hdr.get("requirename", []): if reqname[0] == "/": self.filerequires.append(reqname) i += 1 numpkg = len(filenames) repodir = filename + "/repodata" makeDirs(repodir) (origpfd, pfdtmp) = mkstemp_file(repodir, special=1) pfd = gzip.GzipFile(fileobj=origpfd, mode="wb") if not pfd: return 0 firstlinexml = '<?xml version="1.0" encoding="UTF-8"?>\n' pfd.write(firstlinexml) pfd.write('<metadata xmlns="http://linux.duke.edu/metadata/common" ' \ 'xmlns:rpm="http://linux.duke.edu/metadata/rpm" packages="%d">\n' \ % numpkg) (origffd, ffdtmp) = mkstemp_file(repodir, special=1) ffd = gzip.GzipFile(fileobj=origffd, mode="wb") if not ffd: return 0 ffd.write(firstlinexml) ffd.write('<filelists xmlns="http://linux.duke.edu/metadata/' \ 'filelists" packages="%d">\n' % numpkg) (origofd, ofdtmp) = mkstemp_file(repodir, special=1) ofd = gzip.GzipFile(fileobj=origofd, mode="wb") if not ofd: return 0 ofd.write(firstlinexml) ofd.write('<otherdata xmlns="http://linux.duke.edu/metadata/other" ' \ 'packages="%s">\n' % numpkg)
d5b95a34fa0e48227e7afbfbbaaecef730519c14 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/d5b95a34fa0e48227e7afbfbbaaecef730519c14/oldpyrpm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 8791, 12, 2890, 16, 25427, 4672, 468, 15589, 7341, 19034, 18, 1323, 562, 12, 2890, 18, 3459, 13, 405, 404, 471, 365, 18, 3459, 18919, 21, 65, 422, 4016, 30, 365, 18, 3459, 273, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 8791, 12, 2890, 16, 25427, 4672, 468, 15589, 7341, 19034, 18, 1323, 562, 12, 2890, 18, 3459, 13, 405, 404, 471, 365, 18, 3459, 18919, 21, 65, 422, 4016, 30, 365, 18, 3459, 273, ...
MSG("Done.")
def cmd_init(argv, path_to_tx=None): """ Initialize the tx client folder. The .tx folder is created by default to the CWD! """ # Current working dir path root = os.getcwd() if path_to_tx: if not os.path.exists(path_to_tx): MSG("tx: The path to root directory does not exist!") return path = find_dot_tx(path_to_tx) if path: MSG("tx: There is already a tx folder!") reinit = raw_input("Do you want to delete it and reinit the project? [y/N]:") while (reinit != 'y' and reinit != 'Y' and reinit != 'N' and reinit != 'n' and reinit != ''): reinit = raw_input("Do you want to delete it and reinit the project? [y/N]:") if not reinit or reinit == 'N': return # Clean the old settings # FIXME: take a backup else: rm_dir = os.path.join(path, ".tx") shutil.rmtree(rm_dir) root = path_to_tx MSG("Creating .tx folder ...") # FIXME: decide the mode of the directory os.mkdir(os.path.join(path_to_tx,".tx")) else: path = find_dot_tx(root) if path: MSG("tx: There is already a tx folder!") reinit = raw_input("Do you want to delete it and reinit the project? [y/N]:") while (reinit != 'y' and reinit != 'Y' and reinit != 'N' and reinit != 'n' and reinit != ''): reinit = raw_input("Do you want to delete it and reinit the project? [y/N]:") if not reinit or reinit == 'N': return # Clean the old settings # FIXME: take a backup else: rm_dir = os.path.join(path, ".tx") shutil.rmtree(rm_dir) MSG("Creating .tx folder ...") # FIXME: decide the mode of the directory os.mkdir(os.path.join(os.getcwd(), ".tx")) MSG("Done.") # Handle the credentials through transifexrc home = os.getenv('USERPROFILE') or os.getenv('HOME') txrc = os.path.join(home, ".transifexrc") config = ConfigParser.RawConfigParser() # Touch the file if it doesn't exist
2229e0d5fbac79a2c02ff622b6b19dbde9a9bca9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11326/2229e0d5fbac79a2c02ff622b6b19dbde9a9bca9/commands.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1797, 67, 2738, 12, 19485, 16, 589, 67, 869, 67, 978, 33, 7036, 4672, 3536, 9190, 326, 2229, 1004, 3009, 18, 225, 1021, 263, 978, 3009, 353, 2522, 635, 805, 358, 326, 385, 16006, 5, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1797, 67, 2738, 12, 19485, 16, 589, 67, 869, 67, 978, 33, 7036, 4672, 3536, 9190, 326, 2229, 1004, 3009, 18, 225, 1021, 263, 978, 3009, 353, 2522, 635, 805, 358, 326, 385, 16006, 5, ...
np.add(chan.raw_data, np.fromstring(decomp_data, fmt_str), chan.raw_data)
chan.raw_data[:] = np.fromstring(decomp_data, fmt_str)
def __read_data_compressed(self, channels): # At least in post-4.0 files, the compressed data isn't interleaved at # all. It's stored in uniform compressed blocks -- this probably # compresses far better than interleaved data. # Strangely, the compressed data seems to always be little-endian. for i in range(len(channels)): cch = self.channel_compression_headers[i] chan = channels[i] # Data seems to be little-endian regardless of the rest of the file fmt_str = '<'+chan.fmt_str[1] self.acq_file.seek(cch.compressed_data_offset) comp_data = self.acq_file.read(cch.compressed_data_len) decomp_data = zlib.decompress(comp_data) # raw_data starts out as zeros. Yeah, this feels hacky to me, too. np.add(chan.raw_data, np.fromstring(decomp_data, fmt_str), chan.raw_data)
bee7b3f529aa17717ec586c5d6d51e36732fce2a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14571/bee7b3f529aa17717ec586c5d6d51e36732fce2a/readers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 896, 67, 892, 67, 15385, 12, 2890, 16, 5750, 4672, 468, 2380, 4520, 316, 1603, 17, 24, 18, 20, 1390, 16, 326, 8968, 501, 5177, 1404, 1554, 22593, 622, 468, 777, 18, 2597, 1807, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 896, 67, 892, 67, 15385, 12, 2890, 16, 5750, 4672, 468, 2380, 4520, 316, 1603, 17, 24, 18, 20, 1390, 16, 326, 8968, 501, 5177, 1404, 1554, 22593, 622, 468, 777, 18, 2597, 1807, ...
stuff = pp[i].data if len(stuff) != 1: raise error, "parameter to \\setindexsubitem{} too long" if pp[i].chtype != chunk_type[GROUP]: raise error, "bad chunk type following \\setindexsubitem" \ "\nexpected GROUP, got " + str(ch.chtype) text = s(buf, stuff[0].data) if text[:1] != '(' or text[-1:] != ')': raise error, \ 'expected indexsubitem enclosed in parenteses' hist.indexsubitem = string.split(text[1:-1]) del stuff, text del pp[i-1:i+1] i = i - 1 length = length - 2
length, i = yank_indexsubitem(pp, length, i, buf, ch, 'setindexsubitem') elif s_buf_data == 'withsubitem': oldsubitem = hist.indexsubitem try: length, i = yank_indexsubitem(pp, length, i, buf, ch, 'withsubitem') stuff = pp[i].data del pp[i] length = length - 1 changeit(buf, stuff) stuff = None finally: hist.indexsubitem = oldsubitem elif s_buf_data in ('textrm', 'pytype'): stuff = pp[i].data pp[i-1:i+1] = stuff length = length - 2 + len(stuff) stuff = None i = i - 1
def changeit(buf, pp): global onlylatexspecial, hist, out i, length = 0, len(pp) while 1: # sanity check: length should always equal len(pp) if len(pp) != length: print i, pp[i] raise 'FATAL', 'inconsistent length. thought ' + `length` + ', but should really be ' + `len(pp)` if i >= length: break ch = pp[i] i = i + 1 if type(ch) is StringType: #normally, only chunks are present in pp, # but in some cases, some extra info # has been inserted, e.g., the \end{...} clauses raise 'FATAL', 'got string, probably too many ' + `end` if ch.chtype == chunk_type[GROUP]: # check for {\em ...} constructs data = ch.data if data and \ data[0].chtype == chunk_type[CSNAME] and \ fontchanges.has_key(s(buf, data[0].data)): k = s(buf, data[0].data) del data[0] pp.insert(i-1, chunk(CSNAME, ch.where, fontchanges[k])) length, i = length+1, i+1 elif data: if len(data) \ and data[0].chtype == chunk_type[GROUP] \ and len(data[0].data) \ and data[0].data[0].chtype == chunk_type[CSNAME] \ and s(buf, data[0].data[0].data) == 'e': data[0] = data[0].data[0] print "invoking \\e magic group transform..." else:
a302c9555984072394cd72609bc8973adecd6fe3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a302c9555984072394cd72609bc8973adecd6fe3/partparse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2549, 305, 12, 4385, 16, 8228, 4672, 2552, 1338, 26264, 9371, 16, 5356, 16, 596, 225, 277, 16, 769, 273, 374, 16, 562, 12, 11858, 13, 1323, 404, 30, 468, 16267, 866, 30, 769, 1410, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2549, 305, 12, 4385, 16, 8228, 4672, 2552, 1338, 26264, 9371, 16, 5356, 16, 596, 225, 277, 16, 769, 273, 374, 16, 562, 12, 11858, 13, 1323, 404, 30, 468, 16267, 866, 30, 769, 1410, 3...
sol_dict=[dict([[eq.left(),eq.right()] for eq in solution]) for solution in sol_list]
if isinstance(sol_list[0], list): sol_dict=[dict([[eq.left(),eq.right()] for eq in solution]) for solution in sol_list] else: sol_dict=[{eq.left():eq.right()} for eq in sol_list]
def solve(f, *args, **kwds): r""" Algebraically solve an equation of system of equations for given variables. INPUT: - ``f`` - equation or system of equations (given by a list or tuple) - ``*args`` - variables to solve for. - ``solution_dict = True`` - return a list of dictionaries containing the solutions. EXAMPLES:: sage: x, y = var('x, y') sage: solve([x+y==6, x-y==4], x, y) [[x == 5, y == 1]] sage: solve([x^2+y^2 == 1, y^2 == x^3 + x + 1], x, y) [[x == -1/2*I*sqrt(3) - 1/2, y == -1/2*sqrt(-I*sqrt(3) + 3)*sqrt(2)], [x == -1/2*I*sqrt(3) - 1/2, y == 1/2*sqrt(-I*sqrt(3) + 3)*sqrt(2)], [x == 1/2*I*sqrt(3) - 1/2, y == -1/2*sqrt(I*sqrt(3) + 3)*sqrt(2)], [x == 1/2*I*sqrt(3) - 1/2, y == 1/2*sqrt(I*sqrt(3) + 3)*sqrt(2)], [x == 0, y == -1], [x == 0, y == 1]] sage: solutions=solve([x^2+y^2 == 1, y^2 == x^3 + x + 1], x, y, solution_dict=True) sage: for solution in solutions: print solution[x].n(digits=3), ",", solution[y].n(digits=3) -0.500 - 0.866*I , -1.27 + 0.341*I -0.500 - 0.866*I , 1.27 - 0.341*I -0.500 + 0.866*I , -1.27 - 0.341*I -0.500 + 0.866*I , 1.27 + 0.341*I 0.000 , -1.00 0.000 , 1.00 sage: z = 5 sage: solve([8*z + y == 3, -z +7*y == 0],y,z) Traceback (most recent call last): ... TypeError: 5 is not a valid variable. If ``True`` appears in the list of equations it is ignored, and if ``False`` appears in the list then no solutions are returned. E.g., note that the first ``3==3`` evaluates to ``True``, not to a symbolic equation. :: sage: solve([3==3, 1.00000000000000*x^3 == 0], x) [x == 0] sage: solve([1.00000000000000*x^3 == 0], x) [x == 0] Here, the first equation evaluates to ``False``, so there are no solutions:: sage: solve([1==3, 1.00000000000000*x^3 == 0], x) [] :: sage: var('s,j,b,m,g') (s, j, b, m, g) sage: sys = [ m*(1-s) - b*s*j, b*s*j-g*j ]; sage: solve(sys,s,j) [[s == 1, j == 0], [s == g/b, j == (b - g)*m/(b*g)]] sage: solve(sys,(s,j)) [[s == 1, j == 0], [s == g/b, j == (b - g)*m/(b*g)]] sage: solve(sys,[s,j]) [[s == 1, j == 0], [s == g/b, j == (b - g)*m/(b*g)]] """ try: return f.solve(*args,**kwds) except AttributeError: from sage.symbolic.ring import is_SymbolicVariable if is_SymbolicVariable(args[0]): variables = args else: variables = tuple(args[0]) for v in variables: if not is_SymbolicVariable(v): raise TypeError, "%s is not a valid variable."%v try: f = [s for s in f if s is not True] except TypeError: raise ValueError, "Unable to solve %s for %s"%(f, args) if any(s is False for s in f): return [] m = maxima(f) try: s = m.solve(variables) except: raise ValueError, "Unable to solve %s for %s"%(f, args) sol_list = string_to_list_of_solutions(repr(s)) if 'solution_dict' in kwds and kwds['solution_dict']==True: sol_dict=[dict([[eq.left(),eq.right()] for eq in solution]) for solution in sol_list] return sol_dict else: return sol_list
3961abf578b8680a70f88012b4051205b3878942 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/3961abf578b8680a70f88012b4051205b3878942/relation.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12439, 12, 74, 16, 380, 1968, 16, 2826, 25577, 4672, 436, 8395, 2262, 29087, 6478, 12439, 392, 15778, 434, 2619, 434, 30369, 364, 864, 3152, 18, 225, 12943, 30, 225, 300, 225, 12176, 74,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12439, 12, 74, 16, 380, 1968, 16, 2826, 25577, 4672, 436, 8395, 2262, 29087, 6478, 12439, 392, 15778, 434, 2619, 434, 30369, 364, 864, 3152, 18, 225, 12943, 30, 225, 300, 225, 12176, 74,...
if not value: return ''
def formatLang(self, value, digits=2, date=False,date_time=False, grouping=True, monetary=False, currency=None): if not value: return '' pool_lang=self.pool.get('res.lang') lang = self.localcontext.get('lang', 'en_US') or 'en_US' lang_obj = pool_lang.browse(self.cr,self.uid,pool_lang.search(self.cr,self.uid,[('code','=',lang)])[0]) if date or date_time: date_format = lang_obj.date_format if date_time: date_format = lang_obj.date_format + " " + lang_obj.time_format if not isinstance(value, time.struct_time): # assume string, parse it if len(str(value)) == 10: # length of date like 2001-01-01 is ten # assume format '%Y-%m-%d' date = mx.DateTime.strptime(value,DT_FORMAT) else: # assume format '%Y-%m-%d %H:%M:%S' value = str(value)[:19] date = mx.DateTime.strptime(str(value),DHM_FORMAT) else: date = mx.DateTime.DateTime(*(value.timetuple()[:6])) return date.strftime(date_format) return lang_obj.format('%.' + str(digits) + 'f', value, grouping=grouping, monetary=monetary)
027272820fe45ae72172261700a82d078a8aa961 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/027272820fe45ae72172261700a82d078a8aa961/report_sxw.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 7275, 12, 2890, 16, 460, 16, 6815, 33, 22, 16, 1509, 33, 8381, 16, 712, 67, 957, 33, 8381, 16, 12116, 33, 5510, 16, 31198, 33, 8381, 16, 5462, 33, 7036, 4672, 282, 2845, 67, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 7275, 12, 2890, 16, 460, 16, 6815, 33, 22, 16, 1509, 33, 8381, 16, 712, 67, 957, 33, 8381, 16, 12116, 33, 5510, 16, 31198, 33, 8381, 16, 5462, 33, 7036, 4672, 282, 2845, 67, 4...
view = content_replacer.ContentMenuView(self.fpage, req)
view = content_replacer.ContentMenuView(self.folder, req)
def testKukitCutObject(self): req = self.portal.REQUEST view = content_replacer.ContentMenuView(self.fpage, req) result = view.cutObject()
c01f348b980345a36cd65be7267e7e1998a9d174 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12181/c01f348b980345a36cd65be7267e7e1998a9d174/test_menus.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 47, 89, 8691, 15812, 921, 12, 2890, 4672, 1111, 273, 365, 18, 24386, 18, 5519, 225, 1476, 273, 913, 67, 26745, 10598, 18, 1350, 4599, 1767, 12, 2890, 18, 5609, 16, 1111, 13, 563,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1842, 47, 89, 8691, 15812, 921, 12, 2890, 4672, 1111, 273, 365, 18, 24386, 18, 5519, 225, 1476, 273, 913, 67, 26745, 10598, 18, 1350, 4599, 1767, 12, 2890, 18, 5609, 16, 1111, 13, 563,...
def loop(timeout=30.0, use_poll=0, map=None):
def loop(timeout=30.0, use_poll=False, map=None):
def loop(timeout=30.0, use_poll=0, map=None): if map is None: map = socket_map if use_poll and hasattr(select, 'poll'): poll_fun = poll2 else: poll_fun = poll while map: poll_fun(timeout, map)
f94fbfa5fad912cd8d3e8c9796714e413449545b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f94fbfa5fad912cd8d3e8c9796714e413449545b/asyncore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2798, 12, 4538, 33, 5082, 18, 20, 16, 999, 67, 13835, 33, 8381, 16, 852, 33, 7036, 4672, 309, 852, 353, 599, 30, 852, 273, 2987, 67, 1458, 225, 309, 999, 67, 13835, 471, 3859, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2798, 12, 4538, 33, 5082, 18, 20, 16, 999, 67, 13835, 33, 8381, 16, 852, 33, 7036, 4672, 309, 852, 353, 599, 30, 852, 273, 2987, 67, 1458, 225, 309, 999, 67, 13835, 471, 3859, 12, ...
self.mol = molecule(win.assy, chem.gensym("Nanotube."))
def __init__(self, win): NanotubeGeneratorDialog.__init__(self, win) # win is parent. Fixes bug 1089. Mark 051119. self.win = win self.mol = molecule(win.assy, chem.gensym("Nanotube.")) # Validator for the length linedit widget. self.validator = QDoubleValidator(self) self.validator.setRange(0.0, 1000.0, 2) # Range of nanotube length (0-100, 2 decimal places) self.length_linedit.setValidator(self.validator) self.cursor_pos = 0 # Default nanotube parameters. self.n = 5 self.m = 5 self.length = 5.0 # Angstoms self.lenstr = '%1.2f' % self.length # Also used for validation self.setup()
d30e9692e8069f4ca8f6a777869c341be527891d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/d30e9692e8069f4ca8f6a777869c341be527891d/NanotubeGenerator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5657, 4672, 23294, 352, 4895, 3908, 6353, 16186, 2738, 972, 12, 2890, 16, 5657, 13, 468, 5657, 353, 982, 18, 225, 12139, 281, 7934, 1728, 6675, 18, 225, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5657, 4672, 23294, 352, 4895, 3908, 6353, 16186, 2738, 972, 12, 2890, 16, 5657, 13, 468, 5657, 353, 982, 18, 225, 12139, 281, 7934, 1728, 6675, 18, 225, ...
sagex_include = ' '.join(['-I %s'%x for x in includes])
sagex_include = ' '.join(['-I %s'%x for x in includes if len(x.strip()) > 0 ])
def sagex(filename, verbose=False, compile_message=False, use_cache=False, create_local_c_file=False): if filename[-5:] != '.spyx': print "File (=%s) must have extension .spyx"%filename base = os.path.split(os.path.splitext(filename)[0])[1] build_dir = '%s/%s'%(SPYX_TMP, base) if os.path.exists(build_dir): # There is already a module here. Maybe we do not have to rebuild? # Find the name. if use_cache: prev_so = [F for F in os.listdir(build_dir) if F[-3:] == '.so'] if len(prev_so) > 0: prev_so = prev_so[0] # should have length 1 because of deletes below if os.path.getmtime(filename) <= os.path.getmtime('%s/%s'%(build_dir, prev_so)): # We do not have to rebuild. return prev_so[:-3], build_dir else: os.makedirs(build_dir) for F in os.listdir(build_dir): G = '%s/%s'%(build_dir,F) if not os.path.isdir(G): os.unlink(G) os.system('cd "%s"; ln -s "%s"/devel/sage/sage/ext/*.c .'%(build_dir, SAGE_ROOT)) if compile_message: print "Compiling %s..."%filename F = open(filename).read() F, libs, includes, language, additional_source_files = pyx_preparse(F) # add the working directory to the includes so custom headers etc. work includes.append(os.path.split(os.path.splitext(filename)[0])[0]) if language == 'c++': extension = "cpp" else: extension = "c" global sequence_number if not sequence_number.has_key(base): sequence_number[base] = 0 name = '%s_%s'%(base, sequence_number[base]) # increment the sequence number so will use a different one next time. sequence_number[base] += 1 additional_source_files = ",".join(["'"+os.path.abspath(os.curdir)+"/"+filename+"'" \ for filename in additional_source_files]) pyx = '%s/%s.pyx'%(build_dir, name) open(pyx,'w').write(F) setup="""
ffd0d4dd43c76894226d38f2cd935dff90c54675 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/ffd0d4dd43c76894226d38f2cd935dff90c54675/sagex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20908, 338, 12, 3459, 16, 3988, 33, 8381, 16, 4074, 67, 2150, 33, 8381, 16, 999, 67, 2493, 33, 8381, 16, 752, 67, 3729, 67, 71, 67, 768, 33, 8381, 4672, 309, 1544, 18919, 25, 26894, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20908, 338, 12, 3459, 16, 3988, 33, 8381, 16, 4074, 67, 2150, 33, 8381, 16, 999, 67, 2493, 33, 8381, 16, 752, 67, 3729, 67, 71, 67, 768, 33, 8381, 4672, 309, 1544, 18919, 25, 26894, ...
cls.add_instance_attribute('bytesDropped', 'std::vector< unsigned long long >', is_const=False)
cls.add_instance_attribute('bytesDropped', 'std::vector< uint64_t >', is_const=False)
def register_Ns3FlowProbeFlowStats_methods(root_module, cls): ## flow-probe.h: ns3::FlowProbe::FlowStats::FlowStats(ns3::FlowProbe::FlowStats const & arg0) [copy constructor] cls.add_constructor([param('ns3::FlowProbe::FlowStats const &', 'arg0')]) ## flow-probe.h: ns3::FlowProbe::FlowStats::FlowStats() [constructor] cls.add_constructor([]) ## flow-probe.h: ns3::FlowProbe::FlowStats::bytes [variable] cls.add_instance_attribute('bytes', 'uint64_t', is_const=False) ## flow-probe.h: ns3::FlowProbe::FlowStats::bytesDropped [variable] cls.add_instance_attribute('bytesDropped', 'std::vector< unsigned long long >', is_const=False) ## flow-probe.h: ns3::FlowProbe::FlowStats::delayFromFirstProbeSum [variable] cls.add_instance_attribute('delayFromFirstProbeSum', 'ns3::Time', is_const=False) ## flow-probe.h: ns3::FlowProbe::FlowStats::packets [variable] cls.add_instance_attribute('packets', 'uint32_t', is_const=False) ## flow-probe.h: ns3::FlowProbe::FlowStats::packetsDropped [variable] cls.add_instance_attribute('packetsDropped', 'std::vector< unsigned int >', is_const=False) return
d6ba081f0bb57b89c23bb2709ba37e3ebc0a3277 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12851/d6ba081f0bb57b89c23bb2709ba37e3ebc0a3277/ns3_module_flow_monitor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1744, 67, 10386, 23, 5249, 21042, 5249, 4195, 67, 5163, 12, 3085, 67, 2978, 16, 2028, 4672, 7541, 4693, 17, 27230, 18, 76, 30, 3153, 23, 2866, 5249, 21042, 2866, 5249, 4195, 2866, 5249, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1744, 67, 10386, 23, 5249, 21042, 5249, 4195, 67, 5163, 12, 3085, 67, 2978, 16, 2028, 4672, 7541, 4693, 17, 27230, 18, 76, 30, 3153, 23, 2866, 5249, 21042, 2866, 5249, 4195, 2866, 5249, ...
iq.swapAttribs("to", "from")
iq.swapAttributeValues("to", "from")
def onGetHostInfo(self, iq): iq.swapAttribs("to", "from") iq["type"] = "result" iq.query.children = [] s = iq.query.addElement("streamhost") s["jid"] = self.jabberId s["host"] = self.proxyIP s["port"] = self.proxyPort self.xmlstream.send(iq)
26dc22b4b597351de5bae35a9b6ca4059e4c0a95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5317/26dc22b4b597351de5bae35a9b6ca4059e4c0a95/proxy65.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 967, 2594, 966, 12, 2890, 16, 24288, 4672, 24288, 18, 22270, 31770, 2932, 869, 3113, 315, 2080, 7923, 24288, 9614, 723, 11929, 273, 315, 2088, 6, 24288, 18, 2271, 18, 5906, 273, 537...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 967, 2594, 966, 12, 2890, 16, 24288, 4672, 24288, 18, 22270, 31770, 2932, 869, 3113, 315, 2080, 7923, 24288, 9614, 723, 11929, 273, 315, 2088, 6, 24288, 18, 2271, 18, 5906, 273, 537...
keys = web.ctx.site.things({'type': '/type/usergroup', 'members': {'key': self.key}})
keys = web.ctx.site.things({'type': '/type/usergroup', 'members': self.key})
def get_usergroups(self): keys = web.ctx.site.things({'type': '/type/usergroup', 'members': {'key': self.key}}) return web.ctx.site.get_many(keys)
89b26dae723e2b4783931bc3b4ca9f054b93f7a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3913/89b26dae723e2b4783931bc3b4ca9f054b93f7a8/code.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1355, 4650, 12, 2890, 4672, 1311, 273, 3311, 18, 5900, 18, 4256, 18, 451, 899, 12590, 11, 723, 4278, 1173, 723, 19, 1355, 1655, 2187, 296, 7640, 4278, 365, 18, 856, 6792, 327,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1355, 4650, 12, 2890, 4672, 1311, 273, 3311, 18, 5900, 18, 4256, 18, 451, 899, 12590, 11, 723, 4278, 1173, 723, 19, 1355, 1655, 2187, 296, 7640, 4278, 365, 18, 856, 6792, 327,...
add_button.connect('clicked', self.on_layer_add) del_button = stock_button(gtk.STOCK_DELETE) del_button.connect('clicked', self.on_layer_del)
def __init__(self,app): gtk.Window.__init__(self) self.set_title(_("Layers")) self.set_role("Layers") self.app = app self.connect('delete-event', self.app.hide_window_cb) self.app.kbm.add_window(self) self.set_size_request(300, 300) self.callbacks_active = True
fa08ff4ae584c23e5712c79fef315eae8185c0e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7129/fa08ff4ae584c23e5712c79fef315eae8185c0e4/layerswindow.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2910, 4672, 22718, 18, 3829, 16186, 2738, 972, 12, 2890, 13, 365, 18, 542, 67, 2649, 24899, 2932, 9282, 6, 3719, 365, 18, 542, 67, 4615, 2932, 9282, 7923...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2910, 4672, 22718, 18, 3829, 16186, 2738, 972, 12, 2890, 13, 365, 18, 542, 67, 2649, 24899, 2932, 9282, 6, 3719, 365, 18, 542, 67, 4615, 2932, 9282, 7923...
f = os.popen('cpp -dM ../../pjlib/include/pj/config_site.h | grep PJ')
f = os.popen('cpp -dM -I../../pjlib/include ../../pjlib/include/pj/config_site.h | grep PJ')
def print_html_report(): # Get Revision info. f = os.popen('svn info | grep Revision') revision = f.readline().split()[1] # Get Machine, OS, and CC name f = os.popen('make -f Footprint.mak print_name') names = f.readline().split() m = names[0] o = names[1] cc = names[2] cc_ver = names[3] # Open HTML file filename = 'footprint-' + m + '-' + o + '.htm' output = open(filename, 'w') title = 'PJSIP and PJMEDIA footprint report for ' + m + '-' + o + ' target' output.write('<HTML><HEAD>\n'); output.write(' <TITLE>' + title + '</TITLE>\n') output.write(' <LINK href="/style/style.css" type="text/css" rel="stylesheet">\n') output.write('</HEAD>\n'); output.write('<BODY bgcolor="white">\n'); output.write('<!--#include virtual="/header.html" -->') output.write(' <H1>' + title + '</H1>\n') output.write('Auto-generated by pjsip-apps/build/get-footprint.py script\n') output.write('<p>Date: ' + time.asctime() + '<BR>\n') output.write('Revision: r' + revision + '</p>\n\n') output.write('<HR>\n') output.write('\n') # Info output.write('<H2>Build Configuration</H2>\n') # build.mak output.write('\n<H3>build.mak</H3>\n') output.write('<tt>\n') f = open('../../build.mak', 'r') s = f.readlines() for l in s: output.write(l + '<BR>\n') output.write('</tt>\n') output.write('<p>Using ' + cc + ' version ' + cc_ver +'</p>\n') # user.mak output.write('\n<H3>user.mak</H3>\n') output.write('<tt>\n') f = open('../../user.mak', 'r') s = f.readlines() for l in s: output.write(l + '<BR>\n') output.write('</tt>\n') # config_site.h output.write('\n<H3>&lt;pj/config.site.h&gt;</H3>\n') output.write('<tt>\n') f = os.popen('cpp -dM ../../pjlib/include/pj/config_site.h | grep PJ') s = f.readlines() for l in s: output.write(l + '<BR>\n') output.write('</tt>\n') # Write individual module size output.write('<H2>Footprint Report</H2>\n') output.write('<p>The table below shows the footprint of individual feature, in bytes.</p>') output.write('<TABLE border="1" cellpadding="2" cellspacing="0">\n' + '<TR bgcolor="#e8e8ff">\n' + ' <TD align="center"><strong>.text</strong></TD>\n' + ' <TD align="center"><strong>.data</strong></TD>\n' + ' <TD align="center"><strong>.bss</strong></TD>\n' + ' <TD align="center"><strong>Features/Module Description</strong></TD>\n' + '</TR>\n') for i in range(1, len(exe_size)): e = exe_size[i] prev = exe_size[i-1] output.write('<TR>\n') if e[1]<>'': output.write( ' <TD align="right">' + `string.atoi(e[2]) - string.atoi(prev[2])` + '</TD>\n') output.write( ' <TD align="right">' + `string.atoi(e[3]) - string.atoi(prev[3])` + '</TD>\n') output.write( ' <TD align="right">' + `string.atoi(e[4]) - string.atoi(prev[4])` + '</TD>\n' ) output.write( ' <TD>' + e[5] + '</TD>\n') else: empty_size = exe_size[1] output.write('<TR bgcolor="#e8e8ff">\n') output.write( ' <TD align="right">&nbsp;</TD>\n') output.write( ' <TD align="right">&nbsp;</TD>\n') output.write( ' <TD align="right">&nbsp;</TD>\n') output.write( ' <TD><strong>' + e[5] + ': .text=' + e[2]+ ', .data=' + e[3] + ', .bss=' + e[4] ) output.write( '\n </strong> <BR>(Size minus empty application size: ' + \ '.text=' + `string.atoi(e[2]) - string.atoi(empty_size[2])` + \ ', .data=' + `string.atoi(e[3]) - string.atoi(empty_size[3])` + \ ', .data=' + `string.atoi(e[4]) - string.atoi(empty_size[4])` + \ ')\n' ) output.write( ' </TD>\n') output.write('</TR>\n') output.write('</TABLE>\n') output.write('<!--#include virtual="/footer.html" -->') output.write('</BODY>\n') output.write('</HTML>\n') # Done output.close()
31513013751334340f72a6a79c6140bcb1f5a7df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1375/31513013751334340f72a6a79c6140bcb1f5a7df/get-footprint.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 2620, 67, 6006, 13332, 225, 468, 968, 13132, 1123, 18, 284, 273, 1140, 18, 84, 3190, 2668, 31505, 1123, 571, 23366, 13132, 6134, 6350, 273, 284, 18, 896, 1369, 7675, 4939, 1435...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 2620, 67, 6006, 13332, 225, 468, 968, 13132, 1123, 18, 284, 273, 1140, 18, 84, 3190, 2668, 31505, 1123, 571, 23366, 13132, 6134, 6350, 273, 284, 18, 896, 1369, 7675, 4939, 1435...
do_exec('mv docs/userguide/*.pdf %s'%dst) do_exec('mv docs/userguide/*.pdf %s'%htmldir)
do_exec('cp docs/userguide/*.pdf %s' % htmldir) do_exec('mv docs/userguide/*.pdf %s' % dst)
def cvs_checkout(d): os.chdir(d) cvsdir = os.path.join(d,projdir) recursive_rmdir(cvsdir) recursive_rmdir('docs') cvs = find_exe('cvs') python = find_exe('python') if cvs is None: os.exit(1) os.environ['CVSROOT']=':pserver:%s@cvs.reportlab.sourceforge.net:/cvsroot/reportlab' % USER if release: do_exec(cvs+(' export -r %s %s' % (tagname,projdir)), 'the export phase') else: do_exec(cvs+' co %s' % projdir, 'the checkout phase') if py2pdf: # now we need to move the files & delete those we don't need dst = py2pdf_dir recursive_rmdir(dst) os.mkdir(dst) do_exec("mv reportlab/demos/py2pdf/py2pdf.py %s"%dst) do_exec("mv reportlab/demos/py2pdf/PyFontify.py %s" % dst) do_exec("mv reportlab/demos/py2pdf/idle_print.py %s" % dst) do_exec("rm -r reportlab/demos reportlab/platypus reportlab/lib/styles.py reportlab/README.pdfgen.txt reportlab/pdfgen/test", "reducing size") do_exec("mv %s %s" % (projdir,dst)) do_exec("chmod a+x %s/py2pdf.py %s/idle_print.py" % (dst, dst)) CVS_remove(dst) else: do_exec(cvs+' co docs') dst = os.path.join(d,"reportlab","docs") do_exec("mkdir %s" % dst) #add our reportlab parent to the path so we import from there if os.environ.has_key('PYTHONPATH'): opp = os.environ['PYTHONPATH'] os.environ['PYTHONPATH']='%s:%s' % (d,opp) else: os.environ['PYTHONPATH']=d os.chdir('docs/reference') do_exec(python + ' ../tools/yaml2pdf.py reference.yml') os.chdir(d) do_exec('mv docs/reference/*.pdf %s'%dst) do_exec('mv docs/reference/*.pdf %s'%htmldir) os.chdir('docs/userguide') do_exec(python + ' genuserguide.py') os.chdir(d) do_exec('mv docs/userguide/*.pdf %s'%dst) do_exec('mv docs/userguide/*.pdf %s'%htmldir) recursive_rmdir('docs') #restore the python path if opp is None: del os.environ['PYTHONPATH'] else: os.environ['PYTHONPATH'] = opp
60e38e92b4f6e1a99ce5a2399be74db532b8ff6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/60e38e92b4f6e1a99ce5a2399be74db532b8ff6f/daily.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 6904, 67, 17300, 12, 72, 4672, 1140, 18, 343, 1214, 12, 72, 13, 276, 6904, 1214, 273, 1140, 18, 803, 18, 5701, 12, 72, 16, 17995, 1214, 13, 5904, 67, 8864, 1214, 12, 71, 6904, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 6904, 67, 17300, 12, 72, 4672, 1140, 18, 343, 1214, 12, 72, 13, 276, 6904, 1214, 273, 1140, 18, 803, 18, 5701, 12, 72, 16, 17995, 1214, 13, 5904, 67, 8864, 1214, 12, 71, 6904, ...
queue_options["qpid.max_count"] = "200" queue_options["qpid.max_size"] = "500"
queue_options["qpid.max_count"] = 200 queue_options["qpid.max_size"] = 500
def test_queue_allow_mode(self): """ Test cases for queue acl in allow mode """ aclf = ACLFile() aclf.write('acl deny bob@QPID create queue name=q1 durable=true passive=true\n') aclf.write('acl deny bob@QPID create queue name=q2 exclusive=true policytype=ring\n') aclf.write('acl deny bob@QPID access queue name=q3\n') aclf.write('acl deny bob@QPID purge queue name=q3\n') aclf.write('acl deny bob@QPID delete queue name=q4\n') aclf.write('acl deny bob@QPID create queue name=q5 maxqueuesize=1000 maxqueuecount=100\n') aclf.write('acl allow all all') aclf.close() result = self.reload_acl() if (result.text.find("format error",0,len(result.text)) != -1): self.fail(result) session = self.get_session('bob','bob') try: session.queue_declare(queue="q1", durable=True, passive=True) self.fail("ACL should deny queue create request with name=q1 durable=true passive=true"); except qpid.session.SessionException, e: self.assertEqual(530,e.args[0].error_code) session = self.get_session('bob','bob') try: queue_options = {} queue_options["qpid.policy_type"] = "ring" session.queue_declare(queue="q2", exclusive=True, arguments=queue_options) self.fail("ACL should deny queue create request with name=q2 exclusive=true qpid.policy_type=ring"); except qpid.session.SessionException, e: self.assertEqual(530,e.args[0].error_code) session = self.get_session('bob','bob') try: queue_options = {} queue_options["qpid.policy_type"] = "ring_strict" session.queue_declare(queue="q2", exclusive=True, arguments=queue_options) except qpid.session.SessionException, e: if (530 == e.args[0].error_code): self.fail("ACL should allow queue create request with name=q2 exclusive=true qpid.policy_type=ring_strict");
2ffd5ef16d8535853832a6ddacb650cc6f2e8362 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/198/2ffd5ef16d8535853832a6ddacb650cc6f2e8362/acl.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4000, 67, 5965, 67, 3188, 12, 2890, 4672, 3536, 7766, 6088, 364, 2389, 7895, 316, 1699, 1965, 3536, 7895, 74, 273, 10098, 812, 1435, 7895, 74, 18, 2626, 2668, 10150, 17096, 800...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4000, 67, 5965, 67, 3188, 12, 2890, 4672, 3536, 7766, 6088, 364, 2389, 7895, 316, 1699, 1965, 3536, 7895, 74, 273, 10098, 812, 1435, 7895, 74, 18, 2626, 2668, 10150, 17096, 800...
class TestBesselJ(object): def test_cephes_vs_amos(self):
def check_cephes_vs_amos(self, f1, f2, rtol=1e-11, atol=0):
def test_yvp(self): yvpr = (yv(1,.2) - yv(3,.2))/2.0 yvp1 = yvp(2,.2) assert_array_almost_equal(yvp1,yvpr,10)
670b0f6dc7ca2d2b86c72fd8030fd59c4629abef /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12971/670b0f6dc7ca2d2b86c72fd8030fd59c4629abef/test_basic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 93, 20106, 12, 2890, 4672, 677, 90, 683, 273, 261, 93, 90, 12, 21, 29257, 22, 13, 300, 677, 90, 12, 23, 29257, 22, 3719, 19, 22, 18, 20, 677, 20106, 21, 273, 677, 20106, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 93, 20106, 12, 2890, 4672, 677, 90, 683, 273, 261, 93, 90, 12, 21, 29257, 22, 13, 300, 677, 90, 12, 23, 29257, 22, 3719, 19, 22, 18, 20, 677, 20106, 21, 273, 677, 20106, ...
return max(stats.solveCubic(a, b, c))
roots = stats.solveCubic(a, b, c) def like(generate): if generate < 0: return -util.INF prod = 0 for l, u, s in zip(lens, means, sdevs): prod += log(stats.normalPdf(l / generate, [u, s*s])) return log(stats.gammaPdf(generate, baserateparam)) + prod return roots[util.argmax(roots, like)]
def mleBaserate(lens, means, sdevs, baserateparam): [alpha, beta] = baserateparam # use only best means and sdevs (highest means) ind = range(len(means)) ind.sort(lambda a, b: cmp(means[b], means[a])) ind = ind[:max(4, len(ind) / 2 + 1)] #ind = ind[:max(4, len(means)-2)] means = util.mget(means, ind) sdevs = util.mget(sdevs, ind) lens = util.mget(lens, ind) # protect against zero ind = util.findgt(.0001, sdevs) lens = util.mget(lens, ind) means = util.mget(means, ind) sdevs = util.mget(sdevs, ind) a = (1 - alpha) / beta b = sum(means[i] * lens[i] / sdevs[i]**2 for i in range(len(lens))) / beta c = - sum(lens[i] ** 2 / sdevs[i] ** 2 for i in range(len(lens))) / beta return max(stats.solveCubic(a, b, c))
dc700e53e023bf21089189239df663a0121fc66a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8482/dc700e53e023bf21089189239df663a0121fc66a/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 312, 298, 11494, 12600, 12, 24800, 16, 4696, 16, 272, 5206, 87, 16, 2580, 12600, 891, 4672, 306, 5429, 16, 6796, 65, 273, 2580, 12600, 891, 225, 468, 999, 1338, 3796, 4696, 471, 272, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 312, 298, 11494, 12600, 12, 24800, 16, 4696, 16, 272, 5206, 87, 16, 2580, 12600, 891, 4672, 306, 5429, 16, 6796, 65, 273, 2580, 12600, 891, 225, 468, 999, 1338, 3796, 4696, 471, 272, 5...
if pos == -1:
if pos == None:
def __scan__(self): """ scan file for timestamps (may take a long time) """ if not hasattr(self, 'filename') or not hasattr(self, 'start'): return 0
42acd927733011cf8240a16b5447261ed338ea48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11721/42acd927733011cf8240a16b5447261ed338ea48/mpeginfo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9871, 972, 12, 2890, 4672, 3536, 4135, 585, 364, 11267, 261, 24877, 4862, 279, 1525, 813, 13, 3536, 309, 486, 3859, 12, 2890, 16, 296, 3459, 6134, 578, 486, 3859, 12, 2890, 16, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9871, 972, 12, 2890, 4672, 3536, 4135, 585, 364, 11267, 261, 24877, 4862, 279, 1525, 813, 13, 3536, 309, 486, 3859, 12, 2890, 16, 296, 3459, 6134, 578, 486, 3859, 12, 2890, 16, 2...
obj.max_bit_rate = data.read_uint32() obj.avg_bit_rate = data.read_uint32() obj.max_packet_size = data.read_uint32() obj.avg_packet_size = data.read_uint32() obj.num_packets = data.read_uint32() obj.duration = data.read_uint32() obj.preroll = data.read_uint32() obj.index_offset = data.read_uint32() obj.data_offset = data.read_uint32() obj.num_streams = data.read_uint16() obj.flags = data.read_uint16()
obj.max_bit_rate = data.read_uint32() obj.avg_bit_rate = data.read_uint32() obj.max_packet_size = data.read_uint32() obj.avg_packet_size = data.read_uint32() obj.num_packets = data.read_uint32() obj.duration = data.read_uint32() obj.preroll = data.read_uint32() obj.index_offset = data.read_uint32() obj.data_offset = data.read_uint32() obj.num_streams = data.read_uint16() obj.flags = data.read_uint16()
def parse_fileproperties(self, data): obj = self.FileProperties()
47877dfb08c6f43c07b0e458250fb48397a0d7e6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5551/47877dfb08c6f43c07b0e458250fb48397a0d7e6/realmedia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 768, 4738, 12, 2890, 16, 501, 4672, 1081, 273, 365, 18, 812, 2297, 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,...
[ 1, 1, 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, 1109, 67, 768, 4738, 12, 2890, 16, 501, 4672, 1081, 273, 365, 18, 812, 2297, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
if not hasattr(object,'__bobo_traverse__'):
def publishTraverse(self, request, name): object = self.context URL=request['URL']
f3734c4f7951b5508cd803627891478738f04cd5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f3734c4f7951b5508cd803627891478738f04cd5/BaseRequest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3808, 29654, 12, 2890, 16, 590, 16, 508, 4672, 733, 273, 365, 18, 2472, 1976, 33, 2293, 3292, 1785, 3546, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3808, 29654, 12, 2890, 16, 590, 16, 508, 4672, 733, 273, 365, 18, 2472, 1976, 33, 2293, 3292, 1785, 3546, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
unit = value
unit = str (value)
def parseSchema (self, ch, codec): """ Parse a received schema-description message. """ self.decOutstanding (ch) packageName = codec.read_str8 () className = codec.read_str8 () hash = codec.read_bin128 () configCount = codec.read_uint16 () instCount = codec.read_uint16 () methodCount = codec.read_uint16 () eventCount = codec.read_uint16 ()
00ad6c2f3a752d5e4d4798e1400a9afdc6e43f71 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/197/00ad6c2f3a752d5e4d4798e1400a9afdc6e43f71/management.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 3078, 261, 2890, 16, 462, 16, 9196, 4672, 3536, 2884, 279, 5079, 1963, 17, 3384, 883, 18, 3536, 365, 18, 4924, 1182, 15167, 261, 343, 13, 9929, 273, 9196, 18, 896, 67, 701, 28, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 3078, 261, 2890, 16, 462, 16, 9196, 4672, 3536, 2884, 279, 5079, 1963, 17, 3384, 883, 18, 3536, 365, 18, 4924, 1182, 15167, 261, 343, 13, 9929, 273, 9196, 18, 896, 67, 701, 28, ...
def box_vert_clicked(obj, it, *args, **kwargs):
def box_vert_clicked(obj, it):
def box_vert_clicked(obj, it, *args, **kwargs): win = elementary.Window("box-vert", elementary.ELM_WIN_BASIC) win.title_set("Box Vert") win.autodel_set(True) bg = elementary.Background(win) win.resize_object_add(bg) bg.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) bg.show() bx = elementary.Box(win) win.resize_object_add(bx) bx.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) bx.show() ic = elementary.Icon(win) ic.file_set("images/logo_small.png") ic.scale_set(0, 0) ic.size_hint_align_set(0.5, 0.5) bx.pack_end(ic) ic.show() ic = elementary.Icon(win) ic.file_set("images/logo_small.png") ic.scale_set(0, 0) ic.size_hint_align_set(0.0, 0.5) bx.pack_end(ic) ic.show() ic = elementary.Icon(win) ic.file_set("images/logo_small.png") ic.scale_set(0, 0) ic.size_hint_align_set(evas.EVAS_HINT_EXPAND, 0.5) bx.pack_end(ic) ic.show() win.show()
ef127faaba8fc06ebbb7bd48a4185405cdfc6a4e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12343/ef127faaba8fc06ebbb7bd48a4185405cdfc6a4e/test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3919, 67, 1097, 67, 7475, 329, 12, 2603, 16, 518, 4672, 5657, 273, 930, 814, 18, 3829, 2932, 2147, 17, 1097, 3113, 930, 814, 18, 2247, 49, 67, 24572, 67, 25642, 13, 5657, 18, 2649, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3919, 67, 1097, 67, 7475, 329, 12, 2603, 16, 518, 4672, 5657, 273, 930, 814, 18, 3829, 2932, 2147, 17, 1097, 3113, 930, 814, 18, 2247, 49, 67, 24572, 67, 25642, 13, 5657, 18, 2649, 6...
filename = song["~filename"] basename = song["~basename"]
filename = song("~filename") basename = song("~basename")
def upload(self, song): filename = song["~filename"] basename = song["~basename"] dirname = os.path.basename(os.path.dirname(filename)) target = os.path.join(self.base, dirname, basename) if not os.path.isdir(os.path.dirname(target)): try: os.mkdir(os.path.dirname(target)) except OSError: pass except: raise error(_("Unable to create directory <b>%s</b>.")%( util.escape(dirname))) try: shutil.copyfile(filename, target) except: raise error(_("Unable to copy <b>%s</b>.") % util.escape(filename))
790eaa159dc980f802d646b81614b1786cd49860 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/790eaa159dc980f802d646b81614b1786cd49860/pmp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3617, 12, 2890, 16, 17180, 4672, 1544, 273, 17180, 2932, 98, 3459, 7923, 4882, 273, 17180, 2932, 98, 13909, 7923, 4283, 273, 1140, 18, 803, 18, 13909, 12, 538, 18, 803, 18, 12287, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3617, 12, 2890, 16, 17180, 4672, 1544, 273, 17180, 2932, 98, 3459, 7923, 4882, 273, 17180, 2932, 98, 13909, 7923, 4283, 273, 1140, 18, 803, 18, 13909, 12, 538, 18, 803, 18, 12287, 12, ...
gui = GUI(Tkinter.Tk()) Tkinter.mainloop()
root = Tkinter.Tk() try: gui = GUI(root) root.mainloop() finally: root.destroy()
def hide(self, event=None): self.stop() self.collapse()
e09bd93685d59fc115d2cfdbe29d6857161c7e2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e09bd93685d59fc115d2cfdbe29d6857161c7e2a/pydoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6853, 12, 2890, 16, 871, 33, 7036, 4672, 365, 18, 5681, 1435, 365, 18, 21405, 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...
[ 1, 1, 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, 6853, 12, 2890, 16, 871, 33, 7036, 4672, 365, 18, 5681, 1435, 365, 18, 21405, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...