rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
delta_r = (float(r2) - float(r1))/size[0]
delta_r = (float(r2) - float(r1)) / size[0]
def plotMSFile(self, filename, outfile = None, format = None, size = (800, 200), starttime = False, endtime = False, dpi = 100, color = 'red', bgcolor = 'white', transparent = False, shadows = False, minmaxlist = False): """ Creates a graph of any given Mini-SEED file. It either saves the image directly to the file system or returns an binary image string. For all color values you can use legit html names, html hex strings (e.g. '#eeefff') or you can pass an R , G , B tuple, where each of R , G , B are in the range [0,1]. You can also use single letters for basic builtin colors ('b' = blue, 'g' = green, 'r' = red, 'c' = cyan, 'm' = magenta, 'y' = yellow, 'k' = black, 'w' = white) and gray shades can be given as a string encoding a float in the 0-1 range. @param filename: Mini-SEED file string @param outfile: Output file string. Also used to automatically determine the output format. Currently supported is emf, eps, pdf, png, ps, raw, rgba, svg and svgz output. Defaults to None. @param format: Format of the graph picture. If no format is given the outfile parameter will be used to try to automatically determine the output format. If no format is found it defaults to png output. If no outfile is specified but a format is than a binary imagestring will be returned. Defaults to None. @param size: Size tupel in pixel for the output file. This corresponds to the resolution of the graph for vector formats. Defaults to 800x200 px. @param starttime: Starttime of the graph as a datetime object. If not set the graph will be plotted from the beginning. Defaults to False. @param endtime: Endtime of the graph as a datetime object. If not set the graph will be plotted until the end. Defaults to False. @param dpi: Dots per inch of the output file. This also affects the size of most elements in the graph (text, linewidth, ...). Defaults to 100. @param color: Color of the graph. If the supplied parameter is a 2-tupel containing two html hex string colors a gradient between the two colors will be applied to the graph. Defaults to 'red'. @param bgcolor: Background color of the graph. If the supplied parameter is a 2-tupel containing two html hex string colors a gradient between the two colors will be applied to the background. Defaults to 'white'. @param transparent: Make all backgrounds transparent (True/False). This will overwrite the bgcolor param. Defaults to False. @param shadows: Adds a very basic drop shadow effect to the graph. Defaults to False. @param minmaxlist: A list containing minimum, maximum and timestamp values. If none is supplied it will be created automatically. Useful for caching. Defaults to False. """ #Either outfile or format needs to be set. if not outfile and not format: raise ValueError('Either outfile or format needs to be set.') #Get a list with minimum and maximum values. if not minmaxlist: minmaxlist = self._getMinMaxList(filename = filename, width = size[0], starttime = starttime, endtime = endtime) starttime = minmaxlist[0] endtime = minmaxlist[1] stepsize = (endtime - starttime)/size[0] minmaxlist = minmaxlist[2:] length = len(minmaxlist) #Importing pyplot and numpy. import matplotlib.pyplot as plt #Setup figure and axes fig = plt.figure(num = None, figsize = (float(size[0])/dpi, float(size[1])/dpi)) ax = fig.add_subplot(111) # hide axes + ticks ax.axison = False #Make the graph fill the whole image. fig.subplots_adjust(left=0, bottom=0, right=1, top=1) #Determine range for the y axis. This may not be the smartest way to #do it. miny = 99999999999999999 maxy = -9999999999999999 for _i in range(length): try: if minmaxlist[_i][0] < miny: miny = minmaxlist[_i][0] except: pass try: if minmaxlist[_i][1] > maxy: maxy = minmaxlist[_i][1] except: pass #Set axes and disable ticks plt.ylim(miny, maxy) plt.xlim(starttime, endtime) plt.yticks([]) plt.xticks([]) #Overwrite the background gradient if transparent is set. if transparent: bgcolor = None #Draw gradient background if needed. if type(bgcolor) == type((1,2)): for _i in xrange(size[0]+1): #Convert hex values to integers r1 = int(bgcolor[0][1:3], 16) r2 = int(bgcolor[1][1:3], 16) delta_r = (float(r2) - float(r1))/size[0] g1 = int(bgcolor[0][3:5], 16) g2 = int(bgcolor[1][3:5], 16) delta_g = (float(g2) - float(g1))/size[0] b1 = int(bgcolor[0][5:], 16) b2 = int(bgcolor[1][5:], 16) delta_b = (float(b2) - float(b1))/size[0] new_r = hex(int(r1 + delta_r * _i))[2:] new_g = hex(int(g1 + delta_g * _i))[2:] new_b = hex(int(b1 + delta_b * _i))[2:] if len(new_r) == 1: new_r = '0'+new_r if len(new_g) == 1: new_g = '0'+new_g if len(new_b) == 1: new_b = '0'+new_b #Create color string bglinecolor = '#'+new_r+new_g+new_b plt.axvline(x = starttime + _i*stepsize, color = bglinecolor) bgcolor = 'white' #Clone color for looping. loop_color = color #Draw horizontal lines. for _i in range(length): #Make gradient if color is a 2-tupel. if type(loop_color) == type((1,2)): #Convert hex values to integers r1 = int(loop_color[0][1:3], 16) r2 = int(loop_color[1][1:3], 16) delta_r = (float(r2) - float(r1))/length g1 = int(loop_color[0][3:5], 16) g2 = int(loop_color[1][3:5], 16) delta_g = (float(g2) - float(g1))/length b1 = int(loop_color[0][5:], 16) b2 = int(loop_color[1][5:], 16) delta_b = (float(b2) - float(b1))/length new_r = hex(int(r1 + delta_r * _i))[2:] new_g = hex(int(g1 + delta_g * _i))[2:] new_b = hex(int(b1 + delta_b * _i))[2:] if len(new_r) == 1: new_r = '0'+new_r if len(new_g) == 1: new_g = '0'+new_g if len(new_b) == 1: new_b = '0'+new_b #Create color string color = '#'+new_r+new_g+new_b #Calculate relative values needed for drawing the lines. yy = (float(minmaxlist[_i][0])-miny)/(maxy-miny) xx = (float(minmaxlist[_i][1])-miny)/(maxy-miny) #Draw shadows if desired. if shadows: plt.axvline(x = minmaxlist[_i][2] + stepsize, ymin = yy - 0.01, ymax = xx - 0.01, color = 'k', alpha = 0.4) #Draw actual data lines. plt.axvline(x = minmaxlist[_i][2], ymin = yy, ymax = xx, color = color) #Save file. if outfile: #If format is set use it. if format: plt.savefig(outfile, dpi = dpi, transparent = transparent, facecolor = bgcolor, edgecolor = bgcolor, format = format) #Otherwise try to get the format from outfile or default to png. else: plt.savefig(outfile, dpi = dpi, transparent = transparent, facecolor = bgcolor, edgecolor = bgcolor) #Return an binary imagestring if outfile is not set but format is. if not outfile: imgdata = StringIO.StringIO() plt.savefig(imgdata, dpi = dpi, transparent = transparent, facecolor = bgcolor, edgecolor = bgcolor, format = format) imgdata.seek(0) return imgdata.read()
da81b4ce7064a28a168b56663efe435b307a52d4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10470/da81b4ce7064a28a168b56663efe435b307a52d4/libmseed.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3207, 3537, 812, 12, 2890, 16, 1544, 16, 8756, 273, 599, 16, 740, 273, 599, 16, 963, 273, 261, 17374, 16, 4044, 3631, 23437, 273, 1083, 16, 31361, 273, 1083, 16, 16361, 273, 2130, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3207, 3537, 812, 12, 2890, 16, 1544, 16, 8756, 273, 599, 16, 740, 273, 599, 16, 963, 273, 261, 17374, 16, 4044, 3631, 23437, 273, 1083, 16, 31361, 273, 1083, 16, 16361, 273, 2130, 16, ...
if self.to_pex:
if self.can_connect() and self.to_pex:
def next_peer_from_queue(self): if self.to_pex: return self.to_pex.pop(0) else: return None
2cb92c8f70cbc4cf36666119d5a5d608d87a09f6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9686/2cb92c8f70cbc4cf36666119d5a5d608d87a09f6/repex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1024, 67, 12210, 67, 2080, 67, 4000, 12, 2890, 4672, 225, 309, 365, 18, 4169, 67, 3612, 1435, 471, 365, 18, 869, 67, 84, 338, 30, 327, 365, 18, 869, 67, 84, 338, 18, 5120, 12, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1024, 67, 12210, 67, 2080, 67, 4000, 12, 2890, 4672, 225, 309, 365, 18, 4169, 67, 3612, 1435, 471, 365, 18, 869, 67, 84, 338, 30, 327, 365, 18, 869, 67, 84, 338, 18, 5120, 12, 20, ...
result = ctx.TryLink(test, '.c')
result = ctx.TryLink(test, extension) if run: result = result and ctx.TryRun(test, extension)[0]
def check_link_flag(ctx, flag): ctx.Message('Checking for linker flag %s... ' % flag) old_flags = ctx.env['LINKFLAGS'] ctx.env.Append(LINKFLAGS = flag) test = """ int main() { return 0; } """ result = ctx.TryLink(test, '.c') ctx.Result(result) if not result: ctx.env.Replace(LINKFLAGS = old_flags) return result
54722f8c19d22a1fa8cf26294ff563f63bda9cd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7064/54722f8c19d22a1fa8cf26294ff563f63bda9cd6/utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 1232, 67, 6420, 12, 5900, 16, 2982, 4672, 1103, 18, 1079, 2668, 14294, 364, 28058, 2982, 738, 87, 2777, 296, 738, 2982, 13, 225, 1592, 67, 7133, 273, 1103, 18, 3074, 3292, 105...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 1232, 67, 6420, 12, 5900, 16, 2982, 4672, 1103, 18, 1079, 2668, 14294, 364, 28058, 2982, 738, 87, 2777, 296, 738, 2982, 13, 225, 1592, 67, 7133, 273, 1103, 18, 3074, 3292, 105...
if 'class="summary"' in l:
if 'class="summary' in l:
def get_bug(self, id): url = "%s/%d" % (self.url, id) try: bugdata = utils.web.getUrl(url) except Exception, e: # Hacketiehack if 'HTTP Error 500' in str(e): raise BugNotFoundError s = 'Could not parse data returned by %s: %s' % (self.description, e) raise BugtrackerError, s for l in bugdata.split("\n"): if 'class="summary"' in l: title = l[l.find('>')+1:l.find('</')] if 'class="status"' in l: status = l[l.find('>(')+2:l.find(')')] if 'headers="h_component"' in l: package = l[l.find('>')+1:l.find('</')] if 'headers="h_severity"' in l: severity = l[l.find('>')+1:l.find('</')] if 'headers="h_stage"' in l: severity = l[l.find('>')+1:l.find('</')] if 'headers="h_owner"' in l: assignee = l[l.find('>')+1:l.find('</')] return [(id, package, title, severity, status, assignee, "%s/%s" % (self.url, id))]
9682fc59557531c9af86738a9cba67c17764713b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3104/9682fc59557531c9af86738a9cba67c17764713b/plugin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 925, 12, 2890, 16, 612, 4672, 880, 273, 2213, 87, 5258, 72, 6, 738, 261, 2890, 18, 718, 16, 612, 13, 775, 30, 7934, 892, 273, 2990, 18, 4875, 18, 588, 1489, 12, 718, 13, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 925, 12, 2890, 16, 612, 4672, 880, 273, 2213, 87, 5258, 72, 6, 738, 261, 2890, 18, 718, 16, 612, 13, 775, 30, 7934, 892, 273, 2990, 18, 4875, 18, 588, 1489, 12, 718, 13, ...
if __name__=='__main__': import os def example1(): widgets = ['Test: ', Percentage(), ' ', Bar(marker=RotatingMarker()), ' ', ETA(), ' ', FileTransferSpeed()] pbar = ProgressBar(widgets=widgets, maxval=10000000).start() for i in range(1000000): pbar.update(10*i+1) pbar.finish() print def example2(): class CrazyFileTransferSpeed(FileTransferSpeed): "It's bigger between 45 and 80 percent" def update(self, pbar): if 45 < pbar.percentage() < 80: return 'Bigger Now ' + FileTransferSpeed.update(self,pbar) else: return FileTransferSpeed.update(self,pbar) widgets = [CrazyFileTransferSpeed(),' <<<', Bar(), '>>> ', Percentage(),' ', ETA()] pbar = ProgressBar(widgets=widgets, maxval=10000000) pbar.start() for i in range(2000000): pbar.update(5*i+1) pbar.finish() print def example3(): widgets = [Bar('>'), ' ', ETA(), ' ', ReverseBar('<')] pbar = ProgressBar(widgets=widgets, maxval=10000000).start() for i in range(1000000): pbar.update(10*i+1) pbar.finish() print def example4(): widgets = ['Test: ', Percentage(), ' ', Bar(marker='0',left='[',right=']'), ' ', ETA(), ' ', FileTransferSpeed()] pbar = ProgressBar(widgets=widgets, maxval=500) pbar.start() for i in range(100,500+1,50): time.sleep(0.2) pbar.update(i) pbar.finish() print example1() example2() example3() example4()
def finish(self): """Used to tell the progress is finished.""" self.update(self.maxval) if self.signal_set: signal.signal(signal.SIGWINCH, signal.SIG_DFL)
69bae1497003b46d8f2f8767ed98775dd0eff8bb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5565/69bae1497003b46d8f2f8767ed98775dd0eff8bb/progressbar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4076, 12, 2890, 4672, 3536, 6668, 358, 9276, 326, 4007, 353, 6708, 12123, 365, 18, 2725, 12, 2890, 18, 1896, 1125, 13, 309, 365, 18, 10420, 67, 542, 30, 4277, 18, 10420, 12, 10420, 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, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4076, 12, 2890, 4672, 3536, 6668, 358, 9276, 326, 4007, 353, 6708, 12123, 365, 18, 2725, 12, 2890, 18, 1896, 1125, 13, 309, 365, 18, 10420, 67, 542, 30, 4277, 18, 10420, 12, 10420, 18,...
host = user + ':' + passwd + '@' + host
host = quote(user, safe='') + ':' + quote(passwd, safe='') + '@' + host
def retry_http_basic_auth(self, url, realm, data=None): host, selector = splithost(url) i = host.find('@') + 1 host = host[i:] user, passwd = self.get_user_passwd(host, realm, i) if not (user or passwd): return None host = user + ':' + passwd + '@' + host newurl = 'http://' + host + selector if data is None: return self.open(newurl) else: return self.open(newurl, data)
afc4f0413ae7c307207772373937b0eb1e0a645b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/afc4f0413ae7c307207772373937b0eb1e0a645b/urllib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3300, 67, 2505, 67, 13240, 67, 1944, 12, 2890, 16, 880, 16, 11319, 16, 501, 33, 7036, 4672, 1479, 16, 3451, 273, 6121, 483, 669, 12, 718, 13, 277, 273, 1479, 18, 4720, 2668, 36, 6134...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3300, 67, 2505, 67, 13240, 67, 1944, 12, 2890, 16, 880, 16, 11319, 16, 501, 33, 7036, 4672, 1479, 16, 3451, 273, 6121, 483, 669, 12, 718, 13, 277, 273, 1479, 18, 4720, 2668, 36, 6134...
kwargs['py_modules'] += extras
kwargs['py_modules'] = extras
def do_setup(): kwargs = package_data.copy() extras = get_extras() if extras: kwargs['py_modules'] += extras kwargs['classifiers'] = classifiers # Install data files properly. kwargs['cmdclass'] = {'build_data': build_data, 'install_data': smart_install_data} # Auto-convert surce code for Python 3 if sys.version_info >= (3,): kwargs['cmdclass']['build_py'] = copy_build_py_2to3 else: kwargs['cmdclass']['build_py'] = build_py dist = setup(**kwargs) return dist
5b2e34e58cde7822dde131681c1d4f97df1e91ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1278/5b2e34e58cde7822dde131681c1d4f97df1e91ad/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 8401, 13332, 1205, 273, 2181, 67, 892, 18, 3530, 1435, 11875, 273, 336, 67, 23687, 1435, 309, 11875, 30, 1205, 3292, 2074, 67, 6400, 3546, 273, 11875, 1205, 3292, 1106, 3383, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 8401, 13332, 1205, 273, 2181, 67, 892, 18, 3530, 1435, 11875, 273, 336, 67, 23687, 1435, 309, 11875, 30, 1205, 3292, 2074, 67, 6400, 3546, 273, 11875, 1205, 3292, 1106, 3383, 35...
return perform_index(colID, ln, "perform_validateconf", addadminbox(subtitle, body))
return perform_index(colID, ln, "perform_checkcollectionstatus", addadminbox(subtitle, body))
def perform_validateconf(colID, ln, confirm=0, callback='yes'): """Validation of the configuration of the collections""" subtitle = """<a name="11"></a>Collections Status""" output = "" colID = int(colID) col_dict = dict(get_def_name('', "collection")) collections = run_sql("SELECT id, name, dbquery, restricted FROM collection ORDER BY id") header = ['Id', 'Name', 'Query', 'Subcollections', 'Restricted', 'I8N','Status'] rnk_list = get_def_name('', "rnkMETHOD") actions = [] for (id, name, dbquery, restricted) in collections: reg_sons = len(get_col_tree(id, 'r')) vir_sons = len(get_col_tree(id, 'v')) status = "" langs = run_sql("SELECT ln from collectionname where id_collection=%s" % id) i8n = "" if len(langs) > 0: for lang in langs: i8n += "%s, " % lang else: i8n = """<b><span class="info">None</span></b>""" if (reg_sons > 1 and dbquery) or dbquery=="": status = """<b><span class="warning">1:Query</span></b>""" elif dbquery is None and reg_sons == 1: status = """<b><span class="warning">2:Query</span></b>""" elif dbquery == "" and reg_sons == 1: status = """<b><span class="warning">3:Query</span></b>""" if (reg_sons > 1 or vir_sons > 1): subs = """<b><span class="info">Yes</span></b>""" else: subs = """<b><span class="info">No</span></b>""" if dbquery is None: dbquery = """<b><span class="info">No</span></b>""" if restricted == "": restricted = "" if status: status += """<b><span class="warning">,4:Restricted</span></b>""" else: status += """<b><span class="warning">4:Restricted</span></b>""" elif restricted is None: restricted = """<b><span class="info">No</span></b>""" if status == "": status = """<b><span class="info">OK</span></b>""" actions.append([id, """<a href="%s/admin/websearch/websearchadmin.py/editcollection?colID=%s&amp;ln=%s">%s</a>""" % (weburl, id, ln, name), dbquery, subs, restricted, i8n, status]) output += tupletotable(header=header, tuple=actions) try: body = [output, extra] except NameError: body = [output] return addadminbox(subtitle, body) if callback: return perform_index(colID, ln, "perform_validateconf", addadminbox(subtitle, body)) else: return addadminbox(subtitle, body)
754d19915d70f2e3a0364cac500bb203b82c6e16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/754d19915d70f2e3a0364cac500bb203b82c6e16/websearchadminlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3073, 67, 5662, 3923, 12, 1293, 734, 16, 7211, 16, 6932, 33, 20, 16, 1348, 2218, 9707, 11, 4672, 3536, 4354, 434, 326, 1664, 434, 326, 6980, 8395, 225, 20281, 273, 3536, 32, 69, 508, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5662, 3923, 12, 1293, 734, 16, 7211, 16, 6932, 33, 20, 16, 1348, 2218, 9707, 11, 4672, 3536, 4354, 434, 326, 1664, 434, 326, 6980, 8395, 225, 20281, 273, 3536, 32, 69, 508, ...
footnote = self.make_target_footnote(target, refs) if not self.notes.has_key(target['refuri']): self.notes[target['refuri']] = footnote
footnote = self.make_target_footnote(target, refs, notes) if not notes.has_key(target['refuri']): notes[target['refuri']] = footnote
def apply(self): nodelist = [] for target in self.document.external_targets: name = target.get('name') if not name: print >>sys.stderr, 'no name on target: %r' % target continue refs = self.document.refnames.get(name, []) if not refs: continue footnote = self.make_target_footnote(target, refs) if not self.notes.has_key(target['refuri']): self.notes[target['refuri']] = footnote nodelist.append(footnote) if len(self.document.anonymous_targets) \ == len(self.document.anonymous_refs): for target, ref in zip(self.document.anonymous_targets, self.document.anonymous_refs): if target.hasattr('refuri'): footnote = self.make_target_footnote(target, [ref]) if not self.notes.has_key(target['refuri']): self.notes[target['refuri']] = footnote nodelist.append(footnote) self.startnode.parent.replace(self.startnode, nodelist) # @@@ what about indirect links to external targets?
8f79e17adb34ec6ac6e9aef23e7b146a9221ec29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/8f79e17adb34ec6ac6e9aef23e7b146a9221ec29/references.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2230, 12, 2890, 4672, 30068, 273, 5378, 364, 1018, 316, 365, 18, 5457, 18, 9375, 67, 11358, 30, 508, 273, 1018, 18, 588, 2668, 529, 6134, 309, 486, 508, 30, 1172, 1671, 9499, 18, 11241...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2890, 4672, 30068, 273, 5378, 364, 1018, 316, 365, 18, 5457, 18, 9375, 67, 11358, 30, 508, 273, 1018, 18, 588, 2668, 529, 6134, 309, 486, 508, 30, 1172, 1671, 9499, 18, 11241...
cr.execute('update "'+self._table+'" set '+string.join(upd0,',')+ ' where id = %d', upd1)
cr.execute('update "' + self._table + '" set ' + \ string.join(upd0, ',') + ' where id = %d', upd1)
def _update_function_stored(self, cr, user, ids, context=None): if not context: context={} f=filter(lambda a: isinstance(self._columns[a], fields.function) and self._columns[a].store, self._columns) if f: result=self.read(cr, user, ids, fields=f, context=context) for res in result: upd0=[] upd1=[] for field in res: if field not in f: continue upd0.append('"'+field+'"='+self._columns[field]._symbol_set[0]) upd1.append(self._columns[field]._symbol_set[1](res[field])) upd1.append(res['id']) cr.execute('update "'+self._table+'" set '+string.join(upd0,',')+ ' where id = %d', upd1) return True
e3e9e296d83bc6d2abc9ab94f95ee811b619c534 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/e3e9e296d83bc6d2abc9ab94f95ee811b619c534/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2725, 67, 915, 67, 22601, 12, 2890, 16, 4422, 16, 729, 16, 3258, 16, 819, 33, 7036, 4672, 309, 486, 819, 30, 819, 12938, 284, 33, 2188, 12, 14661, 279, 30, 1549, 12, 2890, 6315,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2725, 67, 915, 67, 22601, 12, 2890, 16, 4422, 16, 729, 16, 3258, 16, 819, 33, 7036, 4672, 309, 486, 819, 30, 819, 12938, 284, 33, 2188, 12, 14661, 279, 30, 1549, 12, 2890, 6315,...
conf_file_ids.update(node['conf_file_ids'])
def call(self, auth, node_id_or_hostname_list = None): timestamp = int(time.time())
3876b7ec1bb7969648393315537474e9063276a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7598/3876b7ec1bb7969648393315537474e9063276a2/GetSlivers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 745, 12, 2890, 16, 1357, 16, 756, 67, 350, 67, 280, 67, 10358, 67, 1098, 273, 599, 4672, 2858, 273, 509, 12, 957, 18, 957, 10756, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 745, 12, 2890, 16, 1357, 16, 756, 67, 350, 67, 280, 67, 10358, 67, 1098, 273, 599, 4672, 2858, 273, 509, 12, 957, 18, 957, 10756, 2, -100, -100, -100, -100, -100, -100, -100, -100, -...
response = http.RedirectResponse('/home/'+self.worksheet.filename() + '/datafile?name=%s'%name)
response = http.RedirectResponse(worksheet_url + '/datafile?name=%s' % name)
def render(self, ctx): name = '' if ctx.args.has_key('newField'): newfield = ctx.args['newField'][0].strip() else: newfield = None
1524499e906d4aedfc6da2ad2a85c62b16b3326f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11792/1524499e906d4aedfc6da2ad2a85c62b16b3326f/twist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 1103, 4672, 508, 273, 875, 309, 1103, 18, 1968, 18, 5332, 67, 856, 2668, 2704, 974, 11, 4672, 394, 1518, 273, 1103, 18, 1968, 3292, 2704, 974, 3546, 63, 20, 8009, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1743, 12, 2890, 16, 1103, 4672, 508, 273, 875, 309, 1103, 18, 1968, 18, 5332, 67, 856, 2668, 2704, 974, 11, 4672, 394, 1518, 273, 1103, 18, 1968, 3292, 2704, 974, 3546, 63, 20, 8009, ...
if verbosity >= 1:
if verbosity >= 2:
def scrapeCourt(courtID, result, verbosity, daemonmode): if verbosity >= 1: result += "NOW SCRAPING COURT: " + str(courtID) + "\n" if verbosity >= 2: print "NOW SCRAPING COURT: " + str(courtID) if (courtID == 1): """ PDFs are available from the first circuit if you go to their RSS feed. So go to their RSS feed we shall. """ urls = ("http://www.ca1.uscourts.gov/opinions/opinionrss.php",) ct = Court.objects.get(courtUUID='ca1') for url in urls: html = urllib2.urlopen(url).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result # this code gets rid of errant ampersands - they throw big errors # when parsing. We replace them later. if '&' in html: punctuationRegex = re.compile(" & ") html = re.sub(punctuationRegex, " &amp; ", html) tree = etree.fromstring(html) else: tree = etree.fromstring(html) caseLinks = tree.xpath("//item/link") descriptions = tree.xpath("//item/description") docTypes = tree.xpath("//item/category") caseNamesAndNumbers = tree.xpath("//item/title") caseDateRegex = re.compile("(\d{2}/\d{2}/\d{4})", re.VERBOSE | re.DOTALL) caseNumberRegex = re.compile("(\d{2}-.*?\W)(.*)$") # incredibly, this RSS feed is in cron order, so new stuff is at the # end. Mind blowing. i = len(caseLinks)-1 if verbosity >= 2: print str(i) dupCount = 0 while i > 0: # First: docType, since we don't support them all... docType = docTypes[i].text.strip() if verbosity >= 2: print docType if "unpublished" in docType.lower(): documentType = "Unpublished" elif "published" in docType.lower(): documentType = "Published" elif "errata" in docType.lower(): documentType = "Errata" else: # something weird we don't know about, punt i -= 1 continue # next, we begin with the caseLink field caseLink = caseLinks[i].text caseLink = urljoin(url, caseLink) # then we download the PDF, make the hash and document myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i -= 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 8: # eighth dup in a a row. BREAK! # this is 8 here b/c this court has tech problems. break i -= 1 continue else: dupCount = 0 # otherwise, we continue doc.documentType = documentType # next: caseDate caseDate = caseDateRegex.search(descriptions[i].text).group(1) splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]), int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # next: caseNumber caseNumber = caseNumberRegex.search(caseNamesAndNumbers[i].text)\ .group(1) # next: caseNameShort caseNameShort = caseNumberRegex.search(caseNamesAndNumbers[i].text)\ .group(2) # check for dups, make the object if necessary, otherwise, get it cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i -= 1 return result elif (courtID == 2): """ URL hacking FTW. """ urls = ( "http://www.ca2.uscourts.gov/decisions?IW_DATABASE=OPN&IW_FIELD_TEXT=OPN&IW_SORT=-Date&IW_BATCHSIZE=100", "http://www.ca2.uscourts.gov/decisions?IW_DATABASE=SUM&IW_FIELD_TEXT=SUM&IW_SORT=-Date&IW_BATCHSIZE=100", ) ct = Court.objects.get(courtUUID='ca2') for url in urls: html = urllib2.urlopen(url).read() soup = BeautifulSoup(html) aTagsRegex = re.compile('(.*?.pdf).*?', re.IGNORECASE) caseNumRegex = re.compile('.*/(\d{1,2}-\d{3,4})(.*).pdf') aTags = soup.findAll(attrs={'href' : aTagsRegex}) if daemonmode: # this mess is necessary because the court puts random # (literally) numbers throughout their links. No idea why, # but the solution is to figure out the caselinks here, and to hand # those to the sha1 generator. aTagsEncoded = [] for i in aTags: caseLink = i.get('href') caseLink = aTagsRegex.search(caseLink).group(1) try: caseNumbers = caseNumRegex.search(caseLink).group(1) except: caseNumbers = "" aTagsEncoded.append(caseNumbers) # if it's daemonmode, see if the court has changed changed = courtChanged(url, str(aTagsEncoded)) if not changed: # if not, bail. If so, continue to the scraping. return result i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = aTagsRegex.search(caseLink).group(1) caseLink = urljoin(url, caseLink) if verbosity >= 2: print str(i) + ": " + caseLink myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNum = caseNumRegex.search(caseLink).group(1) if verbosity >= 2: print "caseNum: " + str(caseNum) # and the docType documentType = caseNumRegex.search(caseLink).group(2) if 'opn' in documentType: # it's unpublished doc.documentType = "Published" elif 'so' in documentType: doc.documentType = "Unpublished" # next, the caseNameShort (there's probably a better way to do this. caseNameShort = aTags[i].parent.parent.nextSibling.nextSibling\ .nextSibling.nextSibling.contents[0] # next, we can do the caseDate caseDate = aTags[i].parent.parent.nextSibling.nextSibling\ .nextSibling.nextSibling.nextSibling.nextSibling.contents[0]\ .replace('&nbsp;', ' ').strip() # some caseDate cleanup splitDate = caseDate.split('-') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # check for duplicates, make the object in their absence cite, created = hasDuplicate(caseNum, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 3): """ This URL provides the latest 25 cases, so I need to pick out the new ones and only get those. I can do this efficiently by trying to do each, and then giving up once I hit one that I've done before. This will work because they are in reverse chronological order. """ # if these URLs change, the docType identification (below) will need # to be updated. It's lazy, but effective. urls = ("http://www.ca3.uscourts.gov/recentop/week/recprec.htm", "http://www.ca3.uscourts.gov/recentop/week/recnon2day.htm",) ct = Court.objects.get(courtUUID='ca3') for url in urls: html = urllib2.urlopen(url).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) # all links ending in pdf, case insensitive regex = re.compile("pdf$", re.IGNORECASE) aTags = soup.findAll(attrs={"href": regex}) # we will use these vars in our while loop, better not to compile them # each time regexII = re.compile('\d{2}/\d{2}/\d{2}') regexIII = re.compile('\d{2}-\d{4}') i = 0 dupCount = 0 while i < len(aTags): # caseLink and caseNameShort caseLink = aTags[i].get('href') myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 caseNameShort = aTags[i].contents[0] # caseDate and caseNumber junk = aTags[i].previous.previous.previous try: # this error seems to happen upon dups...not sure why yet caseDate = regexII.search(junk).group(0) caseNumber = regexIII.search(junk).group(0) except: i = i+1 continue # next up is the caseDate splitDate = caseDate.split('/') caseDate = datetime.date(int("20" + splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # Make a decision about the docType. if "recprec.htm" in str(url): doc.documentType = "Published" elif "recnon2day.htm" in str(url): doc.documentType = "Unpublished" cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 4): """The fourth circuit is THE worst form of HTML I've ever seen. It's going to break a lot, but I've done my best to clean it up, and make it reliable.""" urls = ("http://pacer.ca4.uscourts.gov/opinions_today.htm",) ct = Court.objects.get(courtUUID='ca4') for url in urls: html = urllib2.urlopen(url).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result # sadly, beautifulsoup chokes on the lines lines of this file because # the HTML is so bad. Stop laughing - the HTML IS awful, but it's not # funny. Anyway, to make this thing work, we must pull out the target # attributes. And so we do. regex = re.compile("target.*>", re.IGNORECASE) html = re.sub(regex, ">", html) soup = BeautifulSoup(html) # all links ending in pdf, case insensitive regex = re.compile("pdf$", re.IGNORECASE) aTags = soup.findAll(attrs={"href": regex}) i = 0 dupCount = 0 regexII = re.compile('\d{2}/\d{2}/\d{4}') regexIII = re.compile('\d{4}(.*)') while i < len(aTags): # caseLink field, and save it caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caselink, we can get the caseNumber and documentType fileName = caseLink.split('/')[-1] caseNumber, documentType = fileName.split('.')[0:2] # the caseNumber needs a hyphen inserted after the second digit caseNumber = caseNumber[0:2] + "-" + caseNumber[2:] if documentType == 'U': doc.documentType = 'Unpublished' elif documentType == 'P': doc.documentType = 'Published' else: doc.documentType = "" # next, we do the caseDate and caseNameShort, so we can quit before # we get too far along. junk = aTags[i].contents[0].replace('&nbsp;', ' ').strip() try: # this error seems to happen upon dups...not sure why yet caseDate = cleanString(regexII.search(junk).group(0)) caseNameShort = regexIII.search(junk).group(1) except: i += 1 continue # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # let's check for duplicates before we proceed cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 5): """New fifth circuit scraper, which can get back versions all the way to 1992! This is exciting, but be warned, the search is not reliable on recent dates. It has been known not to bring back results that are definitely within the set. Watch closely. """ urls = ("http://www.ca5.uscourts.gov/Opinions.aspx",) ct = Court.objects.get(courtUUID='ca5') for url in urls: # Use just one date, it seems to work better this way. todayObject = datetime.date.today() if verbosity >= 2: print "start date: " + str(todayObject) startDate = time.strftime('%m/%d/%Y', todayObject.timetuple()) if verbosity >= 2: print "Start date is: " + startDate # these are a mess because the court has a security check. postValues = { '__EVENTTARGET' : '', '__EVENTARGUMENT' : '', '__VIEWSTATE' : '/wEPDwULLTEwOTU2NTA2NDMPZBYCAgEPZBYKAgEPDxYIHgtDZWxsUGFkZGluZ2YeC0NlbGxTcGFjaW5nZh4JQmFja0NvbG9yCRcQJ/8eBF8hU0ICiIAYZGQCAw8PFggfAGYfAWYfAgmZzP//HwMCiIAYZGQCGQ9kFgYCAg8PFgQfAgqHAR8DAghkZAIEDw8WBB8CCocBHwMCCGRkAgYPDxYEHwIKhwEfAwIIZGQCGw9kFooBAgIPDxYEHwIKhwEfAwIIZGQCBA8PFgQfAgqHAR8DAghkZAIGDw8WBB8CCocBHwMCCGRkAggPDxYEHwIKhwEfAwIIZGQCCg8PFgQfAgqHAR8DAghkZAIMDw8WBB8CCocBHwMCCGRkAg4PDxYEHwIKhwEfAwIIZGQCEA8PFgQfAgqHAR8DAghkZAISDw8WBB8CCocBHwMCCGRkAhQPDxYEHwIKhwEfAwIIZGQCFg8PFgQfAgqHAR8DAghkZAIYDw8WBB8CCocBHwMCCGRkAhoPDxYEHwIKhwEfAwIIZGQCHA8PFgQfAgqHAR8DAghkZAIeDw8WBB8CCocBHwMCCGRkAiAPDxYEHwIKhwEfAwIIZGQCIg8PFgQfAgqHAR8DAghkZAIkDw8WBB8CCocBHwMCCGRkAiYPDxYEHwIKhwEfAwIIZGQCKA8PFgQfAgqHAR8DAghkZAIqDw8WBB8CCocBHwMCCGRkAiwPDxYEHwIKhwEfAwIIZGQCLg8PFgQfAgqHAR8DAghkZAIwDw8WBB8CCocBHwMCCGRkAjIPDxYEHwIKhwEfAwIIZGQCNA8PFgQfAgqHAR8DAghkZAI2Dw8WBB8CCocBHwMCCGRkAjgPDxYEHwIKhwEfAwIIZGQCOg8PFgQfAgqHAR8DAghkZAI8Dw8WBB8CCocBHwMCCGRkAj4PDxYEHwIKhwEfAwIIZGQCQA8PFgQfAgqHAR8DAghkZAJCDw8WBB8CCocBHwMCCGRkAkQPDxYEHwIKhwEfAwIIZGQCRg8PFgQfAgqHAR8DAghkZAJIDw8WBB8CCocBHwMCCGRkAkoPDxYEHwIKhwEfAwIIZGQCTA8PFgQfAgqHAR8DAghkZAJODw8WBB8CCocBHwMCCGRkAlAPDxYEHwIKhwEfAwIIZGQCUg8PFgQfAgqHAR8DAghkZAJUDw8WBB8CCocBHwMCCGRkAlYPDxYEHwIKhwEfAwIIZGQCWA8PFgQfAgqHAR8DAghkZAJaDw8WBB8CCocBHwMCCGRkAlwPDxYEHwIKhwEfAwIIZGQCXg8PFgQfAgqHAR8DAghkZAJgDw8WBB8CCocBHwMCCGRkAmIPDxYEHwIKhwEfAwIIZGQCZA8PFgQfAgqHAR8DAghkZAJmDw8WBB8CCocBHwMCCGRkAmgPDxYEHwIKhwEfAwIIZGQCag8PFgQfAgqHAR8DAghkZAJsDw8WBB8CCocBHwMCCGRkAm4PDxYEHwIKhwEfAwIIZGQCcA8PFgQfAgqHAR8DAghkZAJyDw8WBB8CCocBHwMCCGRkAnQPDxYEHwIKhwEfAwIIZGQCdg8PFgQfAgqHAR8DAghkZAJ4Dw8WBB8CCocBHwMCCGRkAnoPDxYEHwIKhwEfAwIIZGQCfA8PFgQfAgqHAR8DAghkZAJ+Dw8WBB8CCocBHwMCCGRkAoABDw8WBB8CCocBHwMCCGRkAoIBDw8WBB8CCocBHwMCCGRkAoQBDw8WBB8CCocBHwMCCGRkAoYBDw8WBB8CCocBHwMCCGRkAogBDw8WBB8CCocBHwMCCGRkAooBDw8WBB8CCocBHwMCCGRkAh0PEGRkFgECAmRkcx2JRvTiy039dck7+vdOCUS6J5s=', 'txtBeginDate' : startDate, 'txtEndDate' : '', 'txtDocketNumber' : '', 'txtTitle=' : '', 'btnSearch' : 'Search', '__EVENTVALIDATION' : '/wEWCALd2o3pAgLH8d2nDwKAzfnNDgLChrRGAr2b+P4BAvnknLMEAqWf8+4KAqC3sP0KVcw25xdB1YPfbcUwUCqEYjQqaqM=', } data = urllib.urlencode(postValues) req = urllib2.Request(url, data) html = urllib2.urlopen(req).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) #if verbosity >= 2: print soup #all links ending in pdf, case insensitive aTagRegex = re.compile("pdf$", re.IGNORECASE) aTags = soup.findAll(attrs={"href": aTagRegex}) unpubRegex = re.compile(r"pinions.*unpub") i = 0 dupCount = 0 numP = 0 numQ = 0 while i < len(aTags): # this page has PDFs that aren't cases, we must filter them out if 'pinion' not in str(aTags[i]): # it's not an opinion, increment and punt if verbosity >= 2: print "Punting non-opinion URL: " + str(aTags[i]) i += 1 continue # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue # next, we do the docStatus field, b/c we need to include it in # the dup check. This is because we need to abort after we have # three non-precedential and three precedential from this court. if unpubRegex.search(str(aTags[i])) == None: # it's published, else it's unpublished documentType = "Published" numP += 1 else: documentType = "Unpublished" numQ += 1 if verbosity >= 2: print "documentType: " + documentType doc.documentType = documentType if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount >= 3 and numP >= 3 and numQ >= 3: # third dup in a a row for both U and P. break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNumber = aTags[i].contents[0] # next, we do the caseDate caseDate = aTags[i].next.next.contents[0].contents[0] # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # next, we do the caseNameShort caseNameShort = aTags[i].next.next.next.next.next.contents[0]\ .contents[0] # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 6): """Results are available without an HTML POST, but those results lack a date field. Hence, we must do an HTML POST. Missing a day == OK. Just need to monkey with the date POSTed. """ urls = ("http://www.ca6.uscourts.gov/cgi-bin/opinions.pl",) ct = Court.objects.get(courtUUID = 'ca6') for url in urls: today = datetime.date.today() formattedToday = str(today.month) + '/' + str(today.day) + '/' +\ str(today.year) postValues = { 'CASENUM' : '', 'TITLE' : '', 'FROMDATE' : formattedToday, 'TODATE' : formattedToday, 'OPINNUM' : '' } data = urllib.urlencode(postValues) req = urllib2.Request(url, data) html = urllib2.urlopen(req).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) aTags = soup.findAll(attrs={'href' : aTagsRegex}) i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNumber = aTags[i].next.next.next.next.next.contents[0] # using the filename, we can determine the documentType... fileName = aTags[i].contents[0] if 'n' in fileName: # it's unpublished doc.documentType = "Unpublished" elif 'p' in fileName: doc.documentType = "Published" # next, we can do the caseDate caseDate = aTags[i].next.next.next.next.next.next.next.next\ .contents[0] caseDate = cleanString(caseDate) # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[0]),int(splitDate[1]), int(splitDate[2])) doc.dateFiled = caseDate # next, the caseNameShort (there's probably a better way to do this. caseNameShort = aTags[i].next.next.next.next.next.next.next.next\ .next.next.next # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 7): """another court where we need to do a post. This will be a good starting place for getting the judge field, when we're ready for that. Missing a day == OK. Queries return cases for the past week. """ urls = ("http://www.ca7.uscourts.gov/fdocs/docs.fwx",) ct = Court.objects.get(courtUUID = 'ca7') for url in urls: # if these strings change, check that documentType still gets set correctly. dataStrings = ("yr=&num=&Submit=Past+Week&dtype=Opinion&scrid=Select+a+Case", "yr=&num=&Submit=Past+Week&dtype=Nonprecedential+Disposition&scrid=Select+a+Case",) for dataString in dataStrings: req = urllib2.Request(url, dataString) html = urllib2.urlopen(req).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url+dataString, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) aTags = soup.findAll(attrs={'href' : aTagsRegex}) i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get("href") caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNumber = aTags[i].previous.previous.previous.previous.previous\ .previous.previous.previous.previous.previous # next up: caseDate caseDate = aTags[i].previous.previous.previous.contents[0] caseDate = cleanString(caseDate) splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]), int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # next up: caseNameShort caseNameShort = aTags[i].previous.previous.previous.previous\ .previous.previous.previous # next up: docStatus if "type=Opinion" in dataString: doc.documentType = "Published" elif "type=Nonprecedential+Disposition" in dataString: doc.documentType = "Unpublished" # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 8): urls = ("http://www.ca8.uscourts.gov/cgi-bin/new/today2.pl",) ct = Court.objects.get(courtUUID = 'ca8') for url in urls: html = urllib2.urlopen(url).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) aTags = soup.findAll(attrs={'href' : aTagsRegex}) caseNumRegex = re.compile('(\d{2})(\d{4})(u|p)', re.IGNORECASE) caseDateRegex = re.compile('(\d{2}/\d{2}/\d{4})(.*)(</b>)') i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType junk = aTags[i].contents[0] caseNumber = caseNumRegex.search(junk).group(1) + "-" +\ caseNumRegex.search(junk).group(2) documentType = caseNumRegex.search(junk).group(3).upper() if documentType == 'U': doc.documentType = 'Unpublished' elif documentType == 'P': doc.documentType = 'Published' # caseDate is next on the block junk = str(aTags[i].next.next.next) caseDate = caseDateRegex.search(junk).group(1) caseDate = cleanString(caseDate) caseNameShort = caseDateRegex.search(junk).group(2) # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 9): """This court, by virtue of having a javascript laden website, was very hard to parse properly. BeautifulSoup couldn't handle it at all, so lxml has to be used. lxml seems pretty useful, but it was a pain to learn.""" # these URLs redirect now. So much for hacking them. A new approach can probably be done using POST data. urls = ( "http://www.ca9.uscourts.gov/opinions/?o_mode=view&amp;o_sort_field=19&amp;o_sort_type=DESC&o_page_size=100", "http://www.ca9.uscourts.gov/memoranda/?o_mode=view&amp;o_sort_field=21&amp;o_sort_type=DESC&o_page_size=100",) ct = Court.objects.get(courtUUID = 'ca9') for url in urls: if verbosity >= 2: print "Link is now: " + url html = urllib2.urlopen(url).read() tree = fromstring(html) if url == urls[0]: caseLinks = tree.xpath('//table[3]/tbody/tr/td/a') caseNumbers = tree.xpath('//table[3]/tbody/tr/td[2]/label') caseDates = tree.xpath('//table[3]/tbody/tr/td[6]/label') elif url == urls[1]: caseLinks = tree.xpath('//table[3]/tbody/tr/td/a') caseNumbers = tree.xpath('//table[3]/tbody/tr/td[2]/label') caseDates = tree.xpath('//table[3]/tbody/tr/td[7]/label') if daemonmode: # if it's daemonmode, see if the court has changed # this is necessary because the 9th circuit puts random numbers # in their HTML. This gets rid of those, so SHA1 can be generated. listofLinks = [] for i in caseLinks: listofLinks.append(i.get('href')) changed = courtChanged(url, str(listofLinks)) if not changed: # if not, bail. If so, continue to the scraping. return result i = 0 dupCount = 0 while i < len(caseLinks): # we begin with the caseLink field caseLink = caseLinks[i].get('href') caseLink = urljoin(url, caseLink) if verbosity >= 2: print "CaseLink is: " + caseLink # special case if 'no memos filed' in caseLink.lower(): i += 1 continue myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration if verbosity >= 2: print "Error creating file. Punting..." i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # next, we'll do the caseNumber caseNumber = caseNumbers[i].text if verbosity >= 2: print "CaseNumber is: " + caseNumber # next up: document type (static for now) if 'memoranda' in url: doc.documentType = "Unpublished" elif 'opinions' in url: doc.documentType = "Published" if verbosity >= 2: print "Document type is: " + doc.documentType # next up: caseDate splitDate = caseDates[i].text.split('/') caseDate = datetime.date(int(splitDate[2]), int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate if verbosity >= 2: print "CaseDate is: " + str(caseDate) #next up: caseNameShort caseNameShort = titlecase(caseLinks[i].text.lower()) if verbosity >= 2: print "CaseNameShort is: " + caseNameShort + "\n\n" # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 10): # a daily feed of all the items posted THAT day. Missing a day == bad. urls = ("http://www.ck10.uscourts.gov/opinions/new/daily_decisions.rss",) ct = Court.objects.get(courtUUID = 'ca10') for url in urls: html = urllib2.urlopen(url).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result # this code gets rid of errant ampersands - they throw big errors # when parsing. We replace them later. if '&' in html: punctuationRegex = re.compile(" & ") html = re.sub(punctuationRegex, " &amp; ", html) tree = etree.fromstring(html) else: tree = etree.fromstring(html) caseLinks = tree.xpath("//item/link") descriptions = tree.xpath("//item/description") docTypes = tree.xpath("//item/category") caseNames = tree.xpath("//item/title") caseDateRegex = re.compile("(\d{2}/\d{2}/\d{4})", re.VERBOSE | re.DOTALL) caseNumberRegex = re.compile("(\d{2}-\d{4})(.*)$") i = 0 dupCount = 0 while i < len(caseLinks): # we begin with the caseLink field caseLink = caseLinks[i].text caseLink = urljoin(url, caseLink) if verbosity >= 2: print "Link: " + caseLink myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration if verbosity >= 1: print "Error creating file, punting." i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # next: docType (this order of if statements IS correct) docType = docTypes[i].text.strip() if "unpublished" in docType.lower(): doc.documentType = "Unpublished" elif "published" in docType.lower(): doc.documentType = "Published" else: # it's an errata, or something else we don't care about i += 1 continue # next: caseDate caseDate = caseDateRegex.search(descriptions[i].text).group(1) splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]), int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate if verbosity >= 2: print "Case date is: " + str(caseDate) # next: caseNumber caseNumber = caseNumberRegex.search(descriptions[i].text)\ .group(1) if verbosity >= 2: print "Case number is: " + caseNumber # next: caseNameShort caseNameShort = caseNames[i].text if verbosity >= 2: print "Case name is: " + caseNameShort # check for dups, make the object if necessary, otherwise, get it cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 11): """Prior to rev 313 (2010-04-27), this got published documents only, using the court's RSS feed. Currently, it uses lxml to parse the HTML on the published and unpublished feeds. It can be set to do any date range desired, however such modifications should likely go in back_scrape.py.""" # Missing a day == OK. urls = ( "http://www.ca11.uscourts.gov/unpub/searchdate.php", "http://www.ca11.uscourts.gov/opinions/searchdate.php", ) ct = Court.objects.get(courtUUID = 'ca11') for url in urls: date = time.strftime('%Y-%m', datetime.date.today().timetuple()) if verbosity >= 2: print "date: " + str(date) postValues = { 'date' : date, } data = urllib.urlencode(postValues) req = urllib2.Request(url, data) html = urllib2.urlopen(req).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result tree = fromstring(html) if 'unpub' in url: caseNumbers = tree.xpath('//table[3]//table//table/tr[1]/td[2]') caseLinks = tree.xpath('//table[3]//table//table/tr[3]/td[2]/a') caseDates = tree.xpath('//table[3]//table//table/tr[4]/td[2]') caseNames = tree.xpath('//table[3]//table//table/tr[6]/td[2]') elif 'opinion' in url: caseNumbers = tree.xpath('//table[3]//td[3]//table/tr[1]/td[2]') caseLinks = tree.xpath('//table[3]//td[3]//table/tr[3]/td[2]/a') caseDates = tree.xpath('//table[3]//td[3]//table/tr[4]/td[2]') caseNames = tree.xpath('//table[3]//td[3]//table/tr[6]/td[2]') ''' # for debugging print "length: " + str(len(caseNames)) for foo in caseNames: print str(foo.text) return result''' i = 0 dupCount = 0 while i < len(caseNumbers): caseLink = caseLinks[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" if verbosity >= 2: print "Duplicate found at " + str(i) dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 if 'unpub' in url: doc.documentType = "Unpublished" elif 'opinion' in url: doc.documentType = "Published" if verbosity >= 2: print "documentType: " + str(doc.documentType) cleanDate = cleanString(caseDates[i].text) doc.dateFiled = datetime.datetime(*time.strptime(cleanDate, "%m-%d-%Y")[0:5]) if verbosity >= 2: print "dateFiled: " + str(doc.dateFiled) caseNameShort = caseNames[i].text caseNumber = caseNumbers[i].text cite, created = hasDuplicate(caseNumber, caseNameShort) if verbosity >= 2: print "caseNameShort: " + cite.caseNameShort print "caseNumber: " + cite.caseNumber + "\n" doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 12): # terrible site. Code assumes that we download the opinion on the day # it is released. If we miss a day, that could cause a problem. urls = ("http://www.cadc.uscourts.gov/bin/opinions/allopinions.asp",) ct = Court.objects.get(courtUUID = 'cadc') for url in urls: html = urllib2.urlopen(url).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) aTags = soup.findAll(attrs={'href' : aTagsRegex}) caseNumRegex = re.compile("(\d{2}-\d{4})") i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber caseNumber = caseNumRegex.search(caseLink).group(1) # we can hard-code this b/c the D.C. Court paywalls all # unpublished opinions. doc.documentType = "Published" # caseDate is next on the block caseDate = datetime.date.today() doc.dateFiled = caseDate caseNameShort = aTags[i].next.next.next # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # if that goes well, we save to the DB doc.citation = cite # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 13): # running log of all opinions urls = ("http://www.cafc.uscourts.gov/dailylog.html",) ct = Court.objects.get(courtUUID = "cafc") for url in urls: html = urllib2.urlopen(url).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) trTags = soup.findAll('tr') # start on the second row, since the first is headers. i = 1 dupCount = 0 while i <= 50: #stop at 50, if no triple dups first. try: caseLink = trTags[i].td.nextSibling.nextSibling.nextSibling\ .nextSibling.nextSibling.nextSibling.a.get('href').strip('.') caseLink = urljoin(url, caseLink) if 'opinion' not in caseLink: # we have a non-case PDF. punt i += 1 continue except: # the above fails when things get funky, in that case, we punt i += 1 continue myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # next: caseNumber caseNumber = trTags[i].td.nextSibling.nextSibling.contents[0]\ .strip('.pdf') # next: dateFiled dateFiled = trTags[i].td.contents splitDate = dateFiled[0].split("/") dateFiled = datetime.date(int(splitDate[0]), int(splitDate[1]), int(splitDate[2])) doc.dateFiled = dateFiled # next: caseNameShort caseNameShort = trTags[i].td.nextSibling.nextSibling.nextSibling\ .nextSibling.nextSibling.nextSibling.a.contents[0] # next: documentType documentType = trTags[i].td.nextSibling.nextSibling.nextSibling\ .nextSibling.nextSibling.nextSibling.nextSibling.nextSibling\ .contents[0].contents[0] # normalize the result for our internal purposes... if documentType == "N": documentType = "Unpublished" elif documentType == "P": documentType = "Published" doc.documentType = documentType # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result if (courtID == 14): # we do SCOTUS urls = ("http://www.supremecourt.gov/opinions/slipopinions.aspx", "http://www.supremecourt.gov/opinions/in-chambers.aspx", "http://www.supremecourt.gov/opinions/relatingtoorders.aspx",) ct = Court.objects.get(courtUUID = 'scotus') for url in urls: if verbosity >= 2: print "Scraping URL: " + url html = urllib2.urlopen(url).read() tree = fromstring(html) if 'slipopinion' in url: caseLinks = tree.xpath('//table/tr/td[4]/a') caseNumbers = tree.xpath('//table/tr/td[3]') caseDates = tree.xpath('//table/tr/td[2]') elif 'in-chambers' in url: caseLinks = tree.xpath('//table/tr/td[3]/a') caseNumbers = tree.xpath('//table/tr/td[2]') caseDates = tree.xpath('//table/tr/td[1]') elif 'relatingtoorders' in url: caseLinks = tree.xpath('//table/tr/td[3]/a') caseNumbers = tree.xpath('//table/tr/td[2]') caseDates = tree.xpath('//table/tr/td[1]') if daemonmode: # if it's daemonmode, see if the court has changed # this is necessary because the SCOTUS puts random numbers # in their HTML. This gets rid of those, so SHA1 can be generated. listofLinks = [] for i in caseLinks: listofLinks.append(i.get('href')) changed = courtChanged(url, str(listofLinks)) if not changed: # if not, bail. If so, continue to the scraping. return result i = 0 dupCount = 0 while i < len(caseLinks): # we begin with the caseLink field caseLink = caseLinks[i].get('href') caseLink = urljoin(url, caseLink) if verbosity >= 2: print "caseLink: " + caseLink myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" if verbosity >= 2: print "Duplicate found at " + str(i) + '\n' dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 caseNumber = caseNumbers[i].text if verbosity >= 2: print "caseNumber: " + caseNumber caseNameShort = caseLinks[i].text if verbosity >= 2: print "caseNameShort: " + caseNameShort if 'slipopinion' in url: doc.documentType = "Published" elif 'in-chambers' in url: doc.documentType = "In-chambers" elif 'relatingtoorders' in url: doc.documentType = "Relating-to" if verbosity >= 2: print "documentType: " + doc.documentType if '/' in caseDates[i].text: splitDate = caseDates[i].text.split('/') elif '-' in caseDates[i].text: splitDate = caseDates[i].text.split('-') year = int("20" + splitDate[2]) caseDate = datetime.date(year, int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate if verbosity >= 2: print "caseDate: " + str(caseDate) # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result
5f8ab0dce527e0f00d170a17505b959be1785525 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6762/5f8ab0dce527e0f00d170a17505b959be1785525/scrape_and_parse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 888, 25360, 29328, 88, 12, 71, 477, 88, 734, 16, 563, 16, 11561, 16, 8131, 3188, 4672, 309, 11561, 1545, 576, 30, 563, 1011, 315, 27091, 348, 5093, 2203, 1360, 7910, 1099, 56, 30, 315,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 888, 25360, 29328, 88, 12, 71, 477, 88, 734, 16, 563, 16, 11561, 16, 8131, 3188, 4672, 309, 11561, 1545, 576, 30, 563, 1011, 315, 27091, 348, 5093, 2203, 1360, 7910, 1099, 56, 30, 315,...
'<TABLE BORDER="1" CELLPADDING="3" ' +\ 'CELLSPACING="0" WIDTH="100%" BGCOLOR="white">\n' +\ '<TR BGCOLOR=" '<TH COLSPAN=2>\n' + heading + \ '</TH></TR>\n'
'<table class="'+css_class+'" border="1" cellpadding="3"' +\ ' cellspacing="0" width="100%" bgcolor="white">\n' +\ '<tr bgcolor=" '<th colspan="2">\n' + heading +\ '</th></tr>\n'
def _table_header(self, heading, css_class): 'Return a header for an HTML table' return self._start_of(heading)+\ '<TABLE BORDER="1" CELLPADDING="3" ' +\ 'CELLSPACING="0" WIDTH="100%" BGCOLOR="white">\n' +\ '<TR BGCOLOR="#70b0f0" CLASS="'+css_class+'">\n'+\ '<TH COLSPAN=2>\n' + heading + \ '</TH></TR>\n'
89bd16eaf8c7e556babe42c6a92621dbc9b8a7e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/89bd16eaf8c7e556babe42c6a92621dbc9b8a7e9/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2121, 67, 3374, 12, 2890, 16, 11053, 16, 3747, 67, 1106, 4672, 296, 990, 279, 1446, 364, 392, 3982, 1014, 11, 327, 365, 6315, 1937, 67, 792, 12, 19948, 13, 16971, 2368, 7775, 605,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2121, 67, 3374, 12, 2890, 16, 11053, 16, 3747, 67, 1106, 4672, 296, 990, 279, 1446, 364, 392, 3982, 1014, 11, 327, 365, 6315, 1937, 67, 792, 12, 19948, 13, 16971, 2368, 7775, 605,...
if v[0] == 32:
if v.args[0] == 32:
def send(self, str): """Send `str' to the server.""" if self.sock is None: if self.auto_open: self.connect() else: raise NotConnected()
89df245607619ed532106fbbdbf80745815f9c96 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/89df245607619ed532106fbbdbf80745815f9c96/httplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 12, 2890, 16, 609, 4672, 3536, 3826, 1375, 701, 11, 358, 326, 1438, 12123, 309, 365, 18, 15031, 353, 599, 30, 309, 365, 18, 6079, 67, 3190, 30, 365, 18, 3612, 1435, 469, 30, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 12, 2890, 16, 609, 4672, 3536, 3826, 1375, 701, 11, 358, 326, 1438, 12123, 309, 365, 18, 15031, 353, 599, 30, 309, 365, 18, 6079, 67, 3190, 30, 365, 18, 3612, 1435, 469, 30, 10...
attrname = string.lower(attrname)
def parse_starttag(self, i):
b69104e135ad888177d945b2d1362f01d25ee04f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/b69104e135ad888177d945b2d1362f01d25ee04f/xmllib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 1937, 2692, 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,...
[ 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, 1109, 67, 1937, 2692, 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, ...
assert(self.debugPrint("oneTimeCollide()"))
assert self.notify.debugStateCall(self)
def oneTimeCollide(self): """ Makes one quick collision pass for the avatar, for instance as a one-time straighten-things-up operation after collisions have been disabled. """ assert(self.debugPrint("oneTimeCollide()")) self.isAirborne = 0 self.mayJump = 1 tempCTrav = CollisionTraverser("oneTimeCollide") tempCTrav.addCollider(self.cWallSphereNodePath, self.pusher) if self.wantFloorSphere: tempCTrav.addCollider(self.cFloorSphereNodePath, self.event) tempCTrav.addCollider(self.cRayNodePath, self.lifter) tempCTrav.traverse(render)
abc151a082286523619150b15b5dc30864de5bde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/abc151a082286523619150b15b5dc30864de5bde/GravityWalker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1245, 950, 914, 8130, 12, 2890, 4672, 3536, 490, 3223, 1245, 9549, 17740, 1342, 364, 326, 16910, 16, 364, 791, 487, 279, 1245, 17, 957, 21251, 275, 17, 451, 899, 17, 416, 1674, 1839, 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, 1245, 950, 914, 8130, 12, 2890, 4672, 3536, 490, 3223, 1245, 9549, 17740, 1342, 364, 326, 16910, 16, 364, 791, 487, 279, 1245, 17, 957, 21251, 275, 17, 451, 899, 17, 416, 1674, 1839, 2...
cxx.linker_so = [cxx.linker_so[0]] + cxx.compiler_cxx[0] \
cxx.linker_so = [cxx.linker_so[0], cxx.compiler_cxx[0]] \
def CCompiler_cxx_compiler(self): if self.compiler_type=='msvc': return self cxx = copy(self) cxx.compiler_so = [cxx.compiler_cxx[0]] + cxx.compiler_so[1:] if sys.platform.startswith('aix') and 'ld_so_aix' in cxx.linker_so[0]: # AIX needs the ld_so_aix script included with Python cxx.linker_so = [cxx.linker_so[0]] + cxx.compiler_cxx[0] \ + cxx.linker_so[2:] else: cxx.linker_so = [cxx.compiler_cxx[0]] + cxx.linker_so[1:] return cxx
89bdcf9a990f5aa44b9830ae366f3c02f7b5bd7a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14925/89bdcf9a990f5aa44b9830ae366f3c02f7b5bd7a/ccompiler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 385, 9213, 67, 71, 5279, 67, 9576, 12, 2890, 4672, 309, 365, 18, 9576, 67, 723, 18920, 959, 4227, 4278, 327, 365, 276, 5279, 273, 1610, 12, 2890, 13, 276, 5279, 18, 9576, 67, 2048, 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, 385, 9213, 67, 71, 5279, 67, 9576, 12, 2890, 4672, 309, 365, 18, 9576, 67, 723, 18920, 959, 4227, 4278, 327, 365, 276, 5279, 273, 1610, 12, 2890, 13, 276, 5279, 18, 9576, 67, 2048, 2...
m_cmd = 'mount -o loop,rw %s %s' % (self.floppy_img,
m_cmd = 'mount -o loop,rw %s %s' % (self.floppy,
def create_boot_floppy(self): """ Prepares a boot floppy by creating a floppy image file, mounting it and copying an answer file (kickstarts for RH based distros, answer files for windows) to it. After that the image is umounted. """ print "Creating boot floppy"
d245408f9a2fd5877bf4770afc7b97ad08147815 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/d245408f9a2fd5877bf4770afc7b97ad08147815/unattended.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 7137, 67, 74, 16884, 2074, 12, 2890, 4672, 3536, 2962, 84, 4807, 279, 4835, 284, 16884, 2074, 635, 4979, 279, 284, 16884, 2074, 1316, 585, 16, 5344, 310, 518, 471, 8933, 392, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7137, 67, 74, 16884, 2074, 12, 2890, 4672, 3536, 2962, 84, 4807, 279, 4835, 284, 16884, 2074, 635, 4979, 279, 284, 16884, 2074, 1316, 585, 16, 5344, 310, 518, 471, 8933, 392, ...
texts = [] for xpath in xpaths: subset = xml.findall(xpath) texts.extend((x.text for x in subset if x.text)) output = ','.join(texts)
headeroutput = renderHeader(groups, xpaths) output = renderOutput(groups, xpaths, xml)
def get(self): url = self.request.get('url') browse = self.request.get('browse') xpaths = self.request.get_all('xpath') if not url: self.response.out.write(template.render('index.html', {'url':'http://'})) return data = urlfetch.fetch(url).content xml = ElementTree() xml.parse(StringIO(data)) texts = [] for xpath in xpaths: subset = xml.findall(xpath) texts.extend((x.text for x in subset if x.text)) output = ','.join(texts) if not browse: self.response.headers['Content-Type'] = 'text/csv' self.response.headers['Content-Disposition'] = 'filename=xml.csv' self.response.out.write(output) return link = 'url=%s%s' % (urllib.quote_plus(url), ''.join(['&amp;xpath=%s' % xpath for xpath in xpaths])) path = '?browse=1&amp;%s&amp;xpath=' % link self.response.out.write(template.render( 'index.html', { 'url':url, 'output':output, 'link':link, 'browse':renderTree(xml.getroot(), path, 0)}))
34a7b4031e579686dd810915121a927ce408edeb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11773/34a7b4031e579686dd810915121a927ce408edeb/main.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 2890, 4672, 880, 273, 365, 18, 2293, 18, 588, 2668, 718, 6134, 21670, 273, 365, 18, 2293, 18, 588, 2668, 25731, 6134, 619, 4481, 273, 365, 18, 2293, 18, 588, 67, 454, 2668, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 2890, 4672, 880, 273, 365, 18, 2293, 18, 588, 2668, 718, 6134, 21670, 273, 365, 18, 2293, 18, 588, 2668, 25731, 6134, 619, 4481, 273, 365, 18, 2293, 18, 588, 67, 454, 2668, ...
['d']
'd' >>> nth('abcde', 9) is None True
>>> def unique_justseen(iterable, key=None):
11485b4869f989299d806e30a530dd5234c8e9b6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/11485b4869f989299d806e30a530dd5234c8e9b6/test_itertools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 4080, 1652, 3089, 67, 3732, 15156, 12, 15364, 16, 498, 33, 7036, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 4080, 1652, 3089, 67, 3732, 15156, 12, 15364, 16, 498, 33, 7036, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
"""A venue where events are held.""" id = None def __init__(self, id, network): _BaseObject.__init__(self, network) self.id = _number(id) @_string_output def __repr__(self): return "Venue def __eq__(self, other): return self.get_id() == other.get_id() def _get_params(self): return {"venue": self.get_id()} def get_id(self): """Returns the id of the venue.""" return self.id def get_upcoming_events(self): """Returns the upcoming events in this venue.""" doc = self._request("venue.getEvents", True) list = [] for node in doc.getElementsByTagName("event"): list.append(Event(_extract(node, "id"), self.network)) return list def get_past_events(self): """Returns the past events held in this venue.""" doc = self._request("venue.getEvents", True) list = [] for node in doc.getElementsByTagName("event"): list.append(Event(_extract(node, "id"), self.network)) return list
"""A venue where events are held.""" id = None def __init__(self, id, network): _BaseObject.__init__(self, network) self.id = _number(id) @_string_output def __repr__(self): return "Venue def __eq__(self, other): return self.get_id() == other.get_id() def _get_params(self): return {"venue": self.get_id()} def get_id(self): """Returns the id of the venue.""" return self.id def get_upcoming_events(self): """Returns the upcoming events in this venue.""" doc = self._request("venue.getEvents", True) seq = [] for node in doc.getElementsByTagName("event"): seq.append(Event(_extract(node, "id"), self.network)) return seq def get_past_events(self): """Returns the past events held in this venue.""" doc = self._request("venue.getEvents", True) seq = [] for node in doc.getElementsByTagName("event"): seq.append(Event(_extract(node, "id"), self.network)) return seq
def get_next_page(self): """Returns the next page of results as a sequence of Track objects.""" master_node = self._retrieve_next_page() list = [] for node in master_node.getElementsByTagName("venue"): list.append(Venue(_extract(node, "id"), self.network)) return list
312230e30b9a32836e57d3014b7461a466a3dbed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9926/312230e30b9a32836e57d3014b7461a466a3dbed/pylast.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 4285, 67, 2433, 12, 2890, 4672, 3536, 1356, 326, 1024, 1363, 434, 1686, 487, 279, 3102, 434, 11065, 2184, 12123, 225, 4171, 67, 2159, 273, 365, 6315, 17466, 67, 4285, 67, 2433, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 4285, 67, 2433, 12, 2890, 4672, 3536, 1356, 326, 1024, 1363, 434, 1686, 487, 279, 3102, 434, 11065, 2184, 12123, 225, 4171, 67, 2159, 273, 365, 6315, 17466, 67, 4285, 67, 2433, ...
sage: rubik.solve(state) 'R*U' You can also check this using \code{word_problem} method (eg, G = rubik.group();
If you type next rubik.solve(state) and wait a long time, SAGE will return the correct answer, 'R*U'. You can also check this another (but similar) way using the \code{word_problem} method (eg, G = rubik.group();
def solve(self,state): r""" Solves the cube in the \code{state}, given as a dictionary as in \code{legal}. This uses GAP's \code{EpimorphismFromFreeGroup} and \code{PreImagesRepresentative}.
e640cbeb63890f780eed63769cd465ee6e46f525 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/e640cbeb63890f780eed63769cd465ee6e46f525/cubegroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12439, 12, 2890, 16, 2019, 4672, 436, 8395, 348, 355, 3324, 326, 18324, 316, 326, 521, 710, 95, 2019, 5779, 864, 487, 279, 3880, 487, 316, 521, 710, 95, 2013, 5496, 225, 1220, 4692, 61...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2890, 16, 2019, 4672, 436, 8395, 348, 355, 3324, 326, 18324, 316, 326, 521, 710, 95, 2019, 5779, 864, 487, 279, 3880, 487, 316, 521, 710, 95, 2013, 5496, 225, 1220, 4692, 61...
if char is None or char == ">":
if char is None: raise SyntaxError, "unterminated name" if char == ">":
def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: subpattern.append((LITERAL, this)) elif this == "[": # character set set = []
d46b2a42eda94cbac3b610e36d5f97230d629068 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d46b2a42eda94cbac3b610e36d5f97230d629068/sre_parse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 12, 3168, 16, 1936, 16, 2943, 33, 1435, 4672, 225, 468, 1109, 6736, 2652, 1936, 1368, 392, 3726, 666, 18, 225, 720, 4951, 273, 2592, 3234, 12, 4951, 13, 225, 333, 273, 599, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2670, 12, 3168, 16, 1936, 16, 2943, 33, 1435, 4672, 225, 468, 1109, 6736, 2652, 1936, 1368, 392, 3726, 666, 18, 225, 720, 4951, 273, 2592, 3234, 12, 4951, 13, 225, 333, 273, 599, ...
@checkAuth(write = True, admin = True)
@checkAuth(admin = True)
def editPerm(self, auth, group, label, trove, oldlabel, oldtrove, writeperm, capped, admin): writeperm = (writeperm == "on") capped = (capped == "on") admin = (admin == "on")
da24c3346d4fa9223ceb3365b4262bfdf7e6ba3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/da24c3346d4fa9223ceb3365b4262bfdf7e6ba3c/http.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3874, 9123, 12, 2890, 16, 1357, 16, 1041, 16, 1433, 16, 23432, 537, 16, 1592, 1925, 16, 1592, 88, 303, 537, 16, 1045, 12160, 16, 3523, 1845, 16, 3981, 4672, 1045, 12160, 273, 261, 2626...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3874, 9123, 12, 2890, 16, 1357, 16, 1041, 16, 1433, 16, 23432, 537, 16, 1592, 1925, 16, 1592, 88, 303, 537, 16, 1045, 12160, 16, 3523, 1845, 16, 3981, 4672, 1045, 12160, 273, 261, 2626...
if os.path.exists(newpath):
if os.path.isfile(newpath):
def searchPath(directory, path): "Go one step beyond getFullPath and try the various folders in PATH" # Try looking in the current working directory first. newpath = getFullPath(directory, path) if os.path.exists(newpath): return newpath # At this point we have to fail if a directory was given (to prevent cases # like './gdb' from matching '/usr/bin/./gdb'). if not os.path.dirname(path): for dir in os.environ['PATH'].split(os.pathsep): newpath = os.path.join(dir, path) if os.path.exists(newpath): return newpath return None
f3e9f4e5622b2ee849a949caded410b1afce695a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11102/f3e9f4e5622b2ee849a949caded410b1afce695a/automationutils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 743, 12, 5149, 16, 589, 4672, 315, 5741, 1245, 2235, 17940, 10208, 743, 471, 775, 326, 11191, 9907, 316, 7767, 6, 468, 6161, 7849, 316, 326, 783, 5960, 1867, 1122, 18, 25094, 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, 1623, 743, 12, 5149, 16, 589, 4672, 315, 5741, 1245, 2235, 17940, 10208, 743, 471, 775, 326, 11191, 9907, 316, 7767, 6, 468, 6161, 7849, 316, 326, 783, 5960, 1867, 1122, 18, 25094, 273, ...
id, tstart, tend, levstart, levend, fcstart, fcent = matchnames
id, tstart, tend, levstart, levend, fcstart, fcend = matchnames
def getFilePath(self, matchnames, template): """Lookup or generate the file path, depending on whether a filemap or template is present. """ if hasattr(self.parent,'cdms_filemap'): id, tstart, tend, levstart, levend, fcstart, fcent = matchnames filename = self.parent._filemap_[(self.id, tstart, levstart, fcstart)] # ... filemap uses dataset IDs else: filename = getPathFromTemplate(template,matchnames) return filename
041188f959429060e28dc04dad2ffb6caf27511d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/41/041188f959429060e28dc04dad2ffb6caf27511d/variable.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22554, 12, 2890, 16, 845, 1973, 16, 1542, 4672, 3536, 6609, 578, 2103, 326, 585, 589, 16, 8353, 603, 2856, 279, 585, 1458, 578, 1542, 353, 3430, 18, 3536, 309, 3859, 12, 2890, 18, 2938...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22554, 12, 2890, 16, 845, 1973, 16, 1542, 4672, 3536, 6609, 578, 2103, 326, 585, 589, 16, 8353, 603, 2856, 279, 585, 1458, 578, 1542, 353, 3430, 18, 3536, 309, 3859, 12, 2890, 18, 2938...
output[j] = output[j] + cards[card_num].to_s()
board.add(j, cards[card_num].flip())
def shlomif_main(args): print_ts = 0 if (args[1] == "-t"): print_ts = 1 args.pop(0) game_num = long(args[1]) if (len(args) >= 3): which_game = args[2] else: which_game = "freecell" game_chooser = WhichGame(which_game, print_ts) game_class = game_chooser.lookup() cards = game_chooser.deal(game_num) if game_class == "der_katz": if (which_game == "die_schlange"): print "Foundations: H-A S-A D-A C-A H-A S-A D-A C-A" board = Board(9) col_idx = 0 for card in cards: if card.is_king(): col_idx = col_idx + 1 if not ((which_game == "die_schlange") and (card.rank == 1)): board.add(col_idx, card) board.output() elif game_class == "freecell": is_fc = (which_game in ('forecell', 'eight_off')) board = Board(8, with_freecells=is_fc) if is_fc: for i in range(52): if (i < 48): board.add(i%8, cards[i]) else: board.add_freecell(cards[i]) if which_game == "eight_off": board.add_freecell(empty_card()) else: for i in range(52): board.add(i%8, cards[i]) board.output(); elif game_class == "seahaven": board = Board(10, with_freecells=True) board.add_freecell(empty_card()) for i in range(52): if (i < 50): board.add(i%10, cards[i]) else: board.add_freecell(cards[i]) board.output() elif game_class == "bakers_dozen": i, n = 0, 13 kings = [] cards.reverse() for c in cards: if c.is_king(): kings.append(i) i = i + 1 for i in kings: j = i % n while j < i: if not cards[j].is_king(): cards[i], cards[j] = cards[j], cards[i] break j = j + n board = Board(13) for i in range(52): board.add(i%13, cards[i]) board.output() elif game_class == "gypsy": output = range(8); for i in range(8): output[i] = "" for i in range(24): output[i%8] = output[i%8] + cards[i].to_s() if (i < 16): output[i%8] = output[i%8] + " " talon = "Talon:" for i in range(24,8*13): talon = talon + " " + cards[i].to_s() print talon for i in range(8): print output[i] elif game_class == "klondike": #o = "" #for i in cards: # o = o + " " + i.to_s() #print o output = range(7); for i in range(7): output[i] = "" card_num = 0 for r in range(1,7): for s in range(7-r): output[s] = output[s] + cards[card_num].to_s() card_num = card_num + 1 for s in range(7): output[s] = output[s] + cards[card_num].to_s() card_num = card_num + 1 talon = "Talon: " while card_num < 52: talon = talon + cards[card_num].to_s() card_num = card_num + 1 print talon if (not (which_game == "small_harp")): output.reverse(); for i in output: print i elif game_class == "simple_simon": card_num = 0 board = Board(10) num_cards = 9 while num_cards >= 3: for s in range(num_cards): board.add(s, cards[card_num]) card_num = card_num + 1 num_cards = num_cards - 1 for s in range(10): board.add(s, cards[card_num]) card_num = card_num + 1 board.output() elif game_class == "yukon": card_num = 0 output = range(7) for i in range(7): output[i] = "" for i in range(1, 7): for j in range(i, 7): output[j] = output[j] + cards[card_num].to_s() card_num = card_num + 1 for i in range(4): for j in range(1,7): output[j] = output[j] + cards[card_num].to_s() card_num = card_num + 1 for i in range(7): output[i] = output[i] + cards[card_num].to_s() card_num = card_num + 1 for i in output: print i elif game_class == "beleaguered_castle": if (which_game == "beleaguered_castle") or (which_game == "citadel"): new_cards = [] for c in cards: if (c & 0x0F != 1): new_cards.append(c) cards = new_cards; output = range(8) for i in range(8): output[i] = "" card_num = 0 if (which_game == "beleaguered_castle") or (which_game == "citadel"): foundations = [1,1,1,1] else: foundations = [0,0,0,0] for i in range(6): for s in range(8): if (which_game == "citadel"): if (foundations[cards[card_num] >> 4]+1 == (cards[card_num] & 0x0F)): foundations[cards[card_num] >> 4] = foundations[cards[card_num] >> 4] + 1; card_num = card_num + 1 continue output[s] = output[s] + cards[card_num].to_s() card_num = card_num + 1 if (card_num == len(cards)): break if (which_game == "streets_and_alleys"): for s in range(4): output[s] = output[s] + " " + cards[card_num].to_s() card_num = card_num + 1 f_str = "Foundations:" for f in [2,0,3,1]: if (foundations[f] != 0): f_str = f_str + " " + get_card_suit(f) + "-" + get_card_num(foundations[f]) if (f_str != "Foundations:"): print f_str for i in output: print i elif game_class == "fan": board = Board(18) for i in range(52-1): board.add(i%17, cards[i]) board.add(17, cards[i+1]) board.output() else: print "Unknown game type " + which_game + "\n"
e826473f5ec949b65209ec2182ff4051c0b52947 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2756/e826473f5ec949b65209ec2182ff4051c0b52947/make_pysol_freecell_board.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 699, 80, 362, 430, 67, 5254, 12, 1968, 4672, 1172, 67, 3428, 273, 374, 309, 261, 1968, 63, 21, 65, 422, 3701, 88, 6, 4672, 1172, 67, 3428, 273, 404, 833, 18, 5120, 12, 20, 13, 7920...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 699, 80, 362, 430, 67, 5254, 12, 1968, 4672, 1172, 67, 3428, 273, 374, 309, 261, 1968, 63, 21, 65, 422, 3701, 88, 6, 4672, 1172, 67, 3428, 273, 404, 833, 18, 5120, 12, 20, 13, 7920...
mdemo = self.state_update(cr, uid, ids2, newstate, states_to_update, context, level-1,) and mdemo if not module.dependencies_id:
mdemo = self.state_update(cr, uid, ids2, newstate, states_to_update, context, level-1,) or mdemo if not go_deeper:
def state_update(self, cr, uid, ids, newstate, states_to_update, context={}, level=50): if level<1: raise orm.except_orm(_('Error'), _('Recursion error in modules dependencies !')) demo = True for module in self.browse(cr, uid, ids): mdemo = True for dep in module.dependencies_id: if dep.state == 'unknown': raise orm.except_orm(_('Error'), _('You try to install a module that depends on the module: %s.\nBut this module is not available in your system.') % (dep.name,)) if dep.state != newstate: ids2 = self.search(cr, uid, [('name','=',dep.name)]) mdemo = self.state_update(cr, uid, ids2, newstate, states_to_update, context, level-1,) and mdemo if not module.dependencies_id: mdemo = module.demo if module.state in states_to_update: self.write(cr, uid, [module.id], {'state': newstate, 'demo':mdemo}) demo = demo and mdemo return demo
9732a2718da392dbec0accf956e7854e92205252 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12853/9732a2718da392dbec0accf956e7854e92205252/module.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 919, 67, 2725, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 394, 2019, 16, 5493, 67, 869, 67, 2725, 16, 819, 28793, 1801, 33, 3361, 4672, 309, 1801, 32, 21, 30, 1002, 13969, 18, 14137...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 919, 67, 2725, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 394, 2019, 16, 5493, 67, 869, 67, 2725, 16, 819, 28793, 1801, 33, 3361, 4672, 309, 1801, 32, 21, 30, 1002, 13969, 18, 14137...
cmd = self.getCommandLine(bangpath, direct)
cmd = self.getCommandLine(bangpath)
def startInterpreter(self, argstring=None): """Interface used by actions to start the interpreter. This method is the outside interface to the job control mixin to start the interpreter. See the RunScript action for an example of its usage in practice. """ if argstring is not None: self.scriptArgs = argstring if self.buffer.readonly or not self.classprefs.autosave_before_run: msg = "You must save this file to the local filesystem\nbefore you can run it through the interpreter." dlg = wx.MessageDialog(wx.GetApp().GetTopWindow(), msg, "Save the file!", wx.OK | wx.ICON_ERROR ) retval=dlg.ShowModal() return else: self.save()
ab60c495cf8e3ea7a7259529d488fdeba434f06f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11522/ab60c495cf8e3ea7a7259529d488fdeba434f06f/major.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 30010, 12, 2890, 16, 833, 371, 33, 7036, 4672, 3536, 1358, 1399, 635, 4209, 358, 787, 326, 16048, 18, 225, 1220, 707, 353, 326, 8220, 1560, 358, 326, 1719, 3325, 11682, 358, 787, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 30010, 12, 2890, 16, 833, 371, 33, 7036, 4672, 3536, 1358, 1399, 635, 4209, 358, 787, 326, 16048, 18, 225, 1220, 707, 353, 326, 8220, 1560, 358, 326, 1719, 3325, 11682, 358, 787, ...
d.set_mode(DLMODE_NORMAL) d.restart()
if d != self.d: d.set_mode(DLMODE_NORMAL) d.restart()
def restart_other_downloads(self): """ Called by GUI thread """ try: self.dlock.acquire() self.playermode = DLSTATUS_SEEDING self.r = UserDefinedMaxAlwaysOtherwiseEquallyDividedRateManager() uploadrate = float(self.playerconfig['total_max_upload_rate']) print >>sys.stderr,"main: restart_other_downloads: Setting max upload rate to",uploadrate self.r.set_global_max_speed(UPLOAD,uploadrate) finally: self.dlock.release()
9dc804db2e27ad9a0668db60353dcc8865103587 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9686/9dc804db2e27ad9a0668db60353dcc8865103587/swarmplayer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7870, 67, 3011, 67, 7813, 87, 12, 2890, 4672, 3536, 11782, 635, 10978, 2650, 3536, 775, 30, 365, 18, 72, 739, 18, 1077, 1039, 1435, 365, 18, 1601, 1035, 390, 273, 463, 48, 8608, 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, 7870, 67, 3011, 67, 7813, 87, 12, 2890, 4672, 3536, 11782, 635, 10978, 2650, 3536, 775, 30, 365, 18, 72, 739, 18, 1077, 1039, 1435, 365, 18, 1601, 1035, 390, 273, 463, 48, 8608, 67, ...
empath = os.getenv('EXTRA_MODULES_PATH','../addons/') for mname in open(join(empath,'server_modules.list')):
empath = os.getenv('EXTRA_MODULES_PATH', '../addons/') for mname in open(join(empath, 'server_modules.list')):
def find_addons(): for dp, dn, names in os.walk(join('bin', 'addons')): if '__terp__.py' in names: yield basename(dp), dp #look for extra modules try: empath = os.getenv('EXTRA_MODULES_PATH','../addons/') for mname in open(join(empath,'server_modules.list')): mname = mname.strip() if not mname: continue if os.path.exists(join(empath,mname,'__terp__.py')): yield mname, join(empath,mname) else: print "Module %s specified, but no valid path." % mname except: pass
43e9f81873c0cde7b578d2e3f214ad57ee590e2b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/43e9f81873c0cde7b578d2e3f214ad57ee590e2b/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 1289, 7008, 13332, 364, 9986, 16, 8800, 16, 1257, 316, 1140, 18, 11348, 12, 5701, 2668, 4757, 2187, 296, 1289, 7008, 26112, 30, 309, 4940, 387, 84, 25648, 2074, 11, 316, 1257, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 1289, 7008, 13332, 364, 9986, 16, 8800, 16, 1257, 316, 1140, 18, 11348, 12, 5701, 2668, 4757, 2187, 296, 1289, 7008, 26112, 30, 309, 4940, 387, 84, 25648, 2074, 11, 316, 1257, ...
from __interplevel__ import issubclass, _pypy_get
from __interplevel__ import issubclass
def help(): print "You must be joking."
1655df9bb2bf7a1f2f7fd215a52c367e7f712b3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/1655df9bb2bf7a1f2f7fd215a52c367e7f712b3c/__builtin__module.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2809, 13332, 1172, 315, 6225, 1297, 506, 525, 601, 310, 1199, 282, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2809, 13332, 1172, 315, 6225, 1297, 506, 525, 601, 310, 1199, 282, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
this function. This may reformat the data or coerce the type.
this function. This may reformat the data or coerce the type.
def __init__(self, rows, columns, default=None, label=None, to_value=lambda x: x, width=4): r""" An input grid interactive control. Use this in conjunction with the interact command.
0a027916e0c3d675a5b42f57011f9aaa1164c2a9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/0a027916e0c3d675a5b42f57011f9aaa1164c2a9/interact.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2595, 16, 2168, 16, 805, 33, 7036, 16, 1433, 33, 7036, 16, 358, 67, 1132, 33, 14661, 619, 30, 619, 16, 1835, 33, 24, 4672, 436, 8395, 1922, 810, 3068, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2595, 16, 2168, 16, 805, 33, 7036, 16, 1433, 33, 7036, 16, 358, 67, 1132, 33, 14661, 619, 30, 619, 16, 1835, 33, 24, 4672, 436, 8395, 1922, 810, 3068, ...
version=connection._version
version = connection._version
def invalidate(self, tid, oids, connection=None, version=''): """Invalidate references to a given oid.
3f5dc8adcf31c234935a3c71325d44bf2f319df0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3f5dc8adcf31c234935a3c71325d44bf2f319df0/DB.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11587, 12, 2890, 16, 11594, 16, 26629, 16, 1459, 33, 7036, 16, 1177, 2218, 11, 4672, 3536, 26970, 5351, 358, 279, 864, 7764, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 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, 11587, 12, 2890, 16, 11594, 16, 26629, 16, 1459, 33, 7036, 16, 1177, 2218, 11, 4672, 3536, 26970, 5351, 358, 279, 864, 7764, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.s_apply(self.r_exec, args)
return self.s_apply(self.r_exec, args)
def s_exec(self, *args): self.s_apply(self.r_exec, args)
183a2f243768ffd15ff4324b317ba880da1094ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/183a2f243768ffd15ff4324b317ba880da1094ef/rexec.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 67, 4177, 12, 2890, 16, 380, 1968, 4672, 365, 18, 87, 67, 9010, 12, 2890, 18, 86, 67, 4177, 16, 833, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 272, 67, 4177, 12, 2890, 16, 380, 1968, 4672, 365, 18, 87, 67, 9010, 12, 2890, 18, 86, 67, 4177, 16, 833, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
if self.moveOption == 'MOVEDEFAULT': wX = event.pos().x() wY = self.o.height - event.pos().y() wZ = glReadPixelsf(wX, wY, 1, 1, GL_DEPTH_COMPONENT) if wZ[0][0] >= 1.0: junk, self.movingPoint = self.o.mousepoints(event) else: self.movingPoint = A(gluUnProject(wX, wY, wZ[0][0]))
wX = event.pos().x() wY = self.o.height - event.pos().y() wZ = glReadPixelsf(wX, wY, 1, 1, GL_DEPTH_COMPONENT) if wZ[0][0] >= 1.0: junk, self.movingPoint = self.o.mousepoints(event) else: self.movingPoint = A(gluUnProject(wX, wY, wZ[0][0]))
def leftDown(self, event): """Move the selected object(s). """ self.o.SaveMouse(event) self.picking = True self.dragdist = 0.0 self.transDelta = 0 # X, Y or Z deltas for translate. self.rotDelta = 0 # delta for constrained rotations. self.moveOffset = [0.0, 0.0, 0.0] # X, Y and Z offset for move.
6799de36a2e38f769371a6619cda72a9c263b748 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/6799de36a2e38f769371a6619cda72a9c263b748/modifyMode.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2002, 4164, 12, 2890, 16, 871, 4672, 3536, 7607, 326, 3170, 733, 12, 87, 2934, 3536, 365, 18, 83, 18, 4755, 9186, 12, 2575, 13, 365, 18, 11503, 310, 273, 1053, 365, 18, 15997, 4413, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2002, 4164, 12, 2890, 16, 871, 4672, 3536, 7607, 326, 3170, 733, 12, 87, 2934, 3536, 365, 18, 83, 18, 4755, 9186, 12, 2575, 13, 365, 18, 11503, 310, 273, 1053, 365, 18, 15997, 4413, ...
def decompress(filename, dest=None, fn_only=False):
def decompress(filename, dest=None, fn_only=False, check_timestamps=False):
def decompress(filename, dest=None, fn_only=False): """take a filename and decompress it into the same relative location. if the file is not compressed just return the file""" out = dest if not dest: out = filename if filename.endswith('.gz'): ztype='gz' if not dest: out = filename.replace('.gz', '') elif filename.endswith('.bz') or filename.endswith('.bz2'): ztype='bz2' if not dest: if filename.endswith('.bz'): out = filename.replace('.bz','') else: out = filename.replace('.bz2', '') elif filename.endswith('.xz'): ztype='xz' if not dest: out = filename.replace('.xz', '') else: out = filename # returning the same file since it is not compressed ztype = None if ztype and not fn_only: _decompress_chunked(filename, out, ztype) return out
8c6e00abb3511aa55dc43fe676d3a99730ac5ab7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/8c6e00abb3511aa55dc43fe676d3a99730ac5ab7/misc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16824, 12, 3459, 16, 1570, 33, 7036, 16, 2295, 67, 3700, 33, 8381, 16, 866, 67, 25459, 33, 8381, 4672, 3536, 22188, 279, 1544, 471, 16824, 518, 1368, 326, 1967, 3632, 2117, 18, 309, 32...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16824, 12, 3459, 16, 1570, 33, 7036, 16, 2295, 67, 3700, 33, 8381, 16, 866, 67, 25459, 33, 8381, 4672, 3536, 22188, 279, 1544, 471, 16824, 518, 1368, 326, 1967, 3632, 2117, 18, 309, 32...
res = self._getFileAncestors(fileIDLFNs.keys())
res = self._getFileAncestors( fileIDLFNs.keys() )
def _populateFileAncestors(self,lfns,connection=False): connection = self._getConnection(connection) successful = {} failed = {} for lfn,lfnDict in lfns.items(): originalFileID = lfnDict['FileID'] originalDepth = lfnDict.get('AncestorDepth',1) ancestors = lfnDict.get('Ancestors',[]) if lfn in ancestors: ancestors.remove(lfn) if not ancestors: successful[lfn] = True continue res = self._findFiles(ancestors,connection=connection) if res['Value']['Failed']: failed[lfn] = "Failed to resolve ancestor files" continue ancestorIDs = res['Value']['Successful'] fileIDLFNs = {} toInsert = {} for ancestor in ancestorIDs.keys(): fileIDLFNs[ancestorIDs[ancestor]['FileID']] = ancestor toInsert[ancestorIDs[ancestor]['FileID']] = originalDepth res = self._getFileAncestors(fileIDLFNs.keys()) if not res['OK']: failed[lfn] = "Failed to obtain all ancestors" continue fileIDAncestorDict = res['Value'] for fileID,fileIDDict in fileIDAncestorDict.items(): for ancestorID,relativeDepth in fileIDDict.items(): toInsert[ancestorID] = relativeDepth+originalDepth res = self._insertFileAncestors(originalFileID,toInsert,connection=connection) if not res['OK']: failed[lfn] = "Failed to insert ancestor files" else: successful[lfn] = True return S_OK({'Successful':successful,'Failed':failed})
26c5008a7adbc1c761e2409bed59b7710e5f2c74 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/26c5008a7adbc1c761e2409bed59b7710e5f2c74/FileManagerBase.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 19936, 812, 28304, 12, 2890, 16, 20850, 2387, 16, 4071, 33, 8381, 4672, 1459, 273, 365, 6315, 588, 1952, 12, 4071, 13, 6873, 273, 2618, 2535, 273, 2618, 364, 328, 4293, 16, 80, 42...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 19936, 812, 28304, 12, 2890, 16, 20850, 2387, 16, 4071, 33, 8381, 4672, 1459, 273, 365, 6315, 588, 1952, 12, 4071, 13, 6873, 273, 2618, 2535, 273, 2618, 364, 328, 4293, 16, 80, 42...
Run BibTeX if needed before the first compilation.
Run BibTeX if needed before the first compilation. This function also checks if BibTeX has been run by someone else, and in this case it tells the system that it should recompile the document.
def first_bib (self): """ Run BibTeX if needed before the first compilation. """ self.run_needed = self.first_run_needed() if self.env.must_compile: return 0 if self.run_needed: return self.run()
9c5450cdf085e5012e7ba2134cc6281f3471b3a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/9c5450cdf085e5012e7ba2134cc6281f3471b3a1/bibtex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1122, 67, 70, 495, 261, 2890, 4672, 3536, 1939, 605, 495, 21575, 60, 309, 3577, 1865, 326, 1122, 8916, 18, 1220, 445, 2546, 4271, 309, 605, 495, 21575, 60, 711, 2118, 1086, 635, 18626, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1122, 67, 70, 495, 261, 2890, 4672, 3536, 1939, 605, 495, 21575, 60, 309, 3577, 1865, 326, 1122, 8916, 18, 1220, 445, 2546, 4271, 309, 605, 495, 21575, 60, 711, 2118, 1086, 635, 18626, ...
def fl_library_version(ver, rev): """ fl_library_version(ver, rev) -> version_rev ID Returns a consolidated version information, computed as 1000 * version + revision.
def fl_library_version(): """ fl_library_version() -> version_rev ID, ver, rev Returns consolidated version informations @returns: <version_rev> : computed as 1000 * version + revision
def fl_library_version(ver, rev): """ fl_library_version(ver, rev) -> version_rev ID Returns a consolidated version information, computed as 1000 * version + revision. <ver> : version (e.g. 1 in 1.x.yy) <rev> : revision (e.g. 0 in x.0.yy) """ _fl_library_version = cfuncproto( load_so_libforms(), "fl_library_version", \ cty.c_int, [cty.POINTER(cty.c_int), cty.POINTER(cty.c_int)], \ """int fl_library_version(int * ver, int * rev) """) keep_elem_refs(ver, rev) retval = _fl_library_version(ver, rev) return retval
bd6cf497d94f877a33a2bba90b9d74b9e4c950cb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/bd6cf497d94f877a33a2bba90b9d74b9e4c950cb/library.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 1652, 1183, 67, 12083, 67, 1589, 13332, 3536, 1183, 67, 12083, 67, 1589, 1435, 317, 1177, 67, 9083, 1599, 16, 1924, 16, 5588, 225, 2860, 21785, 690, 1177, 26978, 225, 632, 6154, 30, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 1652, 1183, 67, 12083, 67, 1589, 13332, 3536, 1183, 67, 12083, 67, 1589, 1435, 317, 1177, 67, 9083, 1599, 16, 1924, 16, 5588, 225, 2860, 21785, 690, 1177, 26978, 225, 632, 6154, 30, 411, ...
for name in self.get_names(reference):
for name in fs.get_names(reference):
def get_handlers(self, reference): fs, reference = cwd.get_fs_and_reference(reference) for name in self.get_names(reference): ref = reference.resolve2(name) yield self.get_handler(ref)
5c6c364738762cef0d178159ff61dda59dd613b8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/5c6c364738762cef0d178159ff61dda59dd613b8/database.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 11046, 12, 2890, 16, 2114, 4672, 2662, 16, 2114, 273, 7239, 18, 588, 67, 2556, 67, 464, 67, 6180, 12, 6180, 13, 364, 508, 316, 2662, 18, 588, 67, 1973, 12, 6180, 4672, 1278,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 336, 67, 11046, 12, 2890, 16, 2114, 4672, 2662, 16, 2114, 273, 7239, 18, 588, 67, 2556, 67, 464, 67, 6180, 12, 6180, 13, 364, 508, 316, 2662, 18, 588, 67, 1973, 12, 6180, 4672, 1278,...
except ProjInitError, ex:
except (ProjInitError, RuntimeError), ex:
def __init__(self, srs_code): """ Create a new SRS with the given `srs_code` code. """ self.srs_code = srs_code try: epsg_num = get_epsg_num(srs_code) self.proj = Proj(init='epsg:%d' % epsg_num) except ProjInitError, ex: init = _SRS.proj_init.get(srs_code, None) if init is not None: self.proj = init() else: raise ex
91e0c45f30aa03b51926cae82cc218d64306cf21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11249/91e0c45f30aa03b51926cae82cc218d64306cf21/srs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 26200, 67, 710, 4672, 3536, 1788, 279, 394, 348, 13225, 598, 326, 864, 1375, 87, 5453, 67, 710, 68, 981, 18, 3536, 365, 18, 87, 5453, 67, 710, 273, 262...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 26200, 67, 710, 4672, 3536, 1788, 279, 394, 348, 13225, 598, 326, 864, 1375, 87, 5453, 67, 710, 68, 981, 18, 3536, 365, 18, 87, 5453, 67, 710, 273, 262...
self.addText("Failed to locate file '%s'. There is no information on Orange folders that need to be updated." %(self.downfile), 0) self.addText("No folders found.")
self.addText("Failed to locate file '%s'. There is no information on installed Orange files." %(self.downfile), nobr = 0)
def showFolders(self): self.updateGroups = [] self.dontUpdateGroups = [] try: vf = open(self.downfile) self.downstuff, self.updateGroups, self.dontUpdateGroups = self.readLocalVersionFile(vf.readlines(), updateGroups = 1) vf.close() except: self.addText("Failed to locate file '%s'. There is no information on Orange folders that need to be updated." %(self.downfile), 0) self.addText("No folders found.") return dlg = foldersDlg("Check the list of folders you wish to update:", None, "", 1) for group in self.updateGroups: # a category can show up in both groups since you can have files for a category already installed # locally and only then you choose not to update the group anymore if group not in self.dontUpdateGroups: dlg.addCategory(group, 1) for group in self.dontUpdateGroups: dlg.addCategory(group, 0) dlg.finishedAdding(cancel = 1) dlg.move((qApp.desktop().width()-dlg.width())/2, (qApp.desktop().height()-400)/2) # center dlg window res = dlg.exec_loop() if res == 1: self.updateGroups = [] self.dontUpdateGroups = [] for i in range(len(dlg.checkBoxes)): if dlg.checkBoxes[i].isChecked(): self.updateGroups.append(dlg.folders[i]) else: self.dontUpdateGroups.append(dlg.folders[i]) self.writeVersionFile() return
a02e8d7153f2c4738602d3234a7588184bd80c5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/a02e8d7153f2c4738602d3234a7588184bd80c5f/updateOrange.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 14885, 12, 2890, 4672, 365, 18, 2725, 3621, 273, 5378, 365, 18, 72, 1580, 1891, 3621, 273, 5378, 775, 30, 28902, 273, 1696, 12, 2890, 18, 2378, 768, 13, 365, 18, 2378, 334, 3809,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 14885, 12, 2890, 4672, 365, 18, 2725, 3621, 273, 5378, 365, 18, 72, 1580, 1891, 3621, 273, 5378, 775, 30, 28902, 273, 1696, 12, 2890, 18, 2378, 768, 13, 365, 18, 2378, 334, 3809,...
equal_coincs.extend([self[i] for i in (stats == threshold)])
equal_coincs.extend([self[i] for i in (stats == threshold).nonzero()[0]])
def partition_by_stat(self, threshold): """ Return (triggers with stat < threshold, triggers with stat == threshold, triggers with stat > threshold).
7ed5cc06c2adddc94ead6be44a2fad57428dae4d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/7ed5cc06c2adddc94ead6be44a2fad57428dae4d/CoincInspiralUtils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3590, 67, 1637, 67, 5642, 12, 2890, 16, 5573, 4672, 3536, 2000, 261, 313, 8060, 598, 610, 411, 5573, 16, 11752, 598, 610, 422, 5573, 16, 11752, 598, 610, 405, 5573, 2934, 2, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3590, 67, 1637, 67, 5642, 12, 2890, 16, 5573, 4672, 3536, 2000, 261, 313, 8060, 598, 610, 411, 5573, 16, 11752, 598, 610, 422, 5573, 16, 11752, 598, 610, 405, 5573, 2934, 2, -100, -100...
path = os.path.basename(sys.argv[0]) path = os.path.splitext(path)[0] + "-%s.log" % expl
path = "test_docstrings-%s.log" % expl
def _writeLogFile(self, objType): "Write log file for different kind of documentable objects." cwd = os.getcwd()
3f2d07174031e067ea650b4ac177ef95fa37ff07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/3f2d07174031e067ea650b4ac177ef95fa37ff07/test_docstrings.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 19103, 12, 2890, 16, 30078, 4672, 315, 3067, 613, 585, 364, 3775, 3846, 434, 1668, 429, 2184, 1199, 225, 7239, 273, 1140, 18, 588, 11089, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 19103, 12, 2890, 16, 30078, 4672, 315, 3067, 613, 585, 364, 3775, 3846, 434, 1668, 429, 2184, 1199, 225, 7239, 273, 1140, 18, 588, 11089, 1435, 2, -100, -100, -100, -100, -100...
self.unions.append(union) union.properties.root_number = self.root_number
def _evaluate_subgroup(self, subgroup): import image_utilities if len(subgroup) > 1: union = image_utilities.union_images(subgroup) self.unions.append(union) ### union.properties.root_number = self.root_number ### classification = self.guess_glyph_automatic(union) classification_name = classification[0][1] if (classification_name.startswith("_split") or classification_name.startswith("skip")): return 0 else: return classification[0][0] classification = subgroup[0].id_name[0] if classification[1].startswith('_group._part'): return 0 return classification[0]
d5a9979e582851137a037cb0eed0f8b59d7a7652 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/d5a9979e582851137a037cb0eed0f8b59d7a7652/classify.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 21024, 67, 1717, 1655, 12, 2890, 16, 720, 1655, 4672, 1930, 1316, 67, 1367, 1961, 309, 562, 12, 1717, 1655, 13, 405, 404, 30, 7812, 273, 1316, 67, 1367, 1961, 18, 18910, 67, 7369,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 21024, 67, 1717, 1655, 12, 2890, 16, 720, 1655, 4672, 1930, 1316, 67, 1367, 1961, 309, 562, 12, 1717, 1655, 13, 405, 404, 30, 7812, 273, 1316, 67, 1367, 1961, 18, 18910, 67, 7369,...
elif not res_ids: domain[i] = ('id', '=', '0')
def _rec_get(ids, table, parent): if not ids: return [] ids2 = table.search([ (parent, 'in', ids), (parent, '!=', False), ], order=[]) return ids + _rec_get(ids2, table, parent)
63e7f29f6e5886bd880aebc0fa1e437b27f1a6de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9266/63e7f29f6e5886bd880aebc0fa1e437b27f1a6de/modelsql.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3927, 67, 588, 12, 2232, 16, 1014, 16, 982, 4672, 309, 486, 3258, 30, 327, 5378, 3258, 22, 273, 1014, 18, 3072, 3816, 261, 2938, 16, 296, 267, 2187, 3258, 3631, 261, 2938, 16, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3927, 67, 588, 12, 2232, 16, 1014, 16, 982, 4672, 309, 486, 3258, 30, 327, 5378, 3258, 22, 273, 1014, 18, 3072, 3816, 261, 2938, 16, 296, 267, 2187, 3258, 3631, 261, 2938, 16, 1...
self.vte.connect('resize-window', self.on_resize_window)
def connect_signals(self): """Connect all the gtk signals and drag-n-drop mechanics"""
c647948a7fe81768afb7a383769e16ee7aac44bc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6502/c647948a7fe81768afb7a383769e16ee7aac44bc/terminal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3077, 67, 29659, 12, 2890, 4672, 3536, 5215, 777, 326, 22718, 11505, 471, 8823, 17, 82, 17, 7285, 1791, 7472, 2102, 8395, 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, 3077, 67, 29659, 12, 2890, 4672, 3536, 5215, 777, 326, 22718, 11505, 471, 8823, 17, 82, 17, 7285, 1791, 7472, 2102, 8395, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
utargets = [t for t in targets if self._is_useable_url(t)] FixedTargetTest.__init__(self, targets)
utargets = [t for t in targets if self._is_useable_url(t, [''])] FixedTargetTest.__init__(self, utargets)
def __init__(self, targets): BaseSSLTest.__init__(self) utargets = [t for t in targets if self._is_useable_url(t)] FixedTargetTest.__init__(self, targets)
90c90d31036c691f9c9aaf7f88b6f051e32e6285 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3762/90c90d31036c691f9c9aaf7f88b6f051e32e6285/soat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5774, 4672, 3360, 6745, 4709, 16186, 2738, 972, 12, 2890, 13, 5218, 826, 87, 273, 306, 88, 364, 268, 316, 5774, 309, 365, 6315, 291, 67, 1202, 429, 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, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5774, 4672, 3360, 6745, 4709, 16186, 2738, 972, 12, 2890, 13, 5218, 826, 87, 273, 306, 88, 364, 268, 316, 5774, 309, 365, 6315, 291, 67, 1202, 429, 67, ...
try: if int(num) > 9: self.logError(file) return except ValueError: self.logError(file)
num = stripped.split('.', 2)[-1] if len(num) > 1 or not num.isdigit(): self.logError(path)
def doFile(self, file): # heuristic parsing of a manpage filename to figure out its catagory mandir = self.recipe.macros.mandir d = self.recipe.macros.destdir f = file.split('/')[-1] mode = os.stat(d+'/'+file)[stat.ST_MODE] if stat.S_ISDIR(mode): return # irrelevent directory if f[-2:] == 'gz': num = f.split('.')[-2] elif '.' in f: num = f.split('.')[-1] else: self.logError(file) # doesn't have anything parsable in the filename return try: if int(num) > 9: self.logError(file) # manpage catagories go up to 9 return except ValueError: self.logError(file) # not an int return path = ''.join([x for x in (d,mandir,'/','man',num,'/')]) self.warn('Moving %s to %s', file, path) os.makedirs(path) os.rename(d+file, path+f)
a6247cf7c52a7afd630d8108018613b0849ba2e3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8744/a6247cf7c52a7afd630d8108018613b0849ba2e3/badfilecontents.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 812, 12, 2890, 16, 585, 4672, 468, 25833, 5811, 434, 279, 3161, 2433, 1544, 358, 7837, 596, 2097, 6573, 346, 630, 312, 23230, 273, 365, 18, 3927, 3151, 18, 5821, 6973, 18, 889, 48...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 812, 12, 2890, 16, 585, 4672, 468, 25833, 5811, 434, 279, 3161, 2433, 1544, 358, 7837, 596, 2097, 6573, 346, 630, 312, 23230, 273, 365, 18, 3927, 3151, 18, 5821, 6973, 18, 889, 48...
def check_blackman100(self):
def test_blackman100(self):
def check_blackman100(self): gc = self.generic_sun("blackman100") save(gc,test_name()+'.bmp')
1d96ab014629902ff0c3275273182d01de39da50 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13166/1d96ab014629902ff0c3275273182d01de39da50/image_test_case.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 1652, 1842, 67, 11223, 4728, 6625, 12, 2890, 4672, 8859, 273, 365, 18, 13540, 67, 16924, 2932, 11223, 4728, 6625, 7923, 1923, 12, 13241, 16, 3813, 67, 529, 1435, 6797, 18, 70, 1291, 6134,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 1652, 1842, 67, 11223, 4728, 6625, 12, 2890, 4672, 8859, 273, 365, 18, 13540, 67, 16924, 2932, 11223, 4728, 6625, 7923, 1923, 12, 13241, 16, 3813, 67, 529, 1435, 6797, 18, 70, 1291, 6134,...
libraries, extradirs, extraexportsymbols)
libraries, extradirs, extraexportsymbols, outputdir)
def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload"): if architecture == "all": # For the time being we generate two project files. Not as nice as # a single multitarget project, but easier to implement for now. genpluginproject("ppc", module, project, projectdir, sources, sourcedirs, libraries, extradirs, extraexportsymbols) genpluginproject("carbon", module, project, projectdir, sources, sourcedirs, libraries, extradirs, extraexportsymbols) return templatename = "template-%s" % architecture targetname = "%s.%s" % (module, architecture) dllname = "%s.%s.slb" % (module, architecture) if not project: if architecture != "ppc": project = "%s.%s.mcp"%(module, architecture) else: project = "%s.mcp"%module if not projectdir: projectdir = PROJECTDIR if not sources: sources = [module + 'module.c'] if not sourcedirs: for moduledir in MODULEDIRS: if '%' in moduledir: moduledir = moduledir % module fn = os.path.join(projectdir, os.path.join(moduledir, sources[0])) if os.path.exists(fn): moduledir, sourcefile = os.path.split(fn) sourcedirs = [relpath(projectdir, moduledir)] sources[0] = sourcefile break else: print "Warning: %s: sourcefile not found: %s"%(module, sources[0]) sourcedirs = [] if architecture == "carbon": prefixname = "mwerks_carbonplugin_config.h" else: prefixname = "mwerks_plugin_config.h" dict = { "sysprefix" : relpath(projectdir, sys.prefix), "sources" : sources, "extrasearchdirs" : sourcedirs + extradirs, "libraries": libraries, "mac_outputdir" : outputdir, "extraexportsymbols" : extraexportsymbols, "mac_targetname" : targetname, "mac_dllname" : dllname, "prefixname" : prefixname, } mkcwproject.mkproject(os.path.join(projectdir, project), module, dict, force=FORCEREBUILD, templatename=templatename)
83a5e1637a658729814958b5288aba4f7156398c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/83a5e1637a658729814958b5288aba4f7156398c/genpluginprojects.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3157, 4094, 4406, 12, 991, 18123, 16, 1605, 16, 1984, 33, 7036, 16, 1984, 1214, 33, 7036, 16, 5550, 22850, 6487, 1084, 8291, 22850, 6487, 14732, 22850, 6487, 7582, 361, 10539, 22850, 6487,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3157, 4094, 4406, 12, 991, 18123, 16, 1605, 16, 1984, 33, 7036, 16, 1984, 1214, 33, 7036, 16, 5550, 22850, 6487, 1084, 8291, 22850, 6487, 14732, 22850, 6487, 7582, 361, 10539, 22850, 6487,...
def serve(self, port=8200, open_viewer=True):
def serve(self, port=8200, open_viewer=False):
def serve(self, port=8200, open_viewer=True): """ Start a web server for this repository.
26f1ce262139178120e57ecce50a701a3c58d851 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/26f1ce262139178120e57ecce50a701a3c58d851/hg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12175, 12, 2890, 16, 1756, 33, 28, 6976, 16, 1696, 67, 25256, 33, 8381, 4672, 3536, 3603, 279, 3311, 1438, 364, 333, 3352, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12175, 12, 2890, 16, 1756, 33, 28, 6976, 16, 1696, 67, 25256, 33, 8381, 4672, 3536, 3603, 279, 3311, 1438, 364, 333, 3352, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, subkey)
def find_msys_registry(): """Return the MSYS 1.0 directory path stored in the Windows registry The return value is an encoded ascii str. The registry entry for the uninstaller is used. Raise a LookupError if not found. """ subkey = ( 'Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS-1.0_is1') key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, subkey) try: try: return _winreg.QueryValueEx(key, 'Inno Setup: App Path')[0].encode() except WindowsError: raise LookupError("MSYS not found in the registry") finally: key.Close()
7ba5997fe47ddf54ff897301ee28397e01243479 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1298/7ba5997fe47ddf54ff897301ee28397e01243479/msys.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 959, 1900, 67, 9893, 13332, 3536, 990, 326, 490, 30664, 404, 18, 20, 1867, 589, 4041, 316, 326, 8202, 4023, 225, 1021, 327, 460, 353, 392, 3749, 11384, 609, 18, 1021, 4023, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 959, 1900, 67, 9893, 13332, 3536, 990, 326, 490, 30664, 404, 18, 20, 1867, 589, 4041, 316, 326, 8202, 4023, 225, 1021, 327, 460, 353, 392, 3749, 11384, 609, 18, 1021, 4023, 1...
>>> import random >>> dis(pickle.dumps(random.random, 0)) 0: c GLOBAL 'random random' 15: p PUT 0 18: . STOP
>>> import pickletools >>> dis(pickle.dumps(pickletools.dis, 0)) 0: c GLOBAL 'pickletools dis' 17: p PUT 0 20: . STOP
def __init__(self, value): self.value = value
7a614caccfef00fe2134c884f7ff8e91b098e7c1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/7a614caccfef00fe2134c884f7ff8e91b098e7c1/pickletools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 460, 4672, 365, 18, 1132, 273, 460, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 460, 4672, 365, 18, 1132, 273, 460, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
def __init__(self, output_dir, background=False, port=None, root=None):
def __init__(self, output_dir, background=False, port=None, root=None, register_cygwin=None):
def __init__(self, output_dir, background=False, port=None, root=None): """Args: output_dir: the absolute path to the layout test result directory """ self._output_dir = output_dir self._process = None self._port = port self._root = root if self._port: self._port = int(self._port)
a843a3fde6e142db763e90030cbbeac0ebe0dac1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/a843a3fde6e142db763e90030cbbeac0ebe0dac1/http_server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 876, 67, 1214, 16, 5412, 33, 8381, 16, 1756, 33, 7036, 16, 1365, 33, 7036, 16, 1744, 67, 2431, 75, 8082, 33, 7036, 4672, 3536, 2615, 30, 876, 67, 1214,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 876, 67, 1214, 16, 5412, 33, 8381, 16, 1756, 33, 7036, 16, 1365, 33, 7036, 16, 1744, 67, 2431, 75, 8082, 33, 7036, 4672, 3536, 2615, 30, 876, 67, 1214,...
self.data.result = result
self.data.op_result = result
def SetStatus(self, status, result=None): self.lock.acquire() self.data.status = status if result is not None: self.data.result = result self.lock.release()
5d3a153a53c52f3649216ce1221bfb6675cfa3fb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/5d3a153a53c52f3649216ce1221bfb6675cfa3fb/jqueue.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21753, 12, 2890, 16, 1267, 16, 563, 33, 7036, 4672, 365, 18, 739, 18, 1077, 1039, 1435, 365, 18, 892, 18, 2327, 273, 1267, 309, 563, 353, 486, 599, 30, 365, 18, 892, 18, 556, 67, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21753, 12, 2890, 16, 1267, 16, 563, 33, 7036, 4672, 365, 18, 739, 18, 1077, 1039, 1435, 365, 18, 892, 18, 2327, 273, 1267, 309, 563, 353, 486, 599, 30, 365, 18, 892, 18, 556, 67, 2...
messages = self.pimpinstaller.install(list, output)
messages = pimpinstaller.install(list, output)
def installpackage(self, sel, output, recursive, force): pkg = self.packages[sel] list, messages = self.pimpinstaller.prepareInstall(pkg, force, recursive) if messages: return messages messages = self.pimpinstaller.install(list, output) return messages
8a7c1c518eafd321426cd09e70c7c4c0ea5256ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8a7c1c518eafd321426cd09e70c7c4c0ea5256ab/PackageManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 5610, 12, 2890, 16, 357, 16, 876, 16, 5904, 16, 2944, 4672, 3475, 273, 365, 18, 10308, 63, 1786, 65, 666, 16, 2743, 273, 365, 18, 84, 14532, 20163, 18, 9366, 6410, 12, 10657, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5610, 12, 2890, 16, 357, 16, 876, 16, 5904, 16, 2944, 4672, 3475, 273, 365, 18, 10308, 63, 1786, 65, 666, 16, 2743, 273, 365, 18, 84, 14532, 20163, 18, 9366, 6410, 12, 10657, 1...
print "G1 Z%6.2f F%6.2f" % (position, feedrate)
print "G1 Z%06.2f F%06.2f" % (position, feedrate)
def thread_nut(position): "Thread the front of a nut to a position on the rod" print "M00 (Thread a nut on the rod)" #do we wanna use our nut starting device? if useNutStarter: print "G1 Z10 F%6.2f" % (feedrate) #zero us out. print "G92 Z0" #do we wanna use thread locking compound? if useThreadLocker: print "G1 Z%6.2f F%6.2f" % (position-nutHeight, feedrate) print "M00 (Apply thread locker just in front of the nut.)" print "G1 Z%6.2f F%6.2f" % (position, feedrate)
74fb04ff2e7d3c298179074e45420a96021f9c99 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/479/74fb04ff2e7d3c298179074e45420a96021f9c99/make_bot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2650, 67, 82, 322, 12, 3276, 4672, 315, 3830, 326, 6641, 434, 279, 290, 322, 358, 279, 1754, 603, 326, 721, 72, 6, 1172, 315, 49, 713, 261, 3830, 279, 290, 322, 603, 326, 721, 72, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2650, 67, 82, 322, 12, 3276, 4672, 315, 3830, 326, 6641, 434, 279, 290, 322, 358, 279, 1754, 603, 326, 721, 72, 6, 1172, 315, 49, 713, 261, 3830, 279, 290, 322, 603, 326, 721, 72, ...
child.setAttribute('string', gname)
child.setAttribute('string', gname.decode('utf8'))
def __view_look_dom(self, cursor, user, node, context=None): if context is None: context = {} result = False fields_attrs = {} childs = True if node.nodeType == node.ELEMENT_NODE and node.localName == 'field': if node.hasAttribute('name'): attrs = {} try: if node.getAttribute('name') in self._columns: relation = self._columns[node.getAttribute('name')]._obj else: relation = self._inherit_fields[node.getAttribute( 'name')][2]._obj except: relation = False if relation: childs = False views = {} for field in node.childNodes: if field.nodeType == field.ELEMENT_NODE \ and field.localName in ('form', 'tree'): node.removeChild(field) xarch, xfields = self.pool.get(relation ).__view_look_dom_arch(cursor, user, field, context) views[str(field.localName)] = { 'arch': xarch, 'fields': xfields } attrs = {'views': views} fields_attrs[node.getAttribute('name')] = attrs
24a0cba613830db6d90353a7d87b03b5ad22c814 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9266/24a0cba613830db6d90353a7d87b03b5ad22c814/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1945, 67, 7330, 67, 9859, 12, 2890, 16, 3347, 16, 729, 16, 756, 16, 819, 33, 7036, 4672, 309, 819, 353, 599, 30, 819, 273, 2618, 563, 273, 1083, 1466, 67, 7039, 273, 2618, 2161...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1945, 67, 7330, 67, 9859, 12, 2890, 16, 3347, 16, 729, 16, 756, 16, 819, 33, 7036, 4672, 309, 819, 353, 599, 30, 819, 273, 2618, 563, 273, 1083, 1466, 67, 7039, 273, 2618, 2161...
'Visit MoinMoin wiki'), ]
'Visit MoinMoin wiki'))
def formatButtons(self): """ Add 'buttons' to the error dialog """ f = self.formatter buttons = [f.link('javascript:toggleDebugInfo()', 'Show debugging information'), f.link('http://moinmoin.wikiwikiweb.de/MoinMoinBugs', 'Report bug'), f.link('http://moinmoin.wikiwikiweb.de/FrontPage', 'Visit MoinMoin wiki'), ] return f.list(buttons, {'class': 'buttons'})
813ec41fc5e8125876ed5343e1d9b5b5019c4354 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/888/813ec41fc5e8125876ed5343e1d9b5b5019c4354/failure.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 14388, 12, 2890, 4672, 3536, 1436, 296, 16016, 11, 358, 326, 555, 6176, 3536, 284, 273, 365, 18, 12354, 9502, 273, 306, 74, 18, 1232, 2668, 11242, 30, 14401, 2829, 966, 1435, 2187, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 14388, 12, 2890, 4672, 3536, 1436, 296, 16016, 11, 358, 326, 555, 6176, 3536, 284, 273, 365, 18, 12354, 9502, 273, 306, 74, 18, 1232, 2668, 11242, 30, 14401, 2829, 966, 1435, 2187, ...
self.update_rss(file_name)
def run(self): #print "Using libshout version %s" % shout.version() q = self.q __chunk = 0
d0eeb9c5b56edcb8efa2cdc1a6666cef96cf44eb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12047/d0eeb9c5b56edcb8efa2cdc1a6666cef96cf44eb/defuzz.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 468, 1188, 315, 7736, 2561, 674, 659, 1177, 738, 87, 6, 738, 699, 659, 18, 1589, 1435, 1043, 273, 365, 18, 85, 1001, 6551, 273, 374, 2, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 468, 1188, 315, 7736, 2561, 674, 659, 1177, 738, 87, 6, 738, 699, 659, 18, 1589, 1435, 1043, 273, 365, 18, 85, 1001, 6551, 273, 374, 2, -100, -100, -100, -100, ...
raise exceptions.LicornRuntimeException, "The group `%s' doesn't exist." % name
raise exceptions.LicornRuntimeException( "The group '%s' doesn't exist." % name)
def is_empty_group(name): try: return GroupsController.is_empty_gid(GroupsController.name_to_gid(name)) except KeyError: raise exceptions.LicornRuntimeException, "The group `%s' doesn't exist." % name
2c25685af98e96114695a04efeb86385220aeb9c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2c25685af98e96114695a04efeb86385220aeb9c/groups.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 5531, 67, 1655, 12, 529, 4672, 775, 30, 327, 14712, 2933, 18, 291, 67, 5531, 67, 15780, 12, 3621, 2933, 18, 529, 67, 869, 67, 15780, 12, 529, 3719, 1335, 4999, 30, 1002, 479...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 5531, 67, 1655, 12, 529, 4672, 775, 30, 327, 14712, 2933, 18, 291, 67, 5531, 67, 15780, 12, 3621, 2933, 18, 529, 67, 869, 67, 15780, 12, 529, 3719, 1335, 4999, 30, 1002, 479...
@type currentState: C{class 'TranssysProgramLattice'}
@type currentState: C{class 'TranssysInstanceLattice'}
def update_factor_concentrations(self, currentState, size, rndseed) : """ The update function of the simulator, calculates the instances of the next timestep.
5b9e395eee8bebef290e0e04304a3a7225b3acc7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1770/5b9e395eee8bebef290e0e04304a3a7225b3acc7/translattice.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 6812, 67, 11504, 8230, 1012, 12, 2890, 16, 17773, 16, 963, 16, 20391, 12407, 13, 294, 3536, 1021, 1089, 445, 434, 326, 3142, 11775, 16, 17264, 326, 3884, 434, 326, 1024, 27072,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1089, 67, 6812, 67, 11504, 8230, 1012, 12, 2890, 16, 17773, 16, 963, 16, 20391, 12407, 13, 294, 3536, 1021, 1089, 445, 434, 326, 3142, 11775, 16, 17264, 326, 3884, 434, 326, 1024, 27072,...
getSynth().voice=self.oldVoice getSynth().rate=self.oldRate getSynth().pitch=self.oldPitch getSynth().volume=self.oldVolume self.Destroy() def onOk(self,evt):
getSynth().voice=config.conf["speech"][getSynth().name]["voice"] getSynth().rate=config.conf["speech"][getSynth().name]["rate"] getSynth().pitch=config.conf["speech"][getSynth().name]["pitch"] getSynth().volume=config.conf["speech"][getSynth().name]["volume"] self.Destroy() def onOk(self,evt): config.conf["speech"][getSynth().name]["voice"]=self.voiceList.GetSelection()+1 config.conf["speech"][getSynth().name]["rate"]=self.rateSlider.GetValue() config.conf["speech"][getSynth().name]["pitch"]=self.pitchSlider.GetValue() config.conf["speech"][getSynth().name]["volume"]=self.volumeSlider.GetValue()
def onCancel(self,evt): getSynth().voice=self.oldVoice getSynth().rate=self.oldRate getSynth().pitch=self.oldPitch getSynth().volume=self.oldVolume self.Destroy()
b670d693246a684fec02acc72945aee58aa471d5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9340/b670d693246a684fec02acc72945aee58aa471d5/settingsDialogs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 6691, 12, 2890, 16, 73, 11734, 4672, 1322, 878, 451, 7675, 25993, 33, 2890, 18, 1673, 14572, 1322, 878, 451, 7675, 5141, 33, 2890, 18, 1673, 4727, 1322, 878, 451, 7675, 25910, 33, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 6691, 12, 2890, 16, 73, 11734, 4672, 1322, 878, 451, 7675, 25993, 33, 2890, 18, 1673, 14572, 1322, 878, 451, 7675, 5141, 33, 2890, 18, 1673, 4727, 1322, 878, 451, 7675, 25910, 33, ...
security.declareProtected(CMFCorePermissions.ModifyPortalContent,
security.declareProtected(permissions.ModifyPortalContent,
def wrapped(self, parent): schema = self.copy(factory=WrappedSchema) return schema.__of__(parent)
209dd0431121be615174f562fcf89fd6fae6c083 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/209dd0431121be615174f562fcf89fd6fae6c083/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5805, 12, 2890, 16, 982, 4672, 1963, 273, 365, 18, 3530, 12, 6848, 33, 17665, 3078, 13, 327, 1963, 16186, 792, 972, 12, 2938, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5805, 12, 2890, 16, 982, 4672, 1963, 273, 365, 18, 3530, 12, 6848, 33, 17665, 3078, 13, 327, 1963, 16186, 792, 972, 12, 2938, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -10...
featurename = self.user_commandName()
featurename = self.command.user_commandName()
def keyPress(self,key): # several modes extend this method, some might replace it if key == Qt.Key_Delete: self.w.killDo() elif key == Qt.Key_Escape: # Select None. mark 060129. self.o.assy.selectNone() # Zoom in (Ctrl/Cmd+.) & out (Ctrl/Cmd+,) for Eric. Right now, this will work with or without # the Ctrl/Cmd key pressed. We'll fix this later, at the same time we address the issue of # more than one modifier key being pressed (see Bruce's notes below). Mark 050923. elif key == Qt.Key_Period: self.o.scale *= .95 self.o.gl_update() elif key == Qt.Key_Comma: self.o.scale *= 1.05 self.o.gl_update() # comment out wiki help feature until further notice, wware 051101 # [bruce 051130 revived/revised it, elsewhere in file] #if key == Qt.Key_F1: # import webbrowser # # [will 051010 added wiki help feature] # webbrowser.open(self.__WikiHelpPrefix + self.__class__.__name__) #bruce 051201: let's see if I can bring this F1 binding back. # It works for Mac (only if you hold down "fn" key as well as F1); # but I don't know whether it's appropriate for Mac. # F1 for help (opening separate window, not usually an external website) # is conventional for Windows (I'm told). # See bug 1171 for more info about different platforms -- this should be revised to match. # Also the menu item should mention this accel key, but doesn't. elif key == Qt.Key_F1: featurename = self.user_commandName() if featurename: from wiki_help import open_wiki_help_dialog open_wiki_help_dialog( featurename) pass elif 0 and platform.atom_debug:#bruce 051201 -- might be wrong depending on how subclasses call this, so disabled for now print "atom_debug: fyi: glpane keyPress ignored:", key return
1a788da31e9d521b61aa4160e3562daa3fcecbec /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/1a788da31e9d521b61aa4160e3562daa3fcecbec/GraphicsMode.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 498, 11840, 12, 2890, 16, 856, 4672, 468, 11392, 12382, 2133, 333, 707, 16, 2690, 4825, 1453, 518, 309, 498, 422, 7354, 18, 653, 67, 2613, 30, 365, 18, 91, 18, 16418, 3244, 1435, 1327,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 498, 11840, 12, 2890, 16, 856, 4672, 468, 11392, 12382, 2133, 333, 707, 16, 2690, 4825, 1453, 518, 309, 498, 422, 7354, 18, 653, 67, 2613, 30, 365, 18, 91, 18, 16418, 3244, 1435, 1327,...
'-DCMAKE_PREFIX_PATH=%(INSTALL_DIR)s' % self.env, '-DBUILD_OSG_APPLICATIONS=OFF',
'-DCMAKE_PREFIX_PATH=%(INSTALL_DIR)s;%(NOINSTALL_DIR)s' % self.env, '-DBUILD_OSG_APPLICATIONS=ON',
def remove_danger(files, dirname, fnames): files.extend([P.join(dirname,f) for f in fnames if f == 'CMakeLists.txt'])
4c464b615593db891f1e118d7f4383934d268b96 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13144/4c464b615593db891f1e118d7f4383934d268b96/Packages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1206, 67, 21777, 12, 2354, 16, 4283, 16, 25294, 4672, 1390, 18, 14313, 3816, 52, 18, 5701, 12, 12287, 16, 74, 13, 364, 284, 316, 25294, 309, 284, 422, 296, 39, 6464, 7432, 18, 5830, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1206, 67, 21777, 12, 2354, 16, 4283, 16, 25294, 4672, 1390, 18, 14313, 3816, 52, 18, 5701, 12, 12287, 16, 74, 13, 364, 284, 316, 25294, 309, 284, 422, 296, 39, 6464, 7432, 18, 5830, ...
errStr = "ReplicaManager.replicateAndRegister: Failed to replicate LFN from any source."
errStr = "ReplicaManager.__replicate: Failed to replicate with all sources."
def __replicate(self,lfn,destSE,sourceSE='',destPath=''): """ Replicate a LFN to a destination SE.
e8a6375e5f8805958dacbec0f1a4c6f0cfc1b690 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12864/e8a6375e5f8805958dacbec0f1a4c6f0cfc1b690/ReplicaManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 266, 1780, 340, 12, 2890, 16, 80, 4293, 16, 10488, 1090, 16, 3168, 1090, 2218, 2187, 10488, 743, 2218, 11, 4672, 3536, 868, 1780, 340, 279, 18803, 50, 358, 279, 2929, 3174, 18, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 266, 1780, 340, 12, 2890, 16, 80, 4293, 16, 10488, 1090, 16, 3168, 1090, 2218, 2187, 10488, 743, 2218, 11, 4672, 3536, 868, 1780, 340, 279, 18803, 50, 358, 279, 2929, 3174, 18, 2...
parent=package.getName())
parent=included and package.getName() or None)
def _build(name, version, flavor, parent=None): ''' Helper: creates a BobPackage from a NVF and adds it to I{buildPackages} '''
cdb73b21ab2cd32441facbec22ce8ee78466191f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7644/cdb73b21ab2cd32441facbec22ce8ee78466191f/recurse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3510, 12, 529, 16, 1177, 16, 19496, 16, 982, 33, 7036, 4672, 9163, 9705, 30, 3414, 279, 605, 947, 2261, 628, 279, 423, 58, 42, 471, 4831, 518, 358, 467, 95, 3510, 11425, 97, 916...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3510, 12, 529, 16, 1177, 16, 19496, 16, 982, 33, 7036, 4672, 9163, 9705, 30, 3414, 279, 605, 947, 2261, 628, 279, 423, 58, 42, 471, 4831, 518, 358, 467, 95, 3510, 11425, 97, 916...
def test_isGlobalCmakeBuildFile_07(self): self.assertEqual( isGlobalCmakeBuildFile( 'cmake/TPLs/FindTPLLAPACK.cmake' ),
def test_isGlobalBuildFile_07(self): self.assertEqual( isGlobalBuildFile( 'cmake/TPLs/FindTPLLAPACK.cmake' ),
def test_isGlobalCmakeBuildFile_07(self): self.assertEqual( isGlobalCmakeBuildFile( 'cmake/TPLs/FindTPLLAPACK.cmake' ), True )
8de4f439d557111e62761b11543f08a8164bfb0c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1130/8de4f439d557111e62761b11543f08a8164bfb0c/CheckinTest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 291, 5160, 3116, 812, 67, 8642, 12, 2890, 4672, 365, 18, 11231, 5812, 12, 353, 5160, 3116, 812, 12, 296, 71, 6540, 19, 56, 6253, 87, 19, 3125, 11130, 4503, 2203, 3649, 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, 1842, 67, 291, 5160, 3116, 812, 67, 8642, 12, 2890, 4672, 365, 18, 11231, 5812, 12, 353, 5160, 3116, 812, 12, 296, 71, 6540, 19, 56, 6253, 87, 19, 3125, 11130, 4503, 2203, 3649, 18, ...
indexFileTargetPath = os.path.join(fullLogDirName, 'repository', indexFileName) shutil.copyfile(indexFileSourcePath, indexFileTargetPath)
if not is_subjob: indexFileTargetPath = os.path.join(fullLogDirName, 'repository', indexFileName) shutil.copyfile(indexFileSourcePath, indexFileTargetPath)
def renameDataFiles(directory):
58653fd62c6eb46b90adfad78e24ac7861f471f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/58653fd62c6eb46b90adfad78e24ac7861f471f4/feedback_report.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6472, 751, 2697, 12, 5149, 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, 6472, 751, 2697, 12, 5149, 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, -1...
utils.MSG("Done.")
def _auto_local(path_to_tx, resource, source_language, expression, execute=False, source_file=None, nosource=False, regex=False): """ Auto configure local project """ expr_re = '.*%s.*' % expression if not regex: # Force expr to be a valid regex expr (escaped) but keep <lang> intact expr_re = re.escape(expression) expr_re = re.sub(r"\\<lang\\>", '<lang>', expr_re) expr_re = re.sub(r"<lang>", '(?P<lang>[^/]+)', '.*%s$' % expr_re) expr_rec = re.compile(expr_re) # The path everything will be relative to curpath = os.curdir if not execute: utils.MSG("Only printing the commands which will be run if the " "--execute switch is specified.") # First, let's construct a dictionary of all matching files. # Note: Only the last matching file of a language will be stored. translation_files = {} for root, dirs, files in os.walk(curpath): for f in files: f_path = os.path.join(root, f) match = expr_rec.match(f_path) if match: lang = match.group('lang') f_path = os.path.abspath(f_path) if lang == source_language and not source_file: source_file = f_path else: translation_files[lang] = f_path # The set_source_file commands needs to be handled first. # If source file search is enabled, go ahead and find it: if not nosource: if not source_file: raise Exception("Could not find a source language file. Please run" " set --source manually and then re-run this command or provide" " the source file with the -s flag.") if execute: utils.MSG("Updating source for resource %s ( %s -> %s )." % (resource, source_language, relpath(source_file, path_to_tx))) _set_source_file(path_to_tx, resource, source_language, relpath(source_file, path_to_tx)) else: utils.MSG('\ntx set --source -r %(res)s -l %(lang)s %(file)s\n' % { 'res': resource, 'lang': source_language, 'file': relpath(source_file, curpath)}) prj = project.Project(path_to_tx) root_dir = os.path.abspath(path_to_tx) if execute: try: prj.config.get("%s" % resource, "source_file") except ConfigParser.NoSectionError: raise Exception("No resource with slug \"%s\" was found.\nRun 'tx set --auto" "-local -r %s \"expression\"' to do the initial configuration." % resource) # Now let's handle the translation files. if execute: utils.MSG("Updating file expression for resource %s ( %s )." % (resource, expression)) prj.config.set("%s" % resource, "file_filter", expression) else: for (lang, f_path) in sorted(translation_files.items()): utils.MSG('tx set -r %(res)s -l %(lang)s %(file)s' % { 'res': resource, 'lang': lang, 'file': relpath(f_path, curpath)}) prj.save() utils.MSG("Done.")
ee9d4812045d881b413863b36d195e3aec48c61d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11326/ee9d4812045d881b413863b36d195e3aec48c61d/commands.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6079, 67, 3729, 12, 803, 67, 869, 67, 978, 16, 1058, 16, 1084, 67, 4923, 16, 2652, 16, 1836, 33, 8381, 16, 1084, 67, 768, 33, 7036, 16, 26628, 552, 33, 8381, 16, 3936, 33, 838...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6079, 67, 3729, 12, 803, 67, 869, 67, 978, 16, 1058, 16, 1084, 67, 4923, 16, 2652, 16, 1836, 33, 8381, 16, 1084, 67, 768, 33, 7036, 16, 26628, 552, 33, 8381, 16, 3936, 33, 838...
ZeroCoincs = get_coincs_from_cache(cachefile, opts.trig_pattern, opts.exact_match, opts.verbose, coinc_stat) ZeroCoincs = new_coincs_from_coincs(ZeroCoincs, coinc_stat)
PlaygroundZeroCoincs = get_coincs_from_cache(cachefile, opts.playground_zerolag_pattern, opts.exact_match, opts.verbose, coinc_stat) PlaygroundZeroCoincs = new_coincs_from_coincs(PlaygroundZeroCoincs, coinc_stat) FullDataZeroCoincs = get_coincs_from_cache(cachefile, opts.full_data_zerolag_pattern, opts.exact_match, opts.verbose, coinc_stat) FullDataZeroCoincs = new_coincs_from_coincs(FullDataZeroCoincs, coinc_stat)
def split_seq(seq,p): newseq = [] n = len(seq) / p # min items per subsequence r = len(seq) % p # remaindered items b,e = 0l,n + min(1,r) # first split for i in range(p): newseq.append(seq[b:e]) r = max(0, r-1) b,e = e,e + n + min(1,r) # min(1,r) is always 1 or 0 return newseq
598039b1e0121275dc85428188da7ecf13e5d0bc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/598039b1e0121275dc85428188da7ecf13e5d0bc/pylal_ihope_to_randomforest_input.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1416, 67, 5436, 12, 5436, 16, 84, 4672, 394, 5436, 273, 5378, 290, 273, 562, 12, 5436, 13, 342, 293, 468, 1131, 1516, 1534, 720, 6178, 436, 273, 562, 12, 5436, 13, 738, 293, 468, 100...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1416, 67, 5436, 12, 5436, 16, 84, 4672, 394, 5436, 273, 5378, 290, 273, 562, 12, 5436, 13, 342, 293, 468, 1131, 1516, 1534, 720, 6178, 436, 273, 562, 12, 5436, 13, 738, 293, 468, 100...
self.body.append("\\end{%s%s}\n" % (d.env, d.ni and 'ni' or ''))
self.body.append("\\end{%s}\n" % d.env)
def depart_desc(self, node): d = self.descstack.pop() self.body.append("\\end{%s%s}\n" % (d.env, d.ni and 'ni' or ''))
8b8e71eaeb4f4d4dcbed7af67f4ee1fc7d5a5431 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7032/8b8e71eaeb4f4d4dcbed7af67f4ee1fc7d5a5431/latexwriter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26000, 67, 5569, 12, 2890, 16, 756, 4672, 302, 273, 365, 18, 5569, 3772, 18, 5120, 1435, 365, 18, 3432, 18, 6923, 2932, 1695, 409, 95, 9, 87, 9, 87, 6280, 82, 6, 738, 261, 72, 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, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26000, 67, 5569, 12, 2890, 16, 756, 4672, 302, 273, 365, 18, 5569, 3772, 18, 5120, 1435, 365, 18, 3432, 18, 6923, 2932, 1695, 409, 95, 9, 87, 9, 87, 6280, 82, 6, 738, 261, 72, 18, ...
if not befehl['befehl'].startswith('_') or befehl['befehl'].startswith('on_'): try: temp = getattr(self,'cmd_%s' % befehl['befehl']) temp(befehl) except AttributeError: self.notice(befehl['quelle']['nickname'],'Befehl nicht gefunden: %s' % befehl['befehl']) else:
try: temp = getattr(self,'cmd_%s' % befehl['befehl']) temp(befehl) self.loger.log('Befehl','Befehl von %s: %s' % (befehl['quelle']['nickname']," ".join([befehl['befehl']," ".join(befehl['argumente'])]))) except AttributeError:
def _teile_befehl(self,zeile): '''teilt Befehle in ein Dictionary auf: befehl['quelle']['host'],['ident'],['nick'] jeweils als string befehl['ziel'] string befehl['befehl'] string befehl['argumente'] liste
97fd12deea4b6666c5a17c647308be3fd93ec7f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2469/97fd12deea4b6666c5a17c647308be3fd93ec7f8/ircbot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 736, 398, 67, 2196, 3030, 25356, 12, 2890, 16, 8489, 398, 4672, 9163, 736, 4526, 4823, 3030, 76, 298, 316, 16315, 16447, 279, 696, 30, 506, 3030, 25356, 3292, 372, 292, 298, 21712, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 736, 398, 67, 2196, 3030, 25356, 12, 2890, 16, 8489, 398, 4672, 9163, 736, 4526, 4823, 3030, 76, 298, 316, 16315, 16447, 279, 696, 30, 506, 3030, 25356, 3292, 372, 292, 298, 21712, ...
def set_text(self, text):
def set_text(self, text, transaction_ids = []):
def set_text(self, text): ''' deletes all the old notes in a task and sets a single note with the given text ''' #delete old notes notes = self.rtm_taskseries.notes if notes: note_list = self.__getattr_the_rtm_way(notes, 'note') for note_id in [note.id for note in note_list]: self.rtm.tasksNotes.delete(timeline = self.timeline, note_id = note_id) if text == "": return self.rtm.tasksNotes.add(timeline = self.timeline, list_id = self.rtm_list.id, taskseries_id = self.rtm_taskseries.id, task_id = self.rtm_task.id, note_title = "", note_text = text)
abfb6098ab297631b5a39657955ffc083742508d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/abfb6098ab297631b5a39657955ffc083742508d/backend_rtm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 955, 12, 2890, 16, 977, 16, 2492, 67, 2232, 273, 5378, 4672, 9163, 9792, 777, 326, 1592, 10913, 316, 279, 1562, 471, 1678, 279, 2202, 4721, 598, 326, 864, 977, 9163, 468, 3733...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 955, 12, 2890, 16, 977, 16, 2492, 67, 2232, 273, 5378, 4672, 9163, 9792, 777, 326, 1592, 10913, 316, 279, 1562, 471, 1678, 279, 2202, 4721, 598, 326, 864, 977, 9163, 468, 3733...
""", sys.stderr.getvalue())
""", sys.stderr.getvalue().lower())
def test_usage(self): try: self.cli.run(sys.argv) self.fail('Expected SystemExit') except SystemExit, e: self.assertEqual(2, e.code) self.assertEqual("""\
b47eeca5a07028d9d7ad93d279199eb78e649466 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8909/b47eeca5a07028d9d7ad93d279199eb78e649466/frontend.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 9167, 12, 2890, 4672, 775, 30, 365, 18, 4857, 18, 2681, 12, 9499, 18, 19485, 13, 365, 18, 6870, 2668, 6861, 25454, 6134, 1335, 25454, 16, 425, 30, 365, 18, 11231, 5812, 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, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 9167, 12, 2890, 4672, 775, 30, 365, 18, 4857, 18, 2681, 12, 9499, 18, 19485, 13, 365, 18, 6870, 2668, 6861, 25454, 6134, 1335, 25454, 16, 425, 30, 365, 18, 11231, 5812, 12, ...
if f.__call__.im_func.func_code.co_flags & STAR_ARGS:
if call_im_func_code.co_flags & STAR_ARGS:
def _normalizeParseActionArgs( f ): """Internal method used to decorate parse actions that take fewer than 3 arguments, so that all parse actions can be called as f(s,l,t).""" STAR_ARGS = 4
c6e5c5fcf7fe09d7390a6d3525397e48c03606ea /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3693/c6e5c5fcf7fe09d7390a6d3525397e48c03606ea/pyparsing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 12237, 3201, 1803, 2615, 12, 284, 262, 30, 3536, 3061, 707, 1399, 358, 15752, 1109, 4209, 716, 4862, 27886, 2353, 890, 1775, 16, 1427, 716, 777, 1109, 4209, 848, 506, 2566, 487, 284...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 389, 12237, 3201, 1803, 2615, 12, 284, 262, 30, 3536, 3061, 707, 1399, 358, 15752, 1109, 4209, 716, 4862, 27886, 2353, 890, 1775, 16, 1427, 716, 777, 1109, 4209, 848, 506, 2566, 487, 284...
font.render(_("Filter: %s") % (self.searchText), (.05, .7 + v), scale = 0.001)
text = _("Filter: %s") % (self.searchText) + "|" if not self.matchesSearch(self.items[self.selectedIndex]): text += " (%s)" % _("Not found") font.render(text, (.05, .7 + v), scale = 0.001)
def render(self, visibility, topMost): v = (1 - visibility) ** 2
08696d76f393f64cd71f9b1aa0f5463776eb6a71 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7946/08696d76f393f64cd71f9b1aa0f5463776eb6a71/Dialogs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 9478, 16, 1760, 18714, 4672, 331, 273, 261, 21, 300, 9478, 13, 2826, 576, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 9478, 16, 1760, 18714, 4672, 331, 273, 261, 21, 300, 9478, 13, 2826, 576, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
while textLength>1 and globalVars.keyCounter==lastKeyCount and (isPaused or getLastSpeechIndex()!=index):
while textLength>1 and (isPaused or getLastSpeechIndex()!=index):
def _speakSpellingGen(text): lastKeyCount=globalVars.keyCounter textLength=len(text) synth=getSynth() synthConfig=config.conf["speech"][synth.name] for count,char in enumerate(text): uppercase=char.isupper() char=processSymbol(char) if uppercase and synthConfig["sayCapForCapitals"]: char=_("cap %s")%char if uppercase and synth.isSupported("pitch") and synthConfig["raisePitchForCapitals"]: oldPitch=synthConfig["pitch"] synth.pitch=max(0,min(oldPitch+synthConfig["capPitchChange"],100)) index=count+1 log.io("Speaking character %r"%char) if len(char) == 1 and synthConfig["useSpellingFunctionality"]: synth.speakCharacter(char,index=index) else: synth.speakText(char,index=index) if uppercase and synth.isSupported("pitch") and synthConfig["raisePitchForCapitals"]: synth.pitch=oldPitch while textLength>1 and globalVars.keyCounter==lastKeyCount and (isPaused or getLastSpeechIndex()!=index): yield yield if globalVars.keyCounter!=lastKeyCount: break if uppercase and synthConfig["beepForCapitals"]: tones.beep(2000,50)
cf8afe98c4ab333e0fd150793a9c2012d082d2d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9340/cf8afe98c4ab333e0fd150793a9c2012d082d2d2/speech.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 87, 10244, 3389, 1165, 310, 7642, 12, 955, 4672, 29928, 1380, 33, 6347, 5555, 18, 856, 4789, 977, 1782, 33, 1897, 12, 955, 13, 6194, 451, 33, 588, 10503, 451, 1435, 6194, 451, 809...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 87, 10244, 3389, 1165, 310, 7642, 12, 955, 4672, 29928, 1380, 33, 6347, 5555, 18, 856, 4789, 977, 1782, 33, 1897, 12, 955, 13, 6194, 451, 33, 588, 10503, 451, 1435, 6194, 451, 809...
Computes the matching polynomial of the graph G. The algorithm used is a recursive one, based on the following observation: - If e is an edge of G, G' is the result of deleting the edge e, and G'' is the result of deleting each vertex in e, then the matching polynomial of G is equal to that of G' minus that of G''.
Computes the matching polynomial of the graph `G`. If `p(G, k)` denotes the number of `k`-matchings (matchings with `k` edges) in `G`, then the matching polynomial is defined as [Godsil93]_: .. MATH:: \mu(x)=\sum_{k \geq 0} (-1)^k p(G,k) x^{n-2k}
def matching_polynomial(self, complement=True, name=None): """ Computes the matching polynomial of the graph G. The algorithm used is a recursive one, based on the following observation: - If e is an edge of G, G' is the result of deleting the edge e, and G'' is the result of deleting each vertex in e, then the matching polynomial of G is equal to that of G' minus that of G''.
e9ba01b4d7a756fe88149efe3168fa2df92b9a5c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e9ba01b4d7a756fe88149efe3168fa2df92b9a5c/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3607, 67, 3915, 13602, 12, 2890, 16, 17161, 33, 5510, 16, 508, 33, 7036, 4672, 3536, 14169, 281, 326, 3607, 16991, 434, 326, 2667, 611, 18, 225, 1021, 4886, 1399, 353, 279, 5904, 1245, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3607, 67, 3915, 13602, 12, 2890, 16, 17161, 33, 5510, 16, 508, 33, 7036, 4672, 3536, 14169, 281, 326, 3607, 16991, 434, 326, 2667, 611, 18, 225, 1021, 4886, 1399, 353, 279, 5904, 1245, ...
return r._fix(context=context)
return r._fix(context)
def remainder_near(self, other, context=None): """ Remainder nearest to 0- abs(remainder-near) <= other/2 """ other = _convert_other(other)
05069e441412309fa5da59f2e1f6132b4e2386f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05069e441412309fa5da59f2e1f6132b4e2386f6/decimal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10022, 67, 27862, 12, 2890, 16, 1308, 16, 819, 33, 7036, 4672, 3536, 2663, 25407, 11431, 358, 374, 17, 225, 2417, 12, 2764, 25407, 17, 27862, 13, 1648, 1308, 19, 22, 3536, 1308, 273, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10022, 67, 27862, 12, 2890, 16, 1308, 16, 819, 33, 7036, 4672, 3536, 2663, 25407, 11431, 358, 374, 17, 225, 2417, 12, 2764, 25407, 17, 27862, 13, 1648, 1308, 19, 22, 3536, 1308, 273, 3...
raise RuntimeError("cannot notify on un-aquired lock")
raise RuntimeError("cannot notify on un-acquired lock")
def notify(self, n=1): if not self._is_owned(): raise RuntimeError("cannot notify on un-aquired lock") __waiters = self.__waiters waiters = __waiters[:n] if not waiters: if __debug__: self._note("%s.notify(): no waiters", self) return self._note("%s.notify(): notifying %d waiter%s", self, n, n!=1 and "s" or "") for waiter in waiters: waiter.release() try: __waiters.remove(waiter) except ValueError: pass
398dc71406a84c8396d9420ae47bd5b0960c2915 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/398dc71406a84c8396d9420ae47bd5b0960c2915/threading.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5066, 12, 2890, 16, 290, 33, 21, 4672, 309, 486, 365, 6315, 291, 67, 995, 329, 13332, 1002, 7265, 2932, 12892, 5066, 603, 640, 17, 1077, 1402, 2176, 7923, 1001, 7048, 414, 273, 365, 16...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5066, 12, 2890, 16, 290, 33, 21, 4672, 309, 486, 365, 6315, 291, 67, 995, 329, 13332, 1002, 7265, 2932, 12892, 5066, 603, 640, 17, 1077, 1402, 2176, 7923, 1001, 7048, 414, 273, 365, 16...
gv_a = self._arg_imm_op(gv_y, self.rgenop.genconst(32), _PPC.subfic)
gv_a = self._arg_simm_op(gv_y, self.rgenop.genconst(32), _PPC.subfic)
def op_int_lshift(self, gv_x, gv_y): if gv_y.fits_in_immediate(): if abs(gv_y.value) >= 32: return self.rgenop.genconst(0) else: return self._arg_imm_op(gv_x, gv_y, _PPC.slwi) # computing x << y when you don't know y is <=32 # (we can assume y >= 0 though) # here's the plan: # # z = nltu(y, 32) (as per cwg) # w = x << y # r = w&z gv_a = self._arg_imm_op(gv_y, self.rgenop.genconst(32), _PPC.subfic) gv_b = self._arg_op(gv_y, _PPC.addze) gv_z = self._arg_arg_op(gv_b, gv_y, _PPC.subf) gv_w = self._arg_arg_op(gv_x, gv_y, _PPC.slw) return self._arg_arg_op(gv_z, gv_w, _PPC.and_)
1a13bb2e4052fbbe77efb6b6dbf2fa6c38d03672 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/1a13bb2e4052fbbe77efb6b6dbf2fa6c38d03672/rgenop.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1061, 67, 474, 67, 80, 4012, 12, 2890, 16, 11404, 67, 92, 16, 11404, 67, 93, 4672, 309, 11404, 67, 93, 18, 18352, 67, 267, 67, 381, 6785, 13332, 309, 2417, 12, 75, 90, 67, 93, 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, 1061, 67, 474, 67, 80, 4012, 12, 2890, 16, 11404, 67, 92, 16, 11404, 67, 93, 4672, 309, 11404, 67, 93, 18, 18352, 67, 267, 67, 381, 6785, 13332, 309, 2417, 12, 75, 90, 67, 93, 18, ...
while classstack and \ classstack[-1][1] >= thisindent: del classstack[-1] if classstack: cur_class = classstack[-1][0] cur_class._addmethod(meth_name, lineno)
if stack: cur_class = stack[-1][0] if isinstance(cur_class, Class): cur_class._addmethod(meth_name, lineno)
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in which we are searching for a submodule, and then PATH must be the package search path; otherwise, we are searching for a top-level module, and PATH is combined with sys.path. ''' # Compute the full module name (prepending inpackage if set) if inpackage: fullmodule = "%s.%s" % (inpackage, module) else: fullmodule = module # Check in the cache if fullmodule in _modules: return _modules[fullmodule] # Initialize the dict for this module's contents dict = {} # Check if it is a built-in module; we don't do much for these if module in sys.builtin_module_names and not inpackage: _modules[module] = dict return dict # Check for a dotted module name i = module.rfind('.') if i >= 0: package = module[:i] submodule = module[i+1:] parent = readmodule_ex(package, path, inpackage) if inpackage: package = "%s.%s" % (inpackage, package) return readmodule_ex(submodule, parent['__path__'], package) # Search the path for the module f = None if inpackage: f, file, (suff, mode, type) = imp.find_module(module, path) else: f, file, (suff, mode, type) = imp.find_module(module, path + sys.path) if type == imp.PKG_DIRECTORY: dict['__path__'] = [file] path = [file] + path f, file, (suff, mode, type) = imp.find_module('__init__', [file]) _modules[fullmodule] = dict if type != imp.PY_SOURCE: # not Python source, can't do anything with this module f.close() return dict classstack = [] # stack of (class, indent) pairs g = tokenize.generate_tokens(f.readline) try: for tokentype, token, start, end, line in g: if token == 'def': lineno, thisindent = start tokentype, meth_name, start, end, line = g.next() if tokentype != NAME: continue # Syntax error # close all classes indented at least as much while classstack and \ classstack[-1][1] >= thisindent: del classstack[-1] if classstack: # it's a class method cur_class = classstack[-1][0] cur_class._addmethod(meth_name, lineno) else: # it's a function dict[meth_name] = Function(module, meth_name, file, lineno) elif token == 'class': lineno, thisindent = start tokentype, class_name, start, end, line = g.next() if tokentype != NAME: continue # Syntax error # close all classes indented at least as much while classstack and \ classstack[-1][1] >= thisindent: del classstack[-1] # parse what follows the class name tokentype, token, start, end, line = g.next() inherit = None if token == '(': names = [] # List of superclasses # there's a list of superclasses level = 1 super = [] # Tokens making up current superclass while True: tokentype, token, start, end, line = g.next() if token in (')', ',') and level == 1: n = "".join(super) if n in dict: # we know this super class n = dict[n] else: c = n.split('.') if len(c) > 1: # super class is of the form # module.class: look in module for # class m = c[-2] c = c[-1] if m in _modules: d = _modules[m] if c in d: n = d[c] names.append(n) if token == '(': level += 1 elif token == ')': level -= 1 if level == 0: break elif token == ',' and level == 1: pass else: super.append(token) inherit = names cur_class = Class(module, class_name, inherit, file, lineno) dict[class_name] = cur_class classstack.append((cur_class, thisindent)) elif token == 'import' and start[1] == 0: modules = _getnamelist(g) for mod, mod2 in modules: try: # Recursively read the imported module if not inpackage: readmodule_ex(mod, path) else: try: readmodule_ex(mod, path, inpackage) except ImportError: readmodule_ex(mod) except: # If we can't find or parse the imported module, # too bad -- don't die here. pass elif token == 'from' and start[1] == 0: mod, token = _getname(g) if not mod or token != "import": continue names = _getnamelist(g) try: # Recursively read the imported module d = readmodule_ex(mod, path, inpackage) except: # If we can't find or parse the imported module, # too bad -- don't die here. continue # add any classes that were defined in the imported module # to our name space if they were mentioned in the list for n, n2 in names: if n in d: dict[n2 or n] = d[n] elif n == '*': # only add a name if not already there (to mimic # what Python does internally) also don't add # names that start with _ for n in d: if n[0] != '_' and not n in dict: dict[n] = d[n] except StopIteration: pass f.close() return dict
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 2978, 67, 338, 12, 2978, 16, 589, 22850, 6487, 316, 5610, 33, 7036, 4672, 9163, 1994, 279, 1605, 585, 471, 327, 279, 3880, 434, 3318, 18, 225, 5167, 364, 14057, 316, 7767, 471, 25...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2978, 67, 338, 12, 2978, 16, 589, 22850, 6487, 316, 5610, 33, 7036, 4672, 9163, 1994, 279, 1605, 585, 471, 327, 279, 3880, 434, 3318, 18, 225, 5167, 364, 14057, 316, 7767, 471, 25...
tests.remove("test_file") tests.insert(tests.index("test_optparse"), "test_file")
def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False, exclude=False, single=False, randomize=False, fromfile=None, findleaks=False, use_resources=None, trace=False, coverdir='coverage', runleaks=False, huntrleaks=False, verbose2=False): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other default arguments (verbose, quiet, generate, exclude, single, randomize, findleaks, use_resources, trace and coverdir) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ test_support.record_original_stdout(sys.stdout) try: opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrf:lu:t:TD:NLR:wM:', ['help', 'verbose', 'quiet', 'generate', 'exclude', 'single', 'random', 'fromfile', 'findleaks', 'use=', 'threshold=', 'trace', 'coverdir=', 'nocoverdir', 'runleaks', 'huntrleaks=', 'verbose2', 'memlimit=', ]) except getopt.error, msg: usage(2, msg) # Defaults if use_resources is None: use_resources = [] for o, a in opts: if o in ('-h', '--help'): usage(0) elif o in ('-v', '--verbose'): verbose += 1 elif o in ('-w', '--verbose2'): verbose2 = True elif o in ('-q', '--quiet'): quiet = True; verbose = 0 elif o in ('-g', '--generate'): generate = True elif o in ('-x', '--exclude'): exclude = True elif o in ('-s', '--single'): single = True elif o in ('-r', '--randomize'): randomize = True elif o in ('-f', '--fromfile'): fromfile = a elif o in ('-l', '--findleaks'): findleaks = True elif o in ('-L', '--runleaks'): runleaks = True elif o in ('-t', '--threshold'): import gc gc.set_threshold(int(a)) elif o in ('-T', '--coverage'): trace = True elif o in ('-D', '--coverdir'): coverdir = os.path.join(os.getcwd(), a) elif o in ('-N', '--nocoverdir'): coverdir = None elif o in ('-R', '--huntrleaks'): huntrleaks = a.split(':') if len(huntrleaks) != 3: print a, huntrleaks usage(2, '-R takes three colon-separated arguments') if len(huntrleaks[0]) == 0: huntrleaks[0] = 5 else: huntrleaks[0] = int(huntrleaks[0]) if len(huntrleaks[1]) == 0: huntrleaks[1] = 4 else: huntrleaks[1] = int(huntrleaks[1]) if len(huntrleaks[2]) == 0: huntrleaks[2] = "reflog.txt" elif o in ('-M', '--memlimit'): test_support.set_memlimit(a) elif o in ('-u', '--use'): u = [x.lower() for x in a.split(',')] for r in u: if r == 'all': use_resources[:] = RESOURCE_NAMES continue remove = False if r[0] == '-': remove = True r = r[1:] if r not in RESOURCE_NAMES: usage(1, 'Invalid -u/--use option: ' + a) if remove: if r in use_resources: use_resources.remove(r) elif r not in use_resources: use_resources.append(r) if generate and verbose: usage(2, "-g and -v don't go together!") if single and fromfile: usage(2, "-s and -f don't go together!") good = [] bad = [] skipped = [] resource_denieds = [] if findleaks: try: import gc except ImportError: print 'No GC available, disabling findleaks.' findleaks = False else: # Uncomment the line below to report garbage that is not # freeable by reference counting alone. By default only # garbage that is not collectable by the GC is reported. #gc.set_debug(gc.DEBUG_SAVEALL) found_garbage = [] if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = fp.read().strip() tests = [next] fp.close() except IOError: pass if fromfile: tests = [] fp = open(fromfile) for line in fp: guts = line.split() # assuming no test has whitespace in its name if guts and not guts[0].startswith('#'): tests.extend(guts) fp.close() # Strip .py extensions. if args: args = map(removepy, args) if tests: tests = map(removepy, tests) stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) # XXX Temporary hack to force test_optparse to run immediately # XXX after test_file. This should go away as soon as we fix # XXX whatever it is that's causing that to fail. tests.remove("test_file") tests.insert(tests.index("test_optparse"), "test_file") if trace: import trace tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix], trace=False, count=True) test_support.verbose = verbose # Tell tests to be moderately quiet test_support.use_resources = use_resources save_modules = sys.modules.keys() for test in tests: if not quiet: print test sys.stdout.flush() if trace: # If we're tracing code coverage, then we don't exit with status # if on a false return value from main. tracer.runctx('runtest(test, generate, verbose, quiet, testdir)', globals=globals(), locals=vars()) else: try: ok = runtest(test, generate, verbose, quiet, testdir, huntrleaks) except KeyboardInterrupt: # print a newline separate from the ^C print break except: raise if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: skipped.append(test) if ok == -2: resource_denieds.append(test) if findleaks: gc.collect() if gc.garbage: print "Warning: test created", len(gc.garbage), print "uncollectable object(s)." # move the uncollectable objects somewhere so we don't see # them again found_garbage.extend(gc.garbage) del gc.garbage[:] # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) # The lists won't be sorted if running with -r good.sort() bad.sort() skipped.sort() if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if verbose: print "CAUTION: stdout isn't compared in verbose mode:" print "a test that passes in verbose mode may fail without it." if bad: print count(len(bad), "test"), "failed:" printlist(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:" printlist(skipped) e = _ExpectedSkips() plat = sys.platform if e.isvalid(): surprise = set(skipped) - e.getexpected() - set(resource_denieds) if surprise: print count(len(surprise), "skip"), \ "unexpected on", plat + ":" printlist(surprise) else: print "Those skips are all expected on", plat + "." else: print "Ask someone to teach regrtest.py about which tests are" print "expected to get skipped on", plat + "." if verbose2 and bad: print "Re-running failed tests in verbose mode" for test in bad: print "Re-running test %r in verbose mode" % test sys.stdout.flush() try: test_support.verbose = 1 ok = runtest(test, generate, 1, quiet, testdir, huntrleaks) except KeyboardInterrupt: # print a newline separate from the ^C print break except: raise if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) if trace: r = tracer.results() r.write_results(show_missing=True, summary=True, coverdir=coverdir) if runleaks: os.system("leaks %d" % os.getpid()) sys.exit(len(bad) > 0)
d62c41a1fecd8da8545a4fd363bf503c05c7afd9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/d62c41a1fecd8da8545a4fd363bf503c05c7afd9/regrtest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 16341, 33, 7036, 16, 1842, 1214, 33, 7036, 16, 3988, 33, 20, 16, 10902, 33, 8381, 16, 2103, 33, 8381, 16, 4433, 33, 8381, 16, 2202, 33, 8381, 16, 2744, 554, 33, 8381, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 16341, 33, 7036, 16, 1842, 1214, 33, 7036, 16, 3988, 33, 20, 16, 10902, 33, 8381, 16, 2103, 33, 8381, 16, 4433, 33, 8381, 16, 2202, 33, 8381, 16, 2744, 554, 33, 8381, 16, ...
for i in range(plot_points+1):
for i in range(plot_points):
def _call(self, funcs, xrange, parametric=False, polar=False, label='', **kwds): options = dict(self.options) for k, v in kwds.iteritems(): options[k] = v
4f8700b720c6850102dc81de39c839c764c792c4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/4f8700b720c6850102dc81de39c839c764c792c4/plot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1991, 12, 2890, 16, 15630, 16, 12314, 16, 579, 1591, 33, 8381, 16, 24244, 33, 8381, 16, 1433, 2218, 2187, 2826, 25577, 4672, 702, 273, 2065, 12, 2890, 18, 2116, 13, 364, 417, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1991, 12, 2890, 16, 15630, 16, 12314, 16, 579, 1591, 33, 8381, 16, 24244, 33, 8381, 16, 1433, 2218, 2187, 2826, 25577, 4672, 702, 273, 2065, 12, 2890, 18, 2116, 13, 364, 417, 16, ...
inode=inode,
inode_id=inode,
def display(self, offset, row, result): result = result.__class__(result) inode = row['Inode']
54f1c103a5275efcc080ed122695f32ad9406e9a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5568/54f1c103a5275efcc080ed122695f32ad9406e9a/LogicalIndex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2562, 12, 2890, 16, 1384, 16, 1027, 16, 563, 4672, 563, 273, 563, 16186, 1106, 972, 12, 2088, 13, 17870, 273, 1027, 3292, 29897, 3546, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2562, 12, 2890, 16, 1384, 16, 1027, 16, 563, 4672, 563, 273, 563, 16186, 1106, 972, 12, 2088, 13, 17870, 273, 1027, 3292, 29897, 3546, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.add_worker_thread()
self.add_worker_thread(message='Initial worker pool')
def __init__( self, nworkers, name="ThreadPool", daemon=False, max_requests=100, # threads are killed after this many requests hung_thread_limit=30, # when a thread is marked "hung" kill_thread_limit=1800, # when you kill that hung thread dying_limit=300, # seconds that a kill should take to go into effect (longer than this and the thread is a "zombie") spawn_if_under=5, # spawn if there's too many hung threads max_zombie_threads_before_die=0, # when to give up on the process hung_check_period=100, # every 100 requests check for hung workers logger=None, # Place to log messages to error_email=None, # Person(s) to notify if serious problem occurs ): """ Create thread pool with `nworkers` worker threads. """ self.nworkers = nworkers self.max_requests = max_requests self.name = name self.queue = Queue.Queue() self.workers = [] self.daemon = daemon if logger is None: logger = logging.getLogger('paste.httpserver.ThreadPool') if isinstance(logger, basestring): logger = logging.getLogger(logger) self.logger = logger self.error_email = error_email self._worker_count = count()
44a43ea127a5a162dd897d2c8fda21b52777fa59 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2097/44a43ea127a5a162dd897d2c8fda21b52777fa59/httpserver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 365, 16, 290, 15625, 16, 508, 1546, 20621, 3113, 8131, 33, 8381, 16, 943, 67, 11420, 33, 6625, 16, 468, 7403, 854, 24859, 1839, 333, 4906, 3285, 366, 20651, 67, 59...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 365, 16, 290, 15625, 16, 508, 1546, 20621, 3113, 8131, 33, 8381, 16, 943, 67, 11420, 33, 6625, 16, 468, 7403, 854, 24859, 1839, 333, 4906, 3285, 366, 20651, 67, 59...
if request.method != 'POST': return wsgi.Response( status_code=405, status_text='Method Not Allowed', )
def dispatch(self, request): if request.method != 'POST': return wsgi.Response( status_code=405, status_text='Method Not Allowed', ) try: command = request.post_data['command'] except KeyError: return self.error_response('no command given') try: method = getattr(self, 'do_%s' % command) except AttributeError: return self.error_response('invalid command %r' % command) try: return method(request.post_data) except Exception, exc: return self.error_response('error executing command %r: %s' % ( command, exc, ))
82af55735b38535639630716028bd93fdd1ca0ef /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12391/82af55735b38535639630716028bd93fdd1ca0ef/serve.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3435, 12, 2890, 16, 590, 4672, 775, 30, 1296, 273, 590, 18, 2767, 67, 892, 3292, 3076, 3546, 1335, 4999, 30, 327, 365, 18, 1636, 67, 2740, 2668, 2135, 1296, 864, 6134, 775, 30, 707, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3435, 12, 2890, 16, 590, 4672, 775, 30, 1296, 273, 590, 18, 2767, 67, 892, 3292, 3076, 3546, 1335, 4999, 30, 327, 365, 18, 1636, 67, 2740, 2668, 2135, 1296, 864, 6134, 775, 30, 707, ...
button.connect("clicked",portions_popup,0)
button.connect("clicked", portions_popup,0)
def validedChanges(*args): """Check for a least one selected kana portion (display of a message if not the case), catch parameters, then close the window.
64cfb9e0b60a3a976c72fa9d5d722987641133b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3073/64cfb9e0b60a3a976c72fa9d5d722987641133b9/gtk_gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1244, 13898, 7173, 30857, 1968, 4672, 3536, 1564, 364, 279, 4520, 1245, 3170, 417, 13848, 14769, 261, 5417, 434, 279, 883, 309, 486, 326, 648, 3631, 1044, 1472, 16, 1508, 1746, 326, 2742, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1244, 13898, 7173, 30857, 1968, 4672, 3536, 1564, 364, 279, 4520, 1245, 3170, 417, 13848, 14769, 261, 5417, 434, 279, 883, 309, 486, 326, 648, 3631, 1044, 1472, 16, 1508, 1746, 326, 2742, ...
factoid = query.order_by(FactoidValue.id)[int(number)]
if literal: return query.order_by(FactoidValue.id)[int(number):] else: factoid = query.order_by(FactoidValue.id)[int(number)]
def get_factoid(session, name, number, pattern, is_regex, all=False): factoid = None # Reversed LIKE because factoid name contains SQL wildcards if factoid supports arguments query = session.query(Factoid)\ .add_entity(FactoidName).join(Factoid.names)\ .add_entity(FactoidValue).join(Factoid.values)\ .filter(":fact LIKE name ESCAPE :escape").params(fact=name, escape='\\') if pattern: if is_regex: query = query.filter(FactoidValue.value.op('REGEXP')(pattern)) else: pattern = "%%%s%%" % escape_like_re.sub(r'\\\1', pattern) query = query.filter(FactoidValue.value.like(pattern, escape='\\')) if number: try: factoid = query.order_by(FactoidValue.id)[int(number)] except IndexError: return if all: return factoid and [factoid] or query.all() else: return factoid or query.order_by(func.random()).first()
f225bef6763e5cd591e5cd93f62d6ea13a804264 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12048/f225bef6763e5cd591e5cd93f62d6ea13a804264/factoid.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 3493, 839, 12, 3184, 16, 508, 16, 1300, 16, 1936, 16, 353, 67, 7584, 16, 777, 33, 8381, 4672, 5410, 839, 273, 599, 468, 868, 7548, 13161, 2724, 5410, 839, 508, 1914, 3063, 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, 336, 67, 3493, 839, 12, 3184, 16, 508, 16, 1300, 16, 1936, 16, 353, 67, 7584, 16, 777, 33, 8381, 4672, 5410, 839, 273, 599, 468, 868, 7548, 13161, 2724, 5410, 839, 508, 1914, 3063, 2...
mainname = os.path.basename(self.mainprogram) self.files.append((self.mainprogram, pathjoin(resdir, mainname))) mainprogram = self.mainprogram
mainprogram = os.path.basename(self.mainprogram) self.files.append((self.mainprogram, pathjoin(resdir, mainprogram)))
def preProcess(self): resdir = "Contents/Resources" if self.executable is not None: if self.mainprogram is None: execname = self.name else: execname = os.path.basename(self.executable) execpath = pathjoin(self.execdir, execname) if not self.symlink_exec: self.files.append((self.executable, execpath)) self.binaries.append(execpath) self.execpath = execpath
24884f76c6b59aa9cd716174907a02d5d172c2fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/24884f76c6b59aa9cd716174907a02d5d172c2fc/bundlebuilder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 675, 2227, 12, 2890, 4672, 400, 1214, 273, 315, 6323, 19, 3805, 6, 309, 365, 18, 17751, 353, 486, 599, 30, 309, 365, 18, 5254, 12890, 353, 599, 30, 1196, 529, 273, 365, 18, 529, 469,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 675, 2227, 12, 2890, 4672, 400, 1214, 273, 315, 6323, 19, 3805, 6, 309, 365, 18, 17751, 353, 486, 599, 30, 309, 365, 18, 5254, 12890, 353, 599, 30, 1196, 529, 273, 365, 18, 529, 469,...
urilast = r"""[_~/\]a-zA-Z0-9]"""
urilast = r"""[_~/\]a-zA-Z0-9]"""
def parse(self, text, lineno, memo, parent): """ Return 2 lists: nodes (text and inline elements), and system_messages.
9fe47ec4311156cad473d8ed8bf0dba5fd73c14e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1532/9fe47ec4311156cad473d8ed8bf0dba5fd73c14e/states.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 2890, 16, 977, 16, 7586, 16, 11063, 16, 982, 4672, 3536, 2000, 576, 6035, 30, 2199, 261, 955, 471, 6370, 2186, 3631, 471, 2619, 67, 6833, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 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, 12, 2890, 16, 977, 16, 7586, 16, 11063, 16, 982, 4672, 3536, 2000, 576, 6035, 30, 2199, 261, 955, 471, 6370, 2186, 3631, 471, 2619, 67, 6833, 18, 2, -100, -100, -100, -100, -100,...
ATTopicSchema = BaseFolder.schema + ATContentTypeSchema + Schema((
ATTopicSchema = ATContentTypeSchema.copy() + Schema((
def __init__(self, prefix='', archive=False): pass
1c35873a52671de78b994d6a90bb8f8d8622b6cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/1c35873a52671de78b994d6a90bb8f8d8622b6cc/schemata.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1633, 2218, 2187, 5052, 33, 8381, 4672, 1342, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1633, 2218, 2187, 5052, 33, 8381, 4672, 1342, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.client.sendRaw(dummydata)
self.sendRaw(dummydata)
def run(self): # some default values self.uniqueid = "1337" self.password = "" self.username = "GameBot_"+str(self.cid) self.buffersize = 4 # 'data' - String self.truckname = "spectator" # dummy data to prevent timeouts dummydata = self.packPacket(DataPacket(MSG2_VEHICLE_DATA, 0, 1, "data"))
a5e2c1f50b778d1a51f298e285dac89609ce7677 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5557/a5e2c1f50b778d1a51f298e285dac89609ce7677/client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 468, 2690, 805, 924, 365, 18, 6270, 350, 273, 315, 3437, 6418, 6, 365, 18, 3664, 273, 1408, 365, 18, 5053, 273, 315, 12496, 6522, 9548, 15, 701, 12, 2890, 18, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 468, 2690, 805, 924, 365, 18, 6270, 350, 273, 315, 3437, 6418, 6, 365, 18, 3664, 273, 1408, 365, 18, 5053, 273, 315, 12496, 6522, 9548, 15, 701, 12, 2890, 18, 1...
UnicodeTestCase
UnicodeTestCase, XRangeTestCase,
def test_main(): test_support.run_unittest( ListTestCase, TupleTestCase, StringTestCase, UnicodeTestCase )
329ca39a0f56973b99574851bfa27be2f3881d3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/329ca39a0f56973b99574851bfa27be2f3881d3d/test_index.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5254, 13332, 1842, 67, 13261, 18, 2681, 67, 4873, 3813, 12, 987, 4709, 2449, 16, 7257, 4709, 2449, 16, 514, 4709, 2449, 16, 9633, 4709, 2449, 16, 1139, 2655, 4709, 2449, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 13261, 18, 2681, 67, 4873, 3813, 12, 987, 4709, 2449, 16, 7257, 4709, 2449, 16, 514, 4709, 2449, 16, 9633, 4709, 2449, 16, 1139, 2655, 4709, 2449, 16, ...
if self._options.winhttp: shell_args.append('--winhttp')
def Run(self): """Run all our tests on all our test files.
669f1476f3c5cf464e7b82d6338ba7ae41bf8ce0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/669f1476f3c5cf464e7b82d6338ba7ae41bf8ce0/run_webkit_tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1939, 12, 2890, 4672, 3536, 1997, 777, 3134, 7434, 603, 777, 3134, 1842, 1390, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1939, 12, 2890, 4672, 3536, 1997, 777, 3134, 7434, 603, 777, 3134, 1842, 1390, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...