rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
x = numpy.linspace(-5,5,100) y = numpy.linspace(-5,5,100)
xy_range = (-5, 5) x = numpy.linspace(xy_range[0], xy_range[1] ,100) y = numpy.linspace(xy_range[0], xy_range[1] ,100)
def __init__(self): #The delegates views don't work unless we caller the superclass __init__ super(CursorTest, self).__init__() container = HPlotContainer(padding=0, spacing=20) self.plot = container #a subcontainer for the first plot. #I'm not sure why this is required. Without it, the layout doesn't work right. subcontainer = OverlayPlotContainer(padding=40) container.add(subcontainer) #make some data index = numpy.linspace(-10,10,512) value = numpy.sin(index) #create a LinePlot instance and add it to the subcontainer line = create_line_plot([index, value], add_grid=True, add_axis=True, index_sort='ascending', orientation = 'h') subcontainer.add(line) #here's our first cursor. csr = CursorTool(line, drag_button="left", color='blue') self.cursor1 = csr #and set it's initial position (in data-space units) csr.current_position = 0.0, 0.0 #this is a rendered component so it goes in the overlays list line.overlays.append(csr) #some other standard tools line.tools.append(PanTool(line, drag_button="right")) line.overlays.append(ZoomTool(line)) #make some 2D data for a colourmap plot x = numpy.linspace(-5,5,100) y = numpy.linspace(-5,5,100) X,Y = numpy.meshgrid(x, y) Z = numpy.sin(X)*numpy.arctan2(Y,X) #easiest way to get a CMapImagePlot is to use the Plot class ds = ArrayPlotData() ds.set_data('img', Z) img = Plot(ds, padding=40) cmapImgPlot = img.img_plot("img", xbounds = x, ybounds = y, colormap = jet)[0] container.add(img) #now make another cursor csr2 = CursorTool(cmapImgPlot, drag_button='left', color='white', line_width=2.0 ) self.cursor2 = csr2 csr2.current_position = 1.0, 1.5 cmapImgPlot.overlays.append(csr2) #add some standard tools. Note, I'm assigning the PanTool to the #right mouse-button to avoid conflicting with the cursors cmapImgPlot.tools.append(PanTool(cmapImgPlot, drag_button="right")) cmapImgPlot.overlays.append(ZoomTool(cmapImgPlot))
eda0fdd14626fbc54ac536da6646478d997dfe4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13167/eda0fdd14626fbc54ac536da6646478d997dfe4a/cursor_tool_demo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 468, 1986, 22310, 7361, 2727, 1404, 1440, 3308, 732, 4894, 326, 12098, 1001, 2738, 972, 2240, 12, 6688, 4709, 16, 365, 2934, 972, 2738, 972, 1435, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 468, 1986, 22310, 7361, 2727, 1404, 1440, 3308, 732, 4894, 326, 12098, 1001, 2738, 972, 2240, 12, 6688, 4709, 16, 365, 2934, 972, 2738, 972, 1435, 225, 1...
""" Use the Chinese Remainder Theorem to find some integer x such that x=a (mod m) and x=b (mod n). Note that x is only well-defined modulo m\*n.
r""" Use the Chinese Remainder Theorem to find some integer `x` such that `x=a \bmod m` and `x=b \bmod n`. Note that `x` is only well-defined modulo `m\*n`.
def crt(a,b,m,n): """ Use the Chinese Remainder Theorem to find some integer x such that x=a (mod m) and x=b (mod n). Note that x is only well-defined modulo m\*n. EXAMPLES:: sage: crt(2, 1, 3, 5) -4 sage: crt(13,20,100,301) -2087 You can also use upper case:: sage: c = CRT(2,3, 3, 5); c 8 sage: c % 3 == 2 True sage: c % 5 == 3 True """ if isinstance(a,list): return CRT_list(a,b) g, alpha, beta = XGCD(m,n) if g != 1: raise ValueError, "arguments a and b must be coprime" return a+(b-a)*alpha*m
c5cc436e94fabaa9fa38f5732aff2c6f8ca3be27 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/c5cc436e94fabaa9fa38f5732aff2c6f8ca3be27/arith.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 30677, 12, 69, 16, 70, 16, 81, 16, 82, 4672, 436, 8395, 2672, 326, 1680, 25331, 2663, 25407, 1021, 479, 81, 358, 1104, 2690, 3571, 1375, 92, 68, 4123, 716, 1375, 92, 33, 69, 521, 70,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 30677, 12, 69, 16, 70, 16, 81, 16, 82, 4672, 436, 8395, 2672, 326, 1680, 25331, 2663, 25407, 1021, 479, 81, 358, 1104, 2690, 3571, 1375, 92, 68, 4123, 716, 1375, 92, 33, 69, 521, 70,...
def LayoutTestHelperPath(self, target):
def LayoutTestHelperBinaryPath(self, target):
def LayoutTestHelperPath(self, target): """Path to the layout_test helper binary, if needed, empty otherwise""" return ''
ec358dc371508a2ef7248a677cc95a7dc54e2c89 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/ec358dc371508a2ef7248a677cc95a7dc54e2c89/platform_utils_linux.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9995, 4709, 2276, 5905, 743, 12, 2890, 16, 1018, 4672, 3536, 743, 358, 326, 3511, 67, 3813, 4222, 3112, 16, 309, 3577, 16, 1008, 3541, 8395, 327, 875, 2, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9995, 4709, 2276, 5905, 743, 12, 2890, 16, 1018, 4672, 3536, 743, 358, 326, 3511, 67, 3813, 4222, 3112, 16, 309, 3577, 16, 1008, 3541, 8395, 327, 875, 2, -100, -100, -100, -100, -100, ...
twoitemsrepr = "{1: 2, 'ba': 'bo'}" self.assertEqual(twoitemsrepr, str({1: 2, 'ba': 'bo'}))
ok_reprs = ["{1: 2, 'ba': 'bo'}", "{'ba': 'bo', 1: 2}"] self.assert_(str({1: 2, 'ba': 'bo'}) in ok_reprs)
def test_str_repr(self): self.assertEqual('{}', str({})) self.assertEqual('{1: 2}', str({1: 2})) self.assertEqual("{'ba': 'bo'}", str({'ba': 'bo'})) # NOTE: the string repr depends on hash values of 1 and 'ba'!!! twoitemsrepr = "{1: 2, 'ba': 'bo'}" self.assertEqual(twoitemsrepr, str({1: 2, 'ba': 'bo'})) self.assertEqual('{}', repr({})) self.assertEqual('{1: 2}', repr({1: 2})) self.assertEqual("{'ba': 'bo'}", repr({'ba': 'bo'})) self.assertEqual(twoitemsrepr, repr({1: 2, 'ba': 'bo'}))
2bdcd4b2387f2f29789de1be902e4db4199aafd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/2bdcd4b2387f2f29789de1be902e4db4199aafd7/test_dictobject.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 701, 67, 12715, 12, 2890, 4672, 365, 18, 11231, 5812, 2668, 8978, 16, 609, 23506, 3719, 365, 18, 11231, 5812, 2668, 95, 21, 30, 576, 24259, 609, 12590, 21, 30, 576, 31700, 36...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 701, 67, 12715, 12, 2890, 4672, 365, 18, 11231, 5812, 2668, 8978, 16, 609, 23506, 3719, 365, 18, 11231, 5812, 2668, 95, 21, 30, 576, 24259, 609, 12590, 21, 30, 576, 31700, 36...
for key, value in kwargs.items():
field_ids = [ob.prop_name() for ob in context._get_schema().objectValues() if ob.visible] for key in field_ids:
def updateSessionFrom(self, REQUEST=None, **kwargs): """Update session from a given language""" # Update kwargs from request if not REQUEST: return parents = REQUEST.get('PARENTS', None) if not parents: return
0584540f5c863cae973e12fbd278d13ebb5a744b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/0584540f5c863cae973e12fbd278d13ebb5a744b/NyFolder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 2157, 1265, 12, 2890, 16, 12492, 33, 7036, 16, 2826, 4333, 4672, 3536, 1891, 1339, 628, 279, 864, 2653, 8395, 468, 2315, 1205, 628, 590, 309, 486, 12492, 30, 327, 6298, 273, 12492,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 2157, 1265, 12, 2890, 16, 12492, 33, 7036, 16, 2826, 4333, 4672, 3536, 1891, 1339, 628, 279, 864, 2653, 8395, 468, 2315, 1205, 628, 590, 309, 486, 12492, 30, 327, 6298, 273, 12492,...
for x in os.listdir(os.curdir()): if x.startswith(PackageName):
for x in os.listdir(os.curdir): if (x.startswith(PackageName) and x.endswith(pypt_bug_file_format) ):
def run(request, response, func=find_first_match): '''Get items from the request Queue, process them with func(), put the results along with the Thread's name into the response Queue. Stop running when item is None.''' while 1: tuple_item_key = request.get() if tuple_item_key is None: break (key, item) = tuple_item_key (url, file, download_size, checksum) = stripper(item) thread_name = threading.currentThread().getName() if key == 'Update': temp_file = file.split("_") PackageName = temp_file[0] PackageName += " - " + temp_file[len(temp_file) - 1] del temp_file #INFO: We pass None as a filename here because we don't want to do a tree search of # update files. Update files are changed daily and there is no point in doing a search of # them in the cache_dir response.put(func(cache_dir, None) ) #INFO: exit_status here would be False because for updates there's no need to do a # find_first_match # This is more with the above statement where None is passed as the filename exit_status = response.get() if exit_status == False: log.msg("Downloading %s\n" % (PackageName) ) if FetcherInstance.download_from_web(url, file, download_path) == True: log.success("\r%s done.%s\n" % (PackageName, " "* 60) ) if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file(ArgumentOptions.zip_update_file, file) != True: log.err("Couldn't archive %s to file %s.\n" % (file, ArgumentOptions.zip_update_file) ) sys.exit(1) else: log.verbose("%s added to archive %s.\n" % (file, ArgumentOptions.zip_update_file) ) os.unlink(os.path.join(download_path, file) ) else: errlist.append(file) elif key == 'Upgrade': PackageName = file.split("_")[0] response.put(func(cache_dir, file) ) #INFO: find_first_match() returns False or a file name with absolute path full_file_path = response.get() #INFO: If we find the file in the local cache_dir, we'll execute this block. if full_file_path != False: # We'll first check for its md5 checksum if ArgumentOptions.disable_md5check is False: if FetcherInstance.md5_check(full_file_path, checksum) is True: log.verbose("md5checksum correct for package %s.\n" % (PackageName) ) if ArgumentOptions.deb_bugs: bug_fetched = 0 log.verbose("Fetching bug reports for package %s.\n" % (PackageName) ) if FetchBugReportsDebian.FetchBugsDebian(PackageName): log.verbose("Fetched bug reports for package %s.\n" % (PackageName) ) bug_fetched = 1 else: log.verbose("Couldn't fetch bug reports for package %s.\n" % (PackageName) ) if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file(ArgumentOptions.zip_upgrade_file, full_file_path) is True: log.success("%s copied from local cache directory %s\n" % (PackageName, cache_dir) ) else: log.err("Couldn't add %s to archive %s.\n" % (file, ArgumentOptions.zip_upgrade_file) ) sys.exit(1) #INFO: If no zip option enabled, simply copy the downloaded package file # along with the downloaded bug reports. else: try: shutil.copy(full_file_path, download_path) log.success("%s copied from local cache directory %s\n" % (PackageName, cache_dir) ) except shutil.Error: log.verbose("%s already available in %s. Skipping copy!!!\n\n" % (file, download_path) ) if bug_fetched == 1: for x in os.listdir(os.curdir()): if x.startswith(PackageName): shutil.move(x, download_path) log.verbose("Moved %s file to %s folder.\n" % (x, download_path) ) #INFO: Damn!! The md5chesum didn't match :-( # The file is corrupted and we need to download a new copy from the internet else: log.verbose("%s MD5 checksum mismatch. Skipping file.\n" % (file) ) log.msg("Downloading %s - %d KB\n" % (PackageName, download_size/1024) ) if FetcherInstance.download_from_web(url, file, download_path) == True: log.success("\r%s done.%s\n" % (PackageName, " "* 60) ) #Add to cache_dir if possible if ArgumentOptions.cache_dir: try: shutil.copy(file, cache_dir) log.verbose("%s copied to local cache directory %s\n" % (file, ArgumentOptions.cache_dir) ) except shutil.Error: log.verbose("Couldn't copy %s to %s\n\n" % (file, ArgumentOptions.cache_dir) ) #Fetch bug reports if ArgumentOptions.deb_bugs: if FetchBugReportsDebian.FetchBugsDebian(PackageName): log.verbose("Fetched bug reports for package %s.\n" % (PackageName) ) else: log.err("Couldn't fetch bug reports for package %s.\n" % (PackageName) ) if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file(ArgumentOptions.zip_upgrade_file, file) != True: log.err("Couldn't archive %s to file %s\n" % (file, ArgumentOptions.zip_upgrade_file) ) sys.exit(1) else: log.verbose("%s added to archive %s\n" % (file, ArgumentOptions.zip_upgrade_file) ) os.unlink(os.path.join(download_path, file) ) #INFO: You're and idiot. # You should NOT disable md5checksum for any files else: if ArgumentOptions.deb_bugs: bug_fetched = 0 if FetchBugReportsDebian.FetchBugsDebian(PackageName): log.verbose("Fetched bug reports for package %s.\n" % (PackageName) ) bug_fetched = 1 else: log.verbose("Couldn't fetch bug reports for package %s.\n" % (PackageName) ) #FIXME: Don't know why this was really required. If this has no changes, delete it. #file = full_file_path.split("/") #file = file[len(file) - 1] #file = download_path + "/" + file if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file(ArgumentOptions.zip_upgrade_file, file) != True: log.err("Couldn't archive %s to file %s\n" % (file, ArgumentOptions.zip_upgrade_file) ) sys.exit(1) else: log.verbose("%s added to archive %s\n" % (file, ArgumentOptions.zip_upgrade_file) ) os.unlink(os.path.join(download_path, file) ) else: # Since zip file option is not enabled let's copy the file to the target folder try: shutil.copy(full_file_path, download_path) log.success("%s copied from local cache directory %s\n" % (file, cache_dir) ) except shutil.Error: log.verbose("%s already available in dest_dir. Skipping copy!!!\n\n" % (file) ) # And also the bug reports if bug_fetched == 1: for x in os.listdir(os.curdir()): if x.startswith(PackageName): shutil.move(x, download_path) log.verbose("Moved %s file to %s folder.\n" % (x, download_path) ) else: #INFO: This block gets executed if the file is not found in local cache_dir or cache_dir is None # We go ahead and try to download it from the internet log.verbose("%s not available in local cache %s.\n" % (file, ArgumentOptions.cache_dir) ) log.msg("Downloading %s - %d KB\n" % (PackageName, download_size/1024) ) if FetcherInstance.download_from_web(url, file, download_path) == True: #INFO: This block gets executed if md5checksum is allowed if ArgumentOptions.disable_md5check is False: if FetcherInstance.md5_check(file, checksum) is True: if ArgumentOptions.cache_dir: try: shutil.copy(file, ArgumentOptions.cache_dir) log.verbose("%s copied to local cache directory %s\n" % (file, ArgumentOptions.cache_dir) ) except shutil.Error: log.verbose("%s already available in %s. Skipping copy!!!\n\n" % (file, ArgumentOptions.cache_dir) ) if ArgumentOptions.deb_bugs: if FetchBugReportsDebian.FetchBugsDebian(PackageName): log.verbose("Fetched bug reports for package %s.\n" % (PackageName) ) else: log.err("Couldn't fetch bug reports for package %s.\n" % (PackageName) ) if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file(ArgumentOptions.zip_upgrade_file, file) != True: log.err("Couldn't archive %s to file %s\n" % (file, ArgumentOptions.zip_upgrade_file) ) sys.exit(1) else: log.verbose("%s added to archive %s\n" % (file, ArgumentOptions.zip_upgrade_file) ) os.unlink(os.path.join(download_path, file) ) else: if ArgumentOptions.deb_bugs: if FetchBugReportsDebian.FetchBugsDebian(PackageName): log.verbose("Fetched bug reports for package %s.\n" % (PackageName) ) else: log.err("Couldn't fetch bug reports for package %s.\n" % (PackageName) ) if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file(ArgumentOptions.zip_upgrade_file, file) != True: log.err("Couldn't archive %s to file %s\n" % (file, ArgumentOptions.zip_upgrade_file) ) sys.exit(1) else: log.verbose("%s added to archive %s\n" % (file, ArgumentOptions.zip_upgrade_file) ) os.unlink(os.path.join(download_path, file) ) log.success("\r%s done.%s\n" % (PackageName, " "* 60) ) else: #log.err("Couldn't find %s\n" % (PackageName) ) errlist.append(PackageName) else: raise FetchDataKeyError
c20567354efceec30f99e43598053b390f3db916 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12499/c20567354efceec30f99e43598053b390f3db916/pypt_core.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2293, 16, 766, 16, 1326, 33, 4720, 67, 3645, 67, 1916, 4672, 9163, 967, 1516, 628, 326, 590, 7530, 16, 1207, 2182, 598, 1326, 9334, 1378, 326, 1686, 7563, 598, 326, 4884, 180...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2293, 16, 766, 16, 1326, 33, 4720, 67, 3645, 67, 1916, 4672, 9163, 967, 1516, 628, 326, 590, 7530, 16, 1207, 2182, 598, 1326, 9334, 1378, 326, 1686, 7563, 598, 326, 4884, 180...
'account_id': operation.product_id and operation.product_id.property_account_income and operation.product_id.property_account_income.id,
'account_id': account_id,
def action_invoice_create(self, cr, uid, ids, group=False, context=None): """ Creates invoice(s) for repair order. @param group: It is set to true when group invoice is to be generated. @return: Invoice Ids. """ res = {} invoices_group = {} inv_line_obj = self.pool.get('account.invoice.line') inv_obj = self.pool.get('account.invoice') repair_line_obj = self.pool.get('mrp.repair.line') repair_fee_obj = self.pool.get('mrp.repair.fee') for repair in self.browse(cr, uid, ids, context=context): res[repair.id] = False if repair.state in ('draft','cancel') or repair.invoice_id: continue if not (repair.partner_id.id and repair.partner_invoice_id.id): raise osv.except_osv(_('No partner !'),_('You have to select a Partner Invoice Address in the repair form !')) comment = repair.quotation_notes if (repair.invoice_method != 'none'): if group and repair.partner_invoice_id.id in invoices_group: inv_id = invoices_group[repair.partner_invoice_id.id] invoice = inv_obj.browse(cr, uid, inv_id) invoice_vals = { 'name': invoice.name +', '+repair.name, 'origin': invoice.origin+', '+repair.name, 'comment':(comment and (invoice.comment and invoice.comment+"\n"+comment or comment)) or (invoice.comment and invoice.comment or ''), } invoice_obj.write(cr, uid, [inv_id], invoice_vals, context=context) else: a = repair.partner_id.property_account_receivable.id inv = { 'name': repair.name, 'origin':repair.name, 'type': 'out_invoice', 'account_id': a, 'partner_id': repair.partner_id.id, 'address_invoice_id': repair.address_id.id, 'currency_id': repair.pricelist_id.currency_id.id, 'comment': repair.quotation_notes, 'fiscal_position': repair.partner_id.property_account_position.id } inv_id = inv_obj.create(cr, uid, inv) invoices_group[repair.partner_invoice_id.id] = inv_id self.write(cr, uid, repair.id, {'invoiced': True, 'invoice_id': inv_id})
123cb46c6c36bc22eea1bbce33dc5fdf41dfa579 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/123cb46c6c36bc22eea1bbce33dc5fdf41dfa579/mrp_repair.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1301, 67, 16119, 67, 2640, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 1041, 33, 8381, 16, 819, 33, 7036, 4672, 3536, 10210, 9179, 12, 87, 13, 364, 20994, 1353, 18, 632, 891, 1041, 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, 1301, 67, 16119, 67, 2640, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 1041, 33, 8381, 16, 819, 33, 7036, 4672, 3536, 10210, 9179, 12, 87, 13, 364, 20994, 1353, 18, 632, 891, 1041, 3...
write(oid+pack(">HI", len(version), len(data))+version) write(data)
buf = string.join(("s", oid, pack(">HI", len(version), len(data)), version, data), "") write(buf)
def store(self, oid, serial, data, version, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) self._lock_acquire() try: serial=self._call.sendMessage('storea', oid, serial, data, version, self._serial) write=self._tfile.write write(oid+pack(">HI", len(version), len(data))+version) write(data)
fd48e2d583d08a1d52eb7b982c73ea0612be3009 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/fd48e2d583d08a1d52eb7b982c73ea0612be3009/ClientStorage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1707, 12, 2890, 16, 7764, 16, 2734, 16, 501, 16, 1177, 16, 2492, 4672, 309, 2492, 353, 486, 365, 6315, 7958, 30, 1002, 12511, 503, 18, 3245, 3342, 668, 12, 2890, 16, 2492, 13, 365, 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, 1707, 12, 2890, 16, 7764, 16, 2734, 16, 501, 16, 1177, 16, 2492, 4672, 309, 2492, 353, 486, 365, 6315, 7958, 30, 1002, 12511, 503, 18, 3245, 3342, 668, 12, 2890, 16, 2492, 13, 365, 6...
stream.render('xhtml', doctype=doctype, out=buffer)
stream.render(method, doctype=doctype, out=buffer)
def render_template(self, req, filename, data, content_type=None, fragment=False): """Render the `filename` using the `data` for the context.
344ac9e2e24ba716c262ddb0d26fbad228c2ba8c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9317/344ac9e2e24ba716c262ddb0d26fbad228c2ba8c/chrome.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 3202, 12, 2890, 16, 1111, 16, 1544, 16, 501, 16, 913, 67, 723, 33, 7036, 16, 5481, 33, 8381, 4672, 3536, 3420, 326, 1375, 3459, 68, 1450, 326, 1375, 892, 68, 364, 326, 819,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 3202, 12, 2890, 16, 1111, 16, 1544, 16, 501, 16, 913, 67, 723, 33, 7036, 16, 5481, 33, 8381, 4672, 3536, 3420, 326, 1375, 3459, 68, 1450, 326, 1375, 892, 68, 364, 326, 819,...
this = apply(_quickfix.new_DataDictionary, args)
this = _quickfix.new_DataDictionary(*args)
def __init__(self, *args): this = apply(_quickfix.new_DataDictionary, args) try: self.this.append(this) except: self.this = this
7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 751, 10905, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 365, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 751, 10905, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 365, 1...
We compute the eigenvalues of an endomorphism of QQ^3::
We compute the eigenvalues of an endomorphism of `\QQ^3`::
def eigenvalues(self,extend=True): """ Returns a list with the eigenvalues of the endomorphism of vector spaces. If the option extend is set to True (default), then eigenvalues in extensions of the base field are considered. EXAMPLES: We compute the eigenvalues of an endomorphism of QQ^3:: sage: V=QQ^3 sage: H=V.endomorphism_ring()([[1,-1,0],[-1,1,1],[0,3,1]]) sage: H.eigenvalues() [3, 1, -1] Note the effect of the extend option:: sage: V=QQ^2 sage: H=V.endomorphism_ring()([[0,-1],[1,0]]) sage: H.eigenvalues() [-1*I, 1*I] sage: H.eigenvalues(extend=False) []
9bb09580aa7e219d556bbf2e0ec6c8440ac569f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9bb09580aa7e219d556bbf2e0ec6c8440ac569f7/free_module_morphism.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29831, 12, 2890, 16, 14313, 33, 5510, 4672, 3536, 2860, 279, 666, 598, 326, 29831, 434, 326, 679, 362, 7657, 6228, 434, 3806, 7292, 18, 225, 971, 326, 1456, 2133, 353, 444, 358, 1053, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29831, 12, 2890, 16, 14313, 33, 5510, 4672, 3536, 2860, 279, 666, 598, 326, 29831, 434, 326, 679, 362, 7657, 6228, 434, 3806, 7292, 18, 225, 971, 326, 1456, 2133, 353, 444, 358, 1053, ...
svn_client.copy (opts.repo_root + "/MPC/trunk", opts.repo_root + "/MPC/tags/" + branch)
def tag (): """ Tags the DOC and MPC repositories for the version """ global comp_versions, opts branch = "ACE+TAO+CIAO-%d_%d_%d" % (comp_versions["ACE_major"], comp_versions["ACE_minor"], comp_versions["ACE_beta"]) # Tag middleware svn_client.copy (opts.repo_root + "/Middleware/trunk", opts.repo_root + "/Middleware/tags/" + branch) # Update latest tag
039ed4d8ccabc7df75535bd2e6c3838dd108174b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5660/039ed4d8ccabc7df75535bd2e6c3838dd108174b/make_release.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1047, 1832, 30, 3536, 8750, 326, 5467, 39, 471, 490, 3513, 14531, 364, 326, 1177, 3536, 2552, 1161, 67, 10169, 16, 1500, 225, 3803, 273, 315, 6312, 15, 9833, 51, 15, 7266, 20463, 6456, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1047, 1832, 30, 3536, 8750, 326, 5467, 39, 471, 490, 3513, 14531, 364, 326, 1177, 3536, 2552, 1161, 67, 10169, 16, 1500, 225, 3803, 273, 315, 6312, 15, 9833, 51, 15, 7266, 20463, 6456, ...
load.extend(DependencyItem(x, '', self.id, "|hints|") for x in metaLoad) run.extend(DependencyItem(x, '', self.id, "|hints|") for x in metaRun) ignore.extend(DependencyItem(x, '', self.id, "|hints|") for x in metaIgnore)
depsData['require'].extend(DependencyItem(x, '', self.id, "|hints|") for x in metaLoad) depsData['use'] .extend(DependencyItem(x, '', self.id, "|hints|") for x in metaRun) depsData['ignore'] .extend(DependencyItem(x, '', self.id, "|hints|") for x in metaIgnore)
def buildShallowDeps(variants):
a04d746a2d269d8b022654850b972c167beacd2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/a04d746a2d269d8b022654850b972c167beacd2d/Class.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 1555, 5965, 14430, 12, 15886, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 1555, 5965, 14430, 12, 15886, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
key.K_l : 'SUBTITLE'
key.K_l : 'SUBTITLE', key.K_a : 'LANG'
def __cmp__(self, other): """ compare function, return 0 if the objects are identical, 1 otherwise """ if not other: return 1 if isinstance(other, Event): return self.name != other.name return self.name != other
4a872c35e75a4c09617326b5a44f88ddc611094b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/4a872c35e75a4c09617326b5a44f88ddc611094b/event.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9625, 972, 12, 2890, 16, 1308, 4672, 3536, 3400, 445, 16, 327, 374, 309, 326, 2184, 854, 12529, 16, 404, 3541, 3536, 309, 486, 1308, 30, 327, 404, 309, 1549, 12, 3011, 16, 2587, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9625, 972, 12, 2890, 16, 1308, 4672, 3536, 3400, 445, 16, 327, 374, 309, 326, 2184, 854, 12529, 16, 404, 3541, 3536, 309, 486, 1308, 30, 327, 404, 309, 1549, 12, 3011, 16, 2587, ...
res[r] = None
res[r] = False
def _fnct_read(self2, self, cr, uid, ids, prop, val, context={}): property = self.pool.get('ir.property') definition_id = self2._field_get(self, cr, uid, prop)
1235e49ba7f635cfba9705c84aa892c2f135c022 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12853/1235e49ba7f635cfba9705c84aa892c2f135c022/fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4293, 299, 67, 896, 12, 2890, 22, 16, 365, 16, 4422, 16, 4555, 16, 3258, 16, 2270, 16, 1244, 16, 819, 12938, 4672, 1272, 273, 365, 18, 6011, 18, 588, 2668, 481, 18, 4468, 6134, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4293, 299, 67, 896, 12, 2890, 22, 16, 365, 16, 4422, 16, 4555, 16, 3258, 16, 2270, 16, 1244, 16, 819, 12938, 4672, 1272, 273, 365, 18, 6011, 18, 588, 2668, 481, 18, 4468, 6134, ...
"""Same as for the pygame.sprite.Group.
"""initialize group.
def __init__(self, *sprites, **kwargs): """Same as for the pygame.sprite.Group. pygame.sprite.LayeredDirty(*spites, **kwargs): return LayeredDirty
d9760f3e4782abb02dd98080337626eefdad67ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1298/d9760f3e4782abb02dd98080337626eefdad67ee/sprite.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1752, 24047, 16, 2826, 4333, 4672, 3536, 11160, 1041, 18, 225, 2395, 13957, 18, 1752, 796, 18, 4576, 329, 10785, 30857, 1752, 2997, 16, 2826, 4333, 46...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1752, 24047, 16, 2826, 4333, 4672, 3536, 11160, 1041, 18, 225, 2395, 13957, 18, 1752, 796, 18, 4576, 329, 10785, 30857, 1752, 2997, 16, 2826, 4333, 46...
id = self.__ic.stringToIdentity("ClientCallback")
id = self.__ic.stringToIdentity("ClientCallback/%s" % self.__uid )
def createSession(self, username=None, password=None): """ Performs the actual logic of logging in, which is done via the getRouter(). Disallows an extant ServiceFactoryPrx, and tries to re-create a null Ice.Communicator. A null or empty username will throw an exception, but an empty password is allowed. """ import omero
3e067b993041cc146c6d1ad424802b77394ebd52 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12409/3e067b993041cc146c6d1ad424802b77394ebd52/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 2157, 12, 2890, 16, 2718, 33, 7036, 16, 2201, 33, 7036, 4672, 3536, 27391, 326, 3214, 4058, 434, 2907, 316, 16, 1492, 353, 2731, 3970, 326, 4170, 14068, 7675, 3035, 5965, 87, 392, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 2157, 12, 2890, 16, 2718, 33, 7036, 16, 2201, 33, 7036, 4672, 3536, 27391, 326, 3214, 4058, 434, 2907, 316, 16, 1492, 353, 2731, 3970, 326, 4170, 14068, 7675, 3035, 5965, 87, 392, ...
'plainText': (str, u''),
'plainText': (str, ''),
def alert(self, req, form): """ Alert system. Sends an email alert, in HTML/PlainText or only PlainText to a mailing list to alert for new journal releases. """ argd = wash_urlargd(form, {'name': (str, ""), 'sent': (str, "False"), 'plainText': (str, u''), 'htmlMail': (str, ""), 'recipients': (str, ""), 'subject': (str, ""), 'ln': (str, ""), 'issue': (str, ""), 'force': (str, "False")})
291ffb21abdae2eada809c6497e863b468468f6a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/291ffb21abdae2eada809c6497e863b468468f6a/webjournal_webinterface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6881, 12, 2890, 16, 1111, 16, 646, 4672, 3536, 17913, 2619, 18, 2479, 87, 392, 2699, 6881, 16, 316, 3982, 19, 13360, 1528, 578, 1338, 17367, 1528, 358, 279, 4791, 310, 666, 358, 6881, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6881, 12, 2890, 16, 1111, 16, 646, 4672, 3536, 17913, 2619, 18, 2479, 87, 392, 2699, 6881, 16, 316, 3982, 19, 13360, 1528, 578, 1338, 17367, 1528, 358, 279, 4791, 310, 666, 358, 6881, ...
"""
TESTS: We make copies of the _pos and _boundary attributes. sage: g = graphs.PathGraph(3) sage: h = g.copy() sage: h._pos is g._pos False sage: h._boundary is g._boundary False """ from copy import copy
def copy(self): """ Creates a copy of the graph.
c0f1f7761ffc3ed4ce395b494bfa7abd51b35cbf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/c0f1f7761ffc3ed4ce395b494bfa7abd51b35cbf/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1610, 12, 2890, 4672, 22130, 55, 30, 1660, 1221, 13200, 434, 326, 389, 917, 471, 389, 16604, 1677, 18, 272, 410, 30, 314, 273, 19422, 18, 743, 4137, 12, 23, 13, 272, 410, 30, 366, 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, 1610, 12, 2890, 4672, 22130, 55, 30, 1660, 1221, 13200, 434, 326, 389, 917, 471, 389, 16604, 1677, 18, 272, 410, 30, 314, 273, 19422, 18, 743, 4137, 12, 23, 13, 272, 410, 30, 366, 27...
if uname == '':
if not uname:
def getDeviceDetails(self, config): """@see DevController.getDeviceDetails""" uname = config.get('uname', '') dev = config.get('dev', '') if 'ioemu:' in dev: (_, dev) = string.split(dev, ':', 1) try: (dev, dev_type) = string.split(dev, ':', 1) except ValueError: dev_type = "disk"
d13df06190277459f44587138c693ffcdbff7820 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6195/d13df06190277459f44587138c693ffcdbff7820/blkif.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19512, 3790, 12, 2890, 16, 642, 4672, 3536, 36, 5946, 9562, 2933, 18, 588, 3654, 3790, 8395, 31444, 273, 642, 18, 588, 2668, 318, 339, 2187, 28707, 4461, 273, 642, 18, 588, 2668, 5206, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19512, 3790, 12, 2890, 16, 642, 4672, 3536, 36, 5946, 9562, 2933, 18, 588, 3654, 3790, 8395, 31444, 273, 642, 18, 588, 2668, 318, 339, 2187, 28707, 4461, 273, 642, 18, 588, 2668, 5206, ...
gid = super(groups, self).create(cr, uid, vals, context=context)
gid = super(groups, self).create(cr, uid, vals, context=context)
def create(self, cr, uid, vals, context=None): if 'name' in vals: if vals['name'].startswith('-'): raise osv.except_osv(_('Error'), _('The name of the group can not start with "-"')) gid = super(groups, self).create(cr, uid, vals, context=context) if context and context.get('noadmin', False): pass else: # assign this new group to user_root user_obj = self.pool.get('res.users') aid = user_obj.browse(cr, 1, user_obj._get_admin_id(cr)) if aid: aid.write({'groups_id': [(4, gid)]}) return gid
288fc76f2950280ae04edfd8ac2e0b88888cfcf2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/288fc76f2950280ae04edfd8ac2e0b88888cfcf2/res_user.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2890, 16, 4422, 16, 4555, 16, 5773, 16, 819, 33, 7036, 4672, 309, 296, 529, 11, 316, 5773, 30, 309, 5773, 3292, 529, 29489, 17514, 1918, 2668, 6627, 4672, 1002, 1140, 90, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2890, 16, 4422, 16, 4555, 16, 5773, 16, 819, 33, 7036, 4672, 309, 296, 529, 11, 316, 5773, 30, 309, 5773, 3292, 529, 29489, 17514, 1918, 2668, 6627, 4672, 1002, 1140, 90, 18, ...
ans = pfsd.readline ()
def stop (self): global pfsd_port self.kill = True pfsd = Connect ('localhost', pfsd_port) try: if self.onlineSent: pfsd.connect () pfsd.writeline ('OFFLINE') pfsd.writeline ('1') pfsd.writeline (self.remote_sd_id) ans = pfsd.readline () pfsd.writeline ('CLOSE') ans = pfsd.readline () pfsd.close () except: pass
80234e50ae16af35277571ed4f498d59e7cfd1be /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12216/80234e50ae16af35277571ed4f498d59e7cfd1be/lan_tun.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2132, 261, 2890, 4672, 2552, 293, 2556, 72, 67, 655, 365, 18, 16418, 273, 1053, 293, 2556, 72, 273, 8289, 7707, 13014, 2187, 293, 2556, 72, 67, 655, 13, 775, 30, 309, 365, 18, 21026, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2132, 261, 2890, 4672, 2552, 293, 2556, 72, 67, 655, 365, 18, 16418, 273, 1053, 293, 2556, 72, 273, 8289, 7707, 13014, 2187, 293, 2556, 72, 67, 655, 13, 775, 30, 309, 365, 18, 21026, ...
f = open(opts.galaxy_priors_dir+'/'+str(int(mineffD))+'Mpc.pkl','r')
f = open(opts.galaxy_priors_dir+'/galaxy_prior_'+str(int(mineffD))+'Mpc.pkl','r')
def get_unique_filename(name): """ use this to avoid name collisions """ counter = 1 base_name, ext = os.path.splitext(name) while os.path.isfile(name): name = base_name + '_' + str(counter) + ext counter += 1 return name
5d57777704fdde7db5dca49e7d89c4111f8d4dc7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/5d57777704fdde7db5dca49e7d89c4111f8d4dc7/run_skypoints.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 6270, 67, 3459, 12, 529, 4672, 3536, 999, 333, 358, 4543, 508, 27953, 3536, 3895, 273, 404, 1026, 67, 529, 16, 1110, 273, 1140, 18, 803, 18, 4939, 408, 12, 529, 13, 1323, 11...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6270, 67, 3459, 12, 529, 4672, 3536, 999, 333, 358, 4543, 508, 27953, 3536, 3895, 273, 404, 1026, 67, 529, 16, 1110, 273, 1140, 18, 803, 18, 4939, 408, 12, 529, 13, 1323, 11...
assert_almost_equal(self.res1.bic, self.res2.bic, DECIMAL)
if hasattr(self.res2, 'bic'): assert_almost_equal(self.res1.bic, self.res2.bic, DECIMAL) else: raise SkipTest, "Results from Rpy"
def test_BIC(self): assert_almost_equal(self.res1.bic, self.res2.bic, DECIMAL)
c944eab8d84c6cac2fb5de055fceb6bc5953418f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12658/c944eab8d84c6cac2fb5de055fceb6bc5953418f/test_regression.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 38, 2871, 12, 2890, 4672, 1815, 67, 287, 10329, 67, 9729, 12, 2890, 18, 455, 21, 18, 70, 335, 16, 365, 18, 455, 22, 18, 70, 335, 16, 25429, 13, 2, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1842, 67, 38, 2871, 12, 2890, 4672, 1815, 67, 287, 10329, 67, 9729, 12, 2890, 18, 455, 21, 18, 70, 335, 16, 365, 18, 455, 22, 18, 70, 335, 16, 25429, 13, 2, -100, -100, -100, -100,...
if start_row > five_pages:
if start_row >= five_pages:
def query_bugs(self, start_row=None, rows_per_page=10, order=-1, sort_col='number', filters=None, **params): if not filters: filters = {} filters = self._query_bugs_filter.filter(filters, conn=self) collection = filters.get('collection', 'Fedora') version = filters.get('version', '')
c946049c17ed9a781546acacb08d3b518ab8e0b2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12732/c946049c17ed9a781546acacb08d3b518ab8e0b2/bugzillaconnector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 843, 67, 19381, 12, 2890, 16, 787, 67, 492, 33, 7036, 16, 2595, 67, 457, 67, 2433, 33, 2163, 16, 1353, 29711, 21, 16, 1524, 67, 1293, 2218, 2696, 2187, 3415, 33, 7036, 16, 2826, 2010...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 19381, 12, 2890, 16, 787, 67, 492, 33, 7036, 16, 2595, 67, 457, 67, 2433, 33, 2163, 16, 1353, 29711, 21, 16, 1524, 67, 1293, 2218, 2696, 2187, 3415, 33, 7036, 16, 2826, 2010...
print " --full-versions Print full version strings instead of attempting to shorten them"
print " --full-versions Print full version strings instead of " print " attempting to shorten them"
def usage(): print "conary showcs <changeset> [trove]" print "showcs flags: " print " --full-versions Print full version strings instead of attempting to shorten them" print " --info Print dependency information about the troves" print " --ls (Recursive) list file contents" print " --show-changes For modifications, show the old file version next to new one" print " --tags Show tagged files (use with ls to show tagged and untagged)" print " --sha1s Show sha1s for files" print " --ids Show fileids" print " --all Combine above tags" print ""
7a043a96e3eacac362d9230fc019c4c48716a2de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/7a043a96e3eacac362d9230fc019c4c48716a2de/showchangeset.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4084, 13332, 1172, 315, 591, 814, 2405, 2143, 282, 411, 6329, 278, 34, 306, 88, 303, 537, 4279, 1172, 315, 4500, 2143, 2943, 30, 282, 315, 1172, 315, 7734, 1493, 2854, 17, 10169, 282, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4084, 13332, 1172, 315, 591, 814, 2405, 2143, 282, 411, 6329, 278, 34, 306, 88, 303, 537, 4279, 1172, 315, 4500, 2143, 2943, 30, 282, 315, 1172, 315, 7734, 1493, 2854, 17, 10169, 282, ...
'\n'.join(['%s\\%s[1]{%s}' % (nc, alias, cmndef)
'\n'.join(['\\newcommand\\%s[1]{%s}' % (alias, cmndef)
def get_style_defs(self, arg=''): """ Return the \\newcommand sequences needed to define the commands used to format text in the verbatim environment. If ``arg`` is given and true, use \\renewcommand instead. """ nc = (arg and r'\renewcommand' or r'\newcommand') return '%s\\at{@}\n%s\\lb{[}\n%s\\rb{]}\n' % (nc, nc, nc) + \ '\n'.join(['%s\\%s[1]{%s}' % (nc, alias, cmndef) for alias, cmndef in self.cmd2def.iteritems() if cmndef != '#1'])
c1ff3dec7399c0b88356f268039128c6a6e8dc7a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6148/c1ff3dec7399c0b88356f268039128c6a6e8dc7a/latex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 4060, 67, 12537, 12, 2890, 16, 1501, 2218, 11, 4672, 3536, 2000, 326, 1736, 2704, 3076, 8463, 3577, 358, 4426, 326, 4364, 1399, 358, 740, 977, 316, 326, 29526, 3330, 18, 971, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4060, 67, 12537, 12, 2890, 16, 1501, 2218, 11, 4672, 3536, 2000, 326, 1736, 2704, 3076, 8463, 3577, 358, 4426, 326, 4364, 1399, 358, 740, 977, 316, 326, 29526, 3330, 18, 971, ...
gLogger.info('__reportProblematicReplicas: Successfully updated integrity DB with replicas') def __initialiseAccountingObject(self,operation,se,startTime,endTime,size):
gLogger.info( '__reportProblematicReplicas: Successfully updated integrity DB with replicas' ) def __initialiseAccountingObject( self, operation, se, startTime, endTime, size ):
def __reportProblematicReplicas(self,replicaTuples): gLogger.info('__reportProblematicReplicas: The following %s files being reported to integrity DB:' % (len(replicaTuples))) for lfn,pfn,se,reason in sortList(replicaTuples): if lfn: gLogger.info(lfn) else: gLogger.info(pfn) res = self.DataIntegrityClient.setReplicaProblematic(replicaTuples,sourceComponent='MigrationMonitoringAgent') if not res['OK']: gLogger.info('__reportProblematicReplicas: Failed to update integrity DB with replicas',res['Message']) else: gLogger.info('__reportProblematicReplicas: Successfully updated integrity DB with replicas')
9a22336d92a455ef5a2bab49d70e2e3a11f3d910 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9a22336d92a455ef5a2bab49d70e2e3a11f3d910/MigrationMonitoringAgent.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 6006, 13719, 2126, 17248, 12, 2890, 16, 30065, 25813, 4672, 314, 3328, 18, 1376, 2668, 972, 6006, 13719, 2126, 17248, 30, 1021, 3751, 738, 87, 1390, 3832, 14010, 358, 24425, 2383, 24...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6006, 13719, 2126, 17248, 12, 2890, 16, 30065, 25813, 4672, 314, 3328, 18, 1376, 2668, 972, 6006, 13719, 2126, 17248, 30, 1021, 3751, 738, 87, 1390, 3832, 14010, 358, 24425, 2383, 24...
return self.hasPermission('Create', self.classname)
return self.hasPermission('Create')
def newItemPermission(self, props): """Determine whether the user has permission to create this item.
59d1ed178fd4a6cfd7b6fa2e56aae971cea702b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/59d1ed178fd4a6cfd7b6fa2e56aae971cea702b0/actions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26536, 5041, 12, 2890, 16, 3458, 4672, 3536, 8519, 2856, 326, 729, 711, 4132, 358, 752, 333, 761, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26536, 5041, 12, 2890, 16, 3458, 4672, 3536, 8519, 2856, 326, 729, 711, 4132, 358, 752, 333, 761, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
\
\
def parse(self, text, lineno, memo, parent): """ Return 2 lists: nodes (text and inline elements), and system_messages.
039645ec5706bfe06b64e66663e62db9bc1abf30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/039645ec5706bfe06b64e66663e62db9bc1abf30/states.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 2890, 16, 977, 16, 7586, 16, 11063, 16, 982, 4672, 3536, 2000, 576, 6035, 30, 2199, 261, 955, 471, 6370, 2186, 3631, 471, 2619, 67, 6833, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 2890, 16, 977, 16, 7586, 16, 11063, 16, 982, 4672, 3536, 2000, 576, 6035, 30, 2199, 261, 955, 471, 6370, 2186, 3631, 471, 2619, 67, 6833, 18, 2, -100, -100, -100, -100, -100,...
if not issubclass(pywintypes.TimeType, datetime.datetime): return
def testFileTimes(self): if issubclass(pywintypes.TimeType, datetime.datetime): from win32timezone import GetLocalTimeZone now = datetime.datetime.now(tz=GetLocalTimeZone()) ok_delta = datetime.timedelta(seconds=1) later = now + datetime.timedelta(seconds=120) else: tick = int(time.time()) now = pywintypes.Time(tick) ok_delta = 1 later = pywintypes.Time(tick+120)
14ccee35f01afa6ae2a33f3bb83af9e157bf96aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/677/14ccee35f01afa6ae2a33f3bb83af9e157bf96aa/test_win32file.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 812, 10694, 12, 2890, 4672, 309, 14664, 12, 2074, 91, 474, 989, 18, 950, 559, 16, 3314, 18, 6585, 4672, 628, 5657, 1578, 12690, 1930, 968, 2042, 16760, 2037, 273, 3314, 18, 6585, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 812, 10694, 12, 2890, 4672, 309, 14664, 12, 2074, 91, 474, 989, 18, 950, 559, 16, 3314, 18, 6585, 4672, 628, 5657, 1578, 12690, 1930, 968, 2042, 16760, 2037, 273, 3314, 18, 6585, ...
self.buffer = self.buffer.decode('Shift_JIS', 'ignore').encode('utf-8', 'ignore')
self.buffer_decode_from('Shift_JIS')
def parse(self): """Parse buffer to extract records."""
866019beaff5d677c481af4b74bf5e2c6745ce96 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/866019beaff5d677c481af4b74bf5e2c6745ce96/websearch_external_collections_parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 2890, 4672, 3536, 3201, 1613, 358, 2608, 3853, 12123, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1109, 12, 2890, 4672, 3536, 3201, 1613, 358, 2608, 3853, 12123, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
self.atcr = False
def reset(self):
c437671be98e63941490568e9681236dcc0ed266 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/c437671be98e63941490568e9681236dcc0ed266/codecs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2715, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2715, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
svc_name, svc_display_name = self.get_service_names()
svc_name, svc_display_name, svc_deps = self.get_service_names()
def create_exe (self, exe_name, arcname, use_runw): import struct
14cfcb9ea069ed9b526b75163132da57c961461d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1361/14cfcb9ea069ed9b526b75163132da57c961461d/build_exe.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 14880, 261, 2890, 16, 15073, 67, 529, 16, 8028, 529, 16, 999, 67, 2681, 91, 4672, 1930, 1958, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 14880, 261, 2890, 16, 15073, 67, 529, 16, 8028, 529, 16, 999, 67, 2681, 91, 4672, 1930, 1958, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
COLUMN_SEVERITY, site.get_server_name(),
COLUMN_SEVERITY, site.get_source_filename(),
def _add_denormalized_vhosts( self ): site_template = "<b><big>%s</big></b>" lstore = self.get_model() data = [] dirList=os.listdir( Configuration.SITES_ENABLED_DIR ) dirList = [x for x in dirList if self._blacklisted( x ) == False ] dirList = [x for x in dirList if is_denormalized_vhost( x ) == False ] self.items = {} fixable_items = 0 for fname in dirList : site = VirtualHostModel( fname ) self.items[ fname ] = site site = None for idx in sorted( self.items ): site = self.items[ idx ] normalizable = not is_not_normalizable(site.get_name()) markup = site_template % site.get_name() if ( normalizable == False ): markup = markup + " CANNOT FIX" else: fixable_items += 1 iter = lstore.append() pixbuf = self.render_icon(gtk.STOCK_DIALOG_WARNING, gtk.ICON_SIZE_LARGE_TOOLBAR) lstore.set(iter, COLUMN_ICON, pixbuf, COLUMN_FIXED, normalizable, COLUMN_SEVERITY, site.get_server_name(), COLUMN_MARKUP, markup + "\nThe virtual host file is only present inside /etc/apache/sites-enabled.\n<small><i>You must normalize in order to manage this host</i>.</small>" ) if not len(lstore): return -1 return fixable_items
fa904dd21822b0a6dddc427a6ced1685c05cb1fb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9230/fa904dd21822b0a6dddc427a6ced1685c05cb1fb/VhostsTreeView.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1289, 67, 13002, 1687, 1235, 67, 90, 11588, 12, 365, 262, 30, 225, 2834, 67, 3202, 273, 3532, 70, 4438, 14002, 9822, 87, 1757, 14002, 4695, 70, 2984, 328, 2233, 273, 365, 18, 588,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1289, 67, 13002, 1687, 1235, 67, 90, 11588, 12, 365, 262, 30, 225, 2834, 67, 3202, 273, 3532, 70, 4438, 14002, 9822, 87, 1757, 14002, 4695, 70, 2984, 328, 2233, 273, 365, 18, 588,...
np2da = vtkDoubleArrayFromNumPyMultiArray(data)
np2da = self.convert_to_vtk_array(data)
def get_leaktest_scenario(self):
34128e9b0827c17d15020a7d73bb23a6abf2d402 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5572/34128e9b0827c17d15020a7d73bb23a6abf2d402/vtk_data.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 298, 581, 3813, 67, 26405, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 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, 336, 67, 298, 581, 3813, 67, 26405, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
sage: phi,theta=var('phi theta') sage: Y=spherical_harmonic(2,1,theta,phi) sage: rea=spherical_plot3d(abs(real(Y)),(phi,0,2*pi),(theta,0,pi),color='blue',opacity=0.6) sage: ima=spherical_plot3d(abs(imag(Y)),(phi,0,2*pi),(theta,0,pi),color='red' ,opacity=0.6) sage: (rea+ima).show(aspect_ratio=1)
sage: phi, theta = var('phi, theta') sage: Y = spherical_harmonic(2, 1, theta, phi) sage: rea = spherical_plot3d(abs(real(Y)), (phi,0,2*pi), (theta,0,pi), color='blue', opacity=0.6) sage: ima = spherical_plot3d(abs(imag(Y)), (phi,0,2*pi), (theta,0,pi), color='red', opacity=0.6) sage: (rea + ima).show(aspect_ratio=1)
def spherical_plot3d(f, urange, vrange, **kwds): """ Plots a function in spherical coordinates. This function is equivalent to:: sage: r,u,v=var('r,u,v') sage: f=u*v; urange=(u,0,pi); vrange=(v,0,pi) sage: T = (r*cos(u)*sin(v), r*sin(u)*sin(v), r*cos(v), [u,v]) sage: plot3d(f, urange, vrange, transformation=T) or equivalently:: sage: T = Spherical('radius', ['azimuth', 'inclination']) sage: f=lambda u,v: u*v; urange=(u,0,pi); vrange=(v,0,pi) sage: plot3d(f, urange, vrange, transformation=T) INPUT: - ``f`` - a symbolic expression or function of two variables. - ``urange`` - a 3-tuple (u, u_min, u_max), the domain of the azimuth variable. - ``vrange`` - a 3-tuple (v, v_min, v_max), the domain of the inclination variable. EXAMPLES: A sphere of radius 2:: sage: x,y=var('x,y') sage: spherical_plot3d(2,(x,0,2*pi),(y,0,pi)) The real and imaginary parts of a spherical harmonic with `l=2` and `m=1`:: sage: phi,theta=var('phi theta') sage: Y=spherical_harmonic(2,1,theta,phi) sage: rea=spherical_plot3d(abs(real(Y)),(phi,0,2*pi),(theta,0,pi),color='blue',opacity=0.6) sage: ima=spherical_plot3d(abs(imag(Y)),(phi,0,2*pi),(theta,0,pi),color='red' ,opacity=0.6) sage: (rea+ima).show(aspect_ratio=1) A drop of water:: sage: x,y=var('x,y') sage: spherical_plot3d(e^-y,(x,0,2*pi),(y,0,pi),opacity=0.5).show(frame=False) An object similar to a heart:: sage: x,y=var('x,y') sage: spherical_plot3d((2+cos(2*x))*(y+1),(x,0,2*pi),(y,0,pi),rgbcolor=(1,.1,.1)) Some random figures: :: sage: x,y=var('x,y') sage: spherical_plot3d(1+sin(5*x)/5,(x,0,2*pi),(y,0,pi),rgbcolor=(1,0.5,0),plot_points=(80,80),opacity=0.7) :: sage: x,y=var('x,y') sage: spherical_plot3d(1+2*cos(2*y),(x,0,3*pi/2),(y,0,pi)).show(aspect_ratio=(1,1,1)) """ return plot3d(f, urange, vrange, transformation=Spherical('radius', ['azimuth', 'inclination']), **kwds)
742d05ea84125e9e5943320581a4d8c29f5dad43 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/742d05ea84125e9e5943320581a4d8c29f5dad43/plot3d.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 21570, 67, 4032, 23, 72, 12, 74, 16, 8896, 726, 16, 331, 3676, 16, 2826, 25577, 4672, 3536, 3008, 6968, 279, 445, 316, 272, 21570, 5513, 18, 225, 1220, 445, 353, 7680, 358, 2866, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 21570, 67, 4032, 23, 72, 12, 74, 16, 8896, 726, 16, 331, 3676, 16, 2826, 25577, 4672, 3536, 3008, 6968, 279, 445, 316, 272, 21570, 5513, 18, 225, 1220, 445, 353, 7680, 358, 2866, ...
rec_old = create_record(print_record(int(rec_id), 'xm'), 2)[0]
rec_old = create_record(format_record(int(rec_id), 'xm'), 2)[0]
def bibupload(record): """Main function: process a record and fit it in the tables bibfmt, bibrec, bibrec_bibxxx, bibxxx with proper record metadata. Return (error_code, recID) of the processed record. """ error = None # If there are special tags to proceed check if it exists in the record if options['tag'] is not None and not(record.has_key(options['tag'])): write_message(" Failed: Tag not found, enter a valid tag to update.", verbose=1, stream=sys.stderr) return (1, -1) # Extraction of the Record Id from 001, SYSNO or OAIID tags: rec_id = retrieve_rec_id(record) if rec_id == -1: return (1, -1) elif rec_id > 0: write_message(" -Retrieve record ID (found %s): DONE." % rec_id, verbose=2) if not record.has_key('001'): # Found record ID by means of SYSNO or OAIID, and the # input MARCXML buffer does not have this 001 tag, so we # should add it now: error = record_add_field(record, '001', '', '', rec_id, [], 0) if error is None: write_message(" Failed: " \ "Error during adding the 001 controlfield " \ "to the record", verbose=1, stream=sys.stderr) return (1, int(rec_id)) else: error = None write_message(" -Added tag 001: DONE.", verbose=2) write_message(" -Check if the xml marc file is already in the database: DONE" , verbose=2) # Reference mode check if there are reference tag if options['mode'] == 'reference': error = extract_tag_from_record(record, CFG_BIBUPLOAD_REFERENCE_TAG) if error is None: write_message(" Failed: No reference tags has been found...", verbose=1, stream=sys.stderr) return (1, -1) else: error = None write_message(" -Check if reference tags exist: DONE", verbose=2) if options['mode'] == 'insert' or \ (options['mode'] == 'replace_or_insert' and rec_id is None): insert_mode_p = True # Insert the record into the bibrec databases to have a recordId rec_id = create_new_record() write_message(" -Creation of a new record id (%d): DONE" % rec_id, verbose=2) # we add the record Id control field to the record error = record_add_field(record, '001', '', '', rec_id, [], 0) if error is None: write_message(" Failed: " \ "Error during adding the 001 controlfield " \ "to the record", verbose=1, stream=sys.stderr) return (1, int(rec_id)) else: error = None elif options['mode'] != 'insert' and options['mode'] != 'format' and options['stage_to_start_from'] != 5: insert_mode_p = False # Update Mode # Retrieve the old record to update rec_old = create_record(print_record(int(rec_id), 'xm'), 2)[0] if rec_old is None: write_message(" Failed during the creation of the old record!", verbose=1, stream=sys.stderr) return (1, int(rec_id)) else: write_message(" -Retrieve the old record to update: DONE", verbose=2) # Delete tags to correct in the record if options['mode'] == 'correct' or options['mode'] == 'reference': delete_tags_to_correct(record, rec_old) write_message(" -Delete the old tags to correct in the old record: DONE", verbose=2) # Append new tag to the old record and update the new record with the old_record modified if options['mode'] == 'append' or options['mode'] == 'correct' or options['mode'] == 'reference': record = append_new_tag_to_old_record(record, rec_old) write_message(" -Append new tags to the old record: DONE", verbose=2) # now we clear all the rows from bibrec_bibxxx from the old # record (they will be populated later (if needed) during # stage 4 below): delete_bibrec_bibxxx(rec_old, rec_id) write_message(" -Clean bibrec_bibxxx: DONE", verbose=2) write_message(" -Stage COMPLETED", verbose=2) # Have a look if we have FMT tags write_message("Stage 1: Start (Insert of FMT tags if exist).", verbose=2) if options['stage_to_start_from'] <= 1 and extract_tag_from_record(record, 'FMT') is not None: record = insert_fmt_tags(record, rec_id) if record is None: write_message(" Stage 1 failed: Error while inserting FMT tags", verbose=1, stream=sys.stderr) return (1, int(rec_id)) elif record == 0: # Mode format finished stat['nb_records_updated'] += 1 return (0, int(rec_id)) write_message(" -Stage COMPLETED", verbose=2) else: write_message(" -Stage NOT NEEDED", verbose=2) # Have a look if we have FFT tags write_message("Stage 2: Start (Process FFT tags if exist).", verbose=2) if options['stage_to_start_from'] <= 2 and extract_tag_from_record(record, 'FFT') is not None: if insert_mode_p or options['mode'] == 'append': record = insert_fft_tags(record, rec_id) else: record = update_fft_tag(record, rec_id) write_message(" -Stage COMPLETED", verbose=2) else: write_message(" -Stage NOT NEEDED", verbose=2) # Update of the BibFmt write_message("Stage 3: Start (Update bibfmt).", verbose=2) if options['stage_to_start_from'] <= 3: # format the single record as xml rec_xml_new = record_xml_output(record) # Update bibfmt with the format xm of this record if options['mode'] != 'format': error = update_bibfmt_format(rec_id, rec_xml_new, 'xm') if error == 1: write_message(" Failed: error during update_bibfmt_format", verbose=1, stream=sys.stderr) return (1, int(rec_id)) write_message(" -Stage COMPLETED", verbose=2) # Update the database MetaData write_message("Stage 4: Start (Update the database with the metadata).", verbose=2) if options['stage_to_start_from'] <= 4: if options['mode'] == 'insert' or \ options['mode'] == 'replace' or \ options['mode'] == 'replace_or_insert' or \ options['mode'] == 'append' or \ options['mode'] == 'correct' or \ options['mode'] == 'reference': update_database_with_metadata(record, rec_id) else: write_message(" -Stage NOT NEEDED in mode %s" % options['mode'], verbose=2) write_message(" -Stage COMPLETED", verbose=2) else: write_message(" -Stage NOT NEEDED", verbose=2) # Finally we update the bibrec table with the current date write_message("Stage 5: Start (Update bibrec table with current date).", verbose=2) if options['stage_to_start_from'] <= 5 and \ options['notimechange'] == 0 and \ not insert_mode_p: now = convert_datestruct_to_datetext(time.localtime()) write_message(" -Retrieved current localtime: DONE", verbose=2) update_bibrec_modif_date(now, rec_id) write_message(" -Stage COMPLETED", verbose=2) else: write_message(" -Stage NOT NEEDED", verbose=2) # Increase statistics if insert_mode_p: stat['nb_records_inserted'] += 1 else: stat['nb_records_updated'] += 1 # Upload of this record finish write_message("Record "+str(rec_id)+" DONE", verbose=1) return (0, int(rec_id))
0c7f6ad29216972530c14213114120aa884740bb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/0c7f6ad29216972530c14213114120aa884740bb/bibupload.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25581, 6327, 12, 3366, 4672, 3536, 6376, 445, 30, 1207, 279, 1409, 471, 4845, 518, 316, 326, 4606, 25581, 8666, 16, 25581, 3927, 16, 25581, 3927, 67, 70, 495, 18310, 16, 25581, 18310, 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, 25581, 6327, 12, 3366, 4672, 3536, 6376, 445, 30, 1207, 279, 1409, 471, 4845, 518, 316, 326, 4606, 25581, 8666, 16, 25581, 3927, 16, 25581, 3927, 67, 70, 495, 18310, 16, 25581, 18310, 59...
flags = db.DB_CREATE | db.DB_TRUNCATE
flags = db.DB_CREATE if os.path.isfile(file): os.unlink(file)
def _checkflag(flag): if flag == 'r': flags = db.DB_RDONLY elif flag == 'rw': flags = 0 elif flag == 'w': flags = db.DB_CREATE elif flag == 'c': flags = db.DB_CREATE elif flag == 'n': flags = db.DB_CREATE | db.DB_TRUNCATE else: raise error, "flags should be one of 'r', 'w', 'c' or 'n'" return flags | db.DB_THREAD
fa351d6367130ab630b19d72fec1727b61e0fa50 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fa351d6367130ab630b19d72fec1727b61e0fa50/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1893, 6420, 12, 6420, 4672, 309, 2982, 422, 296, 86, 4278, 2943, 273, 1319, 18, 2290, 67, 20403, 10857, 1327, 2982, 422, 296, 21878, 4278, 2943, 273, 374, 1327, 2982, 422, 296, 91, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1893, 6420, 12, 6420, 4672, 309, 2982, 422, 296, 86, 4278, 2943, 273, 1319, 18, 2290, 67, 20403, 10857, 1327, 2982, 422, 296, 21878, 4278, 2943, 273, 374, 1327, 2982, 422, 296, 91, ...
return FTPError("command not implemented")
log.debug("SOMETHING IS SCREWY") def _unblock(self, *_): log.debug('_unblock running') commands = self.blocked self.blocked = None while commands and self.blocked is None: cmd, args = commands.pop(0) self.processCommand(cmd, *args) if self.blocked is not None: self.blocked.extend(commands) def _ebDtpInstance(self, _): log.debug(_)
def processCommand(self, command, *args): if self.blocked != None: self.blocked.append((method,args)) return
cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 2189, 12, 2890, 16, 1296, 16, 380, 1968, 4672, 309, 365, 18, 23156, 480, 599, 30, 365, 18, 23156, 18, 6923, 12443, 2039, 16, 1968, 3719, 327, 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, 1207, 2189, 12, 2890, 16, 1296, 16, 380, 1968, 4672, 309, 365, 18, 23156, 480, 599, 30, 365, 18, 23156, 18, 6923, 12443, 2039, 16, 1968, 3719, 327, 2, -100, -100, -100, -100, -100, -10...
_("%d out of %d hunk%s FAILED -- saving rejects to file %s\n" % (len(self.rej), self.hunks, hunkstr, fname)))
_("%d out of %d hunk%s FAILED -- saving rejects to file %s\n") % (len(self.rej), self.hunks, hunkstr, fname))
def write_rej(self): # our rejects are a little different from patch(1). This always # creates rejects in the same form as the original patch. A file # header is inserted so that you can run the reject through patch again # without having to type the filename.
252c8d85581f2987e5c62ae7983c3003cc9e5438 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/252c8d85581f2987e5c62ae7983c3003cc9e5438/patch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 266, 78, 12, 2890, 4672, 468, 3134, 4925, 87, 854, 279, 12720, 3775, 628, 4729, 12, 21, 2934, 225, 1220, 3712, 468, 3414, 4925, 87, 316, 326, 1967, 646, 487, 326, 2282, 4729,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 266, 78, 12, 2890, 4672, 468, 3134, 4925, 87, 854, 279, 12720, 3775, 628, 4729, 12, 21, 2934, 225, 1220, 3712, 468, 3414, 4925, 87, 316, 326, 1967, 646, 487, 326, 2282, 4729,...
self.doclist.DownloadDocument('non_existent_doc', path)
self.client.Export('non_existent_doc', path)
def testExportNonExistentDocument(self): path = './ned.txt' exception_raised = False try: self.doclist.DownloadDocument('non_existent_doc', path) except Exception, e: # expected exception_raised = True self.assert_(exception_raised) self.assert_(not os.path.exists(path))
76de6e666a2dc6ba3f703b89b870266619bcabd4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10620/76de6e666a2dc6ba3f703b89b870266619bcabd4/service_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 6144, 3989, 4786, 319, 2519, 12, 2890, 4672, 589, 273, 12871, 11748, 18, 5830, 11, 1520, 67, 354, 5918, 273, 1083, 775, 30, 365, 18, 2625, 18, 6144, 2668, 5836, 67, 19041, 67, 24...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6144, 3989, 4786, 319, 2519, 12, 2890, 4672, 589, 273, 12871, 11748, 18, 5830, 11, 1520, 67, 354, 5918, 273, 1083, 775, 30, 365, 18, 2625, 18, 6144, 2668, 5836, 67, 19041, 67, 24...
hsv_merge.py src_rgb src_greyscale dst_rgb
hsv_merge.py src_rgb src_greyscale dst_rgb.tif
def Usage(): print("""
d2b32f7ef7a71311a63ff51a68be531b5cbce93e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10290/d2b32f7ef7a71311a63ff51a68be531b5cbce93e/hsv_merge.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10858, 13332, 1172, 2932, 3660, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 10858, 13332, 1172, 2932, 3660, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
"No matching import parent %s for %s found"
__doc__ = "No matching import parent %s for %s found"
def __str__(self): return self.__doc__ %(self.args[0], self.args[1], self.args[2])
43ec45bd1519334fa54f35ea0dc700ba1d97d890 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/43ec45bd1519334fa54f35ea0dc700ba1d97d890/RepositoryError.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 701, 972, 12, 2890, 4672, 327, 365, 16186, 2434, 972, 8975, 2890, 18, 1968, 63, 20, 6487, 365, 18, 1968, 63, 21, 6487, 365, 18, 1968, 63, 22, 5717, 2, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 701, 972, 12, 2890, 4672, 327, 365, 16186, 2434, 972, 8975, 2890, 18, 1968, 63, 20, 6487, 365, 18, 1968, 63, 21, 6487, 365, 18, 1968, 63, 22, 5717, 2, -100, -100, -100, -100, -...
if begTime is not None: if nowTime < begTime: begin = localtime(begTime) end = localtime(begTime+duration)
if beginTime is not None: if nowTime < beginTime: begin = localtime(beginTime) end = localtime(beginTime+duration)
def buildMultiEntry(self, changecount, service, eventId, begTime, duration, EventName, nowTime, service_name): (clock_pic, rec) = self.getPixmapForEntry(service, eventId, beginTime, duration) r1=self.service_rect r2=self.progress_rect r3=self.descr_rect r4=self.start_end_rect res = [ None ] # no private data needed if rec: res.extend(( (eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width()-21, r1.height(), 0, RT_HALIGN_LEFT, service_name), (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r1.left()+r1.width()-16, r1.top(), 21, 21, clock_pic) )) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width(), r1.height(), 0, RT_HALIGN_LEFT, service_name)) if begTime is not None: if nowTime < begTime: begin = localtime(begTime) end = localtime(begTime+duration)
7c2806b5333b22eb2859c14879991319456cacc6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/7c2806b5333b22eb2859c14879991319456cacc6/EpgList.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 5002, 1622, 12, 2890, 16, 9435, 557, 592, 16, 1156, 16, 26004, 16, 16847, 950, 16, 3734, 16, 2587, 461, 16, 2037, 950, 16, 1156, 67, 529, 4672, 261, 18517, 67, 20003, 16, 1950, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5002, 1622, 12, 2890, 16, 9435, 557, 592, 16, 1156, 16, 26004, 16, 16847, 950, 16, 3734, 16, 2587, 461, 16, 2037, 950, 16, 1156, 67, 529, 4672, 261, 18517, 67, 20003, 16, 1950, ...
if problem_data["BCs"] != "null":
if problem_data["BCs"]:
def calc_global(problem_data): """ Calculates global stiffness matrix, assembly of elemental systems are included here instead of defining an extra function for assembly """ print("Calculating global system...") global NEN, NEN_range, functions, a, V1, V2, c, f, shape_funcs #Defining global variables NEN = problem_data["NEN"] NEN_range = range(NEN) #Taking coefficient functions of DE out of problem data functions = problem_data["functions"] a = functions["a"] V1 = functions["V1"] V2 = functions["V2"] c = functions["c"] f = functions["f"] #Defining shape functions shape_funcs = problem_data["shapefunc"] print(" * Creating matrixes...") NN = problem_data["NN"] K = sparse.lil_matrix((NN, NN)) F = zeros((NN, 1)) print(" * Calculating K and F matrixes...") for e_nodes in problem_data["LtoG"]: Ke, Fe = calc_elem(problem_data, e_nodes) for i, node_i in enumerate(e_nodes): F[node_i] += Fe[i] for j, node_j in enumerate(e_nodes): K[node_i, node_j] += Ke[i][j] print(" * Freeing up memory (1/2)...") del problem_data["GQ"] del problem_data["UV"] del problem_data["functions"] if problem_data["BCs"] != "null": K, F = apply_bc(problem_data, K, F) print (" * Freeing up memory (2/2)...") del problem_data["LtoG"] del problem_data["BCs"] print(" * Converting LIL to CSR format...") K = K.tocsr() return K, F
8b8580fce0563db97e1b2379c25a2d5ce8f2cc5e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8149/8b8580fce0563db97e1b2379c25a2d5ce8f2cc5e/gsystem.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7029, 67, 6347, 12, 18968, 67, 892, 4672, 3536, 26128, 2552, 384, 3048, 4496, 3148, 16, 19931, 434, 930, 287, 14908, 854, 5849, 2674, 3560, 434, 9364, 392, 2870, 445, 364, 19931, 3536, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7029, 67, 6347, 12, 18968, 67, 892, 4672, 3536, 26128, 2552, 384, 3048, 4496, 3148, 16, 19931, 434, 930, 287, 14908, 854, 5849, 2674, 3560, 434, 9364, 392, 2870, 445, 364, 19931, 3536, 1...
codmain.
codomain.
def iter_morphisms(self, arg=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain.
ae6a20e6ab8924137f419ec96957b2a456c43838 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ae6a20e6ab8924137f419ec96957b2a456c43838/words.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1400, 67, 81, 7657, 23749, 12, 2890, 16, 1501, 33, 7036, 16, 11012, 1530, 33, 7036, 16, 1131, 67, 2469, 33, 21, 4672, 436, 8395, 11436, 1879, 777, 14354, 23749, 598, 2461, 12176, 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, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1400, 67, 81, 7657, 23749, 12, 2890, 16, 1501, 33, 7036, 16, 11012, 1530, 33, 7036, 16, 1131, 67, 2469, 33, 21, 4672, 436, 8395, 11436, 1879, 777, 14354, 23749, 598, 2461, 12176, 2890, ...
return date is None and self.FLOOR_DATE or date
return date is None and FLOOR_DATE or date
def created(self): """Dublin Core element - date resource created, returned as DateTime. """ # allow for non-existent creation_date, existed always date = getattr( self, 'creation_date', None ) return date is None and self.FLOOR_DATE or date
0095339775b465f6a299193cd3c99dbd89f7ff95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/0095339775b465f6a299193cd3c99dbd89f7ff95/ExtensibleMetadata.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2522, 12, 2890, 4672, 3536, 40, 29056, 4586, 930, 300, 1509, 1058, 2522, 16, 2106, 487, 3716, 18, 3536, 468, 1699, 364, 1661, 17, 19041, 6710, 67, 712, 16, 20419, 3712, 1509, 273, 3869, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2522, 12, 2890, 4672, 3536, 40, 29056, 4586, 930, 300, 1509, 1058, 2522, 16, 2106, 487, 3716, 18, 3536, 468, 1699, 364, 1661, 17, 19041, 6710, 67, 712, 16, 20419, 3712, 1509, 273, 3869, ...
Tag, otherName="itemsWithTag", displayName=u"Tag", initialValue=None
Tag, displayName=u"Tag", initialValue=None
def getPhotoByFlickrTitle(view, title): photos = KindCollection('FlickrPhotoQuery', FlickrPhotoMixin) filteredPhotos = FilteredCollection('FilteredFlicrkPhotoQuery', photos) for x in filteredPhotos: return x
f2946ac7b77ea1abcb05a65a65f0e3f4bfb7e91b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/f2946ac7b77ea1abcb05a65a65f0e3f4bfb7e91b/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21735, 6302, 858, 2340, 16254, 4247, 12, 1945, 16, 2077, 4672, 18185, 273, 5851, 2532, 2668, 2340, 16254, 19934, 1138, 2187, 29458, 19934, 14439, 13, 5105, 3731, 12440, 273, 4008, 329, 2532,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21735, 6302, 858, 2340, 16254, 4247, 12, 1945, 16, 2077, 4672, 18185, 273, 5851, 2532, 2668, 2340, 16254, 19934, 1138, 2187, 29458, 19934, 14439, 13, 5105, 3731, 12440, 273, 4008, 329, 2532,...
image, mathml = None, None
image, mathml, label = None, None, None
def insert_math_images(file): file = os.path.abspath(file) doc = NonvalidatingReader.parseUri(file) ctxt = Context(doc, processorNss=NSS) # Check that verbatim math is used for node in Evaluate("//xhtml:span[@class='verbatimmath']/@lxir:value", context=ctxt): verbatimmath = node.value assert verbatimmath == u'true', "Need verbatim math mode for math conversion" # Check that the document class is known latexClass = None symbols = [] for node in Evaluate("//xhtml:span[@class='ClassOrPackageUsed']/@lxir:name", context=ctxt): if latexClasses.has_key(node.value): latexClass = latexClasses[node.value] elif node.value in symbolPackages: symbols.append(node.value[:-4]) assert latexClass, "Unknown document class used" # Get All macro text macros = [] for node in Evaluate("//xhtml:span[@class='macro']//text()", context=ctxt): macros.append(node.nodeValue) gen = ImageGenerator(file, latexClass, macros, symbols) # Convert All math images for node in Evaluate("//xhtml:span[@class='formule']", context=ctxt): c = Context(node, processorNss=NSS) formula = "" for t in Evaluate("xhtml:span[@class='text']/text()", context=c): formula += t.nodeValue formula = formula.strip() if not len(formula): print "empty formula found in document" image, mathml = None, None else: if formula[0] != "$": p = node.parentNode env = p.getAttributeNS(None, 'class') assert env, "No env found for equation" if env[-5:] == "-star": env = env[:-5]+"*" formula = "\\begin{" + env + "}\n" + formula + "\n\\end{" + env + "}" image, mathml = gen.makeImage(formula) # remove the empty text node(s) for t in Evaluate("xhtml:span[@class='text']", context=c): t.parentNode.removeChild(t) if image: img = node.ownerDocument.createElementNS(XHTML_NAMESPACE, "img") img.setAttributeNS(XHTML_NAMESPACE, "src", image) img.setAttributeNS(XHTML_NAMESPACE, "alt", formula) node.appendChild(img) if mathml: if mathml.tagName != 'math': # here, we have the case : a$_b$ # mathml is: <span class='msub'><span class='mi'/><span>b</span></span> # original xml is : ... <span>a</span><span class="formula"> ...</span> # and node is the formula # p is <span>a</span> p = get_prev_span_node(node) newNode = node.parentNode.insertBefore(mathml.cloneNode(True), node) newNode.firstChild.appendChild(p) node.parentNode.removeChild(node) print "Formula '%s' replaced by simple form (%s)." % (formula, newNode.tagName + '.' + newNode.getAttributeNS(None, u'class')) else: node.appendChild(node.ownerDocument.importNode(mathml, True)) base, ext = os.path.splitext(file) output = base + "_images" + ext o = open(output, "w") Print(doc, stream = o) o.close()
38e16f44922aeebd03cfc4154522b49522887608 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5321/38e16f44922aeebd03cfc4154522b49522887608/lxirimages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2243, 67, 15949, 67, 7369, 12, 768, 4672, 585, 273, 1140, 18, 803, 18, 5113, 803, 12, 768, 13, 997, 273, 3858, 877, 1776, 2514, 18, 2670, 3006, 12, 768, 13, 14286, 273, 1772, 12, 243...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2243, 67, 15949, 67, 7369, 12, 768, 4672, 585, 273, 1140, 18, 803, 18, 5113, 803, 12, 768, 13, 997, 273, 3858, 877, 1776, 2514, 18, 2670, 3006, 12, 768, 13, 14286, 273, 1772, 12, 243...
EXAMPLES:
EXAMPLES::
def __init__(self, items): r""" Initialize a PickleDict.
03555b4381371de7688c2f08f833898ba9658b7b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/03555b4381371de7688c2f08f833898ba9658b7b/explain_pickle.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1516, 4672, 436, 8395, 9190, 279, 23038, 298, 5014, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1516, 4672, 436, 8395, 9190, 279, 23038, 298, 5014, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
else
else:
def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 776) else quickfix.IntField.__init__(self, 776, 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, 2371, 6669, 13, 469, 30, 9549, 904, 18, 1702, 974, 16186, 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, 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, 2371, 6669, 13, 469, 30, 9549, 904, 18, 1702, 974, 16186, 27...
class Ov3(AbstractCut, NonBritishMixin) :
class Ov3(AbstractCut) :
def _mod1(self, other) : """RE._mod1(other) -> bool.
512a51d75f45fc23887dc67bb266c4f8cc3f48c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/512a51d75f45fc23887dc67bb266c4f8cc3f48c8/Restriction.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1711, 21, 12, 2890, 16, 1308, 13, 294, 3536, 862, 6315, 1711, 21, 12, 3011, 13, 317, 1426, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1711, 21, 12, 2890, 16, 1308, 13, 294, 3536, 862, 6315, 1711, 21, 12, 3011, 13, 317, 1426, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
Pick positive integers m and k and a nonnegative integer q. All the FuzzyBallGraphs constructed from partitions of m with k parts should be cospectral with respect to the normalized
Pick positive integers `m` and `k` and a nonnegative integer `q`. All the FuzzyBallGraphs constructed from partitions of `m` with `k` parts should be cospectral with respect to the normalized
def FuzzyBallGraph(self, partition, q): """ Construct a Fuzzy Ball graph with the integer partition ``partition`` and ``q`` extra vertices.
7d7db5252f36fea2d87565cac78d6b6e8b3c44b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/7d7db5252f36fea2d87565cac78d6b6e8b3c44b4/graph_generators.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 478, 13903, 38, 454, 4137, 12, 2890, 16, 3590, 16, 1043, 4672, 3536, 14291, 279, 478, 13903, 605, 454, 2667, 598, 326, 3571, 3590, 12176, 10534, 10335, 471, 12176, 85, 10335, 2870, 6928, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 478, 13903, 38, 454, 4137, 12, 2890, 16, 3590, 16, 1043, 4672, 3536, 14291, 279, 478, 13903, 605, 454, 2667, 598, 326, 3571, 3590, 12176, 10534, 10335, 471, 12176, 85, 10335, 2870, 6928, ...
port = int(host[i+1:])
try: port = int(host[i+1:]) except ValueError, msg: raise socket.error, str(msg)
def _set_hostport(self, host, port): if port is None: i = host.find(':') if i >= 0: port = int(host[i+1:]) host = host[:i] else: port = self.default_port self.host = host self.port = port
a982c9f11e2f47304c90c363a90406111416fa90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a982c9f11e2f47304c90c363a90406111416fa90/httplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 542, 67, 2564, 655, 12, 2890, 16, 1479, 16, 1756, 4672, 309, 1756, 353, 599, 30, 277, 273, 1479, 18, 4720, 2668, 2497, 13, 309, 277, 1545, 374, 30, 775, 30, 1756, 273, 509, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 542, 67, 2564, 655, 12, 2890, 16, 1479, 16, 1756, 4672, 309, 1756, 353, 599, 30, 277, 273, 1479, 18, 4720, 2668, 2497, 13, 309, 277, 1545, 374, 30, 775, 30, 1756, 273, 509, 12, ...
server.set_debuglevel(0)
if DEBUGLEVEL > 2: server.set_debuglevel(1) else: server.set_debuglevel(0)
def send_email(fromaddr, toaddr, body): server = smtplib.SMTP('smtp.cern.ch') server.set_debuglevel(0) server.sendmail(fromaddr, toaddr, body) server.quit()
accc0ccafc5566a0582cd7acddeba0dfd44f4e9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/accc0ccafc5566a0582cd7acddeba0dfd44f4e9b/alert_engine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 3652, 12, 2080, 4793, 16, 358, 4793, 16, 1417, 4672, 1438, 273, 272, 1010, 6673, 18, 55, 14636, 2668, 20278, 18, 14770, 18, 343, 6134, 309, 6369, 10398, 405, 576, 30, 1438, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 3652, 12, 2080, 4793, 16, 358, 4793, 16, 1417, 4672, 1438, 273, 272, 1010, 6673, 18, 55, 14636, 2668, 20278, 18, 14770, 18, 343, 6134, 309, 6369, 10398, 405, 576, 30, 1438, 1...
setiter = iter(self.set) self.assertEqual(setiter.__length_hint__(), len(self.set))
def test_iteration(self): for v in self.set: self.assert_(v in self.values) setiter = iter(self.set) # note: __length_hint__ is an internal undocumented API, # don't rely on it in your own programs self.assertEqual(setiter.__length_hint__(), len(self.set))
c61af743718846568e96679a352bf2adf5e54b9a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6753/c61af743718846568e96679a352bf2adf5e54b9a/test_set.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 16108, 12, 2890, 4672, 364, 331, 316, 365, 18, 542, 30, 365, 18, 11231, 67, 12, 90, 316, 365, 18, 2372, 13, 444, 2165, 273, 1400, 12, 2890, 18, 542, 13, 468, 4721, 30, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16108, 12, 2890, 4672, 364, 331, 316, 365, 18, 542, 30, 365, 18, 11231, 67, 12, 90, 316, 365, 18, 2372, 13, 444, 2165, 273, 1400, 12, 2890, 18, 542, 13, 468, 4721, 30, 10...
(self._poly - right._poly, \
(selfpoly - rightpoly, \
def _sub_(self, right): selfpoly = self._poly rightpoly = right._poly if self._valbase > right._valbase: selfpoly = selfpoly * self.base_ring().prime_pow(self._valbase - right._valbase) baseval = right._valbase elif self._valbase < right._valbase: rightpoly = rightpoly * self.base_ring().prime_pow(right._valbase - self._valbase) baseval = self._valbase else: baseval = self._valbase # Currently we don't reduce the coefficients of the answer modulo the appropriate power of p or normalize return Polynomial_padic_capped_relative_dense(self.parent(), \ (self._poly - right._poly, \ baseval, \ [min(a + self._valbase - baseval, b + right._valbase - baseval) for (a, b) in zip(_extend_by_infinity(self._relprecs, max(len(self._relprecs), len(right._relprecs))), \ _extend_by_infinity(right._relprecs, max(len(self._relprecs), len(right._relprecs))))], \ False, None, None), construct = True)
a82509f3832c26b57c6c5acac4996cd7fa79553a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/a82509f3832c26b57c6c5acac4996cd7fa79553a/polynomial_padic_capped_relative_dense.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1717, 67, 12, 2890, 16, 2145, 4672, 365, 16353, 273, 365, 6315, 16353, 2145, 16353, 273, 2145, 6315, 16353, 309, 365, 6315, 1125, 1969, 405, 2145, 6315, 1125, 1969, 30, 365, 16353, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1717, 67, 12, 2890, 16, 2145, 4672, 365, 16353, 273, 365, 6315, 16353, 2145, 16353, 273, 2145, 6315, 16353, 309, 365, 6315, 1125, 1969, 405, 2145, 6315, 1125, 1969, 30, 365, 16353, ...
open("/dev/tty", "w").write("lib: self.install_dir = %s\n" % self.install_dir)
def finalize_options(self):
342ad6243e75afa3504736690a6fad2ae03da58b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7126/342ad6243e75afa3504736690a6fad2ae03da58b/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12409, 67, 2116, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12409, 67, 2116, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
>>>>>>> .merge-right.r4008
def html(self, environ): """ text/html representation of the exception """ return ''
255773b152c67560628a1908478d7fbd32c49d9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/255773b152c67560628a1908478d7fbd32c49d9b/httpexceptions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1729, 12, 2890, 16, 5473, 4672, 3536, 977, 19, 2620, 4335, 434, 326, 1520, 3536, 327, 875, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1729, 12, 2890, 16, 5473, 4672, 3536, 977, 19, 2620, 4335, 434, 326, 1520, 3536, 327, 875, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
assert_array_equal(gmm.gm.w, dic['w']) assert_array_equal(gmm.gm.mu, dic['mu']) assert_array_equal(gmm.gm.va, dic['va'])
assert_array_equal(gmm.gm.w, dic['w'], DEF_DEC) assert_array_equal(gmm.gm.mu, dic['mu'], DEF_DEC) assert_array_equal(gmm.gm.va, dic['va'], DEF_DEC)
def test_2d_full(self, level = 1): d = 2 k = 3 mode = 'full' dic = load_dataset('full_2d_3k.mat')
76afc91d8ddf202146c1cc1b22949de3110c98d0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/76afc91d8ddf202146c1cc1b22949de3110c98d0/test_gmm_em.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 22, 72, 67, 2854, 12, 2890, 16, 1801, 273, 404, 4672, 302, 273, 576, 417, 273, 890, 1965, 273, 296, 2854, 11, 11681, 273, 1262, 67, 8682, 2668, 2854, 67, 22, 72, 67, 23, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 22, 72, 67, 2854, 12, 2890, 16, 1801, 273, 404, 4672, 302, 273, 576, 417, 273, 890, 1965, 273, 296, 2854, 11, 11681, 273, 1262, 67, 8682, 2668, 2854, 67, 22, 72, 67, 23, ...
"and need investiagtion: %s" % \
"and need investigation: %s" % \
def finishUpdate(self): pklog.debug("finishUpdate()") if self.conffile_prompts: self._backend.message(MESSAGE_CONFIG_FILES_CHANGED, "The following conffile prompts were found " "and need investiagtion: %s" % \ "\n".join(self.conffile_prompts)) # Check for required restarts if os.path.exists("/var/run/reboot-required") and \ os.path.getmtime("/var/run/reboot-required") > self.start_time: self._backend.require_restart(RESTART_SYSTEM, "")
cc1bfcfb7c1c86f9aceadeeab36942698d0ddf85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12904/cc1bfcfb7c1c86f9aceadeeab36942698d0ddf85/aptBackend.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4076, 1891, 12, 2890, 4672, 2365, 1330, 18, 4148, 2932, 13749, 1891, 1435, 7923, 309, 365, 18, 3923, 768, 67, 17401, 1092, 30, 365, 6315, 9993, 18, 2150, 12, 8723, 67, 7203, 67, 12669, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4076, 1891, 12, 2890, 4672, 2365, 1330, 18, 4148, 2932, 13749, 1891, 1435, 7923, 309, 365, 18, 3923, 768, 67, 17401, 1092, 30, 365, 6315, 9993, 18, 2150, 12, 8723, 67, 7203, 67, 12669, ...
expr = '[^\(\)\s]*lib%s\.[^\(\)\s]*' % name
expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
def _findLib_gcc(name): expr = '[^\(\)\s]*lib%s\.[^\(\)\s]*' % name fdout, ccout = tempfile.mkstemp() os.close(fdout) cmd = 'if type gcc &>/dev/null; then CC=gcc; else CC=cc; fi;' \ '$CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name try: fdout, outfile = tempfile.mkstemp() os.close(fdout) fd = os.popen(cmd) trace = fd.read() err = fd.close() finally: try: os.unlink(outfile) except OSError, e: if e.errno != errno.ENOENT: raise try: os.unlink(ccout) except OSError, e: if e.errno != errno.ENOENT: raise res = re.search(expr, trace) if not res: return None return res.group(0)
19f87553b42882b9e3bd2d7bdb0c6d39e29eb2a7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/19f87553b42882b9e3bd2d7bdb0c6d39e29eb2a7/util.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4720, 5664, 67, 75, 952, 12, 529, 4672, 3065, 273, 436, 11, 15441, 4713, 5153, 87, 5772, 2941, 9, 87, 5834, 15441, 4713, 5153, 87, 65, 4035, 738, 283, 18, 6939, 12, 529, 13, 519...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4720, 5664, 67, 75, 952, 12, 529, 4672, 3065, 273, 436, 11, 15441, 4713, 5153, 87, 5772, 2941, 9, 87, 5834, 15441, 4713, 5153, 87, 65, 4035, 738, 283, 18, 6939, 12, 529, 13, 519...
startNode = result.node(startNodeInfo >> 4)
startNode = result.node((startNodeInfo >> 4) - 1)
def crackEdgeGraph(labelImage, eightConnectedRegions = True, progressHook = None): result = GeoMap(labelImage.size()) cc = crackConnectionImage(labelImage) if eightConnectedRegions: for y in range(1, cc.height()-1): for x in range(1, cc.width()-1): if cc[x,y] == 15: if labelImage[x,y] == labelImage[x-1,y-1]: cc[x,y] += 16 if labelImage[x-1,y] == labelImage[x,y-1]: cc[x,y] += 32 if cc[x,y] == 15+16+32: # crossing regions? if labelImage[x,y-1] > labelImage[x-1,y-1]: cc[x,y] -= 16 else: cc[x,y] -= 32 nodeImage = GrayImage(cc.size()) progressHook = progressHook and progressHook.rangeTicker(cc.height()) for y in range(cc.height()): if progressHook: progressHook() for x in range(cc.width()): nodeConn = int(cc[x, y]) if isNode(nodeConn): startNodeInfo = int(nodeImage[x, y]) if startNodeInfo: startNode = result.node(startNodeInfo >> 4) else: startNode = result.addNode((x - 0.5, y - 0.5)) nodeImage[x, y] = startNodeInfo = startNode.label() << 4 for direction, startConn in enumerate(connections): if nodeConn & startConn and not startNodeInfo & startConn: edge, endPos, endConn = followEdge( cc, (x, y), direction) endNodeInfo = int(nodeImage[endPos]) if not endNodeInfo: endNode = result.addNode((endPos[0] - 0.5, endPos[1] - 0.5)) endNodeInfo = endNode.label() << 4 else: assert not endNodeInfo & endConn, "double connection?" endNode = result.node(endNodeInfo >> 4) edge = result.addEdge(startNode, endNode, edge) startNodeInfo |= startConn if edge.isLoop(): startNodeInfo |= endConn nodeImage[x, y] = startNodeInfo else: nodeImage[x, y] = startNodeInfo nodeImage[endPos] = endNodeInfo | endConn return result
a94194260b0ee2a979b184709c2d70b6c499169d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10394/a94194260b0ee2a979b184709c2d70b6c499169d/crackConvert.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 21580, 6098, 4137, 12, 1925, 2040, 16, 425, 750, 8932, 17344, 273, 1053, 16, 4007, 5394, 273, 599, 4672, 563, 273, 9385, 863, 12, 1925, 2040, 18, 1467, 10756, 225, 4946, 273, 276, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 21580, 6098, 4137, 12, 1925, 2040, 16, 425, 750, 8932, 17344, 273, 1053, 16, 4007, 5394, 273, 599, 4672, 563, 273, 9385, 863, 12, 1925, 2040, 18, 1467, 10756, 225, 4946, 273, 276, ...
for option in Option.objects.filter(option_group__id__in = groups.keys(), value__in = vals.keys()): uid = option.unique_id if opts.has_key(uid): opts[uid] = option
for options in all_options: for option in options: if not opts.has_key(option): k, v = split_option_unique_id(option) vals[v] = False groups[k] = False opts[option] = None for option in Option.objects.filter(option_group__id__in = groups.keys(), value__in = vals.keys()): uid = option.unique_id if opts.has_key(uid): opts[uid] = option
def serialize_options(product, selected_options=()): """ Return a list of optiongroups and options for display to the customer. Only returns options that are actually used by members of this product. Return Value: [ { name: 'group name', id: 'group id', items: [{ name: 'opt name', value: 'opt value', price_change: 'opt price', selected: False, },{..}] }, {..} ] Note: This doesn't handle the case where you have multiple options and some combinations aren't available. For example, you have option_groups color and size, and you have a yellow/large, a yellow/small, and a white/small, but you have no white/large - the customer will still see the options white and large. """ all_options = product.get_valid_options() group_sortmap = OptionGroup.objects.get_sortmap() # first get all objects # right now we only have a list of option.unique_ids, and there are # probably a lot of dupes, so first list them uniquely vals = {} groups = {} opts = {} for options in all_options: for option in options: if not opts.has_key(option): k, v = split_option_unique_id(option) vals[v] = False groups[k] = False opts[option] = None for option in Option.objects.filter(option_group__id__in = groups.keys(), value__in = vals.keys()): uid = option.unique_id if opts.has_key(uid): opts[uid] = option # now we have all the objects in our "opts" dictionary, so build the serialization dict serialized = {} for option in opts.values(): if not serialized.has_key(option.option_group_id): serialized[option.option_group.id] = { 'name': option.option_group.translated_name(), 'id': option.option_group.id, 'items': [], } if not option in serialized[option.option_group_id]['items']: serialized[option.option_group_id]['items'] += [option] option.selected = option.unique_id in selected_options # first sort the option groups values = [] for k, v in serialized.items(): values.append((group_sortmap[k], v)) values.sort() values = zip(*values)[1] log.debug('serialized: %s', values) #now go back and make sure option items are sorted properly. for v in values: v['items'] = _sort_options(v['items']) log.debug('Serialized Options %s: %s', product.product.slug, values) return values
ecd1f31cde88383633d2db5c664f185f38d43f32 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/171/ecd1f31cde88383633d2db5c664f185f38d43f32/utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4472, 67, 2116, 12, 5896, 16, 3170, 67, 2116, 33, 1435, 4672, 3536, 2000, 279, 666, 434, 1456, 4650, 471, 702, 364, 2562, 358, 326, 6666, 18, 5098, 1135, 702, 716, 854, 6013, 1399, 635...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4472, 67, 2116, 12, 5896, 16, 3170, 67, 2116, 33, 1435, 4672, 3536, 2000, 279, 666, 434, 1456, 4650, 471, 702, 364, 2562, 358, 326, 6666, 18, 5098, 1135, 702, 716, 854, 6013, 1399, 635...
cty.c_int, [cty.POINTER(FL_OBJECT), cty.c_int, cty.c_int],
cty.c_int, [cty.POINTER(FL_OBJECT), cty.c_int, cty.c_int],
def fl_set_menu_notitle(ob, off): """ fl_set_menu_notitle(ob, off) -> num. """ retval = _fl_set_menu_notitle(ob, off) return retval
9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 542, 67, 5414, 67, 902, 1280, 12, 947, 16, 3397, 4672, 3536, 1183, 67, 542, 67, 5414, 67, 902, 1280, 12, 947, 16, 3397, 13, 317, 818, 18, 3536, 225, 5221, 273, 389, 2242, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 542, 67, 5414, 67, 902, 1280, 12, 947, 16, 3397, 4672, 3536, 1183, 67, 542, 67, 5414, 67, 902, 1280, 12, 947, 16, 3397, 13, 317, 818, 18, 3536, 225, 5221, 273, 389, 2242, ...
for i in range(1, game.incom+1):
for i in range(game.incom):
def setup(): # prepare to play, set up cosmos w = coord() # Decide how many of everything if choose(): return # frozen game # Prepare the Enterprise game.alldone = game.gamewon = False game.ship = IHE game.state.crew = FULLCREW game.energy = game.inenrg = 5000.0 game.shield = game.inshld = 2500.0 game.shldchg = False game.shldup = False game.inlsr = 4.0 game.lsupres = 4.0 game.quadrant = randplace(GALSIZE) game.sector = randplace(QUADSIZE) game.torps = game.intorps = 10 game.nprobes = randrange(2, 5) game.warpfac = 5.0 game.wfacsq = game.warpfac * game.warpfac for i in range(NDEVICES): game.damage[i] = 0.0 # Set up assorted game parameters game.battle = coord() game.state.date = game.indate = 100.0 * randreal(20, 51) game.nkinks = game.nhelp = game.casual = game.abandoned = 0 game.iscate = game.resting = game.imine = game.icrystl = game.icraft = False game.isatb = game.state.nplankl = 0 game.state.starkl = game.state.basekl = 0 game.iscraft = "onship" game.landed = False game.alive = True game.docfac = 0.25 for i in range(GALSIZE): for j in range(GALSIZE): quad = game.state.galaxy[i][j] quad.charted = 0 quad.planet = None quad.romulans = 0 quad.klingons = 0 quad.starbase = False quad.supernova = False quad.status = "secure" # Initialize times for extraneous events schedule(FSNOVA, expran(0.5 * game.intime)) schedule(FTBEAM, expran(1.5 * (game.intime / game.state.remcom))) schedule(FSNAP, randreal(1.0, 2.0)) # Force an early snapshot schedule(FBATTAK, expran(0.3*game.intime)) unschedule(FCDBAS) if game.state.nscrem: schedule(FSCMOVE, 0.2777) else: unschedule(FSCMOVE) unschedule(FSCDBAS) unschedule(FDSPROB) if (game.options & OPTION_WORLDS) and game.skill >= SKILL_GOOD: schedule(FDISTR, expran(1.0 + game.intime)) else: unschedule(FDISTR) unschedule(FENSLV) unschedule(FREPRO) # Starchart is functional but we've never seen it game.lastchart = FOREVER # Put stars in the galaxy game.instar = 0 for i in range(GALSIZE): for j in range(GALSIZE): k = randrange(1, QUADSIZE**2/10+1) game.instar += k game.state.galaxy[i][j].stars = k # Locate star bases in galaxy for i in range(game.inbase): while True: while True: w = randplace(GALSIZE) if not game.state.galaxy[w.x][w.y].starbase: break contflag = False # C version: for (j = i-1; j > 0; j--) # so it did them in the opposite order. for j in range(1, i): # Improved placement algorithm to spread out bases distq = (w - game.state.baseq[j]).distance() if distq < 6.0*(BASEMAX+1-game.inbase) and withprob(0.75): contflag = True if idebug: prout("=== Abandoning base #%d at %s" % (i, w)) break elif distq < 6.0 * (BASEMAX+1-game.inbase): if idebug: prout("=== Saving base #%d, close to #%d" % (i, j)) if not contflag: break game.state.baseq[i] = w game.state.galaxy[w.x][w.y].starbase = True game.state.chart[w.x][w.y].starbase = True # Position ordinary Klingon Battle Cruisers krem = game.inkling klumper = 0.25*game.skill*(9.0-game.length)+1.0 if klumper > MAXKLQUAD: klumper = MAXKLQUAD while True: r = randreal() klump = (1.0 - r*r)*klumper if klump > krem: klump = krem krem -= klump while True: w = randplace(GALSIZE) if not game.state.galaxy[w.x][w.y].supernova and \ game.state.galaxy[w.x][w.y].klingons + klump <= MAXKLQUAD: break game.state.galaxy[w.x][w.y].klingons += int(klump) if krem <= 0: break # Position Klingon Commander Ships for i in range(1, game.incom+1): while True: w = randplace(GALSIZE) if (game.state.galaxy[w.x][w.y].klingons or withprob(0.25)) and \ not game.state.galaxy[w.x][w.y].supernova and \ game.state.galaxy[w.x][w.y].klingons <= MAXKLQUAD-1 and \ not w in game.state.kcmdr[:i]: break game.state.galaxy[w.x][w.y].klingons += 1 game.state.kcmdr[i] = w # Locate planets in galaxy for i in range(game.inplan): while True: w = randplace(GALSIZE) if game.state.galaxy[w.x][w.y].planet == None: break new = planet() new.w = w new.crystals = "absent" if (game.options & OPTION_WORLDS) and i < NINHAB: new.pclass = "M" # All inhabited planets are class M new.crystals = "absent" new.known = "known" new.name = systnames[i] new.inhabited = True else: new.pclass = ("M", "N", "O")[randrange(0, 3)] if withprob(0.33): new.crystals = "present" new.known = "unknown" new.inhabited = False game.state.galaxy[w.x][w.y].planet = new game.state.planets.append(new) # Locate Romulans for i in range(game.state.nromrem): w = randplace(GALSIZE) game.state.galaxy[w.x][w.y].romulans += 1 # Locate the Super Commander if game.state.nscrem > 0: while True: w = randplace(GALSIZE) if not game.state.galaxy[w.x][w.y].supernova and game.state.galaxy[w.x][w.y].klingons <= MAXKLQUAD: break game.state.kscmdr = w game.state.galaxy[w.x][w.y].klingons += 1 # Place thing (in tournament game, we don't want one!) global thing if game.tourn is None: thing = randplace(GALSIZE) skip(2) game.state.snap = False if game.skill == SKILL_NOVICE: prout(_("It is stardate %d. The Federation is being attacked by") % int(game.state.date)) prout(_("a deadly Klingon invasion force. As captain of the United")) prout(_("Starship U.S.S. Enterprise, it is your mission to seek out")) prout(_("and destroy this invasion force of %d battle cruisers.") % ((game.inkling + game.incom + game.inscom))) prout(_("You have an initial allotment of %d stardates to complete") % int(game.intime)) prout(_("your mission. As you proceed you may be given more time.")) skip(1) prout(_("You will have %d supporting starbases.") % (game.inbase)) proutn(_("Starbase locations- ")) else: prout(_("Stardate %d.") % int(game.state.date)) skip(1) prout(_("%d Klingons.") % (game.inkling + game.incom + game.inscom)) prout(_("An unknown number of Romulans.")) if game.state.nscrem: prout(_("And one (GULP) Super-Commander.")) prout(_("%d stardates.") % int(game.intime)) proutn(_("%d starbases in ") % game.inbase) for i in range(game.inbase): proutn(`game.state.baseq[i]`) proutn(" ") skip(2) proutn(_("The Enterprise is currently in Quadrant %s") % game.quadrant) proutn(_(" Sector %s") % game.sector) skip(2) prout(_("Good Luck!")) if game.state.nscrem: prout(_(" YOU'LL NEED IT.")) waitfor() newqad(False) if len(game.enemies) - (thing == game.quadrant) - (game.tholian != None): game.shldup = True if game.neutz: # bad luck to start in a Romulan Neutral Zone attack(torps_ok=False)
ab4d7f5dd82fc30c4db6597dd6dd68b4dc33f98b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/ab4d7f5dd82fc30c4db6597dd6dd68b4dc33f98b/sst.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 13332, 468, 2911, 358, 6599, 16, 444, 731, 4987, 26719, 341, 273, 2745, 1435, 468, 225, 3416, 831, 3661, 4906, 434, 7756, 309, 9876, 13332, 327, 468, 12810, 7920, 468, 7730, 326, 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, 3875, 13332, 468, 2911, 358, 6599, 16, 444, 731, 4987, 26719, 341, 273, 2745, 1435, 468, 225, 3416, 831, 3661, 4906, 434, 7756, 309, 9876, 13332, 327, 468, 12810, 7920, 468, 7730, 326, 2...
return reduce(__and__, (c.resolve(discodb) for c in self.clauses))
return reduce(__and__, (c.resolve(discodb) for c in self.clauses), Q([]))
def resolve(self, discodb): return reduce(__and__, (c.resolve(discodb) for c in self.clauses))
74e0c4d707533197458aa76d945910bdb8e76a5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/373/74e0c4d707533197458aa76d945910bdb8e76a5d/query.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2245, 12, 2890, 16, 1015, 1559, 70, 4672, 327, 5459, 12, 972, 464, 972, 16, 261, 71, 18, 10828, 12, 2251, 1559, 70, 13, 364, 276, 316, 365, 18, 830, 9608, 3719, 2, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2245, 12, 2890, 16, 1015, 1559, 70, 4672, 327, 5459, 12, 972, 464, 972, 16, 261, 71, 18, 10828, 12, 2251, 1559, 70, 13, 364, 276, 316, 365, 18, 830, 9608, 3719, 2, -100, -100, -100, ...
'queue', '4000000'
'queue', queue_size
def __enter__(self): if self.is_traffic_shaping: self.platformsettings.ipfw(['delete', self.pipe_set]) if (self.up_bandwidth == '0' and self.down_bandwidth == '0' and self.delay_ms == '0' and self.packet_loss_rate == '0'): return try: upload_pipe = '1' # The IPFW pipe for upload rules. download_pipe = '2' # The IPFW pipe for download rules. dns_pipe = '3' # The IPFW pipe for DNS.
1578bee647b0c032f643d61f2adf45d5b1d28f27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3776/1578bee647b0c032f643d61f2adf45d5b1d28f27/trafficshaper.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2328, 972, 12, 2890, 4672, 309, 365, 18, 291, 67, 19231, 67, 674, 24447, 30, 365, 18, 9898, 4272, 18, 625, 11966, 12, 3292, 3733, 2187, 365, 18, 14772, 67, 542, 5717, 309, 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, 1001, 2328, 972, 12, 2890, 4672, 309, 365, 18, 291, 67, 19231, 67, 674, 24447, 30, 365, 18, 9898, 4272, 18, 625, 11966, 12, 3292, 3733, 2187, 365, 18, 14772, 67, 542, 5717, 309, 261, ...
def __init__(data = None)
def __init__(data = None):
def __init__(data = None) if data == None: quickfix.DoubleField.__init__(self, 190) else quickfix.DoubleField.__init__(self, 190, 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, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 5265, 974, 16186, 2738, 972, 12, 2890, 16, 5342, 20, 13, 469, 9549, 904, 18, 5265, 974, 16186, 2738, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 5265, 974, 16186, 2738, 972, 12, 2890, 16, 5342, 20, 13, 469, 9549, 904, 18, 5265, 974, 16186, 2738, ...
return command_classes ]
def preloaded_command_classes(): """ Return a list of command classes for the commands which are always loaded on startup, and should always be reinitialized (in this order) when new command objects are needed. @note: currently this includes all loadable builtin commands, but soon we will implement a way for some commands to be loaded lazily, and remove many commands from this list. """ # classes for builtin commands (or unsplit modes) which were preloaded # by toplevel imports above, in order of desired instantiation: command_classes = [ SelectChunks_Command, SelectAtoms_Command, BuildAtoms_Command, Move_Command, cookieMode, extrudeMode, movieMode, ZoomToAreaMode, ZoomInOutMode, PanMode, RotateMode, PasteMode, PartLibraryMode, LineMode, DnaLineMode, DnaDuplex_EditCommand, Plane_EditCommand, LinearMotor_EditCommand, RotaryMotor_EditCommand, BreakStrands_Command, JoinStrands_Command, MakeCrossovers_Command, BuildDna_EditCommand, DnaSegment_EditCommand, DnaStrand_EditCommand, MultipleDnaSegmentResize_EditCommand, OrderDna_Command, DnaDisplayStyle_Command, BuildNanotube_EditCommand, InsertNanotube_EditCommand, NanotubeSegment_EditCommand, RotateChunks_Command, TranslateChunks_Command, FuseChunks_Command, RotateAboutPoint_Command, StereoProperties_Command, ColorScheme_Command, BuildProtein_EditCommand, ProteinDisplayStyle_Command, LightingScheme_Command] # note: we could extract each one's commandName (class constant) # if we wanted to return them as commandName, commandClass pairs return command_classes ] # note: we could extract each one's commandName (class constant) # if we wanted to return them as commandName, commandClass pairs return command_classes
0bfd89aabee3dccbcbcc0962bb785519b8dbc386 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/0bfd89aabee3dccbcbcc0962bb785519b8dbc386/builtin_command_loaders.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 675, 4230, 67, 3076, 67, 4701, 13332, 3536, 2000, 279, 666, 434, 1296, 3318, 364, 326, 4364, 1492, 854, 3712, 4203, 603, 11850, 16, 471, 1410, 3712, 506, 283, 13227, 261, 267, 333, 1353,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 675, 4230, 67, 3076, 67, 4701, 13332, 3536, 2000, 279, 666, 434, 1296, 3318, 364, 326, 4364, 1492, 854, 3712, 4203, 603, 11850, 16, 471, 1410, 3712, 506, 283, 13227, 261, 267, 333, 1353,...
else:
else:
def main(): """Support mirobridge from the command line returns True """ global localhostname, simulation, verbose, storagegroups, ffmpeg, channel_id, channel_num global flat, download_sleeptime, channel_watch_only, channel_mythvideo_only, channel_new_watch_copy global vid_graphics_dirs, storagegroups, imagemagick, statistics, requirements_are_met global graphic_suffix, graphic_path_suffix, graphic_name_suffix global mythcommflag_recordings, mythcommflag_videos parser = OptionParser(usage=u"%prog usage: mirobridge -huevstdociVHSCWM [parameters]\n") parser.add_option( "-e", "--examples", action="store_true", default=False, dest="examples", help=u"Display examples for executing the jamu script") parser.add_option( "-v", "--version", action="store_true", default=False, dest="version", help=u"Display version and author information") parser.add_option( "-s", "--simulation", action="store_true", default=False, dest="simulation", help=u"Simulation (dry run), no files are copied, symlinks created or MythTV data bases altered. If option (-n) is NOT specified Miro auto downloads WILL take place. See option (-n) help for details.") parser.add_option( "-t", "--testenv", action="store_true", default=False, dest="testenv", help=u"Test that the local environment can run all mirobridge functionality") parser.add_option( "-n", "--no_autodownload", action="store_true", default=False, dest="no_autodownload", help=u"Do not perform Miro Channel updates, video expiry and auto-downloadings. Default is to perform all perform all Channel maintenance features.") parser.add_option( "-o", "--nosubdirs", action="store_true", default=False, dest="nosubdirs", help=u"Organise MythVideo's Miro directory WITHOUT Miro channel subdirectories. The default is to have Channel subdirectories.") parser.add_option( "-c", "--channel", metavar="CHANNEL_ID:CHANNEL_NUM", default="", dest="channel", help=u'Specifies the channel id that is used for Miros unplayed recordings. Enter as "xxxx:yyy". Default is 9999:999. Be warned that once you change the default channel_id "9999" you must always use this option!') #parser.add_option( "-i", "--import", metavar="CONFIGFILE", default="", dest="import", # help=u'Import Miro exported configuration file and or channel changes.') parser.add_option( "-V", "--verbose", action="store_true", default=False, dest="verbose", help=u"Display verbose messages when processing") parser.add_option( "-H", "--hostname", metavar="HOSTNAME", default="", dest="hostname", help=u"MythTV Backend hostname mirobridge is to up date") parser.add_option( "-S", "--sleeptime", metavar="SLEEP_DELAY_SECONDS", default="", dest="sleeptime", help=u"The amount of seconds to wait for an auto download to start.\nThe default is 60 seconds, but this may need to be adjusted for slower Internet connections.") parser.add_option( "-C", "--addchannel", metavar="ICONFILE_PATH", default="OFF", dest="addchannel", help=u'Add a Miro Channel record to MythTV. This gets rid of the "#9999 #9999" on the Watch Recordings screen and replaces it with the usual\nthe channel number and channel name.\nThe default if not overridden by the (-c) option is channel number 999.\nIf a filename and path is supplied it will be set as the channels icon. Make sure your override channel number is NOT one of your current MythTV channel numbers.\nThis option is typically only used once as there can only be one Miro channel record at a time.') parser.add_option( "-N", "--new_watch_copy", action="store_true", default=False, dest="new_watch_copy", help=u'For ALL Miro Channels: Use the "Watch Recording" screen to watch new Miro downloads then once watched copy the videos, icons, screen shot and metadata to MythVideo. Once coping is complete delete the video from Miro.\nThis option overrides any "mirobridge.conf" settings.') parser.add_option( "-W", "--watch_only", action="store_true", default=False, dest="watch_only", help=u'For ALL Miro Channels: Only use "Watch Recording" never move any Miro videos to MythVideo.\nThis option overrides any "mirobridge.conf" settings.') parser.add_option( "-M", "--mythvideo_only", action="store_true", default=False, dest="mythvideo_only", help=u'For ALL Miro Channel videos: Copy newly downloaded Miro videos to MythVideo and removed from Miro. These Miro videos never appear in the MythTV "Watch Recording" screen.\nThis option overrides any "mirobridge.conf" settings.') opts, args = parser.parse_args() if opts.examples: # Display example information sys.stdout.write(examples_txt+'\n') sys.exit(True) if opts.version: # Display program information sys.stdout.write(u"\nTitle: (%s); Version: description(%s); Author: (%s)\n%s\n" % ( __title__, __version__, __author__, __purpose__ )) sys.exit(True) if opts.testenv: test_environment = True else: test_environment = False # Verify that Miro is not currently running if isMiroRunning(): sys.exit(False) # Verify that only None or one of the mutually exclusive (-W), (-M) and (-N) options is being used x = 0 if opts.new_watch_copy: x+=1 if opts.watch_only: x+=1 if opts.mythvideo_only: x+=1 if x > 1: logger.critical(u"The (-W), (-M) and (-N) options are mutually exclusive, so only one can be specified at a time.") sys.exit(False) # Set option related global variables simulation = opts.simulation verbose = opts.verbose if opts.hostname: # Override localhostname if the user specified an hostname localhostname = opts.hostname # Validate settings # Make sure mirobridge is to update a real MythTV backend if not mythdb.getSetting(u'BackendServerIP', hostname = localhostname): logger.critical(u"The MythTV backend (%s) is not a MythTV backend." % localhostname) if test_environment: requirements_are_met = False else: sys.exit(False) ## Video base directory and current version and revision numbers base_video_dir = config.get(prefs.MOVIES_DIRECTORY) miro_version_rev = u"%s r%s" % (config.get(prefs.APP_VERSION), config.get(prefs.APP_REVISION_NUM)) displayMessage(u"Miro Version (%s)" % (miro_version_rev)) displayMessage(u"Base Miro Video Directory (%s)" % (base_video_dir,)) logger.info(u'') # Verify Miro version sufficent and Video file configuration correct. if not os.path.isdir(base_video_dir): logger.critical(u"The Miro Videos directory (%s) does not exist." % str(base_video_dir)) if test_environment: requirements_are_met = False else: sys.exit(False) if config.get(prefs.APP_VERSION) < u"2.0.3": logger.critical(u"The installed version of Miro (%s) is too old. It must be at least v2.0.3 or higher." % config.get(prefs.APP_VERSION)) if test_environment: requirements_are_met = False else: sys.exit(False) # Get storage groups if getStorageGroups() == False: logger.critical(u"Retrieving storage groups from the MythTV data base failed") if test_environment: requirements_are_met = False else: sys.exit(False) elif not u'default' in storagegroups.keys(): logger.critical(u"There must be a 'Default' storage group") if test_environment: requirements_are_met = False else: sys.exit(False) if opts.channel: channel = opts.channel.split(u':') if len(channel) != 2: logger.critical(u"The Channel (%s) must be in the format xxx:yyy with x an y all numeric." % str(opts.channel)) if test_environment: requirements_are_met = False else: sys.exit(False) elif not _can_int(channel[0]) or not _can_int(channel[1]): logger.critical(u"The Channel_id (%s) and Channel_num (%s) must be numeric." % (channel[0], channel[1])) if test_environment: requirements_are_met = False else: sys.exit(False) else: channel_id = int(channel[0]) channel_num = int(channel[1]) if opts.sleeptime: if not _can_int(opts.sleeptime): logger.critical(u"Auto-dewnload sleep time (%s) must be numeric." % str(opts.sleeptime)) if test_environment: requirements_are_met = False else: sys.exit(False) else: download_sleeptime = float(opts.sleeptime) getMythtvDirectories() # Initialize all the Video and graphics directory dictionary if opts.nosubdirs: # Did the user want a flat MythVideo "Miro" directory structure? flat = True # Get the values in the mirobridge.conf configuration file setUseroptions() if opts.watch_only: # ALL Miro videos will only be viewed in the MythTV "Watch Recordings" screen channel_watch_only = [u'all'] if opts.mythvideo_only: # ALL Miro videos will be copied to MythVideo and removed from Miro channel_mythvideo_only = {u'all': vid_graphics_dirs[u'mythvideo']+u'Miro/'} # Once watched ALL Miro videos will be copied to MythVideo and removed from Miro if opts.new_watch_copy: channel_new_watch_copy = {u'all': vid_graphics_dirs[u'mythvideo']+u'Miro/'} # Verify that "Mythvideo Only" and "New-Watch-Copy" channels do not clash if len(channel_mythvideo_only) and len(channel_new_watch_copy): for key in channel_mythvideo_only.keys(): if key in channel_new_watch_copy.keys(): logger.critical(u'The Miro Channel (%s) cannot be used as both a "Mythvideo Only" and "New-Watch-Copy" channel.' % key) if test_environment: requirements_are_met = False else: sys.exit(False) # Verify that ImageMagick is installed ret = useImageMagick(u"convert -version") if ret < 0 or ret > 1: logger.critical(u"ImageMagick must be installed, graphics cannot be resized or converted to the required graphics format (e.g. jpg and or png)") if test_environment: requirements_are_met = False else: sys.exit(False) # Verify that mythcommflag is installed mythcommflagpath = getlocationMythcommflag() if mythcommflagpath: mythcommflag_recordings = mythcommflag_recordings % mythcommflagpath mythcommflag_videos = mythcommflag_videos % mythcommflagpath else: logger.critical(u"mythcommflag must be installed so that Miro video seek tables can be built.") if test_environment: requirements_are_met = False else: sys.exit(False) if opts.testenv: # All tests passed getVideoDetails(u"") # Test that ffmpeg is available if ffmpeg and requirements_are_met: logger.info(u"The environment test passed !\n\n") sys.exit(True) else: logger.critical(u"The environment test FAILED. See previously displayed error messages!") sys.exit(False) if opts.addchannel != u'OFF': # Add a Miro Channel record - Should only be done once createChannelRecord(opts.addchannel, channel_id, channel_num) logger.info(u"The Miro Channel record has been successfully created !\n\n") sys.exit(True) ########################################### # Mainlogic for all Miro and MythTV bridge ########################################### # # Start the Miro Front and Backend - This allows mirobridge to execute actions on the Miro backend # displayMessage(u"Starting Miro Frontend and Backend") startup.initialize(config.get(prefs.THEME_NAME)) app.cli_events = EventHandler() app.cli_events.connect_to_signals() startup.startup() app.cli_events.startup_event.wait() if app.cli_events.startup_failure: logger.critical(u"Starting Miro Frontend and Backend failed: (%s)" % app.cli_events.startup_failure[0]) print_text(app.cli_events.startup_failure[1]) app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) app.cli_interpreter = MiroInterpreter() if opts.verbose: app.cli_interpreter.verbose = True else: app.cli_interpreter.verbose = False app.cli_interpreter.simulation = opts.simulation app.cli_interpreter.videofiles = [] app.cli_interpreter.downloading = False app.cli_interpreter.icon_cache_dir = config.get(prefs.ICON_CACHE_DIRECTORY) app.cli_interpreter.imagemagick = imagemagick app.cli_interpreter.statistics = statistics if config.get(prefs.APP_VERSION) < u"2.5.0": app.renderer = app.cli_interpreter else: app.movie_data_program_info = app.cli_interpreter.movie_data_program_info # # Optionally Update Miro feeds and # download any "autodownloadable" videos which are pending # if not opts.no_autodownload: if opts.verbose: app.cli_interpreter.verbose = False app.cli_interpreter.do_mythtv_getunwatched(u'') before_download = len(app.cli_interpreter.videofiles) if opts.verbose: app.cli_interpreter.verbose = True app.cli_interpreter.do_mythtv_update_autodownload(u'') time.sleep(download_sleeptime) firsttime = True while True: app.cli_interpreter.do_mythtv_check_downloading(u'') if app.cli_interpreter.downloading: time.sleep(30) firsttime = False continue elif firsttime: time.sleep(download_sleeptime) firsttime = False continue else: break if opts.verbose: app.cli_interpreter.verbose = False app.cli_interpreter.do_mythtv_getunwatched(u'') after_download = len(app.cli_interpreter.videofiles) statistics[u'Miros_videos_downloaded'] = after_download - before_download if opts.verbose: app.cli_interpreter.verbose = True # Deal with orphaned oldrecorded records. # These records indicate that the MythTV user deleted the video from the Watched Recordings screen # or from MythVideo # These video items must also be deleted from Miro videostodelete = getOldrecordedOrphans() if len(videostodelete): displayMessage(u"Starting Miro delete of videos deleted in the MythTV Watched Recordings screen.") for video in videostodelete: # Completely remove the video and item information from Miro app.cli_interpreter.do_mythtv_item_remove([video[u'title'], video[u'subtitle']]) # # Collect the set of played Miro video files # app.cli_interpreter.videofiles = getPlayedMiroVideos() # # Updated the played status of items # if app.cli_interpreter.videofiles: displayMessage(u"Starting Miro update of watched MythTV videos") app.cli_interpreter.do_mythtv_updatewatched(u'') # # Get the unwatched videos details from Miro # app.cli_interpreter.do_mythtv_getunwatched(u'') unwatched = app.cli_interpreter.videofiles # # Get the watched videos details from Miro # app.cli_interpreter.do_mythtv_getwatched(u'') watched = app.cli_interpreter.videofiles # # Remove any duplicate Miro videoes from the unwatched or watched list of Miro videos # This means that Miro has duplicates due to a Miro/Channel website issue # These videos should not be added to the MythTV Watch Recordings screen # unwatched_copy = [] for item in unwatched: unwatched_copy.append(item) for item in unwatched_copy: # Check for a duplicate against already watched Miro videos for x in watched: if item[u'channelTitle'] == x[u'channelTitle'] and item[u'title'] == x[u'title']: try: unwatched.remove(item) # Completely remove this duplicate video and item information from Miro app.cli_interpreter.do_mythtv_item_remove(item[u'videoFilename']) displayMessage(u"Skipped adding a duplicate Miro video to the MythTV Watch Recordings screen (%s - %s) which is already in MythVideo.\nSometimes a Miro channel has the same video downloaded multiple times.\nThis is a Miro/Channel web site issue and often rectifies itself overtime." % (item[u'channelTitle'], item[u'title'])) except ValueError: pass duplicates = [] for item in unwatched_copy: dup_flag = 0 for x in unwatched: # Check for a duplicate against un-watched Miro videos if item[u'channelTitle'] == x[u'channelTitle'] and item[u'title'] == x[u'title']: dup_flag+=1 if dup_flag > 1: for x in duplicates: if item[u'channelTitle'] == x[u'channelTitle'] and item[u'title'] == x[u'title']: break else: duplicates.append(item) for duplicate in duplicates: try: unwatched.remove(duplicate) # Completely remove this duplicate video and item information from Miro app.cli_interpreter.do_mythtv_item_remove(duplicate[u'videoFilename']) displayMessage(u"Skipped adding a Miro video to the MythTV Watch Recordings screen (%s - %s) as there are duplicate 'new' video items.\nSometimes a Miro channel has the same video downloaded multiple times.\nThis is a Miro/Channel web site issue and often rectifies itself overtime." % (duplicate[u'channelTitle'], duplicate[u'title'])) except ValueError: pass # # Deal with any Channel videos that are to be copied and removed from Miro # copy_items = [] # Copy unwatched and watched Miro videos (all or only selected Channels) if u'all' in channel_mythvideo_only: for array in [watched, unwatched]: for item in array: copy_items.append(item) elif len(channel_mythvideo_only): for array in [watched, unwatched]: for video in array: if filter(is_not_punct_char, video[u'channelTitle'].lower()) in channel_mythvideo_only.keys(): copy_items.append(video) # Copy ONLY watched Miro videos (all or only selected Channels) if u'all' in channel_new_watch_copy: for video in watched: copy_items.append(video) elif len(channel_new_watch_copy): for video in watched: if filter(is_not_punct_char, video[u'channelTitle'].lower()) in channel_new_watch_copy.keys(): copy_items.append(video) channels_to_copy = {} for key in channel_mythvideo_only.keys(): channels_to_copy[key] = channel_mythvideo_only[key] for key in channel_new_watch_copy.keys(): channels_to_copy[key] = channel_new_watch_copy[key] for video in copy_items: dir_key = filter(is_not_punct_char, video[u'channelTitle'].lower()) # Create the subdirectories to copy the video into directory_coverart = False if not os.path.isdir(channels_to_copy[dir_key]): if simulation: logger.info(u"Simulation: Creating the MythVideo directory (%s)." % (channels_to_copy[dir_key])) else: os.makedirs(channels_to_copy[dir_key]) directory_coverart = True # If the directory was just created it needs coverart else: if video[u'channel_icon']: ext = getExtention(video[u'channel_icon']) if not os.path.isfile(u"%s%s.%s" % (channels_to_copy[dir_key], video[u'channelTitle'].lower(), ext)): directory_coverart = True # If the directory was just created it needs coverart elif video[u'item_icon']: ext = getExtention(video[u'item_icon']) if not os.path.isfile(u"%s%s - %s.%s" % (channels_to_copy[dir_key], video[u'channelTitle'].lower(), video[u'title'].lower(), ext)): directory_coverart = True # If the directory was just created it needs coverart # Copy the Channel icon located in the posters/coverart directory if directory_coverart and video[u'channel_icon']: ext = getExtention(video[u'channel_icon']) tmp_path = channels_to_copy[dir_key][:-1] foldername = tmp_path[tmp_path.rindex(u'/')+1:] dirpath = u"%s%s" % (channels_to_copy[dir_key], u'folder.jpg') dirpath2 = u"%s%s" % (channels_to_copy[dir_key], u'folder.png') if os.path.isfile(dirpath) or os.path.isfile(dirpath2): # See if a folder cover already exists pass else: if simulation: logger.info(u"Simulation: Copy a Channel Icon (%s) for directory (%s)." % (filepath, dirpath)) else: try: # Miro Channel icon copy for the new subdirectory useImageMagick(u'convert "%s" "%s"' % (video[u'channel_icon'], dirpath)) except: logger.critical(u"Copy a Channel Icon (%s) for directory (%s) failed." % (video[u'channel_icon'], dirpath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) # Copy the Miro video file save_video_filename = video[u'videoFilename'] # This filename is needed later for deleting in Miro ext = getExtention(video[u'videoFilename']) if ext.lower() == u'm4v': ext = u'mpg' filepath = u"%s%s - %s.%s" % (channels_to_copy[dir_key], video[u'channelTitle'], video[u'title'], ext) if simulation: logger.info(u"Simulation: Copying the Miro video (%s) to the MythVideo directory (%s)." % (video[u'videoFilename'], filepath)) else: try: # Miro video copied into a MythVideo directory shutil.copy2(video[u'videoFilename'], filepath) statistics[u'Miros_MythVideos_copied']+=1 if u'mythvideo' in storagegroups.keys(): video[u'videoFilename'] = filepath.replace(storagegroups[u'mythvideo'], u'') else: video[u'videoFilename'] = filepath except: logger.critical(u"Copying the Miro video (%s) to the MythVideo directory (%s).\n This maybe a permissions error (mirobridge.py does not have permission to write to the directory)." % (video[u'videoFilename'], filepath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) # Copy the Channel or item's icon if video[u'channel_icon'] and not video[u'channelTitle'].lower() in channel_icon_override: pass else: if video[u'item_icon']: video[u'channel_icon'] = video[u'item_icon'] if video[u'channel_icon']: ext = getExtention(video[u'channel_icon']) if video[u'channelTitle'].lower() in channel_icon_override: filepath = u"%s%s - %s%s.%s" % (vid_graphics_dirs[u'posterdir'], video[u'channelTitle'], video[u'title'], graphic_suffix[u'posterdir'], ext) else: filepath = u"%s%s%s.%s" % (vid_graphics_dirs[u'posterdir'], video[u'channelTitle'], graphic_suffix[u'posterdir'], ext) # There may already be a Channel icon available or it is a symlink which needs to be replaced if not os.path.isfile(filepath) or os.path.islink(filepath): if simulation: logger.info(u"Simulation: Copying the Channel Icon (%s) to the poster directory (%s)." % (video[u'channel_icon'], filepath)) else: try: # Miro Channel icon copied into a MythVideo directory try: # Remove any old symlink file os.remove(filepath) except OSError: pass shutil.copy2(video[u'channel_icon'], filepath) if u'posterdir' in storagegroups.keys(): video[u'channel_icon'] = filepath.replace(storagegroups[u'posterdir'], u'') else: video[u'channel_icon'] = filepath except: logger.critical(u"Copying the Channel Icon (%s) to the poster directory (%s).\n This maybe a permissions error (mirobridge.py does not have permission to write to the directory)." % (video[u'channel_icon'], filepath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) else: if u'posterdir' in storagegroups.keys(): video[u'channel_icon'] = filepath.replace(storagegroups[u'posterdir'], u'') else: video[u'channel_icon'] = filepath # There may already be a Screenshot available or it is a symlink which needs to be replaced if video[u'screenshot']: ext = getExtention(video[u'screenshot']) filepath = u"%s%s - %s%s.%s" % (vid_graphics_dirs[u'episodeimagedir'], video[u'channelTitle'], video[u'title'], graphic_suffix[u'episodeimagedir'], ext) else: filepath = u'' if not os.path.isfile(filepath) or os.path.islink(filepath): if video[u'screenshot']: if simulation: logger.info(u"Simulation: Copying the Screenshot (%s) to the Screenshot directory (%s)." % (video[u'screenshot'], filepath)) else: try: # Miro Channel icon copied into a MythVideo directory try: # Remove any old symlink file os.remove(filepath) except OSError: pass shutil.copy2(video[u'screenshot'], filepath) displayMessage(u"Copied Miro screenshot file (%s) to MythVideo (%s)" % (video[u'screenshot'], filepath)) if u'episodeimagedir' in storagegroups.keys(): video[u'screenshot'] = filepath.replace(storagegroups[u'episodeimagedir'], u'') else: video[u'screenshot'] = filepath except: logger.critical(u"Copying the Screenshot (%s) to the Screenshot directory (%s).\n This maybe a permissions error (mirobridge.py does not have permission to write to the directory)." % (video[u'screenshot'], filepath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) elif video[u'screenshot']: if u'episodeimagedir' in storagegroups.keys(): video[u'screenshot'] = filepath.replace(storagegroups[u'episodeimagedir'], u'') else: video[u'screenshot'] = filepath video[u'copied'] = True # Mark this video item as being copied # Completely remove the video and item information from Miro app.cli_interpreter.do_mythtv_item_remove(save_video_filename) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete # # Add and delete MythTV (Watch Recordings) Miro recorded records # Add and remove symlinks for Miro video files # # Check if the user does not want any channels Added to the "Watch Recordings" screen if channel_mythvideo_only.has_key(u'all'): for video in unwatched: watched.append(video) unwatched = [] else: if len(channel_mythvideo_only): unwatched_copy = [] for video in unwatched: if not filter(is_not_punct_char, video[u'channelTitle'].lower()) in channel_mythvideo_only.keys(): unwatched_copy.append(video) else: watched.append(video) unwatched = unwatched_copy statistics[u'Total_unwatched'] = len(unwatched) if not len(unwatched): displayMessage(u"There are no Miro unwatched video items to add as MythTV Recorded videos.") if not updateMythRecorded(unwatched): logger.critical(u"Updating MythTV Recording with Miro video files failed." % str(base_video_dir)) sys.exit(False) # # Add and delete MythVideo records for played Miro Videos # Add and delete symbolic links to Miro Videos and subdirectories # Add and delete symbolic links to coverart/Miro icons and Miro screenshots/fanart # if len(channel_watch_only): # If the user does not want any channels moved to MythVideo exit if channel_watch_only[0].lower() == u'all': printStatistics() return True if not len(watched): displayMessage(u"There are no Miro watched items to add to MythVideo") if not updateMythVideo(watched): logger.critical(u"Updating MythVideo with Miro video files failed.") sys.exit(False) printStatistics() return True
cefa7947527c8e9e2184befa6fb1cdca04096461 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/cefa7947527c8e9e2184befa6fb1cdca04096461/mirobridge.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3536, 6289, 312, 11373, 18337, 628, 326, 1296, 980, 1135, 1053, 3536, 2552, 1191, 10358, 16, 14754, 16, 3988, 16, 2502, 4650, 16, 6875, 19951, 16, 1904, 67, 350, 16, 1904, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3536, 6289, 312, 11373, 18337, 628, 326, 1296, 980, 1135, 1053, 3536, 2552, 1191, 10358, 16, 14754, 16, 3988, 16, 2502, 4650, 16, 6875, 19951, 16, 1904, 67, 350, 16, 1904, 6...
dbg ('VSGConf: preparing: %s/%s'%(self.profile, key))
value = None dbg (' VSGConf: preparing: %s/%s'%(self.profile, key))
def __getattr__ (self, key = ""): ret = None
842b5a0207f96131d410a9b20b0b52500aa93aa9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1032/842b5a0207f96131d410a9b20b0b52500aa93aa9/terminatorconfig.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 1747, 972, 261, 2890, 16, 498, 273, 1408, 4672, 325, 273, 599, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 1747, 972, 261, 2890, 16, 498, 273, 1408, 4672, 325, 273, 599, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
gx = (x > min & x < max) * gz
gx = (x > min and x < max) * gz
def grad(self, (x, min, max), (gz, )): gx = (x > min & x < max) * gz return gx, None, None
1f1f569be66d8a1dc0d36c06ecf2438f0d451630 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/1f1f569be66d8a1dc0d36c06ecf2438f0d451630/basic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6058, 12, 2890, 16, 261, 92, 16, 1131, 16, 943, 3631, 261, 9764, 16, 262, 4672, 314, 92, 273, 261, 92, 405, 1131, 471, 619, 411, 943, 13, 380, 14136, 327, 314, 92, 16, 599, 16, 599...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6058, 12, 2890, 16, 261, 92, 16, 1131, 16, 943, 3631, 261, 9764, 16, 262, 4672, 314, 92, 273, 261, 92, 405, 1131, 471, 619, 411, 943, 13, 380, 14136, 327, 314, 92, 16, 599, 16, 599...
def grid_function(f, xvals, yvals, typecode=Numeric.Float32):
def grid_function(f, xvals, yvals, typecode=None, ufunc=0):
def grid_function(f, xvals, yvals, typecode=Numeric.Float32): """Evaluate and tabulate a function on a grid. 'xvals' and 'yvals' should be 1-D arrays listing the values of x and y at which 'f' should be tabulated. 'f' should be a function taking two floating point arguments. The return value is a matrix M where 'M[i,j] = f(xvals[i],yvals[j])', which can for example be used in the 'GridData' constructor. Note that 'f' is evaluated at each pair of points using a Python loop, which can be slow if the number of points is large. If speed is an issue, you should if possible compute functions matrix-wise using Numeric's built-in ufuncs. """ m = Numeric.zeros((len(xvals), len(yvals)), typecode) for xi in range(len(xvals)): x = xvals[xi] for yi in range(len(yvals)): y = yvals[yi] m[xi,yi] = f(x,y) return m
a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3068, 67, 915, 12, 74, 16, 619, 4524, 16, 677, 4524, 16, 618, 710, 33, 7036, 16, 582, 644, 33, 20, 4672, 3536, 15369, 471, 3246, 6243, 279, 445, 603, 279, 3068, 18, 225, 296, 92, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3068, 67, 915, 12, 74, 16, 619, 4524, 16, 677, 4524, 16, 618, 710, 33, 7036, 16, 582, 644, 33, 20, 4672, 3536, 15369, 471, 3246, 6243, 279, 445, 603, 279, 3068, 18, 225, 296, 92, 4...
self.RefreshBufferState()
wx.CallAfter(self.RefreshBufferState)
def OnFileSelectedChanged(self, event): selected = event.GetSelection() # At init selected = -1 if selected >= 0: window = self.FileOpened.GetPage(selected) if window: self.Manager.ChangeCurrentNode(window.GetIndex()) self.RefreshBufferState() self.RefreshStatusBar() self.RefreshProfileMenu() event.Skip()
27545b161de41bdbf6f6bbabef24ee9751395880 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11017/27545b161de41bdbf6f6bbabef24ee9751395880/objdictedit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 812, 7416, 5033, 12, 2890, 16, 871, 4672, 3170, 273, 871, 18, 967, 6233, 1435, 468, 2380, 1208, 3170, 273, 300, 21, 309, 3170, 1545, 374, 30, 2742, 273, 365, 18, 812, 23115, 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, 2755, 812, 7416, 5033, 12, 2890, 16, 871, 4672, 3170, 273, 871, 18, 967, 6233, 1435, 468, 2380, 1208, 3170, 273, 300, 21, 309, 3170, 1545, 374, 30, 2742, 273, 365, 18, 812, 23115, 18, ...
sorted(first_elts(expect.values())))
first_elts(sorted(expect.values())))
def test_strict(self): for orig, expect in parse_strict_test_cases: # Test basic parsing d = do_test(orig, "GET") self.assertEqual(d, expect, "Error parsing %s" % repr(orig)) d = do_test(orig, "POST") self.assertEqual(d, expect, "Error parsing %s" % repr(orig))
03d73ca88d113cfdf2c257fc39b688470aabf1f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/03d73ca88d113cfdf2c257fc39b688470aabf1f2/test_cgi.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 13948, 12, 2890, 4672, 364, 1647, 16, 4489, 316, 1109, 67, 13948, 67, 3813, 67, 22186, 30, 468, 7766, 5337, 5811, 302, 273, 741, 67, 3813, 12, 4949, 16, 315, 3264, 7923, 365,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 13948, 12, 2890, 4672, 364, 1647, 16, 4489, 316, 1109, 67, 13948, 67, 3813, 67, 22186, 30, 468, 7766, 5337, 5811, 302, 273, 741, 67, 3813, 12, 4949, 16, 315, 3264, 7923, 365,...
'weight' : product_uos_qty / res['uos_coeff'] * res['weight']
'th_weight' : product_uos_qty / res['uos_coeff'] * res['weight']
def uos_change(self, cr, uid, ids, product_uos, product_uos_qty=0, product_id=None): if not product_id: return {'value': {'product_uom': product_uos, 'product_uom_qty': product_uos_qty}, 'domain':{}} res = self.pool.get('product.product').read(cr, uid, [product_id], ['uom_id', 'uos_id', 'uos_coeff', 'weight'])[0] value = { 'product_uom' : res['uom_id'], } try: value.update({ 'product_uom_qty' : product_uos_qty / res['uos_coeff'], 'weight' : product_uos_qty / res['uos_coeff'] * res['weight'] }) except ZeroDivisionError: pass return {'value' : value}
6a01b2a5073dde41d3a0932a113c38a273d96f73 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/6a01b2a5073dde41d3a0932a113c38a273d96f73/sale.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 582, 538, 67, 3427, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 3017, 67, 89, 538, 16, 3017, 67, 89, 538, 67, 85, 4098, 33, 20, 16, 3017, 67, 350, 33, 7036, 4672, 309, 486, 3017, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 582, 538, 67, 3427, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 3017, 67, 89, 538, 16, 3017, 67, 89, 538, 67, 85, 4098, 33, 20, 16, 3017, 67, 350, 33, 7036, 4672, 309, 486, 3017, ...
str = chr(idaapi.get_byte(ea)) + \
tmp = chr(idaapi.get_byte(ea)) + \
def GetDouble(ea): """ Get value of a floating point number (8 bytes) @param ea: linear address @return: double """ str = chr(idaapi.get_byte(ea)) + \ chr(idaapi.get_byte(ea+1)) + \ chr(idaapi.get_byte(ea+2)) + \ chr(idaapi.get_byte(ea+3)) + \ chr(idaapi.get_byte(ea+4)) + \ chr(idaapi.get_byte(ea+5)) + \ chr(idaapi.get_byte(ea+6)) + \ chr(idaapi.get_byte(ea+7)) return struct.unpack("d", str)[0]
244a3cd02a580c0095170004ec30e922f0d1a8a6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6984/244a3cd02a580c0095170004ec30e922f0d1a8a6/idc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 5265, 12, 24852, 4672, 3536, 968, 460, 434, 279, 13861, 1634, 1300, 261, 28, 1731, 13, 225, 632, 891, 24164, 30, 9103, 1758, 225, 632, 2463, 30, 1645, 3536, 1853, 273, 4513, 12, 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, 968, 5265, 12, 24852, 4672, 3536, 968, 460, 434, 279, 13861, 1634, 1300, 261, 28, 1731, 13, 225, 632, 891, 24164, 30, 9103, 1758, 225, 632, 2463, 30, 1645, 3536, 1853, 273, 4513, 12, 3...
self.selectAllAction.setIconSet(QIconSet(self.image19))
self.selectAllAction.setIconSet(QIconSet(self.image13))
def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar()
2bdc60455ab85cd2792604c15ae9034d3632b0df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/2bdc60455ab85cd2792604c15ae9034d3632b0df/MainWindowUI.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2938, 273, 599, 16, 529, 273, 599, 16, 2242, 273, 374, 4672, 2238, 6376, 3829, 16186, 2738, 972, 12, 2890, 16, 2938, 16, 529, 16, 2242, 13, 365, 18, 23...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2938, 273, 599, 16, 529, 273, 599, 16, 2242, 273, 374, 4672, 2238, 6376, 3829, 16186, 2738, 972, 12, 2890, 16, 2938, 16, 529, 16, 2242, 13, 365, 18, 23...
def execute(self, dir = None, iterations=1, args = None):
def run_once(self, dir = None, args = None):
def execute(self, dir = None, iterations=1, args = None): self.keyval = open(os.path.join(self.resultsdir, 'keyval'), 'w') if not dir: dir = self.tmpdir os.chdir(dir) if not args: args = '-a' profilers = self.job.profilers if not profilers.only(): for i in range(iterations): output = utils.system_output('%s/src/current/iozone %s' % (self.srcdir, args)) self.__format_results(output)
548562c1efd77e9f77ad94c8f542db3581385dc3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10349/548562c1efd77e9f77ad94c8f542db3581385dc3/iozone.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 8243, 12, 2890, 16, 1577, 273, 599, 16, 833, 273, 599, 4672, 365, 18, 856, 1125, 273, 1696, 12, 538, 18, 803, 18, 5701, 12, 2890, 18, 4717, 1214, 16, 296, 856, 1125, 19899,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 8243, 12, 2890, 16, 1577, 273, 599, 16, 833, 273, 599, 4672, 365, 18, 856, 1125, 273, 1696, 12, 538, 18, 803, 18, 5701, 12, 2890, 18, 4717, 1214, 16, 296, 856, 1125, 19899,...
sig1 = sqrt(sum([ (S1[k]-mu1)^2 for k in range(n) ])) sig2 = sqrt(sum([ (S2[k]-mu2)^2 for k in range(n) ]))
sig1 = sqrt(sum([ (S1[k]-mu1)**2 for k in range(n) ])) sig2 = sqrt(sum([ (S2[k]-mu2)**2 for k in range(n) ]))
def translation_correlations(X1,X2): """ The sequence of correlations of the sequence X1 with the cyclic translations of the sequence X2. """ n = len(X1) if n != len(X2): raise ValueError, "Arguments must be of the same length." # Compute the mean value of each sequence: mu1 = sum(X1)/n mu2 = sum(X2)/n # Compute the standard deviations of each sequence: sig1 = sqrt(sum([ (S1[k]-mu1)^2 for k in range(n) ])) sig2 = sqrt(sum([ (S2[k]-mu2)^2 for k in range(n) ])) sig = sig1*sig2 corr_dict = { } for j in range(n): corr_dict[j] = sum([ (S1[i] - mu1) * (S2[(i+j)%n] - mu2) / sig for i in range(n) ]) return corr_dict
7ea31482358623b11403f05e3446fa7e23d5e5a1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/7ea31482358623b11403f05e3446fa7e23d5e5a1/string_ops.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4794, 67, 3850, 15018, 12, 60, 21, 16, 60, 22, 4672, 3536, 1021, 3102, 434, 1858, 15018, 434, 326, 3102, 1139, 21, 598, 326, 30383, 7863, 434, 326, 3102, 1139, 22, 18, 3536, 290, 273, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4794, 67, 3850, 15018, 12, 60, 21, 16, 60, 22, 4672, 3536, 1021, 3102, 434, 1858, 15018, 434, 326, 3102, 1139, 21, 598, 326, 30383, 7863, 434, 326, 3102, 1139, 22, 18, 3536, 290, 273, ...
self._addkey(key, (pos, siz))
def __setitem__(self, key, val): if not type(key) == type('') == type(val): raise TypeError, "keys and values must be strings" if not self._index.has_key(key): (pos, siz) = self._addval(val) self._addkey(key, (pos, siz)) else: pos, siz = self._index[key] oldblocks = (siz + _BLOCKSIZE - 1) / _BLOCKSIZE newblocks = (len(val) + _BLOCKSIZE - 1) / _BLOCKSIZE if newblocks <= oldblocks: pos, siz = self._setval(pos, val) self._index[key] = pos, siz else: pos, siz = self._addval(val) self._index[key] = pos, siz self._addkey(key, (pos, siz))
4f34386761f67b302752d6db8fe6861c497e99f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4f34386761f67b302752d6db8fe6861c497e99f6/dumbdbm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 542, 1726, 972, 12, 2890, 16, 498, 16, 1244, 4672, 309, 486, 618, 12, 856, 13, 422, 618, 2668, 6134, 422, 618, 12, 1125, 4672, 1002, 3580, 16, 315, 2452, 471, 924, 1297, 506, 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, 1001, 542, 1726, 972, 12, 2890, 16, 498, 16, 1244, 4672, 309, 486, 618, 12, 856, 13, 422, 618, 2668, 6134, 422, 618, 12, 1125, 4672, 1002, 3580, 16, 315, 2452, 471, 924, 1297, 506, 2...
type(self.dsage_server.get_jobs_by_username('yqiang')),
type(self.dsage_server.get_jobs_by_username('yqiang', 'new')),
def testget_jobs_by_username(self): self.assertEquals( type(self.dsage_server.get_jobs_by_username('yqiang')), list) self.assertEquals( len(self.dsage_server.get_jobs_by_username('test')), 0) job = expand_job(self.dsage_server.get_job()) job.username = 'testing123' job.code = '' jdict = self.dsage_server.submit_job(job._reduce()) j = expand_job( self.dsage_server.get_jobs_by_username('testing123')[0]) self.assertEquals(j.username, job.username)
c54c403d67d31ac32abe9fc05ec4f6e32ce3a8a0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/c54c403d67d31ac32abe9fc05ec4f6e32ce3a8a0/test_server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 588, 67, 10088, 67, 1637, 67, 5053, 12, 2890, 4672, 365, 18, 11231, 8867, 12, 618, 12, 2890, 18, 2377, 410, 67, 3567, 18, 588, 67, 10088, 67, 1637, 67, 5053, 2668, 93, 85, 77, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 588, 67, 10088, 67, 1637, 67, 5053, 12, 2890, 4672, 365, 18, 11231, 8867, 12, 618, 12, 2890, 18, 2377, 410, 67, 3567, 18, 588, 67, 10088, 67, 1637, 67, 5053, 2668, 93, 85, 77, ...
sage: G<K False sage: G>K False
sage: G<K False sage: G>K False
def __cmp__(self, other): r""" Compare self and other. If self and other are in a common ambient group, then self = other precisely if self is contained in other. EXAMPLES:: sage: G = CyclicPermutationGroup(4) sage: gens = G.gens() sage: H = DihedralGroup(4) sage: PermutationGroup_subgroup(H,list(gens)) Subgroup of Dihedral group of order 8 as a permutation group generated by [(1,2,3,4)] sage: K=PermutationGroup_subgroup(H,list(gens)) sage: G<K False sage: G>K False """ if self is other: return 0 if not isinstance(other, PermutationGroup_generic): return -1 c = cmp(self.ambient_group(), other.ambient_group()) if c: return c if self.is_subgroup(other): return -1 else: return 1
895e1ae73086b953ed8633605c018ded03126ea2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/895e1ae73086b953ed8633605c018ded03126ea2/permgroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9625, 972, 12, 2890, 16, 1308, 4672, 436, 8395, 11051, 365, 471, 1308, 18, 971, 365, 471, 1308, 854, 316, 279, 2975, 13232, 1979, 1041, 16, 1508, 365, 273, 1308, 13382, 291, 2357, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9625, 972, 12, 2890, 16, 1308, 4672, 436, 8395, 11051, 365, 471, 1308, 18, 971, 365, 471, 1308, 854, 316, 279, 2975, 13232, 1979, 1041, 16, 1508, 365, 273, 1308, 13382, 291, 2357, ...
if context['sheet_id'] != vals['sheet_id']:
if context['sheet_id'] != self.browse(cr, uid, res, context=context).sheet_id.id:
def create(self, cr, uid, vals, context={}): if 'sheet_id' in context: ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, context['sheet_id']) if ts.state not in ('draft', 'new'): raise osv.except_osv(_('Error !'), _('You cannot modify an entry in a confirmed timesheet !')) res = super(hr_attendance,self).create(cr, uid, vals, context=context) if 'sheet_id' in context: if context['sheet_id'] != vals['sheet_id']: raise osv.except_osv(_('UserError'), _('You cannot enter an attendance ' \ 'date outside the current timesheet dates!')) return res
61106b0fffea06e767d75ce5f048f81ee30de908 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/61106b0fffea06e767d75ce5f048f81ee30de908/hr_timesheet_sheet.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2890, 16, 4422, 16, 4555, 16, 5773, 16, 819, 12938, 4672, 309, 296, 8118, 67, 350, 11, 316, 819, 30, 3742, 273, 365, 18, 6011, 18, 588, 2668, 7256, 67, 8293, 2963, 67, 8118,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5773, 16, 819, 12938, 4672, 309, 296, 8118, 67, 350, 11, 316, 819, 30, 3742, 273, 365, 18, 6011, 18, 588, 2668, 7256, 67, 8293, 2963, 67, 8118,...
if template_string in template_defaults.keys(): template_string = template_defaults[template_string] edit_template = Template(template_string) def edit(obj, bg=False, editor=None):
if not(isinstance(template_string,Template)): template_string = Template(template_string) fields = set(template_fields(template_string)) if not(fields <= set(['file','line']) and ('file' in fields)): raise ValueError, "Only ${file} and ${line} are allowed as template variables, and ${file} must occur." edit_template = template_string def set_editor(editor_name,opts=''): r""" Sets the editor to be used by the edit command by basic editor name. Currently, the system only knows appropriate call strings for a limited number of editors. If you want to use another editor, you should set the whole edit template via set_edit_template. AUTHOR: Nils Bruin (2007-10-05) EXAMPLE: sage: from sage.misc.edit_module import set_editor sage: set_editor('vi') sage: sage.misc.edit_module.edit_template.template 'vi -c ${line} ${file}' """ if sage.misc.edit_module.template_defaults.has_key(editor_name): set_edit_template(Template(template_defaults[editor_name].safe_substitute(opts=opts))) else: raise ValueError, "editor_name not known. Try set_edit_template(<template_string>) instead." def edit(obj, editor=None, bg=None):
def set_edit_template(template_string): r""" Sets default edit template string. It should reference ${file} and ${line}. This routine normally needs to be called prior to using 'edit'. However, if the editor set in the shell variable EDITOR is known, then the system will substitute an appropriate template for you. See edit_module.template_defaults for the recognised templates. AUTHOR: Nils Bruin (2007-10-03) EXAMPLE: sage: from sage.misc.edit_module import set_edit_template sage: set_edit_template("echo EDIT ${file}:${line}") sage: edit(sage) # not tested EDIT /usr/local/sage/default/devel/sage/sage/__init__.py:1 """ global edit_template if template_string in template_defaults.keys(): template_string = template_defaults[template_string] edit_template = Template(template_string)
b1acc3d600239d835d94480f5c45e8e7eca24f8e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/b1acc3d600239d835d94480f5c45e8e7eca24f8e/edit_module.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 4619, 67, 3202, 12, 3202, 67, 1080, 4672, 436, 8395, 11511, 805, 3874, 1542, 533, 18, 225, 2597, 1410, 2114, 3531, 768, 97, 471, 3531, 1369, 5496, 1220, 12245, 15849, 4260, 358,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 4619, 67, 3202, 12, 3202, 67, 1080, 4672, 436, 8395, 11511, 805, 3874, 1542, 533, 18, 225, 2597, 1410, 2114, 3531, 768, 97, 471, 3531, 1369, 5496, 1220, 12245, 15849, 4260, 358,...
x3 = cosi0*sinj1 y3 = sini0*sinj1 z3 = cosj1
x3 = cosi1*sinj0 y3 = sini1*sinj0 z3 = cosj0
def test_poly(k): draw = [ [ 1, 1, 1, 1 ], [ 1, 0, 1, 0 ], [ 0, 1, 0, 1 ], [ 1, 1, 0, 0 ] ] pladv(0) plvpor(0.0, 1.0, 0.0, 0.9) plwind(-1.0, 1.0, -0.9, 1.1) plcol0(1) plw3d(1.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, alt[k], az[k]) plbox3("bnstu", "x axis", 0.0, 0, "bnstu", "y axis", 0.0, 0, "bcdmnstuv", "z axis", 0.0, 0) plcol0(2)
9ba41e39b693f6c6607abbcd1c6b6b3dbb7c2713 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2933/9ba41e39b693f6c6607abbcd1c6b6b3dbb7c2713/xw18.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 16353, 12, 79, 4672, 225, 3724, 273, 306, 306, 404, 16, 404, 16, 404, 16, 404, 308, 16, 306, 404, 16, 374, 16, 404, 16, 374, 308, 16, 306, 374, 16, 404, 16, 374, 16, 40...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16353, 12, 79, 4672, 225, 3724, 273, 306, 306, 404, 16, 404, 16, 404, 16, 404, 308, 16, 306, 404, 16, 374, 16, 404, 16, 374, 308, 16, 306, 374, 16, 404, 16, 374, 16, 40...
print 'Found file %s, Compiling...' % file
if p.parser.verbose: p.parser.log('Found file %s, Compiling...' % file)
def p_instanceDeclaration(p): """instanceDeclaration : INSTANCE OF className '{' valueInitializerList '}' ';' | INSTANCE OF className alias '{' valueInitializerList '}' ';' | qualifierList INSTANCE OF className '{' valueInitializerList '}' ';' | qualifierList INSTANCE OF className alias '{' valueInitializerList '}' ';' """ alias = None quals = {} if isinstance(p[1], basestring): # no qualifiers cname = p[3] if p[4] == '{': props = p[5] else: props = p[6] alias = p[4] else: cname = p[4] #quals = p[1] # qualifiers on instances are deprecated -- rightly so. if p[5] == '{': props = p[6] else: props = p[7] alias = p[5] try: cc = p.parser.handle.GetClass(cname, p.parser.ns, LocalOnly=False, IncludeQualifiers=True, IncludeClassOrigin=False) p.parser.classnames[p.parser.ns].append(cc.classname.lower()) except pywbem.CIMError, ce: if ce.args[0] == pywbem.CIM_ERR_NOT_FOUND: file = find_mof(cname) print 'Class %s does not exist' % cname if file: print 'Found file %s, Compiling...' % file p.parser.mofcomp.compile_file(file, p.parser.ns) cc = p.parser.handle.GetClass(cname, p.parser.ns, LocalOnly=False, IncludeQualifiers=True, IncludeClassOrigin=False) else: print "Can't find file to satisfy class" raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_CLASS, cname) else: raise path = pywbem.CIMInstanceName(cname, namespace=p.parser.ns) inst = pywbem.CIMInstance(cname, properties=cc.properties, qualifiers=quals, path=path) for prop in props: pname = prop[1] pval = prop[2] cprop = inst.properties[pname] cprop.value = pywbem.tocimobj(cprop.type, pval) for prop in inst.properties.values(): if 'key' not in prop.qualifiers or not prop.qualifiers['key']: continue if prop.value is None: raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, 'Key property %s.%s is not set' % (cname, prop.name)) inst.path.keybindings[prop.name] = prop.value # TODO store alias p[0] = inst
e45c009f365830e687525a374840aeb320395b29 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10648/e45c009f365830e687525a374840aeb320395b29/mof_compiler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 293, 67, 1336, 6094, 12, 84, 4672, 3536, 1336, 6094, 294, 6937, 15932, 2658, 9790, 460, 14729, 682, 9571, 7554, 571, 6937, 15932, 2658, 2308, 9790, 460, 14729, 682, 9571, 7554, 571, 12327,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 293, 67, 1336, 6094, 12, 84, 4672, 3536, 1336, 6094, 294, 6937, 15932, 2658, 9790, 460, 14729, 682, 9571, 7554, 571, 6937, 15932, 2658, 2308, 9790, 460, 14729, 682, 9571, 7554, 571, 12327,...
maxCost = self._sliderCosts[-1] * p for i, c in enumerate(self._sliderCosts): if c > maxCost: self.displayLevel(levelIndex = max(0, i-1)) break
self.displayLevel(cost = self._sliderCosts[-1] * p)
def _levelSliderChanged(self, levelIndex): if self._sliderMode == 0: self.displayLevel(levelIndex = levelIndex) return p = float(levelIndex) / self._levelSlider.maxValue() if self._sliderCosts: maxCost = self._sliderCosts[-1] * p for i, c in enumerate(self._sliderCosts): if c > maxCost: self.displayLevel(levelIndex = max(0, i-1)) break else: self.displayLevel( levelIndex = int(p**0.2 * self._levelSlider.maxValue()))
5ecb73c072d605a5aa7db685f7b7c1c885270a57 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10394/5ecb73c072d605a5aa7db685f7b7c1c885270a57/workspace.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2815, 21824, 5033, 12, 2890, 16, 1801, 1016, 4672, 309, 365, 6315, 28372, 2309, 422, 374, 30, 365, 18, 5417, 2355, 12, 2815, 1016, 273, 1801, 1016, 13, 327, 293, 273, 1431, 12, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2815, 21824, 5033, 12, 2890, 16, 1801, 1016, 4672, 309, 365, 6315, 28372, 2309, 422, 374, 30, 365, 18, 5417, 2355, 12, 2815, 1016, 273, 1801, 1016, 13, 327, 293, 273, 1431, 12, 28...
The given path is first normalized (e.g. a possible trailing path separator removed, special directories '..' and '.' removed). The splitted parts are returned as separate components. If the path contains no extension, an empty string is returned for it. Examples (assuming a UNIX environment):
The given path is first normalized (e.g. a possible trailing path separator removed, special directories '..' and '.' removed). The splitted parts are returned as separate components. If the path contains no extension, an empty string is returned for it. Examples:
def split_extension(self, path): """Splits the extension from the given path. The given path is first normalized (e.g. a possible trailing path separator removed, special directories '..' and '.' removed). The splitted parts are returned as separate components. If the path contains no extension, an empty string is returned for it. Examples (assuming a UNIX environment): | ${path} | ${ext} = | Split Extension | file.extension | | ${p2} | ${e2} = | Split Extension | path/file.ext | | ${p3} | ${e3} = | Split Extension | path/file | | ${p4} | ${e4} = | Split Extension | p1/../p2/file.ext | => - ${path} = 'file' & ${ext} = 'extension' - ${p2} = 'path/file' & ${e2} = 'ext' - ${p3} = 'path/file' & ${e3} = '' - ${p4} = 'p2/file' & ${e4} = 'ext' """ base, ext = os.path.splitext(self.normalize_path(path)) if ext.startswith('.'): ext = ext[1:] return base, ext
a2152145a7e713b7a988a154a7b296b361d56338 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6988/a2152145a7e713b7a988a154a7b296b361d56338/OperatingSystem.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1416, 67, 6447, 12, 2890, 16, 589, 4672, 3536, 16582, 326, 2710, 628, 326, 864, 589, 18, 225, 1021, 864, 589, 353, 1122, 5640, 261, 73, 18, 75, 18, 279, 3323, 7341, 589, 4182, 3723, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1416, 67, 6447, 12, 2890, 16, 589, 4672, 3536, 16582, 326, 2710, 628, 326, 864, 589, 18, 225, 1021, 864, 589, 353, 1122, 5640, 261, 73, 18, 75, 18, 279, 3323, 7341, 589, 4182, 3723, ...
result.append(xpaths(prefix,x,suffix)); return(result);
result.append(xpaths(prefix,x,suffix)) return(result)
def xpaths(prefix,base,suffix): if (type(base) == str): return(prefix + base + suffix); result = []; for x in base: result.append(xpaths(prefix,x,suffix)); return(result);
aa9700942409f59dfc63d4542d0bad0a01230726 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/aa9700942409f59dfc63d4542d0bad0a01230726/makepanda.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 619, 4481, 12, 3239, 16, 1969, 16, 8477, 4672, 309, 261, 723, 12, 1969, 13, 422, 609, 4672, 327, 12, 3239, 397, 1026, 397, 3758, 1769, 563, 273, 5378, 31, 364, 619, 316, 1026, 30, 56...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 619, 4481, 12, 3239, 16, 1969, 16, 8477, 4672, 309, 261, 723, 12, 1969, 13, 422, 609, 4672, 327, 12, 3239, 397, 1026, 397, 3758, 1769, 563, 273, 5378, 31, 364, 619, 316, 1026, 30, 56...
include_dirs=['glib'],
include_dirs=['glib','gi'],
def install_templates(self): self.install_template('pygobject-2.0.pc.in', os.path.join(self.install_dir, 'lib', 'pkgconfig'))
239ff961778e4e1587404d8a70dfbe8630ab0623 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8659/239ff961778e4e1587404d8a70dfbe8630ab0623/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 67, 8502, 12, 2890, 4672, 365, 18, 5425, 67, 3202, 2668, 2074, 75, 1612, 17, 22, 18, 20, 18, 2436, 18, 267, 2187, 1140, 18, 803, 18, 5701, 12, 2890, 18, 5425, 67, 1214, 16, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 67, 8502, 12, 2890, 4672, 365, 18, 5425, 67, 3202, 2668, 2074, 75, 1612, 17, 22, 18, 20, 18, 2436, 18, 267, 2187, 1140, 18, 803, 18, 5701, 12, 2890, 18, 5425, 67, 1214, 16, 2...
args = [jast.StringConstant(self.getclassname( self.name+'$'+self.pyinner.name)),
args = [jast.GetStaticAttribute(self.getclassname( self.name+'.'+self.pyinner.name), "class"),
def dumpMain(self): meths = [] if self.javamain: code = [] newargs = jast.Identifier("newargs") code.append(jast.Declare("String[]", newargs, jast.NewArray("String", ["args.length+1"]))) code.append(jast.Set(jast.Identifier("newargs[0]"), jast.StringConstant(self.name)))
7ab2e35d544d7a66c78cdb7762c50fc1bf7c8a47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6753/7ab2e35d544d7a66c78cdb7762c50fc1bf7c8a47/PythonModule.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 6376, 12, 2890, 4672, 7917, 87, 273, 5378, 309, 365, 18, 19207, 301, 530, 30, 981, 273, 5378, 394, 1968, 273, 525, 689, 18, 3004, 2932, 2704, 1968, 7923, 981, 18, 6923, 12, 78, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 6376, 12, 2890, 4672, 7917, 87, 273, 5378, 309, 365, 18, 19207, 301, 530, 30, 981, 273, 5378, 394, 1968, 273, 525, 689, 18, 3004, 2932, 2704, 1968, 7923, 981, 18, 6923, 12, 78, ...
l = len(tn)
def chunk(text, csize=52): l = len(text) i = 0 while i < l: yield text[i:i+csize] i += csize
fd4dd91a410121fda4a67b8d440e4b4113f74e29 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/fd4dd91a410121fda4a67b8d440e4b4113f74e29/patch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2441, 12, 955, 16, 276, 1467, 33, 9401, 4672, 328, 273, 562, 12, 955, 13, 277, 273, 374, 1323, 277, 411, 328, 30, 2824, 977, 63, 77, 30, 77, 15, 71, 1467, 65, 277, 1011, 276, 1467,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2441, 12, 955, 16, 276, 1467, 33, 9401, 4672, 328, 273, 562, 12, 955, 13, 277, 273, 374, 1323, 277, 411, 328, 30, 2824, 977, 63, 77, 30, 77, 15, 71, 1467, 65, 277, 1011, 276, 1467,...
sleeptime = (start + sleeptime) - time.time()
now = nonportable.getruntime() sleeptime = finish - now
def sleep(seconds): """ <Purpose> Allow the current event to pause execution (similar to time.sleep()). This function will not return early for any reason <Arguments> seconds: The number of seconds to sleep. This can be a floating point value <Exceptions> None. <Side Effects> None. <Returns> None. """ restrictions.assertisallowed('sleep',seconds) start = time.time() sleeptime = seconds while sleeptime > 0.0: time.sleep(sleeptime) sleeptime = (start + sleeptime) - time.time()
fd28dd314d8b713f9b598463e78674bfcc976552 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7272/fd28dd314d8b713f9b598463e78674bfcc976552/emultimer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5329, 12, 7572, 4672, 3536, 411, 10262, 4150, 34, 7852, 326, 783, 871, 358, 11722, 4588, 261, 22985, 358, 813, 18, 19607, 1435, 2934, 1220, 445, 903, 486, 327, 11646, 364, 1281, 3971, 22...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5329, 12, 7572, 4672, 3536, 411, 10262, 4150, 34, 7852, 326, 783, 871, 358, 11722, 4588, 261, 22985, 358, 813, 18, 19607, 1435, 2934, 1220, 445, 903, 486, 327, 11646, 364, 1281, 3971, 22...
if stderr != None:
if stderr is not None:
def communicate(self, input=None): """Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate. The optional input argument should be a string to be sent to the child process, or None, if no data should be sent to the child.
95702de0f98da1d3b802ca9a49a105d914f43a51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/95702de0f98da1d3b802ca9a49a105d914f43a51/subprocess.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15541, 12, 2890, 16, 810, 33, 7036, 4672, 3536, 2465, 621, 598, 1207, 30, 2479, 501, 358, 8801, 18, 225, 2720, 501, 628, 3909, 471, 4514, 16, 3180, 679, 17, 792, 17, 768, 353, 8675, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15541, 12, 2890, 16, 810, 33, 7036, 4672, 3536, 2465, 621, 598, 1207, 30, 2479, 501, 358, 8801, 18, 225, 2720, 501, 628, 3909, 471, 4514, 16, 3180, 679, 17, 792, 17, 768, 353, 8675, ...
build_order = ".i .mc .rc .cpp".split() decorated = [(build_order.index(ext.lower()), obj, (src, ext)) for obj, (src, ext) in build.items()] decorated.sort() items = [item[1:] for item in decorated] class OnlyItems: def __init__(self, items): self._items = items def items(self): return self._items build = OnlyItems(items)
if sys.hexversion < 0x02040000: build_order = ".i .mc .rc .cpp".split() decorated = [(build_order.index(ext.lower()), obj, (src, ext)) for obj, (src, ext) in build.items()] decorated.sort() items = [item[1:] for item in decorated] class OnlyItems: def __init__(self, items): self._items = items def items(self): return self._items build = OnlyItems(items)
def _setup_compile(self, *args): macros, objects, extra, pp_opts, build = \ msvccompiler.MSVCCompiler._setup_compile(self, *args) build_order = ".i .mc .rc .cpp".split() decorated = [(build_order.index(ext.lower()), obj, (src, ext)) for obj, (src, ext) in build.items()] decorated.sort() items = [item[1:] for item in decorated] # The compiler itself only calls ".items" - leverage that, so that # when it does, the list is in the correct order. class OnlyItems: def __init__(self, items): self._items = items def items(self): return self._items build = OnlyItems(items) return macros, objects, extra, pp_opts, build
8a42777317b5e50f0a69562198b01c391bb0d4a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/8a42777317b5e50f0a69562198b01c391bb0d4a5/setup_win32all.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8401, 67, 11100, 12, 2890, 16, 380, 1968, 4672, 24302, 16, 2184, 16, 2870, 16, 8228, 67, 4952, 16, 1361, 273, 521, 4086, 4227, 9576, 18, 3537, 13464, 9213, 6315, 8401, 67, 11100, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8401, 67, 11100, 12, 2890, 16, 380, 1968, 4672, 24302, 16, 2184, 16, 2870, 16, 8228, 67, 4952, 16, 1361, 273, 521, 4086, 4227, 9576, 18, 3537, 13464, 9213, 6315, 8401, 67, 11100, ...
module = apache.import_module(module_name, req.get_config(), [path])
try: module = apache.import_module(module_name, req.get_config(), [path]) except ImportError: func_path = module_name module_name = "index" module = apache.import_module(module_name, req.get_config(), [path])
def handler(req): req.allow_methods(["GET", "POST"]) if req.method not in ["GET", "POST"]: raise apache.SERVER_RETURN, apache.HTTP_METHOD_NOT_ALLOWED func_path = "" if req.path_info: func_path = req.path_info[1:] # skip first / func_path = func_path.replace("/", ".") if func_path[-1:] == ".": func_path = func_path[:-1] # default to 'index' if no path_info was given if not func_path: func_path = "index" # if any part of the path begins with "_", abort if func_path[0] == '_' or func_path.count("._"): raise apache.SERVER_RETURN, apache.HTTP_NOT_FOUND # process input, if any fs = util.FieldStorage(req, keep_blank_values=1) req.form = fs args = {} # step through fields for field in fs.list: if field.filename: # this is a file val = field else: # this is a simple string val = field.value if args.has_key(field.name): args[field.name].append(val) else: args[field.name] = [val] # at the end, we replace lists with single values for arg in args.keys(): if len(args[arg]) == 1: args[arg] = args[arg][0] # add req args["req"] = req ## import the script path, module_name = os.path.split(req.filename) if not module_name: module_name = "index" # get rid of the suffix # explanation: Suffixes that will get stripped off # are those that were specified as an argument to the # AddHandler directive. Everything else will be considered # a package.module rather than module.suffix exts = req.get_addhandler_exts() if req.extension: # this exists if we're running in a | .ext handler exts += req.extension[1:] if exts: suffixes = exts.strip().split() exp = "\\." + "$|\\.".join(suffixes) suff_matcher = re.compile(exp) # python caches these, so its fast module_name = suff_matcher.sub("", module_name) # import module (or reload if needed) # the [path] argument tells import_module not to allow modules whose # full path is not in [path] or below. module = apache.import_module(module_name, req.get_config(), [path]) # does it have an __auth__? realm, user, passwd = process_auth(req, module) # resolve the object ('traverse') try: object = resolve_object(req, module, func_path, realm, user, passwd) except AttributeError: raise apache.SERVER_RETURN, apache.HTTP_NOT_FOUND # not callable, a class or an aunbound method if not callable(object) or \ str(type(object)) == "<type 'class'>" \ or (hasattr(object, 'im_self') and not object.im_self): result = str(object) else: # callable, (but not a class or unbound method) # we need to weed out unexpected keyword arguments # and for that we need to get a list of them. There # are a few options for callable objects here: if str(type(object)) == "<type 'instance'>": # instances are callable when they have __call__() object = object.__call__ if hasattr(object, "func_code"): # function fc = object.func_code expected = fc.co_varnames[0:fc.co_argcount] elif hasattr(object, 'im_func'): # method fc = object.im_func.func_code expected = fc.co_varnames[1:fc.co_argcount] # remove unexpected args unless co_flags & 0x08, # meaning function accepts **kw syntax if not (fc.co_flags & 0x08): for name in args.keys(): if name not in expected: del args[name] result = apply(object, (), args) if result: result = str(result) # unless content_type was manually set, we will attempt # to guess it if not req._content_type_set: # make an attempt to guess content-type if result[:100].strip()[:6].lower() == '<html>' \ or result.find('</') > 0: req.content_type = 'text/html' else: req.content_type = 'text/plain' if req.method != "HEAD": req.write(result) else: req.write("") return apache.OK else: return apache.HTTP_INTERNAL_SERVER_ERROR
bbd4b7aa1f4786832182974e59c1dd4827ca363f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10002/bbd4b7aa1f4786832182974e59c1dd4827ca363f/publisher.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1838, 12, 3658, 4672, 225, 1111, 18, 5965, 67, 5163, 3816, 6, 3264, 3113, 315, 3798, 6, 5717, 309, 1111, 18, 2039, 486, 316, 8247, 3264, 3113, 315, 3798, 11929, 30, 1002, 12291, 18, 43...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1838, 12, 3658, 4672, 225, 1111, 18, 5965, 67, 5163, 3816, 6, 3264, 3113, 315, 3798, 6, 5717, 309, 1111, 18, 2039, 486, 316, 8247, 3264, 3113, 315, 3798, 11929, 30, 1002, 12291, 18, 43...
missingModels = []
def __call__(self, examples, weight): newdata = orange.ExampleTable(orange.Domain([attr for attr in examples.domain if attr != self.attr] + [self.attr]), examples) return self.model(newdata, weight)
1335cc7edbc61134926d522c044ceb1faf80f567 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/1335cc7edbc61134926d522c044ceb1faf80f567/OWImpute.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 10991, 16, 3119, 4672, 394, 892, 273, 578, 726, 18, 10908, 1388, 12, 280, 726, 18, 3748, 3816, 1747, 364, 1604, 316, 10991, 18, 4308, 309, 1604, 480, 365...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 10991, 16, 3119, 4672, 394, 892, 273, 578, 726, 18, 10908, 1388, 12, 280, 726, 18, 3748, 3816, 1747, 364, 1604, 316, 10991, 18, 4308, 309, 1604, 480, 365...