rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
artists = dict.fromkeys([song('artist') for song in songs]).keys() for artist in artists: artist = artist.title().replace(' ', '_') website(WIKI_URL + artist)
l = dict.fromkeys([song(self.k) for song in songs]).keys() for a in l: a = quote(str(a).title().replace(' ', '_')) website(WIKI_URL % config.get('plugins', __name__) + a)
def plugin_songs(self, songs): artists = dict.fromkeys([song('artist') for song in songs]).keys() for artist in artists: artist = artist.title().replace(' ', '_') website(WIKI_URL + artist)
63895939fa1a3a53c1a6c9b27f97167543d16d10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/63895939fa1a3a53c1a6c9b27f97167543d16d10/wikipedia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1909, 67, 816, 564, 12, 2890, 16, 272, 7260, 4672, 3688, 1486, 273, 2065, 18, 2080, 2452, 3816, 816, 75, 2668, 25737, 6134, 364, 17180, 316, 272, 7260, 65, 2934, 2452, 1435, 364, 15469, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1909, 67, 816, 564, 12, 2890, 16, 272, 7260, 4672, 3688, 1486, 273, 2065, 18, 2080, 2452, 3816, 816, 75, 2668, 25737, 6134, 364, 17180, 316, 272, 7260, 65, 2934, 2452, 1435, 364, 15469, ...
if t.line == tokens[i+1].line:
if t.line == t.succ.line:
def check_eol_operators(tokens, lines, warnings): "Check for operators on the end of line." # XXX: don't check `=', not always sure about the style oplist = '&&', '||', '+', '-', '*', '/', '%', '|', '&', '^', \ '==', '!=', '<', '>', '<=', '>=', '?' #, '=' operators = dict([(x, 1) for x in oplist]) for i, t in enumerate(tokens): if t.bracelevel == 0: continue if t.typ != Token.punct or t.string not in operators: continue if t.line == tokens[i+1].line: continue w = 'Line ends with an operator `%s\' (col %d): %s' warnings.append((t.line, w % (t.string, t.col, lines[t.line])))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 30951, 67, 30659, 12, 7860, 16, 2362, 16, 5599, 4672, 315, 1564, 364, 12213, 603, 326, 679, 434, 980, 1199, 468, 11329, 30, 2727, 1404, 866, 1375, 33, 2187, 486, 3712, 3071, 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, 866, 67, 30951, 67, 30659, 12, 7860, 16, 2362, 16, 5599, 4672, 315, 1564, 364, 12213, 603, 326, 679, 434, 980, 1199, 468, 11329, 30, 2727, 1404, 866, 1375, 33, 2187, 486, 3712, 3071, 2...
xml_data = unpack( self.cache.fetch( externalID, get_calias_data ) )
xml_data = self.unpack( self.cache.fetch( get_calias_data, param ) )
def analyze(self, text, content_type="text/txt"): """ Submits 'text' to OpenCalais for analysis and memorizes the extracted metadata. Set the content-type to 'text/html' if you are submitting HTML data. """ externalID = Calais.content_id(text) paramsXML = PARAMS_XML % (content_type, self.allow_distro, self.allow_search, externalID, self.submitter) param = urllib.urlencode({'licenseID':self.api_key, 'content':text, 'paramsXML':paramsXML}) # do not fetch the data again, if a file exists in the cache get_calias_data = urllib.urlopen(OPENCALAIS_URL, param).read if self.cache is None: xml_data = unpack( get_calias_data() ) else: xml_data = unpack( self.cache.fetch( externalID, get_calias_data ) )
81e94b045477ce84d5691e72cef69f651c8d471e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6604/81e94b045477ce84d5691e72cef69f651c8d471e/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12375, 12, 2890, 16, 977, 16, 913, 67, 723, 1546, 955, 19, 5830, 6, 4672, 3536, 2592, 22679, 296, 955, 11, 358, 3502, 3005, 69, 291, 364, 6285, 471, 1663, 280, 3128, 326, 9438, 1982, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12375, 12, 2890, 16, 977, 16, 913, 67, 723, 1546, 955, 19, 5830, 6, 4672, 3536, 2592, 22679, 296, 955, 11, 358, 3502, 3005, 69, 291, 364, 6285, 471, 1663, 280, 3128, 326, 9438, 1982, ...
if target.char.priv & 0x04 or target.char.dead:
if target.char.invulnerable or target.char.dead:
def response( char, args, target ): socket = char.socket # you cannot use skill while dead if char.dead: socket.clilocmessage( 502796, "", 0x3b2, 3, char ) return # Check for a valid target if not target.char: socket.clilocmessage( 502801, "", 0x3b2, 3, char ) return # it's a player if target.char.socket: socket.clilocmessage( 502469, "", 0x3b2, 3, char ) return totame = target.char # You can't reach that (too far away, no los, wrong map) if char.distanceto( totame ) > TAMING_RANGE: socket.clilocmessage( 502803, "", 0x3b2, 3, totame ) return if not char.canreach( totame, TAMING_RANGE ): socket.clilocmessage( 502800, "", 0x3b2, 3, totame ) return # Invulnerable Characters cannot be examined if target.char.priv & 0x04 or target.char.dead: socket.clilocmessage( 502675, "", 0x3b2, 3, totame ) return # already tamed if totame.tamed: socket.clilocmessage( 502804, "", 0x3b2, 3, totame ) return # other player trying to tame if totame.hastag( 'taming' ): socket.clilocmessage( 502466, "", 0x3b2, 3, totame ) return # skill is too low if char.skill[ TAMING ] < totame.totame: socket.clilocmessage( 1042590, "", 0x3b2, 3, totame ) return havetamed = 0 if totame.hastag( 'num_tamed' ): num_tamed = totame.gettag( 'num_tamed' ) # tamed too many times if num_tamed >= MAXTAME: socket.clilocmessage( 1005615, "", 0x3b2, 3, totame ) return else: totame.settag( 'num_tamed', 0 ) # check follower control solt - will be added # if you have already tamed it, no skill-up check for i in range( 0, MAXTAME ): str = "tamer%i" % i if totame.hastag( str ): if totame.gettag( str ) == char.serial: havetamed = 1 else: totame.settag( str, 0 ) # flags totame.settag( 'taming', 1 ) totame.settag( 'angry', 0 ) # Turn toward the char we want to look at char.turnto( target.char ) # start taming socket.clilocmessage( 1010598, "", 0x3b2, 3, totame ) cur_time = servertime() char.settag( 'skill_delay', cur_time + TAMING_DELAY ) # set timer char.addtimer( TAMING_DURATION, "skills.animaltaming.callback", [ havetamed, totame.serial, 0 ] )
592cd6f0b1b67bd3de2ce51301b995a7dd5ea1a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/592cd6f0b1b67bd3de2ce51301b995a7dd5ea1a5/animaltaming.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 766, 12, 1149, 16, 833, 16, 1018, 262, 30, 225, 2987, 273, 1149, 18, 7814, 225, 468, 1846, 2780, 999, 15667, 1323, 8363, 309, 1149, 18, 22097, 30, 2987, 18, 830, 330, 504, 2150, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 766, 12, 1149, 16, 833, 16, 1018, 262, 30, 225, 2987, 273, 1149, 18, 7814, 225, 468, 1846, 2780, 999, 15667, 1323, 8363, 309, 1149, 18, 22097, 30, 2987, 18, 830, 330, 504, 2150, 12, ...
self.file.flush()
self._fflush()
def flush(self): self.file.flush() # cf. xmp_flush() in fusexmp_fh.c os.close(os.dup(self.fd))
bc6033be238417f6b0889845f239ee00e8f8d738 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5459/bc6033be238417f6b0889845f239ee00e8f8d738/xmp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3663, 12, 2890, 4672, 365, 6315, 1403, 80, 1218, 1435, 468, 6080, 18, 619, 1291, 67, 11330, 1435, 316, 19552, 92, 1291, 67, 19260, 18, 71, 1140, 18, 4412, 12, 538, 18, 26427, 12, 2890,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3663, 12, 2890, 4672, 365, 6315, 1403, 80, 1218, 1435, 468, 6080, 18, 619, 1291, 67, 11330, 1435, 316, 19552, 92, 1291, 67, 19260, 18, 71, 1140, 18, 4412, 12, 538, 18, 26427, 12, 2890,...
write_file = fileDir + file[:-3]
write_file = outDir + file[:-3]
def gunzipIt(file, fileDir, outDir): r_file = gzip.GzipFile(fileDir + "/" + file, 'r') write_file = fileDir + file[:-3] w_file = open(write_file, 'w') w_file.write(r_file.read()) w_file.close() r_file.close() move(write_file,outDir + file[:-3]) return None
2c835f25c0f54901b0971bc5d002f508c31f04cd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5181/2c835f25c0f54901b0971bc5d002f508c31f04cd/image_chop.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31475, 4450, 7193, 12, 768, 16, 585, 1621, 16, 596, 1621, 4672, 436, 67, 768, 273, 10331, 18, 27825, 812, 12, 768, 1621, 397, 4016, 397, 585, 16, 296, 86, 6134, 1045, 67, 768, 273, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31475, 4450, 7193, 12, 768, 16, 585, 1621, 16, 596, 1621, 4672, 436, 67, 768, 273, 10331, 18, 27825, 812, 12, 768, 1621, 397, 4016, 397, 585, 16, 296, 86, 6134, 1045, 67, 768, 273, 5...
f = open(fname,'rb')
f = open(fileName, 'rb')
def _loadPickle(self,fname): '''Load data from a file in pickle format.''' f = open(fname,'rb') newStore = cPickle.load(f) #this should also work for derived classes self.__dict__ = newStore.__dict__ #copy the (all) data attributes f.close()
45268ff49ddb4f963530947d7202a5e0642e2fda /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2720/45268ff49ddb4f963530947d7202a5e0642e2fda/storage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 945, 17968, 298, 12, 2890, 16, 12749, 4672, 9163, 2563, 501, 628, 279, 585, 316, 13379, 740, 1093, 6309, 284, 273, 1696, 12, 17812, 16, 296, 6731, 6134, 394, 2257, 273, 276, 17968, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 945, 17968, 298, 12, 2890, 16, 12749, 4672, 9163, 2563, 501, 628, 279, 585, 316, 13379, 740, 1093, 6309, 284, 273, 1696, 12, 17812, 16, 296, 6731, 6134, 394, 2257, 273, 276, 17968, ...
print "Plot to: \n", plot_file_path+".PDF\n"
print "Scatter Plot to: \n", plot_file_path+".PDF\n"
def scatter_plot(group_info,scatter_info,data_set): #data_set is a dictionary keyed by quantity containing lists of groups and X and Y data points. #print "Group Info:", group_info for quantity_number in scatter_info: #print "Dataset for quantity number "+str(quantity_number)+": ", data_set[quantity_number] if data_set[quantity_number] == []: print "No Scatter Plot Data in Quantity "+str(quantity_number)+" Dataset.\n" else: print "Scatter Plot Data for Quantity "+str(quantity_number)+" Dataset." # Set variables for Plot extracted from the first group of lines in config file starting with 'q'. # Variables for plot. plot_title = scatter_info[int(quantity_number)]['Scatter_Plot_Title'] print plot_title x_title = scatter_info[int(quantity_number)]['X_Title'] y_title = scatter_info[int(quantity_number)]['Y_Title'] min_x = float(scatter_info[int(quantity_number)]['Plot_Min']) #print min_x max_x = float(scatter_info[int(quantity_number)]['Plot_Max']) #print max_x min_y = float(scatter_info[int(quantity_number)]['Plot_Min']) max_y = float(scatter_info[int(quantity_number)]['Plot_Max']) percent_error = int(scatter_info[int(quantity_number)]['%error']) title_quadrant = int(scatter_info[int(quantity_number)]['Title_Quadrant']) key_pos = scatter_info[int(quantity_number)]['Key_Position'] key_dist = 0.2*unit.v_cm plot_width = int(scatter_info[int(quantity_number)]['Plot_Width(cm)']) #Create filename from fields in input file record. plot_file_name = scatter_info[int(quantity_number)]['Plot_Filename'] #print plot_file_name # Determine the location for the key, alignment based on key_quadrant setting. if key_pos == "tl" or "tc" or "tr" or "ml" or "mc" or "mr" or "bl" or "bc" or "br": () #print "Key Position =", key_pos else: print "The key position was not specified./nUsing the default bottom right position." key_pos = "br" #Begin Plotting #print exp_data #print mod_data # Initialize graph object g = graph.graphxy(width=plot_width, ratio=1/1, key=graph.key.key(pos=key_pos, dist=key_dist), x=graph.axis.linear(title=x_title, min=min_x, max=max_x), y=graph.axis.linear(title=y_title, min=min_y, max=max_y)) #Plot Midline and Error bounds lines. errorLineCenterPoints = [[min_x,min_y],[max_x,max_y]] #print errorLineCenterPoints lower_bound = max_y - max_y * percent_error / 100 #print lower_bound errorLineLowerPoints = [[min_x,min_y],[max_x,lower_bound]] #print errorLineLowerPoints upper_bound = max_y + max_y * percent_error / 100.0 #print upper_bound errorLineUpperPoints = [[min_x,min_y],[max_x,upper_bound]] #print errorLineUpperPoints g.plot(graph.data.points(errorLineCenterPoints, title=None, x=1, y=2), [graph.style.line([style.linewidth.Thin, style.linestyle.solid])]) g.plot(graph.data.points(errorLineLowerPoints, title=None, x=1, y=2), [graph.style.line([style.linewidth.Thin, style.linestyle.dashed])]) g.plot(graph.data.points(errorLineUpperPoints, title=None, x=1, y=2), [graph.style.line([style.linewidth.Thin, style.linestyle.dashed])]) # mystyle = graph.style.symbol(graph.style.symbol.changetriangletwice, size=0.1*unit.v_cm, # symbolattrs=[graph.style.symbol.changefilledstroked, # attr.changelist([color.rgb.red, color.rgb.green, color.rgb.blue])]) #One point at a time added to plot from each data set. # Iterate over items in scatter data dictionary key for items that are not []. # Append data sets to scatter_plot_data_list # colors for symbols are from http://pyx.sourceforge.net/manual/colorname.html scatter_plot_data_list = [] grouped_data = {} grouped_data_list = range(len(group_quantity_data_dicts[0])+1) #print "Grouped Data List:", grouped_data_list #print "DataSet for Quantity "+str(quantity_number)+":", data_set[quantity_number] if len(data_set[quantity_number]) > 1: #print "Grouped Scatter Data:" #print data_set[quantity_number] for arr_temp in grouped_data_list: grouped_data_list[arr_temp] = [] for data_set_item in data_set[quantity_number]: #print data_set_item #print "Data for group "+data_set_item[0]+":", data_set_item[1] grouped_data_list[int(data_set_item[0])].append(data_set_item[1]) print "Grouped data list:", grouped_data_list #g.plot(graph.data.points(scatter_plot_data, x=1, y=2, title=group_info[int(data_set[quantity_number][0][0])]["Group_Title"]), [mystyle]) group_counter = 0 for j in grouped_data_list: print "J =", j if j != []: print group_counter # Pull group symbol specifications from config file. config_group_symbol = group_info[group_counter]["Symbol"] #print config_group_symbol group_symbol = "graph.style.symbol."+config_group_symbol #print group_symbol config_group_symbol_color = group_info[group_counter]["Color"] #print config_group_symbol_color #group_color = "color.rgb."+config_group_symbol_color config_group_symbol_filled = group_info[group_counter]["Filled"] #print config_group_symbol_filled if config_group_symbol_filled == 'yes': fillstyle = "deco.filled([color.rgb."+config_group_symbol_color+"])" else: fillstyle = "deco.stroked([color.rgb."+config_group_symbol_color+"])" print group_symbol, fillstyle #Create temporary symbol style. tempstyle = "graph.style.symbol("+group_symbol+", size=0.1*unit.v_cm, symbolattrs=["+fillstyle+"])" print "TempStyle:", tempstyle scatterpointstyle = eval(tempstyle) #print group_info[group_counter]["Group_Title"] g.plot(graph.data.points(j, x=1, y=2, title=group_info[group_counter]["Group_Title"]), [scatterpointstyle]) else: pass group_counter = group_counter + 1 else: print "Non-Grouped Scatter Data:" print data_set[quantity_number] scatter_plot_data = [] scatter_plot_data.append(data_set[quantity_number][0][1]) print scatter_plot_data #print grouped_data_list # Now plot the Title text, alignment based on title quadrant setting. if title_quadrant == 1: g.text(0.1, g.height - 0.2, plot_title, [text.halign.left, text.valign.top, text.size.small]) elif title_quadrant == 2: g.text(g.width-0.1, g.height - 0.2, plot_title, [text.halign.right, text.valign.top, text.size.normalsize]) elif title_quadrant == 3: g.text(0.1, 0.2, plot_title, [text.halign.left, text.valign.bottom, text.size.normalsize]) elif title_quadrant == 4: g.text(g.width-0.1, 0.2, plot_title, [text.halign.right, text.valign.bottom, text.size.normalsize]) else: print "A title location was not specified./nUsing the default top left quadrant." g.text(0.1, g.height - 0.2, plot_title, [text.halign.left, text.valign.top, text.size.small]) # Write the output plot_file_path = output_directory+plot_file_name #print plot_file_path g.writePDFfile(plot_file_path) print "Plot to: \n", plot_file_path+".PDF\n"
ad91d4eb3f67d10bfa5d623cd1280d36462603e1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12/ad91d4eb3f67d10bfa5d623cd1280d36462603e1/Validation_Data_Processor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14644, 67, 4032, 12, 1655, 67, 1376, 16, 31320, 67, 1376, 16, 892, 67, 542, 4672, 468, 892, 67, 542, 353, 279, 3880, 17408, 635, 10457, 4191, 6035, 434, 3252, 471, 1139, 471, 1624, 501...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14644, 67, 4032, 12, 1655, 67, 1376, 16, 31320, 67, 1376, 16, 892, 67, 542, 4672, 468, 892, 67, 542, 353, 279, 3880, 17408, 635, 10457, 4191, 6035, 434, 3252, 471, 1139, 471, 1624, 501...
queue.put(("print", "failed to create log file '%s'" % filename))
queue.put(("print", "failed to create log file '%s': %s" % (filename, e)))
def event_handler(event_name, **kwargs): global start_time, packet_count, queue, do_trace_pjsip, do_trace_sip, trace_sip_file if event_name == "siptrace": if not do_trace_sip: return if trace_sip_file is None: try: filename = os.path.join(process._system_config_directory, 'log', '%s@%s' % (sip_uri.user, sip_uri.host), 'sip_trace.txt') trace_sip_file = open(filename, 'a') except IOError, e: queue.put(("print", "failed to create log file '%s'" % filename)) return if start_time is None: start_time = kwargs["timestamp"] packet_count += 1 if kwargs["received"]: direction = "RECEIVED" else: direction = "SENDING" buf = ["%s: Packet %d, +%s" % (direction, packet_count, (kwargs["timestamp"] - start_time))] buf.append("%(timestamp)s: %(source_ip)s:%(source_port)d --> %(destination_ip)s:%(destination_port)d" % kwargs) buf.append(kwargs["data"]) buf.append('--\n') trace_sip_file.write("\n".join(buf)) trace_sip_file.flush() elif event_name != "log": queue.put(("pypjua_event", (event_name, kwargs))) elif do_trace_pjsip: queue.put(("print", "%(timestamp)s (%(level)d) %(sender)14s: %(message)s" % kwargs))
9ab830805065b6abd11c08a01e09837cd41bcf1e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5703/9ab830805065b6abd11c08a01e09837cd41bcf1e/sip_audio_session.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 871, 67, 4176, 12, 2575, 67, 529, 16, 2826, 4333, 4672, 2552, 787, 67, 957, 16, 4414, 67, 1883, 16, 2389, 16, 741, 67, 5129, 67, 84, 2924, 625, 16, 741, 67, 5129, 67, 28477, 16, 26...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 871, 67, 4176, 12, 2575, 67, 529, 16, 2826, 4333, 4672, 2552, 787, 67, 957, 16, 4414, 67, 1883, 16, 2389, 16, 741, 67, 5129, 67, 84, 2924, 625, 16, 741, 67, 5129, 67, 28477, 16, 26...
Id: 4
Id: 5
def exercise_modifiers(verbose=0): if (verbose): out = sys.stdout mtz_object = mtz.object() mtz_object.set_title(title="012345678") assert mtz_object.title() == "012345678" mtz_object.set_title(title="012345678", append=True) assert mtz_object.title() == "012345678 012345678" mtz_object.set_title(title="0123456789"*10+"012345678", append=True) assert mtz_object.title() == "012345678 "*2 + "0123456789"*5 mtz_object.set_title("0123456789"*100) assert mtz_object.title() == "0123456789"*7 mtz_object.add_history(lines=flex.std_string(["a1", "a2"])) assert list(mtz_object.history()) == ["a1", "a2"] mtz_object.add_history(lines=flex.std_string(["b1", "b2"])) assert list(mtz_object.history()) == ["b1", "b2", "a1", "a2"] mtz_object.add_history(line="c1") assert list(mtz_object.history()) == ["c1", "b1", "b2", "a1", "a2"] mtz_object.set_space_group_name(name="sg"*100) assert mtz_object.space_group_name() == "sgsgsgsgsgsgsgsgsgsg" mtz_object.set_space_group_number(number=12) assert mtz_object.space_group_number() == 12 mtz_object.set_point_group_name(name="pg"*100) assert mtz_object.point_group_name() == "pgpgpgpgpg" mtz_object.set_lattice_centring_type(symbol="C") assert mtz_object.lattice_centring_type() == "C" for space_group_symbols in sgtbx.space_group_symbol_iterator(): space_group = sgtbx.space_group(space_group_symbols) mtz_object.set_space_group(space_group) assert mtz_object.space_group() == space_group assert mtz_object.n_symmetry_matrices() == space_group.order_z() mtz_object = mtz.object() \ .set_title(title="exercise") \ .add_history(lines=flex.std_string(["h2"])) \ .add_history(line="h1") \ .set_space_group_name("sg") \ .set_space_group_number(123) \ .set_point_group_name("pg") \ .set_space_group(sgtbx.space_group_info(number=123).group()) assert mtz_object.title() == "exercise" assert list(mtz_object.history()) == ["h1", "h2"] for stage in [0,1]: for i_crystal in xrange(3): if (stage == 0): if (i_crystal % 2 == 0): crystal = mtz_object.add_crystal( name="crystal_%d"%i_crystal, project_name="project_%d"%i_crystal, unit_cell_parameters=(10+i_crystal,20,20,90,90,120)) else: crystal = mtz_object.add_crystal( name="crystal_%d"%i_crystal, project_name="project_%d"%i_crystal, unit_cell=uctbx.unit_cell((10+i_crystal,20,20,90,90,120))) else: crystal = mtz_object.crystals()[i_crystal] assert crystal.i_crystal() == i_crystal assert crystal.name() == "crystal_%d"%i_crystal assert crystal.project_name() == "project_%d"%i_crystal assert approx_equal(crystal.unit_cell_parameters(), (10+i_crystal,20,20,90,90,120)) if (not verbose): out = StringIO() mtz_object.show_summary(out=out) if (not verbose): assert out.getvalue() == """\
c3cf0722281a181a283d00bb69ac8271125a2ef3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/c3cf0722281a181a283d00bb69ac8271125a2ef3/tst_ext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24165, 67, 15432, 12, 11369, 33, 20, 4672, 309, 261, 11369, 4672, 596, 273, 2589, 18, 10283, 5874, 94, 67, 1612, 273, 5874, 94, 18, 1612, 1435, 5874, 94, 67, 1612, 18, 542, 67, 2649, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24165, 67, 15432, 12, 11369, 33, 20, 4672, 309, 261, 11369, 4672, 596, 273, 2589, 18, 10283, 5874, 94, 67, 1612, 273, 5874, 94, 18, 1612, 1435, 5874, 94, 67, 1612, 18, 542, 67, 2649, ...
dlg = dialog_ok_cancel("Rat will simplify your code", ("By putting common utilities in one place all " "benefit and get nicer apps."), title="foo", run=False)
def _on_close(self, *args): if not self.cancel_button.get_property("sensitive"): return True # click on the cancel button self.cancel_button.clicked() # let the clicked event close the window if it likes too return True
0c0d33f43620369fb91c3eb94fcd412bb75c28f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2366/0c0d33f43620369fb91c3eb94fcd412bb75c28f9/hig.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 265, 67, 4412, 12, 2890, 16, 380, 1968, 4672, 309, 486, 365, 18, 10996, 67, 5391, 18, 588, 67, 4468, 2932, 23481, 6, 4672, 327, 1053, 468, 4682, 603, 326, 3755, 3568, 365, 18, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 265, 67, 4412, 12, 2890, 16, 380, 1968, 4672, 309, 486, 365, 18, 10996, 67, 5391, 18, 588, 67, 4468, 2932, 23481, 6, 4672, 327, 1053, 468, 4682, 603, 326, 3755, 3568, 365, 18, 1...
os.chdir('docs/graphguide') do_exec(python + ' gengraphguide.py') os.chdir(d) do_exec('cp docs/graphguide/*.pdf %s' % htmldir) do_exec('mv docs/graphguide/*.pdf %s' % dst)
def cvs_checkout(d): os.chdir(d) cvsdir = os.path.join(d,projdir) recursive_rmdir(cvsdir) recursive_rmdir('docs') cvs = find_exe('cvs') python = find_exe('python') if cvs is None: os.exit(1) os.environ['CVSROOT']=':pserver:%s@cvs.reportlab.sourceforge.net:/cvsroot/reportlab' % USER if release: do_exec(cvs+(' export -r %s %s' % (tagname,projdir)), 'the export phase') else: do_exec(cvs+' co %s' % projdir, 'the checkout phase') if py2pdf: # now we need to move the files & delete those we don't need dst = py2pdf_dir recursive_rmdir(dst) os.mkdir(dst) do_exec("mv reportlab/demos/py2pdf/py2pdf.py %s"%dst) do_exec("mv reportlab/demos/py2pdf/PyFontify.py %s" % dst) do_exec("mv reportlab/demos/py2pdf/idle_print.py %s" % dst) do_exec("rm -r reportlab/demos reportlab/platypus reportlab/lib/styles.py reportlab/README.pdfgen.txt reportlab/pdfgen/test", "reducing size") do_exec("mv %s %s" % (projdir,dst)) do_exec("chmod a+x %s/py2pdf.py %s/idle_print.py" % (dst, dst)) CVS_remove(dst) else: do_exec(cvs+' co docs') dst = os.path.join(d,"reportlab","docs") do_exec("mkdir %s" % dst) P=os.path.join(os.environ['HOME'],'python_stuff','lib') PP=os.path.join(P,'PIL') PP = "%s:%s:%s" % (d,P,PP) #add our reportlab parent to the path so we import from there if os.environ.has_key('PYTHONPATH'): opp = os.environ['PYTHONPATH'] os.environ['PYTHONPATH']='%s:%s' % (PP,opp) else: opp = None os.environ['PYTHONPATH']=PP if '-pythonpath' in sys.argv: print 'PYTHONPATH=%s'%os.environ['PYTHONPATH'] os.chdir('docs/reference') do_exec(python + ' ../tools/yaml2pdf.py reference.yml') os.chdir(d) do_exec('cp docs/reference/*.pdf %s' % htmldir) do_exec('mv docs/reference/*.pdf %s' % dst) os.chdir('docs/userguide') do_exec(python + ' genuserguide.py') os.chdir(d) do_exec('cp docs/userguide/*.pdf %s' % htmldir) do_exec('mv docs/userguide/*.pdf %s' % dst) os.chdir('docs/graphguide') do_exec(python + ' gengraphguide.py') os.chdir(d) do_exec('cp docs/graphguide/*.pdf %s' % htmldir) do_exec('mv docs/graphguide/*.pdf %s' % dst) os.chdir('docs/graphguide') do_exec(python + ' gengraphguide.py') os.chdir(d) do_exec('cp docs/graphguide/*.pdf %s' % htmldir) do_exec('mv docs/graphguide/*.pdf %s' % dst) recursive_rmdir('docs') pyc_remove(cvsdir) #restore the python path if opp is None: del os.environ['PYTHONPATH'] else: os.environ['PYTHONPATH'] = opp
da93a3a86937edc5b6f03eb65be125f5bcfde424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/da93a3a86937edc5b6f03eb65be125f5bcfde424/daily.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 6904, 67, 17300, 12, 72, 4672, 1140, 18, 343, 1214, 12, 72, 13, 276, 6904, 1214, 273, 1140, 18, 803, 18, 5701, 12, 72, 16, 17995, 1214, 13, 5904, 67, 8864, 1214, 12, 71, 6904, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 6904, 67, 17300, 12, 72, 4672, 1140, 18, 343, 1214, 12, 72, 13, 276, 6904, 1214, 273, 1140, 18, 803, 18, 5701, 12, 72, 16, 17995, 1214, 13, 5904, 67, 8864, 1214, 12, 71, 6904, ...
content.append(ElementReference())
content.append(ElementReference(self))
def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) content = []
6d624a54ef4e80f277c247ef300c646e01f4568e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13054/6d624a54ef4e80f277c247ef300c646e01f4568e/XMLSchema.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 628, 8832, 12, 2890, 16, 756, 4672, 365, 18, 542, 2498, 12, 2159, 13, 2939, 273, 365, 18, 588, 6323, 12, 2159, 13, 913, 273, 5378, 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, 628, 8832, 12, 2890, 16, 756, 4672, 365, 18, 542, 2498, 12, 2159, 13, 2939, 273, 365, 18, 588, 6323, 12, 2159, 13, 913, 273, 5378, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
test()
test()
def IDLETest(extension): import sys, os modname = "pywin.idle." + extension __import__(modname) mod=sys.modules[modname] mod.TclError = TextError klass = getattr(mod, extension) # Create a new Scintilla Window. import pywin.framework.editor d=pywin.framework.editor.editorTemplate.OpenDocumentFile(None) v=d.GetFirstView() fname=os.path.splitext(__file__)[0] + ".py" v.SCIAddText(open(fname).read()) d.SetModifiedFlag(0) r=klass( IDLEWrapper( TkText(v) ) ) return r
a770882769f1e5eeac47c51b33b56135b0dd2f2a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/677/a770882769f1e5eeac47c51b33b56135b0dd2f2a/IDLEenvironment.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1599, 900, 4709, 12, 6447, 4672, 1930, 2589, 16, 1140, 16037, 273, 315, 2074, 8082, 18, 20390, 1199, 397, 2710, 1001, 5666, 972, 12, 1711, 529, 13, 681, 33, 9499, 18, 6400, 63, 1711, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1599, 900, 4709, 12, 6447, 4672, 1930, 2589, 16, 1140, 16037, 273, 315, 2074, 8082, 18, 20390, 1199, 397, 2710, 1001, 5666, 972, 12, 1711, 529, 13, 681, 33, 9499, 18, 6400, 63, 1711, 5...
if ch == '\\': p += '\\' elif ch == '\'': p += '\'' elif ch == '\"': p += '\"' elif ch == 'b': p += '\b' elif ch == 'f': p += '\014' elif ch == 't': p += '\t' elif ch == 'n': p += '\n'
if ch == '\\': p += u'\\' elif ch == '\'': p += u'\'' elif ch == '\"': p += u'\"' elif ch == 'b': p += u'\b' elif ch == 'f': p += u'\014' elif ch == 't': p += u'\t' elif ch == 'n': p += u'\n'
def PyUnicode_DecodeUnicodeEscape(s, size, errors): if (size == 0): return u'' p = [] pos = 0 while (pos < size):
16ed2024742360e02d96bf99f8cb5ce4527577cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/16ed2024742360e02d96bf99f8cb5ce4527577cd/app_codecs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4707, 16532, 67, 6615, 16532, 8448, 12, 87, 16, 963, 16, 1334, 4672, 225, 309, 261, 1467, 422, 374, 4672, 327, 582, 6309, 225, 293, 273, 5378, 949, 273, 374, 1323, 261, 917, 411, 963, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4707, 16532, 67, 6615, 16532, 8448, 12, 87, 16, 963, 16, 1334, 4672, 225, 309, 261, 1467, 422, 374, 4672, 327, 582, 6309, 225, 293, 273, 5378, 949, 273, 374, 1323, 261, 917, 411, 963, ...
o.loaned = bool(i[20])
def convert_from_old_db(self, source_file, destination_file): #{{{ # TODO: table.insert().execute({'number':1, 'o_title':'test1'}, {'number':2, 'title: 'test2'}) is faster! print 'Converting old database - it can take several minutes...' gutils.info(self,_("Griffith will now convert your database to the new format. This can take several minutes if you have a large database.")) from sqlalchemy.orm import clear_mappers from sql import GriffithSQL from gutils import digits_only import os if not os.path.isfile(source_file): return False if open(source_file).readline()[:47] == '** This file contains an SQLite 2.1 database **': try: import sqlite from sqlite import DatabaseError except: print 'Old DB conversion: please install pysqlite legacy (v1.0)' gutils.warning(self,_("Old DB conversion: please install pysqlite legacy (v1.0)")) return False else: from pysqlite2 import dbapi2 as sqlite from pysqlite2.dbapi2 import DatabaseError if os.path.isfile(destination_file): # rename destination_file if it already exist i = 1 while True: if os.path.isfile("%s_%s" % (destination_file, i)): i += 1 else: break os.rename(destination_file, "%s_%s" % (destination_file, i)) try: old_db = sqlite.connect(source_file) except DatabaseError, e: if str(e) == 'file is encrypted or is not a database': print 'Your database is most probably in wrong SQLite format, please convert it to SQLite3:' print '$ sqlite ~/.griffith/griffith.gri .dump | sqlite3 ~/.griffith/griffith.gri3' print '$ mv ~/.griffith/griffith.gri{,2}' print '$ mv ~/.griffith/griffith.gri{3,}' print 'or install pysqlite in version 1.0' gutils.warning(self,_("Your database is most probably in SQLite2 format, please convert it to SQLite3")) else: raise return False old_cursor = old_db.cursor() # fix old database old_cursor.execute("UPDATE movies SET media = '1' WHERE media = 'DVD';") old_cursor.execute("UPDATE movies SET media = '2' WHERE media = 'DVD-R';") old_cursor.execute("UPDATE movies SET media = '3' WHERE media = 'DVD-RW';") old_cursor.execute("UPDATE movies SET media = '4' WHERE media = 'DVD+R';") old_cursor.execute("UPDATE movies SET media = '5' WHERE media = 'DVD+RW';") old_cursor.execute("UPDATE movies SET media = '6' WHERE media = 'DVD-RAM';") old_cursor.execute("UPDATE movies SET media = '7' WHERE media = 'DivX';") old_cursor.execute("UPDATE movies SET media = '7' WHERE media = 'DIVX';") old_cursor.execute("UPDATE movies SET media = '7' WHERE media = 'XviD';") old_cursor.execute("UPDATE movies SET media = '7' WHERE media = 'XVID';") old_cursor.execute("UPDATE movies SET media = '7' WHERE media = 'WMV';") old_cursor.execute("UPDATE movies SET media = '9' WHERE media = 'VCD';") old_cursor.execute("UPDATE movies SET media = '10' WHERE media = 'SVCD'; ") old_cursor.execute("UPDATE movies SET media = '11' WHERE media = 'VHS';") old_cursor.execute("UPDATE movies SET media = '12' WHERE media = 'BETACAM';") old_cursor.execute("UPDATE movies SET collection_id=0 WHERE collection_id<1") old_cursor.execute("UPDATE movies SET volume_id=0 WHERE volume_id<1") old_cursor.execute("UPDATE movies SET color=NULL WHERE color<1 OR color=''") old_cursor.execute("UPDATE movies SET condition=NULL WHERE condition<0 OR condition='' OR condition>2") old_cursor.execute("UPDATE movies SET layers=NULL WHERE layers<0 OR layers='' OR layers>3") old_cursor.execute("UPDATE movies SET region=NULL WHERE region='' OR region=2 OR region<0 OR region>8") old_cursor.execute("UPDATE movies SET year=NULL WHERE year<1900 or year>2007") old_cursor.execute("UPDATE movies SET rating=0 WHERE rating<0") # FIXME? old_cursor.execute("UPDATE movies SET rating=10 WHERE rating>10") # FIXME? old_cursor.execute("UPDATE loans SET return_date=NULL WHERE return_date=''") old_cursor.execute("DELETE FROM loans WHERE date='' OR date ISNULL") old_cursor.execute("DELETE FROM loans WHERE movie_id=0") old_cursor.execute("DELETE FROM loans WHERE movie_id NOT IN (SELECT id FROM movies)") old_cursor.execute("DELETE FROM volumes WHERE name = ''") old_cursor.execute("DELETE FROM volumes WHERE name = 'None'") old_cursor.execute("DELETE FROM collections WHERE name = ''") old_cursor.execute("DELETE FROM collections WHERE name = 'None'") old_cursor.execute("DELETE FROM languages WHERE name = ''") self.config['db_type'] = 'sqlite' self.config['default_db'] = 'griffith.db' self.config['posters'] = 'posters' self.config['color'] = 0 self.config['condition'] = 0 self.config['layers'] = 0 self.config['media'] = 0 self.config['region'] = 0 self.config['vcodec'] = 0 self.locations['posters'] = os.path.join(self.locations['home'], 'posters') new_db = GriffithSQL(self.config, self.debug, self.locations['home']) # collections collection_mapper = {0:None, u'':None} old_cursor.execute("SELECT id, name, loaned FROM collections;") for i in old_cursor.fetchall(): o = new_db.Collection(name=i[1], loaned=bool(i[2])) o.save(); o.flush() collection_mapper[i[0]] = o.collection_id # volumes volume_mapper = {0:None, u'':None} old_cursor.execute("SELECT id, name, loaned FROM volumes;") for i in old_cursor.fetchall(): o = new_db.Volume(name=i[1], loaned=bool(i[2])) o.save(); o.flush() volume_mapper[i[0]] = o.volume_id # people person_mapper = {} old_cursor.execute("SELECT id, name, email, phone FROM people;") for i in old_cursor.fetchall(): o = new_db.Person(name=i[1], email=i[2], phone=i[3]) o.save(); o.flush() person_mapper[i[0]] = o.person_id # languages language_mapper = {} old_cursor.execute("SELECT id, name FROM languages;") for i in old_cursor.fetchall(): o = new_db.Lang.get_by(name=i[1]) if o is not None: language_mapper[i[0]] = o.lang_id else: o = new_db.Lang(name=i[1]) o.save(); o.flush() language_mapper[i[0]] = o.lang_id # media medium_mapper = {'0':None} old_cursor.execute("SELECT id, name FROM media;") for i in old_cursor.fetchall(): o = new_db.Medium.get_by(name=i[1]) if o is not None: medium_mapper[i[0]] = o.medium_id else: o = new_db.Medium(name=i[1]) o.save(); o.flush() medium_mapper[i[0]] = o.medium_id # tags tag_mapper = {} old_cursor.execute("SELECT id, name FROM tags;") for i in old_cursor.fetchall(): o = new_db.Tag.get_by(name=i[1]) if o is not None: tag_mapper[i[0]] = o.tag_id else: o = new_db.Tag(name=i[1]) o.save(); o.flush() tag_mapper[i[0]] = o.tag_id # movies movie_mapper = {} old_cursor.execute(""" SELECT id, volume_id, collection_id, original_title, title, director, number, image, plot, country, year, runtime, classification, genre, studio, site, imdb, actors, trailer, rating, loaned, media, num_media, obs, seen, region, condition, color, layers FROM movies ORDER BY number;""") for i in old_cursor.fetchall(): o = new_db.Movie() o.number = digits_only(i[6]) o.volume_id = volume_mapper[i[1]] o.collection_id = collection_mapper[i[2]] o.o_title = i[3][:255] o.title = i[4][:255] o.director = i[5][:255] o.image = i[7][:128] o.plot = i[8] o.country = i[9][:128] o.year = digits_only(i[10]) o.runtime = digits_only(i[11]) o.classification = i[12][:128] o.genre = i[13][:128] o.studio = i[14][:128] o.o_site = i[15][:255] o.site = i[16][:255] o.cast = i[17] o.trailer = i[18][:255] o.rating = digits_only(i[19]) o.loaned = bool(i[20]) o.medium_id = medium_mapper[int(i[21])] o.media_num = digits_only(i[22]) o.notes = i[23] o.seen = bool(i[24]) o.region = digits_only(i[25]) o.cond = digits_only(i[26], 5) o.color = digits_only(i[27], 3) o.layers = digits_only(i[28], 4) o.save(); o.flush() movie_mapper[i[0]] = o.movie_id # movie tag old_cursor.execute("SELECT movie_id, tag_id FROM movie_tag;") for i in old_cursor.fetchall(): o = new_db.MovieTag.get_by(movie_id=movie_mapper[i[0]], tag_id=tag_mapper[i[1]]) if o is None: m = new_db.Movie.get_by(movie_id=movie_mapper[i[0]]) t = new_db.Tag.get_by(tag_id=tag_mapper[i[1]]) t.save() m.tags.append(t) m.save(); m.flush() # movie lang old_cursor.execute("SELECT movie_id, lang_id, type FROM movie_lang;") for i in old_cursor.fetchall(): o = new_db.MovieLang.get_by(movie_id=movie_mapper[i[0]], lang_id=language_mapper[i[1]], type=i[2]) if o is None: m = new_db.Movie.get_by(movie_id=movie_mapper[i[0]]) l = new_db.MovieLang(lang_id=language_mapper[i[1]], type=i[2]) l.save() m.languages.append(l) m.save(); m.flush() # loans old_cursor.execute("SELECT person_id, movie_id, volume_id, collection_id, date, return_date FROM loans;") for i in old_cursor.fetchall(): m = new_db.Movie.get_by(movie_id=movie_mapper[i[1]]) o = new_db.Loan() o.person_id = person_mapper[i[0]] o.volume_id = volume_mapper[i[2]] o.collection_id = collection_mapper[i[3]] o.date = str(i[4])[:10] if i[5] is not None: o.return_date = str(i[5])[:10] else: m.loaned = True o.save(); m.loans.append(o) m.flush() clear_mappers() return True
2dadec19fe55a20ffd9eb6f4ebb1688a211b033a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2687/2dadec19fe55a20ffd9eb6f4ebb1688a211b033a/dbupgrade.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 67, 2080, 67, 1673, 67, 1966, 12, 2890, 16, 1084, 67, 768, 16, 2929, 67, 768, 4672, 202, 3642, 12187, 468, 2660, 30, 1014, 18, 6387, 7675, 8837, 12590, 11, 2696, 4278, 21, 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, 1765, 67, 2080, 67, 1673, 67, 1966, 12, 2890, 16, 1084, 67, 768, 16, 2929, 67, 768, 4672, 202, 3642, 12187, 468, 2660, 30, 1014, 18, 6387, 7675, 8837, 12590, 11, 2696, 4278, 21, 16, ...
"sda_size", "sdb_size", "vcpus"],
"sda_size", "sdb_size", "vcpus", "tags"],
def CheckPrereq(self): """Check prerequisites.
130a6a6ff0223537219f70aea30ee14136e81040 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/130a6a6ff0223537219f70aea30ee14136e81040/cmdlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2073, 2050, 822, 85, 12, 2890, 4672, 3536, 1564, 30328, 16608, 2997, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 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, 2073, 2050, 822, 85, 12, 2890, 4672, 3536, 1564, 30328, 16608, 2997, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
sci_not = re.compile("(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]\d+)")
def symbolic_expression_from_maxima_string(x, equals_sub=False, maxima=maxima): syms = dict(_syms) if len(x) == 0: raise RuntimeError, "invalid symbolic expression -- ''" maxima.set('_tmp_',x) # This is inefficient since it so rarely is needed: #r = maxima._eval_line('listofvars(_tmp_);')[1:-1] s = maxima._eval_line('_tmp_;') formal_functions = maxima_tick.findall(s) if len(formal_functions) > 0: for X in formal_functions: syms[X[1:]] = function(X[1:]) # You might think there is a potential very subtle bug if 'foo is in a string literal -- # but string literals should *never* ever be part of a symbolic expression. s = s.replace("'","") delayed_functions = maxima_qp.findall(s) if len(delayed_functions) > 0: for X in delayed_functions: syms[X[2:]] = SymbolicFunction_delayed(X[2:]) s = s.replace("?%","") s = multiple_replace(symtable, s) s = s.replace("%","") if equals_sub: s = s.replace('=','==') #replace all instances of scientific notation #with regular notation sci_not = re.compile("(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]\d+)") search = sci_not.search(s) while not search is None: (start, end) = search.span() s = s.replace(s[start:end], str(RR(s[start:end]))) search = sci_not.search(s) # have to do this here, otherwise maxima_tick catches it syms['limit'] = dummy_limit global is_simplified try: # use a global flag so all expressions obtained via # evaluation of maxima code are assumed pre-simplified is_simplified = True last_msg = '' while True: try: w = sage_eval(s, syms) except NameError, msg: if msg == last_msg: raise NameError, msg msg = str(msg) last_msg = msg i = msg.find("'") j = msg.rfind("'") nm = msg[i+1:j] syms[nm] = var(nm) else: break if isinstance(w, (list, tuple)): return w else: x = SR(w) return x except SyntaxError: raise TypeError, "unable to make sense of Maxima expression '%s' in SAGE"%s finally: is_simplified = False
7a8e31fb299d2e32b920eae07fe9653ae59d945b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/7a8e31fb299d2e32b920eae07fe9653ae59d945b/calculus.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16754, 67, 8692, 67, 2080, 67, 1896, 13888, 67, 1080, 12, 92, 16, 1606, 67, 1717, 33, 8381, 16, 943, 13888, 33, 1896, 13888, 4672, 24367, 273, 2065, 24899, 9009, 959, 13, 225, 309, 562...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16754, 67, 8692, 67, 2080, 67, 1896, 13888, 67, 1080, 12, 92, 16, 1606, 67, 1717, 33, 8381, 16, 943, 13888, 33, 1896, 13888, 4672, 24367, 273, 2065, 24899, 9009, 959, 13, 225, 309, 562...
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse) glLightfv(GL_LIGHT0, GL_SPECULAR, specular) glLightfv(GL_LIGHT0, GL_POSITION, (0.0, 0.0, -1.0, 0.0))
glLightfv(GL_LIGHT0, GL_AMBIENT, (0.0, 0.0, 0.0, 1.0)) glLightfv(GL_LIGHT0, GL_DIFFUSE, (1.0, 1.0, 1.0, 1.0)) glLightfv(GL_LIGHT0, GL_SPECULAR, (1.0, 1.0, 1.0, 1.0)) glLightfv(GL_LIGHT0, GL_POSITION, (0.0, 0.0, zplane + 10.0, 0.0)) glLightModelfv(GL_LIGHT_MODEL_AMBIENT, (0.2, 0.2, 0.2, 1.0))
def opengl_render(self): ## setup perspective matrix
878842438ad5dcf87f49337f7c582fe163496f4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10674/878842438ad5dcf87f49337f7c582fe163496f4b/glutviewer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 7043, 67, 5902, 12, 2890, 4672, 7541, 3875, 26651, 3148, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 7043, 67, 5902, 12, 2890, 4672, 7541, 3875, 26651, 3148, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
pvs = [] for v in ('0', '4.2', '4.2.3.4', '5.0.0-alpha', '5.0.0-rc1', '5.0.0-rc1.1', '5.0.0'): pv = parse_version(v) print v, pv pvs.append(pv)
pvs = [] for v in ('0', '4.2', '4.2.3.4', '5.0.0-alpha', '5.0.0-rc1', '5.0.0-rc1.1', '5.0.0_rc2', '5.0.0'): pv = parse_version(v) print v, pv pvs.append(pv)
def parse_version(s): """Convert a version string to a chronologically-sortable key This is a rough cross between distutils' StrictVersion and LooseVersion; if you give it versions that would work with StrictVersion, then it behaves the same; otherwise it acts like a slightly-smarter LooseVersion. It is *possible* to create pathological version coding schemes that will fool this parser, but they should be very rare in practice. The returned value will be a tuple of strings. Numeric portions of the version are padded to 8 digits so they will compare numerically, but without relying on how numbers compare relative to strings. Dots are dropped, but dashes are retained. Trailing zeros between alpha segments or dashes are suppressed, so that e.g. "2.4.0" is considered the same as "2.4". Alphanumeric parts are lower-cased. The algorithm assumes that strings like "-" and any alpha string that alphabetically follows "final" represents a "patch level". So, "2.4-1" is assumed to be a branch or patch of "2.4", and therefore "2.4.1" is considered newer than "2.4-1", whic in turn is newer than "2.4". Strings like "a", "b", "c", "alpha", "beta", "candidate" and so on (that come before "final" alphabetically) are assumed to be pre-release versions, so that the version "2.4" is considered newer than "2.4a1". Finally, to handle miscellaneous cases, the strings "pre", "preview", and "rc" are treated as if they were "c", i.e. as though they were release candidates, and therefore are not as new as a version string that does not contain them. """ parts = [] for part in _parse_version_parts(s.lower()): if part.startswith('*'): if part<'*final': # remove '-' before a prerelease tag while parts and parts[-1]=='*final-': parts.pop() # remove trailing zeros from each series of numeric parts while parts and parts[-1]=='00000000': parts.pop() parts.append(part) return tuple(parts)
9d28da502c472dc8936f3df3502fb9cd19cfca35 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12853/9d28da502c472dc8936f3df3502fb9cd19cfca35/parse_version.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 1589, 12, 87, 4672, 3536, 2723, 279, 1177, 533, 358, 279, 12227, 3966, 6478, 17, 27236, 498, 225, 1220, 353, 279, 23909, 6828, 3086, 2411, 5471, 11, 22307, 1444, 471, 3176, 258...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 1589, 12, 87, 4672, 3536, 2723, 279, 1177, 533, 358, 279, 12227, 3966, 6478, 17, 27236, 498, 225, 1220, 353, 279, 23909, 6828, 3086, 2411, 5471, 11, 22307, 1444, 471, 3176, 258...
raise IOError("Install DK-data.zip from http://www.ssfpack.com/DKbook.html")
raise IOError("Install DK-data.zip from http://www.ssfpack.com/DKbook.html or specify its correct local path.")
def Q(x): cholQ = np.array([[x[1],0],[0,x[2]]]) return np.dot(cholQ,cholQ.T)
3f0ccb720bd60c3732850d8827f15d2f4f538f23 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12658/3f0ccb720bd60c3732850d8827f15d2f4f538f23/kalmanf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2238, 12, 92, 4672, 462, 355, 53, 273, 1130, 18, 1126, 3816, 63, 92, 63, 21, 6487, 20, 6487, 63, 20, 16, 92, 63, 22, 13563, 5717, 327, 1130, 18, 9811, 12, 343, 355, 53, 16, 343, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2238, 12, 92, 4672, 462, 355, 53, 273, 1130, 18, 1126, 3816, 63, 92, 63, 21, 6487, 20, 6487, 63, 20, 16, 92, 63, 22, 13563, 5717, 327, 1130, 18, 9811, 12, 343, 355, 53, 16, 343, ...
del values[key] values[key + '__isnull'] = True
match_values[key + '__isnull'] = True else: match_values[key] = values[key]
def start(http_request): """ Front page with URL input, browser chooser, and options. """ # Initialize forms. post = http_request.POST or None url_form = UrlForm(post) features_form = FeaturesForm(post) options_form = OptionsForm(post) # Get available choices from database, with correct translations. active_factories = Factory.objects.filter( last_poll__gte=last_poll_timeout()) active_browsers = Browser.objects.filter( factory__in=active_factories, active=True) if not active_browsers: error_title = _("out of service") error_message = ' '.join(( _("No active screenshot factories."), _("Please try again later."), )) return render_to_response('error.html', locals()) features_form.load_choices(active_browsers) options_form.load_choices(active_factories) # Validate posted data. valid_post = (url_form.is_valid() and options_form.is_valid() and features_form.is_valid()) # Preload some database entries for browser forms preload_foreign_keys(active_browsers, factory=active_factories, factory__operating_system=True, browser_group=True) # Browser forms for each platform. browser_forms = [] for platform in Platform.objects.all(): browser_form = BrowsersForm(active_browsers, platform, post) if browser_form.is_bound: browser_form.full_clean() if browser_form.fields: browser_forms.append(browser_form) valid_post = valid_post and browser_form.is_valid() browser_forms[0].is_first = True browser_forms[-1].is_last = True if not valid_post: # Show HTML form. if 'url' in http_request.GET: url_form.fields['url'].initial = http_request.GET['url'] multi_column(browser_forms) selectors = ' |\n'.join(selector_links(browser_forms)) news_list = NewsItem.objects.all()[:10] sponsors_list = Sponsor.objects.filter(premium=True) return render_to_response('start/start.html', locals()) # Create screenshot requests and redirect to website overview. expire = datetime.now() + timedelta(minutes=30) values = { 'ip': http_request.META['REMOTE_ADDR'], 'website': url_form.cleaned_data['website'], } values.update(options_form.cleaned_data) values.update(features_form.cleaned_data) for key in values: if values[key] is None: del values[key] values[key + '__isnull'] = True existing = RequestGroup.objects.filter( expire__gte=datetime.now(), **values).order_by('-submitted') if len(existing): request_group = existing[0] request_group.expire = expire request_group.save() else: request_group = RequestGroup.objects.create(expire=expire, **values) for browser_form in browser_forms: create_platform_requests( request_group, browser_form.platform, browser_form) # Make sure that the redirect will show the new request group transaction.commit() # return render_to_response('debug.html', locals()) return HttpResponseRedirect(values['website'].get_absolute_url())
f1449bdb2454241fa86dbeb789b26207da6e4eec /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3111/f1449bdb2454241fa86dbeb789b26207da6e4eec/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 12, 2505, 67, 2293, 4672, 3536, 16465, 1363, 598, 1976, 810, 16, 4748, 5011, 13164, 16, 471, 702, 18, 3536, 468, 9190, 10138, 18, 1603, 273, 1062, 67, 2293, 18, 3798, 578, 599, 88...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2505, 67, 2293, 4672, 3536, 16465, 1363, 598, 1976, 810, 16, 4748, 5011, 13164, 16, 471, 702, 18, 3536, 468, 9190, 10138, 18, 1603, 273, 1062, 67, 2293, 18, 3798, 578, 599, 88...
options.graph_font_size = _str_to_int(val)
options.graph_font_size = _str_to_int(val, optname)
def parse_configfiles(configfiles, options, names): configparser = ConfigParser.ConfigParser() # ConfigParser.read() silently ignores errors, so open the files # manually (since we want to notify the user of any errors). for configfile in configfiles: fp = open(configfile, 'r') # may raise IOError. configparser.readfp(fp, configfile) fp.close() for optname in configparser.options('epydoc'): val = configparser.get('epydoc', optname, vars=os.environ).strip() optname = optname.lower().strip() if optname in ('modules', 'objects', 'values', 'module', 'object', 'value'): names.extend(val.replace(',', ' ').split()) elif optname == 'target': options.target = val elif optname == 'output': if val.lower() not in ACTIONS: raise ValueError('"%s" expected one of: %s' % (optname, ', '.join(ACTIONS))) options.action = val.lower() elif optname == 'verbosity': options.verbosity = _str_to_int(val, optname) elif optname == 'debug': options.debug = _str_to_bool(val, optname) elif optname in ('simple-term', 'simple_term'): options.simple_term = _str_to_bool(val, optname) # Generation options elif optname == 'docformat': options.docformat = val elif optname == 'parse': options.parse = _str_to_bool(val, optname) elif optname == 'introspect': options.introspect = _str_to_bool(val, optname) elif optname == 'exclude': options.exclude.append(val) elif optname in ('exclude-parse', 'exclude_parse'): options.exclude_parse.append(val) elif optname in ('exclude-introspect', 'exclude_introspect'): options.exclude_introspect.append(val) elif optname == 'inheritance': if val.lower() not in INHERITANCE_STYLES: raise ValueError('"%s" expected one of: %s.' % (optname, ', '.join(INHERITANCE_STYLES))) options.inerhitance = val.lower() elif optname =='private': options.private = _str_to_bool(val, optname) elif optname =='imports': options.imports = _str_to_bool(val, optname) elif optname == 'sourcecode': options.include_source_code = _str_to_bool(val, optname) elif optname in ('include-log', 'include_log'): options.include_log = _str_to_bool(val, optname) # Output options elif optname == 'name': options.prj_name = val elif optname == 'css': options.css = val elif optname == 'url': options.prj_url = val elif optname == 'link': options.prj_link = val elif optname == 'top': options.top_page = val elif optname == 'help': options.help_file = val elif optname =='frames': options.show_frames = _str_to_bool(val, optname) elif optname in ('separate-classes', 'separate_classes'): options.list_classes_separately = _str_to_bool(val, optname) # External API elif optname in ('external-api', 'external_api'): options.external_api.extend(val.replace(',', ' ').split()) elif optname in ('external-api-file', 'external_api_file'): options.external_api_file.append(val) elif optname in ('external-api-root', 'external_api_root'): options.external_api_root.append(val) # Graph options elif optname == 'graph': graphtypes = val.replace(',', '').split() for graphtype in graphtypes: if graphtype not in GRAPH_TYPES + ('all',): raise ValueError('"%s" expected one of: all, %s.' % (optname, ', '.join(GRAPH_TYPES))) options.graphs.extend(graphtypes) elif optname == 'dotpath': options.dotpath = val elif optname in ('graph-font', 'graph_font'): options.graph_font = val elif optname in ('graph-font-size', 'graph_font_size'): options.graph_font_size = _str_to_int(val) elif optname == 'pstat': options.pstat_files.extend(val.replace(',', ' ').split()) # Return value options elif optname in ('failon', 'fail-on', 'fail_on'): if val.lower.strip() in ('error', 'errors'): options.fail_on = log.ERROR elif val.lower.strip() in ('warning', 'warnings'): options.fail_on = log.WARNING elif val.lower.strip() in ('docstring_warning', 'docstring_warnings'): options.fail_on = log.DOCSTRING_WARNING else: raise ValueError("%r expected one of: error, warning, " "docstring_warning" % optname) else: raise ValueError('Unknown option %s' % optname)
11b8469663cc07a3cfa94ffba1c2ec2a64818ed7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3512/11b8469663cc07a3cfa94ffba1c2ec2a64818ed7/cli.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 1425, 2354, 12, 1425, 2354, 16, 702, 16, 1257, 4672, 642, 4288, 273, 25076, 18, 809, 2678, 1435, 468, 25076, 18, 896, 1435, 22274, 17868, 1334, 16, 1427, 1696, 326, 1390, 468, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 1425, 2354, 12, 1425, 2354, 16, 702, 16, 1257, 4672, 642, 4288, 273, 25076, 18, 809, 2678, 1435, 468, 25076, 18, 896, 1435, 22274, 17868, 1334, 16, 1427, 1696, 326, 1390, 468, ...
val = val.replace('\x00', '')
null_idx = val.find("\x00") if null_idx == -1: null_idx = len(val) val = val[0:null_idx]
def unpack(self, data): """ Return a dict with the unpacked data. """ self.__setup() unpacked = struct.unpack(self.format_string, data) output = {} for name, fs, start_index, end_index in self.full_struct_info: l = end_index-start_index if l == 1: val = unpacked[start_index] else: val = unpacked[start_index:end_index] if type(val) == str: val = val.replace('\x00', '') output[name] = val return output
e0a7b480ea7866ae4bb2adc5f4e0157e941d5634 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14571/e0a7b480ea7866ae4bb2adc5f4e0157e941d5634/struct_dict.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6167, 12, 2890, 16, 501, 4672, 3536, 2000, 279, 2065, 598, 326, 24195, 501, 18, 3536, 365, 16186, 8401, 1435, 24195, 273, 1958, 18, 17309, 12, 2890, 18, 2139, 67, 1080, 16, 501, 13, 87...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6167, 12, 2890, 16, 501, 4672, 3536, 2000, 279, 2065, 598, 326, 24195, 501, 18, 3536, 365, 16186, 8401, 1435, 24195, 273, 1958, 18, 17309, 12, 2890, 18, 2139, 67, 1080, 16, 501, 13, 87...
subject = "ALERT! "+ str(len(diff)) + " VOs reported by gratia from " + str(AccountingReports.gBegin) +" to " + str(AccountingReports.gEnd) + " are not in OIM."
subject = "ALERT! "+ str(len(diff)) + " VOs reporting to gratia were not found in OIM."
def compareVOs(argv=None): # get the list of vos reported by gratia gratia = AccountingReports.GetReportingVOs(AccountingReports.gBegin, AccountingReports.gEnd) # get the list of vos reported by oim oim = AccountingReports.GetListOfRegisteredVO(voType = 'active') excluded = ['unknown','other'] # What is in gratia that is not in oim diff = list(set(gratia) - set(oim) - set(excluded)) # Find out the sites that report these VOs. The code below creates a detailed formatted report. voStr="" # Construct the mysql query string using the conditions for VOnames like (VOName='zeus' or VOName='aceace') for vo in sorted(diff,key=str.lower): voStr+="VOName=\"" + vo + "\" or " voStr=re.compile("VOName=.*\"",re.IGNORECASE).search(voStr).group(0) # join query to find the list of sites that reported these VOs. See the voStr constructed above being used here query = "select T.SiteName, J.VOName from Site T, Probe P, VOProbeSummary J where (" + voStr + ") and P.siteid = T.siteid and J.ProbeName = P.probename and EndTime >= \"" + str(AccountingReports.gBegin) + "\" and EndTime < \"" + str(AccountingReports.gEnd) + "\" and J.ProbeName not like \"psacct:%\" group by J.VOName,T.SiteName order by lower(J.VOName),lower(T.SiteName);" # Run the query and get the results siteVO = AccountingReports.RunQueryAndSplit(query) # Title for the report message = "VO discrepancy between OIM and gratia from "+ str(AccountingReports.gBegin) +" to "+str(AccountingReports.gEnd) + "\n\n" #siteVO=[] # fake test to simulate a the else (All OK) condition # If one or more VOs matched this criteria, then create a formatted report if len(siteVO)!=0: subject = "ALERT! "+ str(len(diff)) + " VOs reported by gratia from " + str(AccountingReports.gBegin) +" to " + str(AccountingReports.gEnd) + " are not in OIM." # alerting header that could be caught by the wrapper script to alert in the subject line of the email message+=subject message+="\nListed below are these VOs along with the sites that reported them.\n" dashLen=59; # for decoration count=0 message+=dashLen*"-" + "\n" message+=(" %s |%5s%-20s|%5s %-20s|"%("# "," ","VO"," ","SITE"))+"\n" message+=dashLen*"-"+"\n" for entry in siteVO: count+=1 site = entry.split('\t')[0] vo = entry.split('\t')[1] if(count<10): message+=(" %d. |%5s%-20s|%5s %-20s|"%(count," ",vo," ",site))+"\n" else: message+=(" %d. |%5s%-20s|%5s %-20s|"%(count," ",vo," ",site))+"\n" message+=dashLen*"-"+"\n" # If no VO matched the criteria else: subject = "All OK! Gratia did not report any VOs not found in OIM for " + str(AccountingReports.gBegin) + " to " + str(AccountingReports.gEnd) # alerting header that could be caught by the wrapper script to alert in the subject line of the email message+=subject message+="\n\n" # What is in oim that is not in gratia - might indicate inactivity for that particular VO diff = list(set(oim) - set(gratia) - set(excluded)) if(len(diff) > 0): message+=str(len(diff)) + " VOs in OIM did not report to gratia. These VOs are listed below."+"\n\n" # sort VOs in the list alphabetically ignoring case count=0 for vo in sorted(diff,key=str.lower): count+=1 message+= vo + "; " if count%5==0: message+="\n" else: message+="All VOs in OIM have reported"+"\n" message+="\n" message+="\n" message = "<pre>" + message + "</pre>" content={} content['text'] = message content['html'] = message content['csv'] = str(None) AccountingReports.sendEmail( (['karthik'], ['karunach@nhn.ou.edu']), subject, content, None,None,'phyast.nhn.ou.edu')
18f59209b1eb9c75171cf9afeb73163acd3a94ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/637/18f59209b1eb9c75171cf9afeb73163acd3a94ac/compareVOs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3400, 58, 15112, 12, 19485, 33, 7036, 4672, 468, 336, 326, 666, 434, 331, 538, 14010, 635, 3821, 270, 1155, 3821, 270, 1155, 273, 6590, 310, 18631, 18, 967, 29285, 58, 15112, 12, 3032, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3400, 58, 15112, 12, 19485, 33, 7036, 4672, 468, 336, 326, 666, 434, 331, 538, 14010, 635, 3821, 270, 1155, 3821, 270, 1155, 273, 6590, 310, 18631, 18, 967, 29285, 58, 15112, 12, 3032, ...
item_x0 = content.x item_y0 = content.y
if content.align == 'center': item_x0 = content.x + (content.width - cols * hspace) / 2 else: item_x0 = content.x if content.valign == 'center': item_y0 = content.y + (content.height - rows * vspace) / 2 else: item_y0 = content.y
def update_content(self): """ update the listing area """
89d3a48576954c634545f1e0e240fa334f6245a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/89d3a48576954c634545f1e0e240fa334f6245a2/listing_area.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 1745, 12, 2890, 4672, 3536, 1089, 326, 11591, 5091, 3536, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1089, 67, 1745, 12, 2890, 4672, 3536, 1089, 326, 11591, 5091, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
raise DiscoError("Can't specify partitions without map")
self['nr_reduces'] = 0 elif 'partitions' in kwargs: raise DiscoError("Can't specify partitions without map") elif not ispartitioned and self['merge_partitions']: raise DiscoError("Can't merge non-partitioned inputs") elif ispartitioned and not self['merge_partitions']: self['nr_reduces'] = len(util.parse_dir(self['input'][0]))
def __init__(self, *args, **kwargs): super(JobDict, self).__init__(*args, **kwargs)
0e0fd15a8350d3c94f604b816a229d27a862dda4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/373/0e0fd15a8350d3c94f604b816a229d27a862dda4/core.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 16, 2826, 4333, 4672, 2240, 12, 2278, 5014, 16, 365, 2934, 972, 2738, 972, 30857, 1968, 16, 2826, 4333, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 16, 2826, 4333, 4672, 2240, 12, 2278, 5014, 16, 365, 2934, 972, 2738, 972, 30857, 1968, 16, 2826, 4333, 13, 2, -100, -100, -100, -100, -100, -...
except _RegError:
except RegError:
def get_msvc_paths (path, version='6.0', platform='x86'): """Get a list of devstudio directories (include, lib or path). Return a list of strings; will be empty list if unable to access the registry or appropriate registry keys not found.""" if not _can_read_reg: return [] L = [] if path=='lib': path= 'Library' path = string.upper(path + ' Dirs') K = ('Software\\Microsoft\\Devstudio\\%s\\' + 'Build System\\Components\\Platforms\\Win32 (%s)\\Directories') % \ (version,platform) for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS): try: k = _RegOpenKeyEx(base,K) i = 0 while 1: try: (p,v,t) = _RegEnumValue(k,i) if string.upper(p) == path: V = string.split(v,';') for v in V: if v == '' or v in L: continue L.append(v) break i = i + 1 except _RegError: break except _RegError: pass return L
2f60430e0909b2e5da8b0cca0f12721fa270d324 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2f60430e0909b2e5da8b0cca0f12721fa270d324/msvccompiler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 959, 4227, 67, 4481, 261, 803, 16, 1177, 2218, 26, 18, 20, 2187, 4072, 2218, 92, 5292, 11, 4672, 3536, 967, 279, 666, 434, 4461, 334, 4484, 6402, 261, 6702, 16, 2561, 578, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 959, 4227, 67, 4481, 261, 803, 16, 1177, 2218, 26, 18, 20, 2187, 4072, 2218, 92, 5292, 11, 4672, 3536, 967, 279, 666, 434, 4461, 334, 4484, 6402, 261, 6702, 16, 2561, 578, 5...
/.../release/RunChandler... --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --catsPerfLog=test_profile/time.log --scriptFile=tools/QATestScripts/Performance/PerfImportCalendar.py --create
/.../chandler... --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --catsPerfLog=test_profile/time.log --scriptFile=tools/QATestScripts/Performance/PerfImportCalendar.py --create
def runPerfTests(options, tests=None): """ Run the Performance Test Suite >>> options = parseOptions() >>> checkOptions(options) >>> options.dryrun = True >>> options.verbose = True >>> options.modes = ['debug'] >>> runPerfTests(options) Skipping Performance Tests - release mode not specified False >>> options.modes = ['release'] >>> runPerfTests(options) /.../release/RunChandler... --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --catsPerfLog=test_profile/time.log --scriptFile=tools/QATestScripts/Performance/PerfImportCalendar.py --create PerfImportCalendar.py 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | 0.00 ... 0.00 ... /.../release/RunChandler... --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --catsPerfLog=test_profile/time.log --scriptFile=tools/QATestScripts/Performance/PerfLargeDataResizeCalendar.py --restore=test_profile/__repository__.001 PerfLargeDataResizeCalendar.py 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | 0.00 ... 0.00 ... Creating repository for startup time tests ... Startup ... ... Creating repository for startup time tests ... Startup_with_large_calendar ... ... Showing performance log in 5 seconds, Ctrl+C to stop tests - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + False """ failed = False savePWD = os.getcwd() try: if 'release' in options.modes: delayedLogger = DelayedLogger() if not options.dryrun: os.chdir(options.chandlerHome) if tests is None: for item in glob.glob(os.path.join(options.profileDir, '__repository__.0*')): if os.path.isdir(item): build_lib.rmdirs(item) else: os.remove(item) testlist = [] testlistLarge = [] if tests is None: testlistStartup = ['startup', 'startup_large'] for item in glob.glob(os.path.join(options.chandlerHome, 'tools', 'QATestScripts', 'Performance', 'Perf*.py')): if 'PerfLargeData' in item: testlistLarge.append(item) else: testlist.append(item) else: testlistStartup = [] for item in tests: if 'PerfLargeData' in item: testlistLarge.append(item) elif item in ('startup', 'startup_large'): testlistStartup.append(item) else: testlist.append(item) repeat = 1 if options.tbox: repeat = 3 elif options.repeat: repeat = options.repeat # small repo tests if testlist: failed = runScriptPerfTests(options, testlist, repeat=repeat, logger=delayedLogger) # large repo tests if testlistLarge and (not failed or options.noStop): if runScriptPerfTests(options, testlistLarge, largeData=True, repeat=repeat, logger=delayedLogger): failed = True # startup tests if testlistStartup and (not failed or options.noStop): if os.name == 'nt' or sys.platform == 'cygwin': t = build_lib.getCommand(['which', 'time.exe']) if not t: log('time.exe not found, skipping startup performance tests') elif sys.platform == 'darwin': t = build_lib.getCommand(['which', 'gtime']) if t.startswith("no gtime"): log('gtime not found, skipping startup performance tests') log('NOTE: gtime is not part of OS X, you need to compile one' + \ 'yourself (get source from http://directory.fsf.org/time.html)' + \ 'or get it from darwinports project.') else: t = '/usr/bin/time' if os.path.isfile(t): if 'startup' in testlistStartup and runStartupPerfTests(options, t, repeat=repeat, logger=delayedLogger): failed = True if not failed: # Don't continue even if noStop, almost certain these won't work if 'startup_large' in testlistStartup and runStartupPerfTests(options, t, largeData=True, repeat=repeat, logger=delayedLogger): failed = True else: log('time command not found, skipping startup performance tests') if not tests: log('Showing performance log in 5 seconds, Ctrl+C to stop tests') if not options.dryrun: try: time.sleep(5) except KeyboardInterrupt: sys.exit(0) log('- + ' * 15) delayedLogger.logAll() else: log('Skipping Performance Tests - release mode not specified') finally: os.chdir(savePWD) return failed
2268248f0e4728b63ca1842648cbad866d679472 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/2268248f0e4728b63ca1842648cbad866d679472/rt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 22016, 14650, 12, 2116, 16, 7434, 33, 7036, 4672, 3536, 1939, 326, 11217, 1359, 7766, 348, 9519, 225, 4080, 702, 273, 1109, 1320, 1435, 4080, 866, 1320, 12, 2116, 13, 4080, 702, 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, 1086, 22016, 14650, 12, 2116, 16, 7434, 33, 7036, 4672, 3536, 1939, 326, 11217, 1359, 7766, 348, 9519, 225, 4080, 702, 273, 1109, 1320, 1435, 4080, 866, 1320, 12, 2116, 13, 4080, 702, 18...
assert self.count
assert self.count > 0
def pop(self): """reduce count by 1""" assert self.count self.count -= 1 if not self.count: self.hide()
13f3881b22585b4afca5955a50ab9791a11df14a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1679/13f3881b22585b4afca5955a50ab9791a11df14a/board.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1843, 12, 2890, 4672, 3536, 12498, 1056, 635, 404, 8395, 1815, 365, 18, 1883, 405, 374, 365, 18, 1883, 3947, 404, 309, 486, 365, 18, 1883, 30, 365, 18, 11248, 1435, 2, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1843, 12, 2890, 4672, 3536, 12498, 1056, 635, 404, 8395, 1815, 365, 18, 1883, 405, 374, 365, 18, 1883, 3947, 404, 309, 486, 365, 18, 1883, 30, 365, 18, 11248, 1435, 2, -100, -100, -100...
files = popenx(cmdline, 'b') fi = files[0] fo = files[1] if self.have_popen3: fe = files[2]
files = subprocess.Popen(cmdline, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE )
def run_cgi(self): """Execute a CGI script.""" path = self.path dir, rest = self.cgi_info
e868b2a04ca14a7ea789345b2efec716cf34bfd1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/e868b2a04ca14a7ea789345b2efec716cf34bfd1/CGIHTTPServer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 19062, 12, 2890, 4672, 3536, 5289, 279, 385, 13797, 2728, 12123, 589, 273, 365, 18, 803, 1577, 16, 3127, 273, 365, 18, 19062, 67, 1376, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 19062, 12, 2890, 4672, 3536, 5289, 279, 385, 13797, 2728, 12123, 589, 273, 365, 18, 803, 1577, 16, 3127, 273, 365, 18, 19062, 67, 1376, 2, -100, -100, -100, -100, -100, -100, ...
def handle_endtag(self, tag):
def handle_endtag(self, tagname):
def handle_endtag(self, tag): if self._data: self._flush() # prevent duplicate end-tags if the HTML is malformed if tagname.lower() not in self._forbidden_end_elements: self.append(('end-tag', tag))
d5d161310c1788fa1de153f8f6fa201d88401858 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14078/d5d161310c1788fa1de153f8f6fa201d88401858/treecompare.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 409, 2692, 12, 2890, 16, 25586, 4672, 309, 365, 6315, 892, 30, 365, 6315, 11330, 1435, 468, 5309, 6751, 679, 17, 4156, 309, 326, 3982, 353, 17458, 309, 25586, 18, 8167, 1435, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 409, 2692, 12, 2890, 16, 25586, 4672, 309, 365, 6315, 892, 30, 365, 6315, 11330, 1435, 468, 5309, 6751, 679, 17, 4156, 309, 326, 3982, 353, 17458, 309, 25586, 18, 8167, 1435, ...
def convert_result_value(self, value): print "RESULT", value
def convert_result_value(self, value, engine):
def convert_result_value(self, value): print "RESULT", value if value is None: print "RETNONE" return None print "HI" parts = value.split('.') try: (value, microsecond) = value.split('.') microsecond = int(microsecond) except ValueError: (value, microsecond) = (value, 0) tup = time.strptime(value, "%Y-%m-%d %H:%M:%S") return datetime.datetime(microsecond=microsecond, *tup[0:6])
ad7938a8e0c2b0d57954b7d5ec1e0b2ad9552625 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1074/ad7938a8e0c2b0d57954b7d5ec1e0b2ad9552625/sqlite.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 67, 2088, 67, 1132, 12, 2890, 16, 460, 16, 4073, 4672, 309, 460, 353, 599, 30, 1172, 315, 10238, 9826, 6, 327, 599, 1172, 315, 29994, 6, 2140, 273, 460, 18, 4939, 2668, 1093, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 67, 2088, 67, 1132, 12, 2890, 16, 460, 16, 4073, 4672, 309, 460, 353, 599, 30, 1172, 315, 10238, 9826, 6, 327, 599, 1172, 315, 29994, 6, 2140, 273, 460, 18, 4939, 2668, 1093, 1...
def AddChildNode (self, data, names, hasChildren):
def AddChildNode (self, item, names, hasChildren):
def AddChildNode (self, data, names, hasChildren): childNodeId = self.treeList.AppendItem (self.nodeId, names.pop(0), -1, -1, wxTreeItemData (data)) index = 1 for name in names: self.treeList.SetItemText (childNodeId, name, index) index += 1
538d775ef0987b49832bb1a2e5975c7da5efc900 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/538d775ef0987b49832bb1a2e5975c7da5efc900/ContainerBlocks.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1436, 25550, 261, 2890, 16, 761, 16, 1257, 16, 27780, 4672, 9465, 548, 273, 365, 18, 3413, 682, 18, 5736, 1180, 261, 2890, 18, 2159, 548, 16, 1257, 18, 5120, 12, 20, 3631, 300, 21, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1436, 25550, 261, 2890, 16, 761, 16, 1257, 16, 27780, 4672, 9465, 548, 273, 365, 18, 3413, 682, 18, 5736, 1180, 261, 2890, 18, 2159, 548, 16, 1257, 18, 5120, 12, 20, 3631, 300, 21, 1...
self.db = MySQLdb.connect(user=dbconn['user'], host=dbconn['host'], passwd=dbconn['pass'], db=dbconn['name'])
self.db = MySQLdb.connect(user=dbconn['user'], host=dbconn['host'], passwd=dbconn['pass'], db=dbconn['name'], use_unicode=True, charset='utf8')
def __init__(self, args=None): # Setup connection variables dbconn = { 'host' : None, 'name' : None, 'user' : None, 'pass' : None }
53abf494e48624e0682025712a4b94e181a3211f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/53abf494e48624e0682025712a4b94e181a3211f/MythDB.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 833, 33, 7036, 4672, 468, 10939, 1459, 3152, 1319, 4646, 273, 288, 296, 2564, 11, 294, 599, 16, 296, 529, 11, 294, 599, 16, 296, 1355, 11, 294, 599, 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, 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, 833, 33, 7036, 4672, 468, 10939, 1459, 3152, 1319, 4646, 273, 288, 296, 2564, 11, 294, 599, 16, 296, 529, 11, 294, 599, 16, 296, 1355, 11, 294, 599, 16...
return self.fn( scope, obj, *args )
ret = self.fn( scope, obj, *args ) return ret
def call( self, scope, obj, *args ): # implicitly eval's the args args = [ i.message(scope,'eval') for i in args ] return self.fn( scope, obj, *args )
c3eb52f34e4ae8a3d76b6dff2c5623c696aa6160 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10358/c3eb52f34e4ae8a3d76b6dff2c5623c696aa6160/yalie.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 745, 12, 365, 16, 2146, 16, 1081, 16, 380, 1968, 262, 30, 468, 24682, 5302, 1807, 326, 833, 833, 273, 306, 277, 18, 2150, 12, 4887, 11189, 8622, 6134, 364, 277, 316, 833, 308, 327, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 745, 12, 365, 16, 2146, 16, 1081, 16, 380, 1968, 262, 30, 468, 24682, 5302, 1807, 326, 833, 833, 273, 306, 277, 18, 2150, 12, 4887, 11189, 8622, 6134, 364, 277, 316, 833, 308, 327, 3...
log.append(date, author, description, rcs_file, revision, my_tags)
log.append((date, author, description, rcs_file, revision, my_tags))
def BuildLog(log_date_command): import os, regex, string reading_description = 0 reading_tags = 0 description = [] log = [] tag_pattern = regex.compile("^ \([^:]+\): \([0-9.]+\)\n$") for line in os.popen(log_date_command, 'r').readlines(): if line[:5] == '=====' or line[:5] == '-----': if description != []: try: my_tags = tags[revision] except KeyError: my_tags = [] log.append(date, author, description, rcs_file, revision, my_tags) reading_description = 0 description = [] continue if reading_description: description.append(line) continue if reading_tags: if tag_pattern.match(line) > 0: tag = tag_pattern.group(1) revs = string.splitfields(tag_pattern.group(2), ", ") for rev in revs: try: tags[rev].append(tag) except KeyError: tags[rev] = [tag] continue reading_tags = 0 if line[:len("Working file: ")] == "Working file: ": rcs_file = line[len("Working file: "):-1] tags = {} elif line[:len("revision ")] == "revision ": revision = line[len("revision "):-1] elif line[:len("date: ")] == "date: ": (dd, aa, ss, ll) = string.splitfields(line, ';') (discard, date) = string.splitfields(dd, ': ') (discard, author) = string.splitfields(aa, ': ') reading_description = 1 elif line[:len("symbolic names:")] == "symbolic names:": reading_tags = 1 return log
0efad460e369a3875f52aca56f3cc6b82da39a69 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/675/0efad460e369a3875f52aca56f3cc6b82da39a69/cvs2hist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3998, 1343, 12, 1330, 67, 712, 67, 3076, 4672, 1930, 1140, 16, 3936, 16, 533, 225, 6453, 67, 3384, 273, 374, 6453, 67, 4156, 273, 374, 2477, 273, 5378, 613, 273, 5378, 1047, 67, 4951, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3998, 1343, 12, 1330, 67, 712, 67, 3076, 4672, 1930, 1140, 16, 3936, 16, 533, 225, 6453, 67, 3384, 273, 374, 6453, 67, 4156, 273, 374, 2477, 273, 5378, 613, 273, 5378, 1047, 67, 4951, ...
es.msg(Player(attackerid).weapon)
def player_death(event_var): victimid = int(event_var['userid']) attackerid = int(event_var['attacker']) # Make sure it wasn't a suicide if attackerid == 0: return # Make sure it wasn't a teamkill if event_var['es_attackerteam'] == event_var['es_userteam']: return # Is this player on nade level? es.msg(Player(attackerid).weapon) if Player(attackerid).weapon == 'hegrenade': # Make sure the player didn't kill with an hegrenade if event_var['weapon'] == 'weapon_hegrenade': return # Are we in warmup? if int(es.ServerVar("gg_warmup_round")) > 0 : return # Give them another grenade giveGrenade(attackerid)
02bcdbb8b66cf0e500b0c3634d946de65d291565 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4555/02bcdbb8b66cf0e500b0c3634d946de65d291565/gg_earn_nade.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7291, 67, 323, 421, 12, 2575, 67, 1401, 4672, 225, 28873, 381, 350, 273, 509, 12, 2575, 67, 1401, 3292, 8339, 19486, 13843, 264, 350, 273, 509, 12, 2575, 67, 1401, 3292, 4558, 484, 264...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7291, 67, 323, 421, 12, 2575, 67, 1401, 4672, 225, 28873, 381, 350, 273, 509, 12, 2575, 67, 1401, 3292, 8339, 19486, 13843, 264, 350, 273, 509, 12, 2575, 67, 1401, 3292, 4558, 484, 264...
def setRenderWindowHeight(self,height):
def setRenderWindowHeight(self, height):
def setRenderWindowHeight(self,height): """ Sets the render window height
8b37908045cf0e13ee80799183f0dbb1043c4f9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8476/8b37908045cf0e13ee80799183f0dbb1043c4f9e/renderer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 3420, 3829, 2686, 12, 2890, 16, 2072, 4672, 3536, 11511, 326, 1743, 2742, 2072, 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, 444, 3420, 3829, 2686, 12, 2890, 16, 2072, 4672, 3536, 11511, 326, 1743, 2742, 2072, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
' bb ' : ' reportnumber:', ' bbn ' : ' reportnumber:', ' bull ' : ' reportnumber:', ' bulletin-bd ' : ' reportnumber:', ' bulletin-bd-no ' : ' reportnumber:', ' eprint ' : ' reportnumber:',
'bb' : 'reportnumber:', 'bbn' : 'reportnumber:', 'bull' : 'reportnumber:', 'bulletin-bd' : 'reportnumber:', 'bulletin-bd-no' : 'reportnumber:', 'eprint' : 'reportnumber:',
def __init__(self, message): """Initialization.""" self.message = message
855acf1f403f93dbc03543809cdbbd3d0c4c46af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/855acf1f403f93dbc03543809cdbbd3d0c4c46af/search_engine_query_parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 883, 4672, 3536, 17701, 12123, 365, 18, 2150, 273, 883, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 883, 4672, 3536, 17701, 12123, 365, 18, 2150, 273, 883, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
name, address = address.split(u'<')
name = address[:index] address = address[index+1:]
def getEmailAddress(cls, view, nameOrAddressString, fullName=u'', create=True): """ Factory Method -------------- When creating a new EmailAddress, we check for an existing item first. We do look them up in the repository to prevent duplicates, but there's nothing to keep bad ones from accumulating, although repository garbage collection should eventually remove them.
4226215c87ccbcd1fc1ec354332468d0928d69ee /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9228/4226215c87ccbcd1fc1ec354332468d0928d69ee/mail.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17297, 1887, 12, 6429, 16, 1476, 16, 26840, 1887, 780, 16, 12424, 33, 89, 11, 2187, 752, 33, 5510, 4672, 3536, 7822, 2985, 300, 16982, 5203, 4979, 279, 394, 8166, 1887, 16, 732, 866, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17297, 1887, 12, 6429, 16, 1476, 16, 26840, 1887, 780, 16, 12424, 33, 89, 11, 2187, 752, 33, 5510, 4672, 3536, 7822, 2985, 300, 16982, 5203, 4979, 279, 394, 8166, 1887, 16, 732, 866, 3...
sys.argv[0] = "/foo/bar/baz.py" parser = OptionParser("usage: %prog ...", version="%prog 1.2") expected_usage = "usage: baz.py ...\n" self.assertUsage(parser, expected_usage) self.assertVersion(parser, "baz.py 1.2") self.assertHelp(parser, expected_usage + "\n" + "options:\n" " --version show program's version number and exit\n" " -h, --help show this help message and exit\n")
save_argv = sys.argv[:] try: sys.argv[0] = "/foo/bar/baz.py" parser = OptionParser("usage: %prog ...", version="%prog 1.2") expected_usage = "usage: baz.py ...\n" self.assertUsage(parser, expected_usage) self.assertVersion(parser, "baz.py 1.2") self.assertHelp(parser, expected_usage + "\n" + "options:\n" " --version show program's version number and exit\n" " -h, --help show this help message and exit\n") finally: sys.argv[:] = save_argv
def test_default_progname(self): # Make sure that program name taken from sys.argv[0] by default. sys.argv[0] = "/foo/bar/baz.py" parser = OptionParser("usage: %prog ...", version="%prog 1.2") expected_usage = "usage: baz.py ...\n" self.assertUsage(parser, expected_usage) self.assertVersion(parser, "baz.py 1.2") self.assertHelp(parser, expected_usage + "\n" + "options:\n" " --version show program's version number and exit\n" " -h, --help show this help message and exit\n")
c0a05538975d90418acf7315c3002f8af7498aef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/c0a05538975d90418acf7315c3002f8af7498aef/test_optparse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1886, 67, 14654, 529, 12, 2890, 4672, 468, 4344, 3071, 716, 5402, 508, 9830, 628, 2589, 18, 19485, 63, 20, 65, 635, 805, 18, 2589, 18, 19485, 63, 20, 65, 273, 2206, 11351, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1886, 67, 14654, 529, 12, 2890, 4672, 468, 4344, 3071, 716, 5402, 508, 9830, 628, 2589, 18, 19485, 63, 20, 65, 635, 805, 18, 2589, 18, 19485, 63, 20, 65, 273, 2206, 11351, ...
else
else:
def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 95) else quickfix.IntField.__init__(self, 95, data)
484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 13, 309, 501, 422, 599, 30, 9549, 904, 18, 1702, 974, 16186, 2738, 972, 12, 2890, 16, 16848, 13, 469, 30, 9549, 904, 18, 1702, 974, 16186, 2738, 9...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1001, 2738, 972, 12, 892, 273, 599, 13, 309, 501, 422, 599, 30, 9549, 904, 18, 1702, 974, 16186, 2738, 972, 12, 2890, 16, 16848, 13, 469, 30, 9549, 904, 18, 1702, 974, 16186, 2738, 9...
@param skin_name: Skin name as its on properties tab of portal_skins
@param skin_name: Skin name as its on properties tab of portal_skins
def check_skin_exists(site, skin_name): """ Check that skin exists on the site and is usable. @param skin_name: Skin name as its on properties tab of portal_skins """ portal_skins = site.portal_skins # ['Plone Default'] available = portal_skins.getSkinSelections() return skin_name in available
96ab5b60f3acc0d0bb8d77001d241b0fe2136956 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10164/96ab5b60f3acc0d0bb8d77001d241b0fe2136956/monkeypatch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 7771, 267, 67, 1808, 12, 4256, 16, 18705, 67, 529, 4672, 3536, 2073, 716, 18705, 1704, 603, 326, 2834, 471, 353, 15603, 18, 225, 632, 891, 18705, 67, 529, 30, 10362, 267, 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, 866, 67, 7771, 267, 67, 1808, 12, 4256, 16, 18705, 67, 529, 4672, 3536, 2073, 716, 18705, 1704, 603, 326, 2834, 471, 353, 15603, 18, 225, 632, 891, 18705, 67, 529, 30, 10362, 267, 508,...
self.box1.pack_end(fo)
self.box1.pack_start(fo)
def createView(self): self.gsmsc = GSMstateContener(self.dbus) self.box1 = elementary.Box(self.window)
005284460c03576dc7de0b640b1916e6c28325ea /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11428/005284460c03576dc7de0b640b1916e6c28325ea/shr_gsm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15193, 12, 2890, 4672, 225, 365, 18, 564, 959, 71, 273, 611, 7303, 2019, 660, 708, 12, 2890, 18, 1966, 407, 13, 225, 365, 18, 2147, 21, 273, 930, 814, 18, 3514, 12, 2890, 18, 5668, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15193, 12, 2890, 4672, 225, 365, 18, 564, 959, 71, 273, 611, 7303, 2019, 660, 708, 12, 2890, 18, 1966, 407, 13, 225, 365, 18, 2147, 21, 273, 930, 814, 18, 3514, 12, 2890, 18, 5668, ...
self.umask = string.atoi(cp.get("daemon", "umask"), 8)
self.umask = string.atoi(cp.get("daemon", "umask"), 8)
def setup(self, config_file): # Load configuration file cp = MMCConfigParser() cp.read(config_file)
09d50ab583efe4bb5bf42b1fc73409225838b094 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5988/09d50ab583efe4bb5bf42b1fc73409225838b094/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 12, 2890, 16, 642, 67, 768, 4672, 468, 4444, 1664, 585, 3283, 273, 18295, 39, 809, 2678, 1435, 3283, 18, 896, 12, 1425, 67, 768, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 12, 2890, 16, 642, 67, 768, 4672, 468, 4444, 1664, 585, 3283, 273, 18295, 39, 809, 2678, 1435, 3283, 18, 896, 12, 1425, 67, 768, 13, 2, -100, -100, -100, -100, -100, -100, -100, ...
self._increment_running_processes()
if self._process_started(): self._increment_running_processes()
def _try_starting_process(self): if not self._can_run_new_process(): return
5850742fcf1692fdfb85aff27f14191f83006de4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12268/5850742fcf1692fdfb85aff27f14191f83006de4/monitor_db.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 698, 67, 18526, 67, 2567, 12, 2890, 4672, 309, 486, 365, 6315, 4169, 67, 2681, 67, 2704, 67, 2567, 13332, 327, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 698, 67, 18526, 67, 2567, 12, 2890, 4672, 309, 486, 365, 6315, 4169, 67, 2681, 67, 2704, 67, 2567, 13332, 327, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
def dbus_typesig_to_type_string(type_char): type_char = str(type_char) if type_char == 'i': return "sint" if type_char == 'u': return "uint" if type_char == 'y': return "char" if type_char == 's': return "str" if type_char == 'b': return "bool"
def dbus_typesig_to_type_string(type_char): type_char = str(type_char) if type_char == 'i': return "sint" if type_char == 'u': return "uint" if type_char == 'y': return "char" if type_char == 's': return "str" if type_char == 'b': return "bool"
ce89a5046907a6798daa83b3557cd89f2f05c50e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11701/ce89a5046907a6798daa83b3557cd89f2f05c50e/jack_configure.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21866, 67, 2352, 360, 67, 869, 67, 723, 67, 1080, 12, 723, 67, 3001, 4672, 618, 67, 3001, 273, 609, 12, 723, 67, 3001, 13, 309, 618, 67, 3001, 422, 296, 77, 4278, 327, 315, 87, 474...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21866, 67, 2352, 360, 67, 869, 67, 723, 67, 1080, 12, 723, 67, 3001, 4672, 618, 67, 3001, 273, 609, 12, 723, 67, 3001, 13, 309, 618, 67, 3001, 422, 296, 77, 4278, 327, 315, 87, 474...
return p_id.translate(TRANSMAP)
if isinstance(p_id, unicode): x = p_id.encode('utf-8') else: x = str(p_id) return x.translate(TRANSMAP)
def utCleanupId(self, p_id=''): """ """ return p_id.translate(TRANSMAP)
ed94fbebef73e9a79236afd3531b45cf91475714 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3287/ed94fbebef73e9a79236afd3531b45cf91475714/utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5218, 15007, 548, 12, 2890, 16, 293, 67, 350, 2218, 11, 4672, 3536, 3536, 327, 293, 67, 350, 18, 13929, 12, 8989, 7303, 2203, 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, 5218, 15007, 548, 12, 2890, 16, 293, 67, 350, 2218, 11, 4672, 3536, 3536, 327, 293, 67, 350, 18, 13929, 12, 8989, 7303, 2203, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -10...
newbucket = Bucket(calendar=self, startdate=start, value=value) newbucket.save() newbucket = Bucket(calendar=self, startdate=end, value=b.value) newbucket.save()
Bucket(calendar=self, startdate=start, value=value).save() Bucket(calendar=self, startdate=end, value=b.value).save()
def setvalue(self, start, end, value, user=None): '''Update calendar buckets such that the calendar value is changed in the specified date range. The admin log is updated if a user is passed as argument. ''' # Create a change log entry, if a user is specified if user: global CALENDARID if not CALENDARID: CALENDARID = ContentType.objects.get_for_model(models.get_model('input','calendar')).id LogEntry.objects.log_action( user.id, CALENDARID, self.name, self.name, CHANGE, "Updated value to %s for the daterange %s to %s" % (value, start, end) ) for b in self.buckets.all(): if b.enddate <= start: # Earlier bucket continue elif b.startdate >= end: # Later bucket return elif b.startdate == start and b.enddate <= end: # Overwrite entire bucket b.value = value b.save() elif b.startdate >= start and b.enddate <= end: # Bucket became redundant b.delete() elif b.startdate < start and b.enddate > end: # New value is completely within this bucket newbucket = Bucket(calendar=self, startdate=start, value=value) newbucket.save() newbucket = Bucket(calendar=self, startdate=end, value=b.value) newbucket.save() elif b.startdate < start: # An existing bucket is partially before the new daterange newbucket = Bucket(calendar=self, startdate=start, value=value) newbucket.save() elif b.enddate > end: # An existing bucket is partially after the new daterange newbucket = Bucket(calendar=self, startdate=b.startdate, value=value) newbucket.save() b.startdate = end b.save() return
d2095577795f63005c897c11277c19930f5fddda /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8604/d2095577795f63005c897c11277c19930f5fddda/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 1132, 12, 2890, 16, 787, 16, 679, 16, 460, 16, 729, 33, 7036, 4672, 9163, 1891, 5686, 9169, 4123, 716, 326, 5686, 460, 353, 3550, 316, 326, 1269, 1509, 1048, 18, 1021, 3981, 613, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1132, 12, 2890, 16, 787, 16, 679, 16, 460, 16, 729, 33, 7036, 4672, 9163, 1891, 5686, 9169, 4123, 716, 326, 5686, 460, 353, 3550, 316, 326, 1269, 1509, 1048, 18, 1021, 3981, 613, ...
"log_file", "log_level", "logdir", ]
"log_file", "log_level"]
def test_installation(request): """ This function gets called when someone starts up pyblosxom.cgi from the command line with no REQUEST_METHOD environment variable. It: 1. tests properties in their config.py file 2. verifies they have a datadir and that it exists 3. initializes all the plugins they have installed 4. runs "cb_verify_installation"--plugins can print out whether they are installed correctly (i.e. have valid config property settings and can read/write to data files) 5. exits The goal is to be as useful and informative to the user as we can be without being overly verbose and confusing. This is designed to make it much much much easier for a user to verify their PyBlosxom installation is working and also to install new plugins and verify that their configuration is correct. @param request: the Request object @type request: object """ config = request.config # BASE STUFF print "Welcome to PyBlosxom's installation verification system." print "------" print "]] printing diagnostics [[" print "pyblosxom: %s" % VERSION_DATE print "sys.version: %s" % sys.version.replace("\n", " ") print "os.name: %s" % os.name print "codebase: %s" % config.get("codebase", "--default--") print "------" # CONFIG FILE print "]] checking config file [[" print "config has %s properties set." % len(config) print "" # these are required by the blog required_config = ["datadir"] # these are nice to have optional properties nice_to_have_config = ["blog_title", "blog_author", "blog_description", "blog_language", "blog_encoding", "blog_icbm", "base_url", "depth", "num_entries", "renderer", "plugin_dirs", "load_plugins", "blog_email", "blog_rights", "default_flavour", "flavourdir", "log_file", "log_level", "logdir", ] config_keys = config.keys() # remove keys that are auto-generated config_keys.remove("pyblosxom_version") config_keys.remove("pyblosxom_name") missing_required_props = [] missing_optionsal_props = [] missing_required_props = [m for m in required_config if m not in config_keys] missing_optional_props = [m for m in nice_to_have_config if m not in config_keys] all_keys = nice_to_have_config + required_config config_keys = [m for m in config_keys if m not in all_keys] def wrappify(ks): ks.sort() if len(ks) == 1: return " %s" % ks[0] elif len(ks) == 2: return " %s and %s" % (ks[0], ks[1]) ks = ", ".join(ks[:-1]) + " and " + ks[-1] import textwrap return " " + "\n ".join( textwrap.wrap(ks, 72) ) if missing_required_props: print "" print "Missing properties must be set in order for your blog to" print "work." print "" print wrappify(missing_required_props) print "" print "This must be done before we can go further. Exiting." return if missing_optional_props: print "" print "You're missing optional properties. These are not required, " print "but some of them may interest you. Refer to the documentation " print "for more information." print "" print wrappify(missing_optional_props) if config_keys: print "" print "These are properties PyBlosxom doesn't know about. They " print "could be used by plugins or could be ones you've added." print "Remove them if you know they're not used." print "" print wrappify(config_keys) print "" print "PASS: config file is fine." print "------" print "]] checking datadir [[" # DATADIR if not os.path.isdir(config["datadir"]): print "datadir '%s' does not exist." % config["datadir"] print "You need to create your datadir and give it appropriate" print "permissions." print "" print "This must be done before we can go further. Exiting." return print "PASS: datadir is there." print " Note: this does NOT check whether your webserver has " print " permissions to view files therein!" print "------" print "Now we're going to verify your plugin configuration." if "plugin_dirs" in config: plugin_utils.initialize_plugins(config["plugin_dirs"], config.get("load_plugins", None)) no_verification_support = [] for mem in plugin_utils.plugins: if hasattr(mem, "verify_installation"): print "=== plugin: '%s'" % mem.__name__ print " file: %s" % mem.__file__ print " version: %s" % (str(getattr(mem, "__version__"))) try: if mem.verify_installation(request) == 1: print " PASS" else: print " FAIL!!!" except AssertionError, error_message: print " FAIL!!! ", error_message else: mn = mem.__name__ mf = mem.__file__ no_verification_support.append( "'%s' (%s)" % (mn, mf)) if len(no_verification_support) > 0: print "" print "The following plugins do not support installation " + \ "verification:" for mem in no_verification_support: print " %s" % mem else: print "You have chosen not to load any plugins."
968d7609e94abfe313dd71771797523b41a87464 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11836/968d7609e94abfe313dd71771797523b41a87464/pyblosxom.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5425, 367, 12, 2293, 4672, 3536, 1220, 445, 5571, 2566, 1347, 18626, 2542, 731, 2395, 70, 383, 30319, 362, 18, 19062, 628, 326, 1296, 980, 598, 1158, 12492, 67, 5327, 3330, 219...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5425, 367, 12, 2293, 4672, 3536, 1220, 445, 5571, 2566, 1347, 18626, 2542, 731, 2395, 70, 383, 30319, 362, 18, 19062, 628, 326, 1296, 980, 598, 1158, 12492, 67, 5327, 3330, 219...
day += 1 date += 1
day_of_week += 1 daynumber += 1 try: date = DateTime(year, month, daynumber) except DateTime.DateError: daynumber = 1 year, month = getNextYearMonth( year, month) date = DateTime(year, month, daynumber)
def update(self): context = aq_inner(self.context) request = self.request weeklist = [] # Start at first day of the week # With the DateTime.week() method Monday is considered the first day. date = self.startDate - self.startDate.dow() + 1 # Assemble info for at most one month: while date.month() <= self.month and date.year() <= self.year: weekinfo = dict( week_number = date.week(), week_start = context.restrictedTraverse('@@plone').toLocalizedTime(date), ) # Start the week cleanly day = 0 daylist = [] raw_total = 0.0 while day < 7: opts = dict(date=date, memberid=self.memberid) days_bookings = DayBookingOverview(context, request, **opts) if days_bookings.raw_total > 0: daylist.append(dict(total=days_bookings.total, day_of_week=date.Day())) else: daylist.append(dict(total=None, day_of_week=date.Day())) raw_total += days_bookings.raw_total day += 1 date += 1 # Add the info to the dict for this week weekinfo['days'] = daylist weekinfo['week_total'] = formatTime(raw_total) self.bookinglist.append(weekinfo) # update month total self.raw_total += raw_total
9a7fdb1d058742097a7227daa51983b5e844d8e0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10431/9a7fdb1d058742097a7227daa51983b5e844d8e0/bookings.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 2890, 4672, 819, 273, 279, 85, 67, 7872, 12, 2890, 18, 2472, 13, 590, 273, 365, 18, 2293, 4860, 1098, 273, 5378, 468, 3603, 622, 1122, 2548, 434, 326, 4860, 468, 3423, 326, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 2890, 4672, 819, 273, 279, 85, 67, 7872, 12, 2890, 18, 2472, 13, 590, 273, 365, 18, 2293, 4860, 1098, 273, 5378, 468, 3603, 622, 1122, 2548, 434, 326, 4860, 468, 3423, 326, ...
if self._max is not None and result > self._max:
if self.max is not None and result > self.max:
def __call__(self, value): result = int(value) if self._min is not None and result < self._min: raise ValueError if self._max is not None and result > self._max: raise ValueError
db9e338070a398a192079704b923bdad2df996f2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3688/db9e338070a398a192079704b923bdad2df996f2/cli_framework.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 460, 4672, 563, 273, 509, 12, 1132, 13, 309, 365, 6315, 1154, 353, 486, 599, 471, 563, 411, 365, 6315, 1154, 30, 1002, 2068, 309, 365, 18, 1896, 353, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 460, 4672, 563, 273, 509, 12, 1132, 13, 309, 365, 6315, 1154, 353, 486, 599, 471, 563, 411, 365, 6315, 1154, 30, 1002, 2068, 309, 365, 18, 1896, 353, 4...
ws_key = raw_input('Please enter your worksheet key: ')
ws_key = raw_input('Please enter your worksheet key (usually od6): ')
def testWorksheetCRUD(self): # Add a new worksheet. new_worksheet = self.gd_client.AddWorksheet('worksheet_title_test_12', '2', 3, self.key) self.assertEquals(new_worksheet.col_count.text, '3') self.assertEquals(new_worksheet.row_count.text, '2') self.assertEquals(new_worksheet.title.text, 'worksheet_title_test_12')
a62bf3a7ebe3ce569f090a6ce6342b042b7278af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6580/a62bf3a7ebe3ce569f090a6ce6342b042b7278af/service_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 14105, 5093, 12587, 12, 2890, 4672, 468, 1436, 279, 394, 13622, 18, 394, 67, 1252, 8118, 273, 365, 18, 19016, 67, 2625, 18, 986, 14105, 2668, 1252, 8118, 67, 2649, 67, 3813, 67, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 14105, 5093, 12587, 12, 2890, 4672, 468, 1436, 279, 394, 13622, 18, 394, 67, 1252, 8118, 273, 365, 18, 19016, 67, 2625, 18, 986, 14105, 2668, 1252, 8118, 67, 2649, 67, 3813, 67, ...
return [Seq(chunk, self.alphabet) \ for chunk in str(self).rsplit(sep_str, maxsplit)]
try : return [Seq(part, self.alphabet) \ for part in str(self).rsplit(sep_str, maxsplit)] except AttributeError : words = [Seq(word[::-1], self.alphabet) for word \ in str(self)[::-1].split(sep_str[::-1], maxsplit)] words.reverse() return words
def rsplit(self, sep=None, maxsplit=-1) : """Right split method, like that of a python string.
a53527ae22db24937c6f782659733fc20e24291c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7167/a53527ae22db24937c6f782659733fc20e24291c/Seq.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17406, 12, 2890, 16, 5478, 33, 7036, 16, 943, 4939, 29711, 21, 13, 294, 3536, 4726, 1416, 707, 16, 3007, 716, 434, 279, 5790, 533, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17406, 12, 2890, 16, 5478, 33, 7036, 16, 943, 4939, 29711, 21, 13, 294, 3536, 4726, 1416, 707, 16, 3007, 716, 434, 279, 5790, 533, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100...
rv = {}
def get_msvs8_install_dirs(version = None, vs8suite = None): """ Get installed locations for various msvc-related products, like the .NET SDK and the Platform SDK. """ if not SCons.Util.can_read_reg: return {} if not version: versions = get_visualstudio_versions() if versions: version = versions[0] #use highest version by default else: return {} version_num, suite = msvs_parse_version(version) K = 'Software\\Microsoft\\VisualStudio\\' + str(version_num) if (version_num >= 8.0): if vs8suite == None: # We've been given no guidance about which Visual Studio 8 # suite to use, so attempt to autodetect. suites = get_visualstudio8_suites() if suites: vs8suite = suites[0] if vs8suite == 'EXPRESS': K = 'Software\\Microsoft\\VCExpress\\' + str(version_num) # vc++ install dir rv = {} if (version_num < 7.0): key = K + r'\Setup\Microsoft Visual C++\ProductDir' else: key = K + r'\Setup\VC\ProductDir' try: (rv['VCINSTALLDIR'], t) = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, key) except SCons.Util.RegError: pass # visual studio install dir if (version_num < 7.0): try: (rv['VSINSTALLDIR'], t) = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, K + r'\Setup\Microsoft Visual Studio\ProductDir') except SCons.Util.RegError: pass if not rv.has_key('VSINSTALLDIR') or not rv['VSINSTALLDIR']: if rv.has_key('VCINSTALLDIR') and rv['VCINSTALLDIR']: rv['VSINSTALLDIR'] = os.path.dirname(rv['VCINSTALLDIR']) else: rv['VSINSTALLDIR'] = os.path.join(SCons.Platform.win32.get_program_files_dir(),'Microsoft Visual Studio') else: try: (rv['VSINSTALLDIR'], t) = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, K + r'\Setup\VS\ProductDir') except SCons.Util.RegError: pass # .NET framework install dir try: (rv['FRAMEWORKDIR'], t) = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'Software\Microsoft\.NETFramework\InstallRoot') except SCons.Util.RegError: pass if rv.has_key('FRAMEWORKDIR'): # try and enumerate the installed versions of the .NET framework. contents = os.listdir(rv['FRAMEWORKDIR']) l = re.compile('v[0-9]+.*') versions = [] for entry in contents: if l.match(entry): versions.append(entry) def versrt(a,b): # since version numbers aren't really floats... aa = a[1:] bb = b[1:] aal = aa.split('.') bbl = bb.split('.') c = int(bbl[0]) - int(aal[0]) if c == 0: c = int(bbl[1]) - int(aal[1]) if c == 0: c = int(bbl[2]) - int(aal[2]) return c versions.sort(versrt) rv['FRAMEWORKVERSIONS'] = versions # assume that the highest version is the latest version installed rv['FRAMEWORKVERSION'] = versions[0] # .NET framework SDK install dir try: if rv.has_key('FRAMEWORKVERSION') and rv['FRAMEWORKVERSION'][:4] == 'v1.1': key = r'Software\Microsoft\.NETFramework\sdkInstallRootv1.1' else: key = r'Software\Microsoft\.NETFramework\sdkInstallRoot' (rv['FRAMEWORKSDKDIR'], t) = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE,key) except SCons.Util.RegError: pass # MS Platform SDK dir try: (rv['PLATFORMSDKDIR'], t) = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'Software\Microsoft\MicrosoftSDK\Directories\Install Dir') except SCons.Util.RegError: pass if rv.has_key('PLATFORMSDKDIR'): # if we have a platform SDK, try and get some info on it. vers = {} try: loc = r'Software\Microsoft\MicrosoftSDK\InstalledSDKs' k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,loc) i = 0 while 1: try: key = SCons.Util.RegEnumKey(k,i) sdk = SCons.Util.RegOpenKeyEx(k,key) j = 0 name = '' date = '' version = '' while 1: try: (vk,vv,t) = SCons.Util.RegEnumValue(sdk,j) if vk.lower() == 'keyword': name = vv if vk.lower() == 'propagation_date': date = vv if vk.lower() == 'version': version = vv j = j + 1 except SCons.Util.RegError: break if name: vers[name] = (date, version) i = i + 1 except SCons.Util.RegError: break rv['PLATFORMSDK_MODULES'] = vers except SCons.Util.RegError: pass return rv
6dcb3e94cf8a7c38bf5387774e447f5256ea1120 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6357/6dcb3e94cf8a7c38bf5387774e447f5256ea1120/msvc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 959, 6904, 28, 67, 5425, 67, 8291, 12, 1589, 273, 599, 16, 6195, 28, 30676, 273, 599, 4672, 3536, 968, 5876, 7838, 364, 11191, 4086, 4227, 17, 9243, 10406, 16, 3007, 326, 263,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 959, 6904, 28, 67, 5425, 67, 8291, 12, 1589, 273, 599, 16, 6195, 28, 30676, 273, 599, 4672, 3536, 968, 5876, 7838, 364, 11191, 4086, 4227, 17, 9243, 10406, 16, 3007, 326, 263,...
snmpTargetAddrEntry, = mibInstrumController.mibBuilder.importSymbols( 'SNMP-TARGET-MIB', 'snmpTargetAddrEntry'
( snmpTargetAddrEntry, snmpTargetAddrTagList ) = mibInstrumController.mibBuilder.importSymbols( 'SNMP-TARGET-MIB', 'snmpTargetAddrEntry', 'snmpTargetAddrTagList'
def getTargetNames(snmpEngine, tag): mibInstrumController = snmpEngine.msgAndPduDsp.mibInstrumController # Transport endpoint snmpTargetAddrEntry, = mibInstrumController.mibBuilder.importSymbols( 'SNMP-TARGET-MIB', 'snmpTargetAddrEntry' ) targetNames = [] nextName = snmpTargetAddrEntry.name + (6,) while 1: try: mibNode = snmpTargetAddrEntry.getNextNode(nextName) except NoSuchInstanceError: break # XXX stop on eot if tag in string.split(str(mibNode.syntax)): # XXX add __split__() targetNames.append( snmpTargetAddrEntry.getIndicesFromInstId(mibNode.name)[0] ) nextName = mibNode.name return targetNames
3f6268f8e85be46746030a585dcd5d5bd013f5e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/587/3f6268f8e85be46746030a585dcd5d5bd013f5e3/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8571, 1557, 12, 26527, 4410, 16, 1047, 4672, 312, 495, 382, 701, 379, 2933, 273, 15366, 4410, 18, 3576, 1876, 52, 2544, 40, 1752, 18, 81, 495, 382, 701, 379, 2933, 468, 9514, 2494, 261...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8571, 1557, 12, 26527, 4410, 16, 1047, 4672, 312, 495, 382, 701, 379, 2933, 273, 15366, 4410, 18, 3576, 1876, 52, 2544, 40, 1752, 18, 81, 495, 382, 701, 379, 2933, 468, 9514, 2494, 261...
except ImportError:
except:
for mdef in autoIncludes: try: self.__loadModule(mdef) # Since it succesfully loaded, it's no longer a guess. mdef.guess = False except ImportError: pass
12afbaf31883fd587f4ed7f16ce4a143bd0fab68 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7242/12afbaf31883fd587f4ed7f16ce4a143bd0fab68/FreezeTool.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 364, 312, 536, 316, 3656, 16815, 30, 775, 30, 365, 16186, 945, 3120, 12, 81, 536, 13, 468, 7897, 518, 8667, 764, 4095, 4203, 16, 518, 1807, 1158, 7144, 279, 7274, 18, 312, 536, 18, 20885, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 364, 312, 536, 316, 3656, 16815, 30, 775, 30, 365, 16186, 945, 3120, 12, 81, 536, 13, 468, 7897, 518, 8667, 764, 4095, 4203, 16, 518, 1807, 1158, 7144, 279, 7274, 18, 312, 536, 18, 20885, ...
def resolveRedirect(self):
def resolveRedirect(self, useHEAD = True):
def resolveRedirect(self): ''' Requests the header from the server. If the page is an HTTP redirect, returns the redirect target URL as a string. Otherwise returns None. ''' if self.scheme == 'http': conn = httplib.HTTPConnection(self.host) elif self.scheme == 'https': conn = httplib.HTTPSConnection(self.host) conn.request('HEAD', '%s%s' % (self.path, self.query), None, self.header) response = conn.getresponse() if response.status >= 300 and response.status <= 399: #print response.getheaders() redirTarget = response.getheader('Location') #print "redirTarget:", redirTarget if redirTarget: if redirTarget.startswith('http://') or redirTarget.startswith('https://'): self.changeUrl(redirTarget) return True elif redirTarget.startswith('/'): self.changeUrl('%s://%s%s' % (self.protocol, self.host, redirTarget)) return True else: # redirect to relative position # cut off filename directory = self.path[:self.path.rindex('/') + 1] # handle redirect to parent directory while redirTarget.startswith('../'): redirTarget = redirTarget[3:] # change /foo/bar/ to /foo/ directory = directory[:-1] directory = directory[:directory.rindex('/') + 1] self.changeUrl('%s://%s%s%s' % (self.protocol, self.host, directory, redirTarget)) return True else: return False # not a redirect
f389d16ab34b6f2834424d596326436eb58228e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/f389d16ab34b6f2834424d596326436eb58228e4/weblinkchecker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2245, 5961, 12, 2890, 16, 999, 12458, 273, 1053, 4672, 9163, 7090, 326, 1446, 628, 326, 1438, 18, 971, 326, 1363, 353, 392, 2239, 3136, 16, 1135, 326, 3136, 1018, 1976, 487, 279, 533, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2245, 5961, 12, 2890, 16, 999, 12458, 273, 1053, 4672, 9163, 7090, 326, 1446, 628, 326, 1438, 18, 971, 326, 1363, 353, 392, 2239, 3136, 16, 1135, 326, 3136, 1018, 1976, 487, 279, 533, ...
etag = header_getter('ETag', rfc_section='14.19')
etag = converter( header_getter('ETag', rfc_section='14.19'), _parse_etag_response, _serialize_etag_response, 'Entity tag')
def decode_content(self): content_encoding = self.content_encoding if not content_encoding or content_encoding == 'identity': return if content_encoding != 'gzip': raise ValueError( "I don't know how to decode the content %s" % content_encoding) from webob.util.safegzip import GzipFile f = StringIO(self.body) gzip_f = GzipFile(filename='', mode='r', fileobj=f) new_body = gzip_f.read() gzip_f.close() f.close() self.content_encoding = None self.body = new_body
27721d37a62c616781b9e6b6a139d69611eb9449 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12287/27721d37a62c616781b9e6b6a139d69611eb9449/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2495, 67, 1745, 12, 2890, 4672, 913, 67, 5999, 273, 365, 18, 1745, 67, 5999, 309, 486, 913, 67, 5999, 578, 913, 67, 5999, 422, 296, 10781, 4278, 327, 309, 913, 67, 5999, 480, 296, 17...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2495, 67, 1745, 12, 2890, 4672, 913, 67, 5999, 273, 365, 18, 1745, 67, 5999, 309, 486, 913, 67, 5999, 578, 913, 67, 5999, 422, 296, 10781, 4278, 327, 309, 913, 67, 5999, 480, 296, 17...
if args is None: called_builtin = builtin(in_channel, out_channel) else: called_builtin = builtin(in_channel, out_channel, *args) parallel_processes = csp.Par( called_builtin, self.producer()(in_channel, in_data), self.consumer()(out_channel, reads=len(in_data)+excess_reads, result_channel=result_channel) ) parallel_processes.start()
coordinator = self.coordinator()(in_channel, out_channel, result_channel, in_data, builtin, builtin_args, excess_reads) coordinator.start() result = result_channel.read() return result
def feedBuiltin(self, in_data, builtin, args=None, excess_reads=0): """Feed the data from `in_data` into the builtin CSPProcess (process/thread) and return a sequence of the corresponding output values. If `args` isn't `None`, use this tuple as the positional arguments to the builtin. If `excess_reads` is greater than 0, read this many values after reading output values corresponding to the input and include them in the returned output data. """ csp = self.csp_process in_channel, out_channel, result_channel = self.spare_channels[:3] # Use positional arguments if requested if args is None: called_builtin = builtin(in_channel, out_channel) else: called_builtin = builtin(in_channel, out_channel, *args) parallel_processes = csp.Par( called_builtin, self.producer()(in_channel, in_data), self.consumer()(out_channel, reads=len(in_data)+excess_reads, result_channel=result_channel) ) parallel_processes.start() # Collect output data from builtin
7bc9d1c19922e91df587c0941b9e85ec0e7c5fa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10307/7bc9d1c19922e91df587c0941b9e85ec0e7c5fa1/test_builtins.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4746, 28032, 12, 2890, 16, 316, 67, 892, 16, 15273, 16, 833, 33, 7036, 16, 23183, 67, 11904, 33, 20, 4672, 3536, 8141, 326, 501, 628, 1375, 267, 67, 892, 68, 1368, 326, 15273, 385, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4746, 28032, 12, 2890, 16, 316, 67, 892, 16, 15273, 16, 833, 33, 7036, 16, 23183, 67, 11904, 33, 20, 4672, 3536, 8141, 326, 501, 628, 1375, 267, 67, 892, 68, 1368, 326, 15273, 385, 3...
self.__agentModules['instance'].finalize()
self.__agentModules[agentName]['instance'].finalize()
def finalize( self ): for agentName in self.__agentModules: self.__agentModules['instance'].finalize()
470d4712d91daeb76d02951a8c8119829bb04282 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/470d4712d91daeb76d02951a8c8119829bb04282/AgentReactor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12409, 12, 365, 262, 30, 364, 4040, 461, 316, 365, 16186, 5629, 7782, 30, 365, 16186, 5629, 7782, 3292, 1336, 29489, 30343, 1435, 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, 0, 0, 0, 0, 0, 0, 0, 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, 12409, 12, 365, 262, 30, 364, 4040, 461, 316, 365, 16186, 5629, 7782, 30, 365, 16186, 5629, 7782, 3292, 1336, 29489, 30343, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
query="select file.location, element.li_name, substr(element.name, 0, 2) as etype, element.name, element.file_id, element.reference_file_id from element, file where element.file_id =file.id and element.type in ('ID','IM') and file.production_id=?;"
query="select file.location, element.li_name, substr(element.name, 1, 2) as etype, element.name, element.file_id, element.reference_file_id from element, file where element.file_id =file.id and element.type in ('ID','IM') and file.production_id=?;"
def queryDependancy(productionId, filter): connection = sqlite3.connect(settings.SQLITE3_CONNECTIONURL) if filter=="all": query="select file.location, element.li_name, substr(element.name, 0, 2) as etype, element.name, element.file_id, element.reference_file_id from element, file where element.file_id =file.id and element.type in ('ID','IM') and file.production_id=?;" else: f=[] for t in filter.split(","): f.append("'"+t+"'") nFilter = ",".join(f) query="select file.location, element.li_name, substr(element.name, 0, 2) as etype, element.name, element.file_id, element.reference_file_id from element, file where element.file_id =file.id and element.type in ('ID','IM') and file.production_id=? and etype in ("+nFilter+");" result = connection.execute(query, [productionId]).fetchall() connection.close() return result
fcf005804af38f0418292d95f06959889eeed301 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4259/fcf005804af38f0418292d95f06959889eeed301/indexer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 843, 4584, 12514, 12, 17273, 548, 16, 1034, 4672, 1459, 273, 16184, 23, 18, 3612, 12, 4272, 18, 3997, 5398, 23, 67, 15461, 1785, 13, 309, 1034, 31713, 454, 6877, 843, 1546, 4025, 585, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 843, 4584, 12514, 12, 17273, 548, 16, 1034, 4672, 1459, 273, 16184, 23, 18, 3612, 12, 4272, 18, 3997, 5398, 23, 67, 15461, 1785, 13, 309, 1034, 31713, 454, 6877, 843, 1546, 4025, 585, ...
if default:
if id == wx.ID_CLOSE: container.SetCancelButton(btn) self.SetEscapeId(id) else: container.SetAffirmativeButton(btn)
def __button(self, parent, default, evt_handler, id, container): """Convenience method for creating a control""" btn = wx.Button(self, id) wx.EVT_BUTTON(parent, btn.GetId(), evt_handler) if default: self.SetDefaultItem(btn) container.Add(btn, 0)
01f62a12ca8547e7a54951a0e67c95aa57328a81 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5252/01f62a12ca8547e7a54951a0e67c95aa57328a81/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 5391, 12, 2890, 16, 982, 16, 805, 16, 6324, 67, 4176, 16, 612, 16, 1478, 4672, 3536, 14700, 707, 364, 4979, 279, 3325, 8395, 10638, 273, 7075, 18, 3616, 12, 2890, 16, 612, 13, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 5391, 12, 2890, 16, 982, 16, 805, 16, 6324, 67, 4176, 16, 612, 16, 1478, 4672, 3536, 14700, 707, 364, 4979, 279, 3325, 8395, 10638, 273, 7075, 18, 3616, 12, 2890, 16, 612, 13, ...
efwplan = extfilewalker() efwplan.addcallback('.c',lambda x: True) planarity_list = efwplan.walk('devel/sage/sage/graphs/planarity') planarity_ext = list() for x in planarity_list: ext = GCC_extension_object(gccc, env, [x], tempdir+"/sage/graphs/planarity", options = { '-fPIC':None } ) ext.generate_action(env).enable() planarity_ext.append(ext)
def buildsage(env, gccc): TM = taskmanager.TM efw = extfilewalker() efw.addcallback('.pyx',lambda x: True) pyx_list = efw.walk('devel/sage/sage') develdir = os.path.realpath(env.options['SAGE_ROOT'] + '/devel/sage/') if verbose>100: print 'Devel Dir: ' + develdir cyc = Cython_compiler() cyc.set_option_val('-I'+'.',None) pyx_pextn_dict = cyc.get_build_extensions(env, pyx_list, cwd = develdir) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/flint/fmpz_poly.pyx"),include_dirs = [abs_sage_local(env, 'include/FLINT/')], libraries = ["csage", "flint", "gmp", "gmpxx", "m", "stdc++"],prop_options={ str(GCC_extension_object): {'-std':'c99' } } ) ntllibs = ["csage", "ntl", "gmp", "gmpxx", "m", "stdc++"] config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_ZZ.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_ZZX.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_ZZ_pContext.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_ZZ_p.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_ZZ_pX.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_ZZ_pEContext.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_ZZ_pE.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_ZZ_pEX.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_lzz_pContext.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_lzz_p.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_lzz_pX.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_GF2.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_GF2X.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_GF2EContext.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_GF2E.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_GF2EX.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_mat_ZZ.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_mat_GF2E.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/ntl/ntl_GF2EContext.pyx"),language="C++", libraries=ntllibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/mwrank/mwrank.pyx"),define_macros=[("NTL_ALL",None)], libraries=["curvesntl", "g0nntl", "jcntl", "rankntl", "ntl", "gmp", "gmpxx", "stdc++", "m", "pari"] ) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/pari/gen.pyx"),libraries=['pari', 'gmp']) cremonalibs = ['g0nntl', 'jcntl', 'gmpxx', 'ntl', 'gmp', 'm', 'stdc++', 'pari', 'curvesntl'] config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/cremona/mat.pyx"),language="C++", define_macros=[("NTL_ALL",None)], libraries=cremonalibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/libs/cremona/homspace.pyx"),language="C++", define_macros=[("NTL_ALL",None)], libraries=cremonalibs) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/rings/finite_field_givaro.pyx"),language="C++", libraries=['givaro', 'gmpxx', 'gmp', 'm', 'stdc++']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/finite_field_ntl_gf2e.pyx'),language="C++", libraries=['ntl', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,"sage/rings/real_rqdf.pyx"),language="C++", libraries=['qd', 'm', 'stdc++','gmp','mpfr','qd', 'csage' ]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/matrix/misc.pyx'),libraries=['mpfr','gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/matrix/matrix_integer_2x2.pyx'),libraries=['gmp']) BLAS = env.options['BLAS'] BLAS2 = env.options['BLAS2'] config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/libs/linbox/linbox.pyx'),language="C++", libraries=['linboxwrap', 'ntl', 'linbox', 'gmp', 'gmpxx', 'stdc++', 'givaro', BLAS, BLAS2]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/libs/singular/singular.pyx'),language='C++', include_dirs=[abs_sage_local(env,'include/singular')], libraries=['m', 'readline', 'singular', 'singfac', 'singcf', 'omalloc', 'givaro', 'gmpxx', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/libs/fplll/fplll.pyx'),language='C++', include_dirs = [abs_sage_local(env, 'include/fplll')], libraries=['gmp', 'mpfr', 'stdc++', 'fplll']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/matrix/matrix_modn_dense.pyx'),libraries = ['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/matrix/matrix_mod2_dense.pyx'),libraries = ['gmp','m4ri']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/matrix/matrix_rational_dense.pyx'),libraries = ['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/matrix/matrix_integer_sparse.pyx'),libraries = ['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/matrix/matrix_rational_sparse.pyx'),libraries = ['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/matrix/matrix_integer_dense.pyx'),libraries = ['iml', 'gmp', 'm', BLAS, BLAS2]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/matrix/matrix_real_double_dense.pyx'),define_macros=[('GSL_DISABLE_DEPRECATED','1')], include_dirs = [abs_sage_local(env,'lib/python2.5/site-packages/numpy/core/include/numpy')], libraries=[BLAS, BLAS2, 'gsl']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/matrix/change_ring.pyx'),define_macros=[('GSL_DISABLE_DEPRECATED','1')], libraries=[BLAS, BLAS2, 'gsl', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/matrix/matrix_complex_double_dense.pyx'),define_macros=[('GSL_DISABLE_DEPRECATED','1')], include_dirs=[abs_sage_local(env,'lib/python2.5/site-packages/numpy/core/include/numpy')], libraries=['gsl', BLAS, BLAS2]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/matrix/solve.pyx'),define_macros = [('GSL_DISABLE_DEPRECATED','1')], libraries = ['gsl', BLAS, BLAS2]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/matrix/matrix_mpolynomial_dense.pyx'),language="C++", include_dirs = [abs_sage_local(env,'include/singular')], libraries = ['m', 'readline', 'singular', 'singcf', 'singfac', 'omalloc', 'givaro', 'gmpxx', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/complex_number.pyx'),libraries = ['mpfr', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/gsl/probability_distribution.pyx'),define_macros=[('GSL_DISABLE_DEPRECATED','1')], libraries=['gsl', BLAS, BLAS2]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/gsl/integration.pyx'),define_macros=[('GSL_DISABLE_DEPRECATED','1')], libraries=['gsl', BLAS, BLAS2]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/gsl/ode.pyx'),define_macros=[('GSL_DISABLE_DEPRECATED','1')], libraries=['gsl', BLAS]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/gsl/fft.pyx'),define_macros=[('GSL_DISABLE_DEPRECATED','1')], libraries=['gsl', BLAS, BLAS2]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/gsl/interpolation.pyx'),define_macros=[('GSL_DISABLE_DEPRECATED','1')], libraries=['gsl', BLAS, BLAS2]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/gsl/callback.pyx'),define_macros=[('GSL_DISABLE_DEPRECATED','1')], libraries=['gsl', BLAS, BLAS2]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/real_double.pyx'),define_macros=[('GSL_DISABLE_DEPRECATED','1')], libraries=['gsl', 'gmp', BLAS, BLAS2]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/complex_double.pyx'),libraries = ['gsl', BLAS, BLAS2, 'pari', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/modules/real_double_vector.pyx'),define_macros = [('GSL_DISABLE_DEPRECAED','1')], include_dirs=[abs_sage_local(env,'lib/python2.5/site-packages/numpy/core/include/numpy')], libraries = ['gsl', BLAS, BLAS2, 'pari','gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/modules/complex_double_vector.pyx'),define_macros = [('GSL_DISABLE_DEPRECAED','1')], include_dirs=[abs_sage_local(env,'lib/python2.5/site-packages/numpy/core/include/numpy')], libraries = ['gsl', BLAS, BLAS2, 'pari','gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/modules/vector_integer_dense.pyx'),libraries=['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/modules/vector_rational_dense.pyx'),libraries=['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/gsl/gsl_array.pyx'),define_macros=[('GSL_DISABLE_DEPRECATED','1')], libraries=['gsl', BLAS, BLAS2]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/gsl/ode.pyx'),define_macros=[('GSL_DISABLE_DEPRECATED','1')], libraries=['gsl',BLAS]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/gsl/dwt.pyx'),define_macros=[('GSL_DISABLE_DEPRECATED','1')], libraries=['gsl',BLAS]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/libs/symmetrica/symmetrica.pyx'),libraries=['symmetrica']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/ext/arith_gmp.pyx'),libraries=['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/ext/multi_modular.pyx'),libraries=['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/polynomial/multi_polynomial_libsingular.pyx'),language='C++', include_dirs = [abs_sage_local(env,'include/singular')], libraries = ['m', 'readline', 'singular', 'singcf', 'singfac', 'omalloc', 'givaro', 'gmpxx', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx'),language='C++', include_dirs = [abs_sage_local(env,'include/singular')], libraries = ['m', 'readline', 'singular', 'singcf', 'singfac', 'omalloc', 'givaro', 'gmpxx', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/structure/sage_object.pyx'),libraries=['ntl']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/real_mpfr.pyx'),libraries = ['mpfi', 'mpfr', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/real_mpfi.pyx'),libraries = ['mpfi', 'mpfr', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/complex_interval.pyx'),libraries = ['mpfi', 'mpfr', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/integer.pyx'),libraries = ['ntl', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/integer_ring.pyx'),libraries = ['ntl', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/interfaces/libecm.pyx'),libraries = ['ecm', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/padics/pow_computer.pyx'),language='C++', libraries = ["csage", "ntl", "gmp", "gmpxx", "m", "stdc++"]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/padics/pow_computer_ext.pyx'),language='C++', libraries = ["csage", "ntl", "gmp", "gmpxx", "m", "stdc++"]) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/padics/padic_fixed_mod_element.pyx'),libraries = ['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/padics/padic_capped_absolute_element.pyx'),libraries = ['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/padics/padic_capped_relative_element.pyx'),libraries = ['gmp', 'csage']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/padics/padic_ext_element.pyx'),language = 'C++', libraries = ['gmp', 'ntl', 'csage', 'gmpxx', 'm', 'stdc++']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/padics/padic_ZZ_pX_element.pyx'),language = 'C++', libraries = ['gmp', 'ntl', 'csage', 'gmpxx', 'm', 'stdc++']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/padics/padic_ZZ_pX_FM_element.pyx'),language = 'C++', libraries = ['gmp', 'ntl', 'csage', 'gmpxx', 'm', 'stdc++']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/padics/padic_ZZ_pX_CR_element.pyx'),language = 'C++', libraries = ['gmp', 'ntl', 'csage', 'gmpxx', 'm', 'stdc++']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/padics/padic_ZZ_pX_CA_element.pyx'),language = 'C++', libraries = ['gmp', 'ntl', 'csage', 'gmpxx', 'm', 'stdc++']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/padics/padic_printing.pyx'),language = 'C++', libraries = ['gmp', 'ntl', 'csage', 'gmpxx', 'm', 'stdc++']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/memory.pyx'),libraries = ['gmp','stdc++']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/bernoulli_mod_p.pyx'),language = 'C++', include_dirs = [abs_sage_path(env,'sage/libs/ntl/')], libraries=['ntl','stdc++']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/schemes/hyperelliptic_curves/hypellfrob.pyx'),language = 'C++', include_dirs = [abs_sage_path(env,'sage/libs/ntl/'), abs_sage_path(env, 'sage/schemes/hyperelliptic_curves/hypellfrob/')], libraries = ['ntl','stdc++', 'gmp', 'zn_poly']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/polynomial/polynomial_integer_dense_ntl.pyx'),language = 'C++', include_dirs = [abs_sage_path(env,'sage/libs/ntl/')], libraries = ['ntl','stdc++', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/polynomial/polynomial_modn_dense_ntl.pyx'),language = 'C++', include_dirs = [abs_sage_path(env,'sage/libs/ntl/')], libraries = ['ntl','stdc++', 'gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/rational.pyx'),libraries = ['ntl','gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/sparse_poly.pyx'),libraries = ['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/polynomial/real_roots.pyx'),libraries = ['mpfr', 'qd']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/number_field/number_field_element.pyx'),language = 'C++', libraries=['ntl','gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/number_field/number_field_element_quadratic.pyx'),language = 'C++', libraries=['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/number_field/totallyreal_data.pyx'),libraries = ['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/modular/modsym/heilbronn.pyx'),libraries = ['gmp','m']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/modular/modsym/p1list.pyx'),libraries = ['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/integer_mod.pyx'),libraries = ['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/combinat/expnums.pyx'),libraries = ['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/combinat/partitions.pyx'),language='C++', libraries = ['qd', 'gmp', 'mpfr']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/graphs/graph_fast.pyx'),libraries = ['gmp']) config_gcc_file(env,pyx_pextn_dict, abs_sage_path(env,'sage/rings/polynomial/pbori.pyx'),language='C++', include_dirs = [abs_sage_local(env,'include/cudd'),abs_sage_local(env,'include/polybori'), abs_sage_local(env,'include/polybori/groebner')], libraries=['polybori','pboriCudd','groebner'])
f31e735d8e54368b01edf43244ff3ca84d9600d3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/f31e735d8e54368b01edf43244ff3ca84d9600d3/sagebuild.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10736, 410, 12, 3074, 16, 314, 952, 71, 4672, 27435, 273, 1562, 4181, 18, 22903, 425, 11966, 273, 1110, 768, 11348, 264, 1435, 425, 11966, 18, 1289, 3394, 2668, 18, 2074, 92, 2187, 14661...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10736, 410, 12, 3074, 16, 314, 952, 71, 4672, 27435, 273, 1562, 4181, 18, 22903, 425, 11966, 273, 1110, 768, 11348, 264, 1435, 425, 11966, 18, 1289, 3394, 2668, 18, 2074, 92, 2187, 14661...
'string': '%s - %s' % (m.product_id.code, m.product_id.name),
'string': '%s - %s' % (_to_xml(m.product_id.code or '/'), _to_xml(m.product_id.name)),
def _get_moves(self, cr, uid, data, context): pick_obj = pooler.get_pool(cr.dbname).get('stock.picking') pick = pick_obj.browse(cr, uid, [data['id']])[0] res = {} _moves_fields.clear() _moves_arch_lst = ['<?xml version="1.0"?>', '<form string="Make packing">'] for m in pick.move_lines: quantity = m.product_qty if m.state<>'assigned': quantity = 0 _moves_arch_lst.append('<field name="move%s" />' % (m.id,)) _moves_fields['move%s' % m.id] = { 'string': '%s - %s' % (m.product_id.code, m.product_id.name), 'type' : 'float', 'required' : True, 'default' : make_default(quantity)} if (pick.type == 'in') and (m.product_id.cost_method == 'average'): price=0 if hasattr(m, 'purchase_line_id') and m.purchase_line_id: price=m.purchase_line_id.price_unit currency=0 if hasattr(pick, 'purchase_id') and pick.purchase_id: currency=pick.purchase_id.pricelist_id.currency_id.id _moves_arch_lst.append('<group col="6"><field name="uom%s"/>\ <field name="price%s"/>' % (m.id,m.id,)) _moves_fields['price%s' % m.id] = {'string': 'Unit Price', 'type': 'float', 'required': True, 'default': make_default(price)} _moves_fields['uom%s' % m.id] = {'string': 'UOM', 'type': 'many2one', 'relation': 'product.uom', 'required': True, 'default': make_default(m.product_uom.id)} _moves_arch_lst.append('<field name="currency%d"/></group>' % (m.id,)) _moves_fields['currency%s' % m.id] = {'string': 'Currency', 'type': 'many2one', 'relation': 'res.currency', 'required': True, 'default': make_default(currency)} _moves_arch_lst.append('<newline/>') res.setdefault('moves', []).append(m.id) _moves_arch_lst.append('</form>') _moves_arch.string = '\n'.join(_moves_arch_lst) return res
bab0315ce26895b5834e62986d079e78de88bf34 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/bab0315ce26895b5834e62986d079e78de88bf34/wizard_partial_picking.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 81, 10829, 12, 2890, 16, 4422, 16, 4555, 16, 501, 16, 819, 4672, 6002, 67, 2603, 273, 2845, 264, 18, 588, 67, 6011, 12, 3353, 18, 20979, 2934, 588, 2668, 15381, 18, 115...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 81, 10829, 12, 2890, 16, 4422, 16, 4555, 16, 501, 16, 819, 4672, 6002, 67, 2603, 273, 2845, 264, 18, 588, 67, 6011, 12, 3353, 18, 20979, 2934, 588, 2668, 15381, 18, 115...
if isinstance(code, str):
if isinstance(code, basestring):
def label(code): if isinstance(code, str): return ('~', 0, code) # built-in functions ('~' sorts at the end) else: return (code.co_filename, code.co_firstlineno, code.co_name)
514916c6c34cd7c871afd6da4923e0506a83282a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/514916c6c34cd7c871afd6da4923e0506a83282a/cProfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1433, 12, 710, 4672, 309, 1549, 12, 710, 16, 10699, 4672, 327, 7707, 98, 2187, 374, 16, 981, 13, 565, 468, 6650, 17, 267, 4186, 7707, 20206, 18524, 622, 326, 679, 13, 469, 30, 327, 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, 1433, 12, 710, 4672, 309, 1549, 12, 710, 16, 10699, 4672, 327, 7707, 98, 2187, 374, 16, 981, 13, 565, 468, 6650, 17, 267, 4186, 7707, 20206, 18524, 622, 326, 679, 13, 469, 30, 327, 2...
if value < cursori:
if str(value) < str(cursori):
def setCursor(self, cursor): if not cursor: return treeview = self._treeview model = treeview.get_model() iter = None bestiter = None for i in range(len(cursor)): cursori = cursor[i] iter = model.iter_children(iter) while iter: value = model.get_value(iter, 0) if value == cursori: bestiter = iter break if value < cursori: bestiter = iter iter = model.iter_next(iter) else: break if bestiter: path = model.get_path(bestiter) treeview.set_cursor(path) treeview.scroll_to_cell(path)
b5532eac2c0c7ccc94c2a7aa392a98f90febbfc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8317/b5532eac2c0c7ccc94c2a7aa392a98f90febbfc4/packageview.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 6688, 12, 2890, 16, 3347, 4672, 309, 486, 3347, 30, 327, 2151, 1945, 273, 365, 6315, 3413, 1945, 938, 273, 2151, 1945, 18, 588, 67, 2284, 1435, 1400, 273, 599, 3796, 2165, 273, 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, 444, 6688, 12, 2890, 16, 3347, 4672, 309, 486, 3347, 30, 327, 2151, 1945, 273, 365, 6315, 3413, 1945, 938, 273, 2151, 1945, 18, 588, 67, 2284, 1435, 1400, 273, 599, 3796, 2165, 273, 59...
pManager.manager.DebugStr('cConfigureGrabber '+ __version__ +': reading section "'+sect+'".', 4)
def ParseConfig(self): """Read configfile and build configuration page
03eb441e0af3f174def00adaec1cf6900eace472 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2853/03eb441e0af3f174def00adaec1cf6900eace472/cConfigureGrabber.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2884, 809, 12, 2890, 4672, 3536, 1994, 642, 768, 471, 1361, 1664, 1363, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 2884, 809, 12, 2890, 4672, 3536, 1994, 642, 768, 471, 1361, 1664, 1363, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
value[field] = self._defaults[field](cursor, user, context)
value[field] = self._defaults[field](cursor, user, context=context)
def default_get(self, cursor, user, fields_names, context=None, with_rec_name=True): ''' Return a dict with the default values for each field in fields_names.
77b10845858606e08f6f6ea301f9ae724fed59e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9266/77b10845858606e08f6f6ea301f9ae724fed59e1/model.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 805, 67, 588, 12, 2890, 16, 3347, 16, 729, 16, 1466, 67, 1973, 16, 819, 33, 7036, 16, 598, 67, 3927, 67, 529, 33, 5510, 4672, 9163, 2000, 279, 2065, 598, 326, 805, 924, 364, 1517, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 805, 67, 588, 12, 2890, 16, 3347, 16, 729, 16, 1466, 67, 1973, 16, 819, 33, 7036, 16, 598, 67, 3927, 67, 529, 33, 5510, 4672, 9163, 2000, 279, 2065, 598, 326, 805, 924, 364, 1517, ...
self.addFile(fileId, oldVersion, newVersion, filecs)
newFiles.append((fileId, oldVersion, newVersion, filecs))
def rootChangeSet(self, db, keepExisting):
61ec4b6e84d57a75d76112f32595e47979394c1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/61ec4b6e84d57a75d76112f32595e47979394c1e/changeset.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1365, 21565, 12, 2890, 16, 1319, 16, 3455, 9895, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1365, 21565, 12, 2890, 16, 1319, 16, 3455, 9895, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
def __init__(self,count=0,unit=0): self.count = count
def __init__(self,count=0.0,unit=0): self.count = float(count)
def __init__(self,count=0,unit=0): self.count = count try: unit.isdigit() self.unit = counter.units[unit] except: self.unit = unit
4e82f83a9adcd5c627796d3e7860e590efe5a07d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2315/4e82f83a9adcd5c627796d3e7860e590efe5a07d/nmstats.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1883, 33, 20, 18, 20, 16, 4873, 33, 20, 4672, 365, 18, 1883, 273, 1431, 12, 1883, 13, 775, 30, 2836, 18, 291, 11052, 1435, 365, 18, 4873, 273, 3895, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1001, 2738, 972, 12, 2890, 16, 1883, 33, 20, 18, 20, 16, 4873, 33, 20, 4672, 365, 18, 1883, 273, 1431, 12, 1883, 13, 775, 30, 2836, 18, 291, 11052, 1435, 365, 18, 4873, 273, 3895, ...
self.isconf('lock -m "testing snap"')
self.isconf('-m "testing snap" lock')
def testsnap(self): file = volroot + "/tmp1" content = str(random.random()) open(file,'w').write(content) self.failUnless(os.path.exists(file)) self.isconf('lock -m "testing snap"') self.isconf("snap " + file) os.unlink(file) self.failIf(os.path.exists(file))
69a607687ca3b00828345784db03293ede5deb22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6207/69a607687ca3b00828345784db03293ede5deb22/testCLI.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7434, 2322, 12, 2890, 4672, 585, 273, 6626, 3085, 397, 2206, 5645, 21, 6, 913, 273, 609, 12, 9188, 18, 9188, 10756, 1696, 12, 768, 11189, 91, 16063, 2626, 12, 1745, 13, 365, 18, 6870, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7434, 2322, 12, 2890, 4672, 585, 273, 6626, 3085, 397, 2206, 5645, 21, 6, 913, 273, 609, 12, 9188, 18, 9188, 10756, 1696, 12, 768, 11189, 91, 16063, 2626, 12, 1745, 13, 365, 18, 6870, ...
c.Run()
def call_node_stop_master(node, stop_daemons): """Tells a node to demote itself from master status.
ecfe94918845683627f97b646872fde40247176b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/ecfe94918845683627f97b646872fde40247176b/rpc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 745, 67, 2159, 67, 5681, 67, 7525, 12, 2159, 16, 2132, 67, 21511, 87, 4672, 3536, 21009, 87, 279, 756, 358, 9626, 1168, 6174, 628, 4171, 1267, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 745, 67, 2159, 67, 5681, 67, 7525, 12, 2159, 16, 2132, 67, 21511, 87, 4672, 3536, 21009, 87, 279, 756, 358, 9626, 1168, 6174, 628, 4171, 1267, 18, 2, -100, -100, -100, -100, -100, -100...
choices = { "nothing": _("nothing connected"),
choices = { "nothing": _("not configured"),
def createConfigMode(self): if self.nim.isCompatible("DVB-S"): choices = { "nothing": _("nothing connected"), "simple": _("simple"), "advanced": _("advanced")} #if len(nimmanager.getNimListOfType(nimmanager.getNimType(self.slotid), exception = x)) > 0: # choices["equal"] = _("equal to") # choices["satposdepends"] = _("second cable of motorized LNB") if len(nimmanager.canEqualTo(self.slotid)) > 0: choices["equal"] = _("equal to") if len(nimmanager.canDependOn(self.slotid)) > 0: choices["satposdepends"] = _("second cable of motorized LNB") if len(nimmanager.canConnectTo(self.slotid)) > 0: choices["loopthrough"] = _("loopthrough to") self.nimConfig.configMode.setChoices(choices, default = "nothing")
9f8056cd2f459c5221e4af6e37b75bc671f14e8d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6652/9f8056cd2f459c5221e4af6e37b75bc671f14e8d/Satconfig.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 809, 2309, 12, 2890, 4672, 309, 365, 18, 82, 381, 18, 291, 14599, 2932, 30199, 38, 17, 55, 6, 4672, 7246, 273, 288, 315, 30874, 6877, 389, 2932, 902, 4351, 6, 3631, 315, 9647, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 809, 2309, 12, 2890, 4672, 309, 365, 18, 82, 381, 18, 291, 14599, 2932, 30199, 38, 17, 55, 6, 4672, 7246, 273, 288, 315, 30874, 6877, 389, 2932, 902, 4351, 6, 3631, 315, 9647, 6...
docindex = build_doc_index(item, introspect, parse, add_submodules)
docindex = build_doc_index([item], introspect, parse, add_submodules)
def build_doc(item, introspect=True, parse=True, add_submodules=True): """ Build API documentation for a given item, and return it as an L{APIDoc} object. @rtype: L{APIDoc} @param item: The item to document, specified using any of the following: - A string, naming a python package directory (e.g., C{'epydoc/markup'}) - A string, naming a python file (e.g., C{'epydoc/docparser.py'}) - A string, naming a python object (e.g., C{'epydoc.docparser.DocParser'}) - Any (non-string) python object (e.g., C{list.append}) @param introspect: If true, then use introspection to examine the specified items. Otherwise, just use parsing. @param parse: If true, then use parsing to examine the specified items. Otherwise, just use introspection. """ docindex = build_doc_index(item, introspect, parse, add_submodules) return docindex.root[0]
8aa7231229258c90d0edec0d2a3fa13ea99ef70f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/8aa7231229258c90d0edec0d2a3fa13ea99ef70f/docbuilder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 67, 2434, 12, 1726, 16, 30165, 33, 5510, 16, 1109, 33, 5510, 16, 527, 67, 1717, 6400, 33, 5510, 4672, 3536, 3998, 1491, 7323, 364, 279, 864, 761, 16, 471, 327, 518, 487, 392, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 67, 2434, 12, 1726, 16, 30165, 33, 5510, 16, 1109, 33, 5510, 16, 527, 67, 1717, 6400, 33, 5510, 4672, 3536, 3998, 1491, 7323, 364, 279, 864, 761, 16, 471, 327, 518, 487, 392, 5...
r.update({f:(r['__domain'][0][2],r[r['__domain'][0][0]])}) if result['fields'][f]['type'] == 'date' and r[f]: r[f] = ''
r.update({f:(r['__domain'][0][2],r[r['__domain'][0][0]])})
def create(self, cr, uid, ids, datas, context=None): if not context: context={} self.context = context pool = pooler.get_pool(cr.dbname) model = pool.get(datas['model']) model_id = pool.get('ir.model').search(cr, uid, [('model','=',model._name)]) if model_id: model_desc = pool.get('ir.model').browse(cr, uid, model_id[0], context).name self.title = model_desc else: model_desc = model._description self.title = model_desc
7c5bc6cde05c41a743a7b7277daf1acf00c7f93f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7c5bc6cde05c41a743a7b7277daf1acf00c7f93f/ps_list.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 5386, 16, 819, 33, 7036, 4672, 309, 486, 819, 30, 819, 12938, 365, 18, 2472, 273, 819, 2845, 273, 2845, 264, 18, 588, 67, 6011, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 5386, 16, 819, 33, 7036, 4672, 309, 486, 819, 30, 819, 12938, 365, 18, 2472, 273, 819, 2845, 273, 2845, 264, 18, 588, 67, 6011, 12, ...
self.where = where
self.where = where
def __init__(self, author=None, category=None, content=None, atom_id=None, link=None, published=None, title=None, updated=None, color=None, access_level=None, hidden=None, timezone=None, selected=None, where=None, extension_elements=None, extension_attributes=None, text=None): gdata.GDataEntry.__init__(self, author=author, category=category, content=content, atom_id=atom_id, link=link, published=published, title=title, updated=updated, text=None)
220fb3846b34b52b462236a865acc3580b5bf99c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5609/220fb3846b34b52b462236a865acc3580b5bf99c/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2869, 33, 7036, 16, 3150, 33, 7036, 16, 913, 33, 7036, 16, 3179, 67, 350, 33, 7036, 16, 1692, 33, 7036, 16, 9487, 33, 7036, 16, 2077, 33, 7036, 16, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2869, 33, 7036, 16, 3150, 33, 7036, 16, 913, 33, 7036, 16, 3179, 67, 350, 33, 7036, 16, 1692, 33, 7036, 16, 9487, 33, 7036, 16, 2077, 33, 7036, 16, 3...
def __init__(self, player_ui, navigator, service_locator): Window.__init__(self, player_ui, navigator)
def __init__(self, quit_handler, navigator, service_locator): Window.__init__(self, quit_handler, navigator)
def __init__(self, player_ui, navigator, service_locator): Window.__init__(self, player_ui, navigator) self.__fs_services = service_locator.file_system_services self.__music_repository = service_locator.music_repository self.body = appuifw.Listbox(self.get_list_items(), self.go_to)
43a0f8d3d71fafa93f66b7de5c6311692b8b2ccd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5169/43a0f8d3d71fafa93f66b7de5c6311692b8b2ccd/aspyplayer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 9706, 67, 4176, 16, 19796, 16, 1156, 67, 20048, 4672, 6076, 16186, 2738, 972, 12, 2890, 16, 9706, 67, 4176, 16, 19796, 13, 365, 16186, 2556, 67, 8387, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 9706, 67, 4176, 16, 19796, 16, 1156, 67, 20048, 4672, 6076, 16186, 2738, 972, 12, 2890, 16, 9706, 67, 4176, 16, 19796, 13, 365, 16186, 2556, 67, 8387, 27...
\\usepackage[colorlinks,linkcolor=blue]{hyperref}
\\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
def suite(): s = DocutilsTestSupport.LatexPublishTestSuite() s.generateTests(totest) return s
a8810a46529d2a8dea00f857923963b9d9d68b55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/a8810a46529d2a8dea00f857923963b9d9d68b55/test_latex2e.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11371, 13332, 272, 273, 3521, 5471, 4709, 6289, 18, 6607, 338, 6024, 4709, 13587, 1435, 272, 18, 7163, 14650, 12, 3307, 395, 13, 327, 272, 282, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 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, 11371, 13332, 272, 273, 3521, 5471, 4709, 6289, 18, 6607, 338, 6024, 4709, 13587, 1435, 272, 18, 7163, 14650, 12, 3307, 395, 13, 327, 272, 282, 2, -100, -100, -100, -100, -100, -100, -10...
if depth > maxDepth: maxDepth = depth
def findDepth(self, insts): depth = 0 maxDepth = 0 for i in insts: opname = i[0] delta = self.effect.get(opname, 0) if delta > 1: depth = depth + delta elif delta < 0: if depth > maxDepth: maxDepth = depth depth = depth + delta else: if depth > maxDepth: maxDepth = depth # now check patterns for pat, pat_delta in self.patterns: if opname[:len(pat)] == pat: delta = pat_delta depth = depth + delta break # if we still haven't found a match if delta == 0: meth = getattr(self, opname, None) if meth is not None: depth = depth + meth(i[1]) if depth < 0: depth = 0 return maxDepth
ff22a17528570ea77a7832f497e0214ff24c7d85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9633/ff22a17528570ea77a7832f497e0214ff24c7d85/pyassem.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 6148, 12, 2890, 16, 1804, 87, 4672, 3598, 273, 374, 22074, 273, 374, 364, 277, 316, 1804, 87, 30, 30273, 273, 277, 63, 20, 65, 3622, 273, 365, 18, 13867, 18, 588, 12, 556, 529,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 6148, 12, 2890, 16, 1804, 87, 4672, 3598, 273, 374, 22074, 273, 374, 364, 277, 316, 1804, 87, 30, 30273, 273, 277, 63, 20, 65, 3622, 273, 365, 18, 13867, 18, 588, 12, 556, 529,...
p = _parse(s, g, flags) tail = s.get()
p = _parse(source, state, flags) tail = source.get()
def parse(source, flags=()): s = Tokenizer(source) g = Pattern() b = [] while 1: p = _parse(s, g, flags) tail = s.get() if tail == "|": b.append(p) elif tail == ")": raise SyntaxError, "unbalanced parenthesis" elif tail is None: if b: b.append(p) p = SubPattern(g) _branch(p, b) break else: raise SyntaxError, "bogus characters at end of regular expression" return p
815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 3168, 16, 2943, 33, 1435, 4672, 272, 273, 26702, 12, 3168, 13, 314, 273, 6830, 1435, 324, 273, 5378, 1323, 404, 30, 293, 273, 389, 2670, 12, 3168, 16, 919, 16, 2943, 13, 57...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 3168, 16, 2943, 33, 1435, 4672, 272, 273, 26702, 12, 3168, 13, 314, 273, 6830, 1435, 324, 273, 5378, 1323, 404, 30, 293, 273, 389, 2670, 12, 3168, 16, 919, 16, 2943, 13, 57...
del RegistrationServer._registeredUsers[nodeId] del self._ruTimestamp[nodeId]
if verbose: print "%s removed" % str(PresenceServer._registeredUsers[nodeId]) del PresenceServer._registeredUsers[nodeId] del PresenceServer._ruTimestamp[nodeId] elif verbose: print "keep: %s (%s)" % (str(PresenceServer._registeredUsers[nodeId]), str(values))
def _auto_logout_everybody(self): """evicts registered nodes after some time """ now = datetime.utcnow() for nodeId, values in self._ruTimestamp.items(): dt = now - values if dt.seconds > self._autoExpirationDelayInSecs: del RegistrationServer._registeredUsers[nodeId] del self._ruTimestamp[nodeId]
b920bf9f70394ee1dde3b38d84ef8b4cb9d0e733 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2259/b920bf9f70394ee1dde3b38d84ef8b4cb9d0e733/registration.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6079, 67, 21229, 67, 20434, 3432, 12, 2890, 4672, 3536, 73, 11946, 87, 4104, 2199, 1839, 2690, 813, 3536, 2037, 273, 3314, 18, 17892, 3338, 1435, 364, 11507, 16, 924, 316, 365, 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, 6079, 67, 21229, 67, 20434, 3432, 12, 2890, 4672, 3536, 73, 11946, 87, 4104, 2199, 1839, 2690, 813, 3536, 2037, 273, 3314, 18, 17892, 3338, 1435, 364, 11507, 16, 924, 316, 365, 6315...
self.assertEqual(tf.read(), "appleorange")
output = tf.read() stripped = remove_stderr_debug_decorations(output) self.assertEqual(stripped, "appleorange")
def test_stdout_stderr_file(self): # capture stdout and stderr to the same open file tf = tempfile.TemporaryFile() p = subprocess.Popen([sys.executable, "-c", 'import sys;' \ 'sys.stdout.write("apple");' \ 'sys.stdout.flush();' \ 'sys.stderr.write("orange")'], stdout=tf, stderr=tf) p.wait() tf.seek(0) self.assertEqual(tf.read(), "appleorange")
7ebb9fcf9e437f932409de74d92a511fbe5eeb6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/7ebb9fcf9e437f932409de74d92a511fbe5eeb6c/test_subprocess.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 10283, 67, 11241, 67, 768, 12, 2890, 4672, 468, 7477, 3909, 471, 4514, 358, 326, 1967, 1696, 585, 3253, 273, 13275, 18, 23808, 1435, 293, 273, 6652, 18, 52, 3190, 3816, 9499, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 10283, 67, 11241, 67, 768, 12, 2890, 4672, 468, 7477, 3909, 471, 4514, 358, 326, 1967, 1696, 585, 3253, 273, 13275, 18, 23808, 1435, 293, 273, 6652, 18, 52, 3190, 3816, 9499, ...
'max_projectors_per_atom']
'max_projectors_per_atom', 'atomdos_energygrid_size', 'atomdos_angular_channels', 'atomdos_radial_orbs']
def restart(self): ''' Restart the calculator by deleting nc dimensions that will be rewritten on the next calculation. This is sometimes required when certain dimensions change related to unitcell size changes planewave/densitywave cutoffs and kpt changes. These can cause fortran netcdf errors if the data does not match the pre-defined dimension sizes.
9020934695c27fb64d90b2a9995cd10043e64b09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1380/9020934695c27fb64d90b2a9995cd10043e64b09/jacapo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7870, 12, 2890, 4672, 9163, 20709, 326, 15497, 635, 12993, 8194, 5769, 716, 903, 506, 26768, 603, 326, 1024, 11096, 18, 1220, 353, 16594, 1931, 1347, 8626, 5769, 2549, 3746, 358, 2836, 385...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2890, 4672, 9163, 20709, 326, 15497, 635, 12993, 8194, 5769, 716, 903, 506, 26768, 603, 326, 1024, 11096, 18, 1220, 353, 16594, 1931, 1347, 8626, 5769, 2549, 3746, 358, 2836, 385...
src = urllib2.urlopen(url) length = int(src.info().get('Content-Length', 0))
with auth_handler_lock: auth_handler.retried = 0 src = urllib2.urlopen(url) length = int(src.info().get('Content-Length', 0))
def download(url, filename, tmpname, status): src = urllib2.urlopen(url) length = int(src.info().get('Content-Length', 0)) if not tmpname: tmpname = filename dst = open(tmpname, 'w') status.set(0, length) while True: data = src.read(1024) if len(data) == 0: src.close() dst.close() if length and os.stat(tmpname)[stat.ST_SIZE] != length: # something went wrong os.unlink(tmpname) raise IOError('download %s failed' % url) if tmpname != filename: os.rename(tmpname, filename) return True status.update(len(data)) dst.write(data)
843a7ca62d3db7a612d88309894656971804a8ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11722/843a7ca62d3db7a612d88309894656971804a8ef/url.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4224, 12, 718, 16, 1544, 16, 1853, 529, 16, 1267, 4672, 598, 1357, 67, 4176, 67, 739, 30, 1357, 67, 4176, 18, 266, 313, 2092, 273, 374, 1705, 273, 11527, 22, 18, 295, 18589, 12, 718,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4224, 12, 718, 16, 1544, 16, 1853, 529, 16, 1267, 4672, 598, 1357, 67, 4176, 67, 739, 30, 1357, 67, 4176, 18, 266, 313, 2092, 273, 374, 1705, 273, 11527, 22, 18, 295, 18589, 12, 718,...
- ``'pari'`` - use PARI's factorial function
- ``'pari'`` - use PARI's factorial function
def factorial(n, algorithm='gmp'): r""" Compute the factorial of `n`, which is the product `1\cdot 2\cdot 3 \cdots (n-1)\cdot n`. INPUT: - ``n`` - an integer - ``algorithm`` - string (default: 'gmp') - ``'gmp'`` - use the GMP C-library factorial function - ``'pari'`` - use PARI's factorial function OUTPUT: an integer EXAMPLES:: sage: from sage.rings.arith import factorial sage: factorial(0) 1 sage: factorial(4) 24 sage: factorial(10) 3628800 sage: factorial(1) == factorial(0) True sage: factorial(6) == 6*5*4*3*2 True sage: factorial(1) == factorial(0) True sage: factorial(71) == 71* factorial(70) True sage: factorial(-32) Traceback (most recent call last): ... ValueError: factorial -- must be nonnegative PERFORMANCE: This discussion is valid as of April 2006. All timings below are on a Pentium Core Duo 2Ghz MacBook Pro running Linux with a 2.6.16.1 kernel. - It takes less than a minute to compute the factorial of `10^7` using the GMP algorithm, and the factorial of `10^6` takes less than 4 seconds. - The GMP algorithm is faster and more memory efficient than the PARI algorithm. E.g., PARI computes `10^7` factorial in 100 seconds on the core duo 2Ghz. - For comparison, computation in Magma `\leq` 2.12-10 of `n!` is best done using ``*[1..n]``. It takes 113 seconds to compute the factorial of `10^7` and 6 seconds to compute the factorial of `10^6`. Mathematica V5.2 compute the factorial of `10^7` in 136 seconds and the factorial of `10^6` in 7 seconds. (Mathematica is notably very efficient at memory usage when doing factorial calculations.) """ if n < 0: raise ValueError, "factorial -- must be nonnegative" if algorithm == 'gmp': return ZZ(n).factorial() elif algorithm == 'pari': return pari.factorial(n) else: raise ValueError, 'unknown algorithm'
07a0e7a1987887a17f526710029b60138c7463cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/07a0e7a1987887a17f526710029b60138c7463cb/arith.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5578, 649, 12, 82, 16, 4886, 2218, 75, 1291, 11, 4672, 436, 8395, 8155, 326, 5578, 649, 434, 1375, 82, 9191, 1492, 353, 326, 3017, 1375, 21, 64, 4315, 352, 576, 64, 4315, 352, 890, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5578, 649, 12, 82, 16, 4886, 2218, 75, 1291, 11, 4672, 436, 8395, 8155, 326, 5578, 649, 434, 1375, 82, 9191, 1492, 353, 326, 3017, 1375, 21, 64, 4315, 352, 576, 64, 4315, 352, 890, 5...
self.annotate_hook(driver.get_jitcell_at, driver.greens, **kwds_s) self.annotate_hook(driver.set_jitcell_at, driver.greens, [s_jitcell], **kwds_s) self.annotate_hook(driver.get_printable_location, driver.greens, **kwds_s)
h = self.annotate_hook return (h(driver.get_jitcell_at, driver.greens, **kwds_s) and h(driver.set_jitcell_at, driver.greens, [s_jitcell], **kwds_s) and h(driver.get_printable_location, driver.greens, **kwds_s))
def annotate_hooks(self, **kwds_s): driver = self.instance.im_self s_jitcell = self.bookkeeper.valueoftype(BaseJitCell) self.annotate_hook(driver.get_jitcell_at, driver.greens, **kwds_s) self.annotate_hook(driver.set_jitcell_at, driver.greens, [s_jitcell], **kwds_s) self.annotate_hook(driver.get_printable_location, driver.greens, **kwds_s)
b12180b5de3f693496ad9c18fa99946ad1883dfb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/b12180b5de3f693496ad9c18fa99946ad1883dfb/jit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13795, 67, 10468, 12, 2890, 16, 2826, 25577, 67, 87, 4672, 3419, 273, 365, 18, 1336, 18, 381, 67, 2890, 272, 67, 78, 305, 3855, 273, 365, 18, 3618, 79, 9868, 18, 1132, 792, 723, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13795, 67, 10468, 12, 2890, 16, 2826, 25577, 67, 87, 4672, 3419, 273, 365, 18, 1336, 18, 381, 67, 2890, 272, 67, 78, 305, 3855, 273, 365, 18, 3618, 79, 9868, 18, 1132, 792, 723, 12, ...
k -- an integer (ddefault: 2) p -- a prime (default: 0); just the p-new subspace if given
k -- an integer (default: 2) p -- a prime (default: 0); just the $p$-new subspace if given
def dimension_new_cusp_forms_group(group, k=2, p=0): """ Return the dimension of the new space of cusp forms for the congruence subgroup group. If p is given, return the p-new subspace. INPUT: group -- a congruence subgroup k -- an integer (ddefault: 2) p -- a prime (default: 0); just the p-new subspace if given OUTPUT: Integer EXAMPLES: sage: sage.modular.dims.dimension_new_cusp_forms_group(Gamma0(33),2) 1 sage: sage.modular.dims.dimension_new_cusp_forms_group(Gamma0(33),2,3) 1 sage: sage.modular.dims.dimension_new_cusp_forms_group(Gamma0(33),2,11) 3 sage: sage.modular.dims.dimension_new_cusp_forms_group(Gamma1(33),2) 19 sage: sage.modular.dims.dimension_new_cusp_forms_group(Gamma1(33),2,11) 21 sage: sage.modular.dims.dimension_new_cusp_forms_group(GammaH(33,[1,2]),2) 3 """ assert isinstance(group, congroup.CongruenceSubgroup), \ "Argument 1 must be a congruence subgroup." if isinstance(group, congroup.Gamma0): return dimension_new_cusp_forms_gamma0(group.level(), k, p) elif isinstance(group, congroup.Gamma1): return dimension_new_cusp_forms_gamma1(group.level(), k, p) elif congroup.is_GammaH(group): return dimension_new_cusp_forms_H(group, k, p) else: raise NotImplementedError, "Computing of dimensions for congruence subgroups besides \ Gamma0 and Gamma1 is not yet implemented."
248019f740827c6c514f1cd94eb6bd825f071218 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/248019f740827c6c514f1cd94eb6bd825f071218/dims.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4968, 67, 2704, 67, 71, 407, 84, 67, 9741, 67, 1655, 12, 1655, 16, 417, 33, 22, 16, 293, 33, 20, 4672, 3536, 2000, 326, 4968, 434, 326, 394, 3476, 434, 27964, 84, 10138, 364, 326, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4968, 67, 2704, 67, 71, 407, 84, 67, 9741, 67, 1655, 12, 1655, 16, 417, 33, 22, 16, 293, 33, 20, 4672, 3536, 2000, 326, 4968, 434, 326, 394, 3476, 434, 27964, 84, 10138, 364, 326, ...
if c.fitting[2] == 0:
if isset(CrashFlag, GetFlag("FIT_SKY")): c.fitting[2] = 0 else:
def isset(flag, bit): """Return True if the specified bit is set in the given bit mask""" return (flag & (1 << bit)) != 0
fd0d22c1cab10a076604581ca3b2c40b247e0e74 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8867/fd0d22c1cab10a076604581ca3b2c40b247e0e74/pymorph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1020, 12, 6420, 16, 2831, 4672, 3536, 990, 1053, 309, 326, 1269, 2831, 353, 444, 316, 326, 864, 2831, 3066, 8395, 327, 261, 6420, 473, 261, 21, 2296, 2831, 3719, 480, 374, 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, 1020, 12, 6420, 16, 2831, 4672, 3536, 990, 1053, 309, 326, 1269, 2831, 353, 444, 316, 326, 864, 2831, 3066, 8395, 327, 261, 6420, 473, 261, 21, 2296, 2831, 3719, 480, 374, 2, -100, -10...
return dpkg_info(package)
return __dpkg_info(package)
def info(package): """\ Returns a dictionary with package information about a given package file: - type: Package management program that handles the file - system_support: If the package management program is installed on the system or not - source: If it is a source (True) our binary (False) package - version: The package version (or name), that is used to check against the package manager if the package is installed - arch: The architecture for which a binary package was built - installed: Whether the package is installed (True) on the system or not (False) Implemented package types: - 'dpkg' - dpkg (debian, ubuntu) package files - 'rpm' - rpm (red hat, suse) package files Raises an exception if the package type is not one of the implemented package types. """ if not os.path.isfile(package): raise ValueError('invalid file %s to verify' % package) # Use file and libmagic to determine the actual package file type. file_result = system_output('file ' + package) known_package_managers = ['rpm', 'dpkg'] for package_manager in known_package_managers: if package_manager == 'rpm': package_pattern = re.compile('RPM', re.IGNORECASE) elif package_manager == 'dpkg': package_pattern = re.compile('Debian', re.IGNORECASE) result = re.search(package_pattern, file_result) if result and package_manager == 'rpm': return rpm_info(package) elif result and package_manager == 'dpkg': return dpkg_info(package) # If it's not one of the implemented package manager methods, there's # not much that can be done, hence we throw an exception. raise PackageError('Unknown package type %s' % file_result)
0f5dcab9d2fdfaa6328baf4fa9aa57b606fd56ed /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/0f5dcab9d2fdfaa6328baf4fa9aa57b606fd56ed/package.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1123, 12, 5610, 4672, 3536, 64, 2860, 279, 3880, 598, 2181, 1779, 2973, 279, 864, 2181, 585, 30, 300, 618, 30, 7508, 11803, 5402, 716, 7372, 326, 585, 300, 2619, 67, 13261, 30, 971, 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, 1123, 12, 5610, 4672, 3536, 64, 2860, 279, 3880, 598, 2181, 1779, 2973, 279, 864, 2181, 585, 30, 300, 618, 30, 7508, 11803, 5402, 716, 7372, 326, 585, 300, 2619, 67, 13261, 30, 971, 32...
lang = req.lang
def print_citation_summary_html(req, citedbylist, criteria=""): """Prints citation summary in html. The criteria, if any, is added to the link""" lang = req.lang alldict = calculate_citations(tresholdsNames, citedbylist) avgstr = str(alldict['avgcites']) totalcites = str(alldict['totalcites']) #format avg so that it does not span 10 digits avgstr = avgstr[0:4] reciddict = alldict['reciddict'] return template.citesummary_html(lang, totalcites, avgstr, reciddict)
50059b83f89be99a148b098af195bd8ca4ddd2dd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/50059b83f89be99a148b098af195bd8ca4ddd2dd/search_engine_summarizer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 71, 8773, 67, 7687, 67, 2620, 12, 3658, 16, 276, 16261, 1637, 1098, 16, 3582, 1546, 6, 4672, 3536, 15402, 21145, 4916, 316, 1729, 18, 1021, 3582, 16, 309, 1281, 16, 353, 3096...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 71, 8773, 67, 7687, 67, 2620, 12, 3658, 16, 276, 16261, 1637, 1098, 16, 3582, 1546, 6, 4672, 3536, 15402, 21145, 4916, 316, 1729, 18, 1021, 3582, 16, 309, 1281, 16, 353, 3096...
st = gst.Structure('application/x-gst-dvd');
st = gst.Structure('application/x-gst-dvd')
def subpictureClut(clut): """Create and return a new subpicture CLUT event based on the specified color lookup table (an 16 position array).""" st = gst.Structure('application/x-gst-dvd'); st.set_value('event', 'dvd-spu-clut-change') # Each value is stored in a separate field. for i in range(16): st.set_value('clut%02d' % i, clut[i]) return gst.event_new_any(st)
473dc8e598b7381c585def115d0d76dc79e52f54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5222/473dc8e598b7381c585def115d0d76dc79e52f54/events.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 720, 21126, 2009, 322, 12, 830, 322, 4672, 3536, 1684, 471, 327, 279, 394, 720, 21126, 14934, 1693, 871, 2511, 603, 326, 1269, 2036, 3689, 1014, 261, 304, 2872, 1754, 526, 13, 12123, 384...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 720, 21126, 2009, 322, 12, 830, 322, 4672, 3536, 1684, 471, 327, 279, 394, 720, 21126, 14934, 1693, 871, 2511, 603, 326, 1269, 2036, 3689, 1014, 261, 304, 2872, 1754, 526, 13, 12123, 384...
self.wTree.get_widget("ctcm_mark_as_not_done").set_sensitive(True)
self.wTree.get_widget( "ctcm_mark_as_not_done").set_sensitive(True)
def taskdone_cursor_changed(self, selection=None): #We unselect all in the active task view #Only if something is selected in the closed task list #And we change the status of the Done/dismiss button self.donebutton.set_icon_name("gtg-task-done") self.dismissbutton.set_icon_name("gtg-task-dismiss") if selection.count_selected_rows() > 0: tid = self.get_selected_task(self.taskdone_tview) task = self.req.get_task(tid) self.task_tview.get_selection().unselect_all() self.note_tview.get_selection().unselect_all() if task.get_status() == "Dismiss": self.wTree.get_widget("ctcm_mark_as_not_done").set_sensitive(False) self.wTree.get_widget("ctcm_undismiss").set_sensitive(True) self.dismissbutton.set_label(GnomeConfig.MARK_UNDISMISS) self.donebutton.set_label(GnomeConfig.MARK_DONE) self.donebutton.set_tooltip_text(GnomeConfig.MARK_DONE_TOOLTIP) self.dismissbutton.set_icon_name("gtg-task-undismiss") self.dismissbutton.set_tooltip_text(GnomeConfig.MARK_UNDISMISS_TOOLTIP)
fac54dcba973acc5967f43b60fb540659a1a87a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8234/fac54dcba973acc5967f43b60fb540659a1a87a8/browser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1562, 8734, 67, 9216, 67, 6703, 12, 2890, 16, 4421, 33, 7036, 4672, 468, 3218, 640, 4025, 777, 316, 326, 2695, 1562, 1476, 468, 3386, 309, 5943, 353, 3170, 316, 326, 4375, 1562, 666, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1562, 8734, 67, 9216, 67, 6703, 12, 2890, 16, 4421, 33, 7036, 4672, 468, 3218, 640, 4025, 777, 316, 326, 2695, 1562, 1476, 468, 3386, 309, 5943, 353, 3170, 316, 326, 4375, 1562, 666, 4...
policies_options += \ '<option img="%s" value="%s" caption="%s"/>' % \ (policy.__image__, policy.id, policy.displayName.value) self.params['POLICIES_OPTIONS'] = policies_options
policies_options += [xmlUtils.XMLEncode(policy.__image__), policy.id, xmlUtils.XMLEncode(policy.displayName.value)] self.params['POLICIES'] = ';'.join(policies_options)
def setParams(self): self.response.setHeader('cache-control', 'no-cache') sLang = self.request.getLang()
19d016592fde3a93ded6b6761dfcf716d2874a72 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2504/19d016592fde3a93ded6b6761dfcf716d2874a72/ui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31705, 12, 2890, 4672, 365, 18, 2740, 18, 542, 1864, 2668, 2493, 17, 7098, 2187, 296, 2135, 17, 2493, 6134, 272, 7275, 273, 365, 18, 2293, 18, 588, 7275, 1435, 2, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 31705, 12, 2890, 4672, 365, 18, 2740, 18, 542, 1864, 2668, 2493, 17, 7098, 2187, 296, 2135, 17, 2493, 6134, 272, 7275, 273, 365, 18, 2293, 18, 588, 7275, 1435, 2, -100, -100, -100, -10...
maxima(ic)
maxima.eval(ic)
def desolve_system(des,vars,ics=None): """ Solves any size system of 1st order odes using maxima. Initials conditions are optional. INPUT: de -- a list of strings representing the ODEs in maxima notation (eg, de = "diff(f(x),x,2)=diff(f(x),x)+sin(x)") vars -- a list of strings representing the variables (eg, vars = ["t","x","y"], where t is the independent variable and x,y the dependent variables) ics -- a list of numbers representing initial conditions (eg, x(0)=1, y(0)=2 is ics = [0,1,2]) WARNING: The given ics sets the initial values of the dependent vars in maxima, so subsequent ODEs involving these variables will have these initial conditions automatically imposed. EXAMPLES: sage: from sage.calculus.desolvers import desolve_system sage: t = var('t') sage: x = function('x', t) sage: y = function('y', t) sage: de1 = lambda z: diff(z[0],t) + z[1] - 1 sage: de2 = lambda z: diff(z[1],t) - z[0] + 1 sage: des = [de1([x(t),y(t)]),de2([x(t),y(t)])] sage: vars = ["t","x","y"] sage: desolve_system(des,vars) ['(1-y(0))*sin(t)+(x(0)-1)*cos(t)+1', '(x(0)-1)*sin(t)+(y(0)-1)*cos(t)+1'] sage: ics = [0,1,-1] sage: soln = desolve_system(des,vars,ics); soln ['2*sin(t)+1', '1-2*cos(t)'] sage: solnx = lambda s: RR(eval(soln[0].replace("t","s"))) sage: solnx(3) 1.28224001611973 sage: solny = lambda s: RR(eval(soln[1].replace("t","s"))) sage: P1 = plot([solnx,solny],0,1) sage: P2 = parametric_plot((solnx,solny),0,1) Now type show(P1), show(P2) to view these. AUTHOR: David Joyner (3-2006, 8-2007) """ d = len(des) dess = [de._repr_() + "=0" for de in des] for i in range(d): cmd="de:" + dess[int(i)] + ";" maxima(cmd) desstr = "[" + ",".join(dess) + "]" d = len(vars) varss = list(vars[i] + "(" + vars[0] + ")" for i in range(1,d)) varstr = "[" + ",".join(varss) + "]" if ics!=None: #d = len(ics) ## must be same as len(des) for i in range(1,d): ic = "atvalue(" + vars[int(i)] + "("+vars[0] + ")," + str(vars[0]) + "=" + str(ics[0]) + "," + str(ics[int(i)]) + ")" maxima(ic) cmd = "desolve(" + desstr + "," + varstr + ");" soln = maxima(cmd) return [f.rhs()._maxima_init_() for f in soln]
403ac5f76dbf68ca39442594f49b86d97362fce3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/403ac5f76dbf68ca39442594f49b86d97362fce3/desolvers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2832, 5390, 67, 4299, 12, 5489, 16, 4699, 16, 2102, 33, 7036, 4672, 3536, 348, 355, 3324, 1281, 963, 2619, 434, 404, 334, 1353, 320, 5489, 1450, 943, 13888, 18, 10188, 87, 4636, 854, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2832, 5390, 67, 4299, 12, 5489, 16, 4699, 16, 2102, 33, 7036, 4672, 3536, 348, 355, 3324, 1281, 963, 2619, 434, 404, 334, 1353, 320, 5489, 1450, 943, 13888, 18, 10188, 87, 4636, 854, 3...
msg="Sip Iteration %i: %i objects match. rms scatter is %g arcsec or %g pixels" \ %(i, matchSize, sipObject.getScatterInArcsec(), sipObject.getScatterInPixels()) log.log(Log.DEBUG, msg)
def determineWcs(policy, exposure, sourceSet, log=None, solver=None, doTrim=False): """Top level function for calculating a Wcs. Given an initial guess at a Wcs (hidden inside an exposure) and a set of sources (sourceSet), use astrometry.net to confirm the Wcs, then calculate distortion terms. Input: policy: An lsst.pex.policy.Policy object containing the parameters for the solver exposure lsst.afw.image.Exposure representation of an image and a wcs this provides the initial guess at position and plate scale sourceSet A list of lsst.afw.detection.Source objects, indicating the pixel positions of stars in the field log A lsst.pex.logging.Log object (optional), used for printing progress doTrim Check that all sources lie within the image, and remove those that don't. solver Optionally provide a previously created astrometry.net solver. If not provided one will be created. """ if log is None: log = StdoutLog() #Write log messages to stdout log.log(Log.INFO, "In determineWcs") #Short names exp = exposure srcSet = sourceSet if doTrim: nStart = len(srcSet) srcSet = trimBadPoints(exp, srcSet) if log: nEnd = len(srcSet) log.log(log.DEBUG, "Kept %i of %i sources after trimming" %(nEnd, nStart)) #Extract an initial guess wcs if available wcsIn = exp.getWcs() #May be None if wcsIn is None: log.log(log.WARN, "No wcs found on exposure. Doing blind solve") #Setup solver if solver is None: path=os.path.join(eups.productDir("astrometry_net_data"), "metadata.paf") solver = astromNet.GlobalAstrometrySolution(path) solver.allowDistortion(policy.get('allowDistortion')) matchThreshold = policy.get('matchThreshold') solver.setMatchThreshold(matchThreshold) else: solver.reset() #Set solving params log.log(log.DEBUG, "Setting starlist") solver.setStarlist(srcSet) log.log(log.DEBUG, "Setting numBrightObj") solver.setNumBrightObjects( min(policy.get('numBrightStars'), len(srcSet))) #Do a blind solve if we're told to, or if we don't have an input wcs doBlindSolve = policy.get('blindSolve') or (wcsIn is None) if doBlindSolve: log.log(log.DEBUG, "Solving with no initial guess at position") isSolved = solver.solve() else: isSolved = solver.solve(wcsIn) #Did we solve? log.log(log.DEBUG, "Finished Solve step.") if not isSolved: log.log(log.WARN, "No solution found, using input Wcs") return [], wcsIn wcs = solver.getWcs() # # Generate a list of catalogue objects in the field. # #First obtain the catalogue-listed positions of stars log.log(log.DEBUG, "Determining match objects") imgSizeInArcsec = getImageSizeInArcsec(srcSet, wcs) #Do we want magnitude information filterName = chooseFilterName(exposure, policy, solver, log) try: cat = solver.getCatalogue(2*imgSizeInArcsec, filterName) except LsstCppException, e: log.log(Log.WARN, str(e)) log.log(Log.WARN, "Attempting to access catalogue positions and fluxes") version = eups.productDir("astrometry_net_data") log.log(Log.WARN, "Catalogue version: %s" %(version)) log.log(Log.WARN, "Requested filter: %s" %(filterName)) log.log(Log.WARN, "Available filters: " + str(solver.getCatalogueMetadataFields())) raise matchList=[] #Make sure this stays in scope if True: #Now generate a list of matching objects distInArcsec = policy.get('distanceForCatalogueMatchinArcsec') cleanParam = policy.get('cleaningParameter') matchList = matchSrcAndCatalogue(cat=cat, img=srcSet, wcs=wcs, distInArcsec=distInArcsec, cleanParam=cleanParam) if len(matchList) == 0: log.log(Log.WARN, "No matches found between input source and catalogue.") log.log(Log.WARN, "Something in wrong. Defaulting to input wcs") return [], wcsIn log.log(Log.DEBUG, "%i catalogue objects match input source list using linear Wcs" %(len(matchList))) else: log.log(Log.DEBUG, "Getting matched sources: Fluxes in band %s " %(filterName)) matchList = solver.getMatchedSources(filterName) if policy.get('calculateSip'): #Iteratively calculate sip distortions and regenerate matchList based on improved wcs sipOrder = policy.get('sipOrder') matchSize = len(matchList) i=0 while True: try: sipObject = astromSip.CreateWcsWithSip(matchList, wcs, sipOrder) wcs = sipObject.getNewWcs() except LsstCppException, e: log.log(Log.WARN, "Failed to calculate distortion terms. Error:") log.log(Log.WARN, str(e)) log.log(Log.WARN, "Using best guess wcs") break #Use the new wcs to update the match list proposedMatchlist = matchSrcAndCatalogue(cat=cat, img=srcSet, wcs=wcs, distInArcsec=distInArcsec, cleanParam=cleanParam) if len(proposedMatchlist) <= matchSize: #We're regressing, so stop break matchList = proposedMatchlist matchSize = len(matchList) msg="Sip Iteration %i: %i objects match. rms scatter is %g arcsec or %g pixels" \ %(i, matchSize, sipObject.getScatterInArcsec(), sipObject.getScatterInPixels()) log.log(Log.DEBUG, msg) i=i+1 else: log.log(Log.DEBUG, "Updating wcs in input exposure with linear wcs") exposure.setWcs(wcs) solver.reset() return [matchList, wcs]
3a1220ada6e32f2a9cc1f75646c46a20369e7b0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6522/3a1220ada6e32f2a9cc1f75646c46a20369e7b0a/determineWcs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4199, 59, 2143, 12, 5086, 16, 14620, 16, 1084, 694, 16, 613, 33, 7036, 16, 12776, 33, 7036, 16, 741, 14795, 33, 8381, 4672, 3536, 3401, 1801, 445, 364, 21046, 279, 678, 2143, 18, 225, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4199, 59, 2143, 12, 5086, 16, 14620, 16, 1084, 694, 16, 613, 33, 7036, 16, 12776, 33, 7036, 16, 741, 14795, 33, 8381, 4672, 3536, 3401, 1801, 445, 364, 21046, 279, 678, 2143, 18, 225, ...
source = line[7:-1]
source = unquote(line[6:])
def unquote(str): return str[1:-1].replace("\\n", "\n") \ .replace('\\"', "\"")
2a54df0171cffbe3f57dad8b055d60ba7d278677 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/2a54df0171cffbe3f57dad8b055d60ba7d278677/translate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25611, 12, 701, 4672, 327, 609, 63, 21, 30, 17, 21, 8009, 2079, 2932, 1695, 82, 3113, 1548, 82, 7923, 282, 521, 263, 2079, 2668, 27576, 2187, 11143, 13, 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, 25611, 12, 701, 4672, 327, 609, 63, 21, 30, 17, 21, 8009, 2079, 2932, 1695, 82, 3113, 1548, 82, 7923, 282, 521, 263, 2079, 2668, 27576, 2187, 11143, 13, 2, -100, -100, -100, -100, -100...
val += c[1] query += ')'
return query, val query, val = _query(clause, 'OR') query_global, val_global = _query(clause_global, 'AND') if query_global: if query: query = '('+query+') AND '+query_global val.extend(val_global) else: query = query_global val = val_global
def domain_get(self, cr, uid, model_name): # root user above constraint if uid == 1: return '', []
da808e63717f21dab9b6c5ee127d2d74770b88ca /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12853/da808e63717f21dab9b6c5ee127d2d74770b88ca/ir_rule.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2461, 67, 588, 12, 2890, 16, 4422, 16, 4555, 16, 938, 67, 529, 4672, 468, 1365, 729, 5721, 4954, 309, 4555, 422, 404, 30, 327, 10226, 5378, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2461, 67, 588, 12, 2890, 16, 4422, 16, 4555, 16, 938, 67, 529, 4672, 468, 1365, 729, 5721, 4954, 309, 4555, 422, 404, 30, 327, 10226, 5378, 2, -100, -100, -100, -100, -100, -100, -100,...
farch = fname.split('@')[-3]
farch = self.file_to_arch[fname]
def read_files(self): for fname in [f for f in self.files if f.endswith('primary.xml.gz')]: farch = fname.split('@')[-3] fdata = lxml.etree.parse(fname).getroot() self.parse_primary(fdata, farch) for fname in [f for f in self.files if f.endswith('filelists.xml.gz')]: farch = fname.split('@')[-3] fdata = lxml.etree.parse(fname).getroot() self.parse_filelist(fdata, farch) # merge data sdata = self.packages.values() self.packages['global'] = copy.deepcopy(sdata.pop()) while sdata: self.packages['global'].intersection(sdata.pop())
7c4ce56bf3898af3475020066234fcc47bdbf103 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11867/7c4ce56bf3898af3475020066234fcc47bdbf103/Packages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 2354, 12, 2890, 4672, 364, 5299, 316, 306, 74, 364, 284, 316, 365, 18, 2354, 309, 284, 18, 5839, 1918, 2668, 8258, 18, 2902, 18, 9764, 6134, 14542, 284, 991, 273, 365, 18, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 2354, 12, 2890, 4672, 364, 5299, 316, 306, 74, 364, 284, 316, 365, 18, 2354, 309, 284, 18, 5839, 1918, 2668, 8258, 18, 2902, 18, 9764, 6134, 14542, 284, 991, 273, 365, 18, 7...