rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
return _issue(request, slug) | datas = _issue(request, slug) datas['t_squares_open'] = dict((square_open.coord, square_open) for square_open in datas['squares_open']) datas['t_squares'] = dict((square.coord, square) for square in datas['squares']) return datas | def issue(request, slug, format, template_name): return _issue(request, slug) | 422851b173939a1f9e13be99ff369dff2823b569 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4038/422851b173939a1f9e13be99ff369dff2823b569/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5672,
12,
2293,
16,
4959,
16,
740,
16,
1542,
67,
529,
4672,
5386,
273,
389,
13882,
12,
2293,
16,
4959,
13,
5386,
3292,
88,
67,
87,
29405,
67,
3190,
3546,
273,
2065,
12443,
19719,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5672,
12,
2293,
16,
4959,
16,
740,
16,
1542,
67,
529,
4672,
5386,
273,
389,
13882,
12,
2293,
16,
4959,
13,
5386,
3292,
88,
67,
87,
29405,
67,
3190,
3546,
273,
2065,
12443,
19719,
67,
... |
def is_prime(n, flag=0): | def is_prime(n): | def is_prime(n, flag=0): r""" Returns True if `x` is prime, and False otherwise. The result is proven correct - *this is NOT a pseudo-primality test!*. INPUT: - ``flag`` - int - ``0`` (default) - use a combination of algorithms. - ``1`` - certify primality using the Pocklington-Lehmer Test. - ``2`` - certify primality using the APRCL test. OUTPUT: - ``bool`` - True or False .. note:: We do not consider negatives of prime numbers as prime. EXAMPLES:: sage: is_prime(389) True sage: is_prime(2000) False sage: is_prime(2) True sage: is_prime(-1) False sage: factor(-6) -1 * 2 * 3 sage: is_prime(1) False sage: is_prime(-2) False IMPLEMENTATION: Calls the PARI isprime function. """ n = ZZ(n) return pari(n).isprime() | 133b7e088df249ef66124a15442618c8ad5bb505 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/133b7e088df249ef66124a15442618c8ad5bb505/arith.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
16382,
12,
82,
4672,
436,
8395,
2860,
1053,
309,
1375,
92,
68,
353,
17014,
16,
471,
1083,
3541,
18,
1021,
563,
353,
450,
3995,
3434,
300,
380,
2211,
353,
4269,
279,
12454,
17,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
16382,
12,
82,
4672,
436,
8395,
2860,
1053,
309,
1375,
92,
68,
353,
17014,
16,
471,
1083,
3541,
18,
1021,
563,
353,
450,
3995,
3434,
300,
380,
2211,
353,
4269,
279,
12454,
17,... |
myNDVs=1*logical_or(myNDVs==1, myval==myNDV[i]) | myNDVs=1*numpy.logical_or(myNDVs==1, myval==myNDV[i]) | def doit(opts, args): if opts.debug: print "gdal_calc.py starting calculation %s" %(opts.calc) ################################################################ # fetch details of input layers ################################################################ # set up some lists to store data for each band myFiles=[] myBands=[] myAlphaList=[] myDataType=[] myDataTypeNum=[] myNDV=[] DimensionsCheck=None # loop through input files - checking dimensions for i,myI in enumerate(AlphaList[0:len(sys.argv)-1]): myF = eval("opts.%s" %(myI)) myBand = eval("opts.%s_band" %(myI)) if myF: myFiles.append(gdal.Open(myF, gdal.GA_ReadOnly)) # check if we have asked for a specific band... if myBand: myBands.append(myBand) else: myBands.append(1) myAlphaList.append(myI) myDataType.append(gdal.GetDataTypeName(myFiles[i].GetRasterBand(myBands[i]).DataType)) myDataTypeNum.append(myFiles[i].GetRasterBand(myBands[i]).DataType) myNDV.append(myFiles[i].GetRasterBand(myBands[i]).GetNoDataValue()) # check that the dimensions of each layer are the same if DimensionsCheck: if DimensionsCheck!=[myFiles[i].RasterXSize, myFiles[i].RasterYSize]: print "Error! Dimensions of file %s (%i, %i) are different from file %s (%i, %i). Cannot proceed" return else: DimensionsCheck=[myFiles[i].RasterXSize, myFiles[i].RasterYSize] if opts.debug: print "file %s: %s, dimensions: %s, %s, type: %s" %(myI,myF,DimensionsCheck[0],DimensionsCheck[1],myDataType[i]) ################################################################ # set up output file ################################################################ # open output file exists if os.path.isfile(opts.outF) and not opts.overwrite: if opts.debug: print "Output file %s exists - filling in results into file" %(opts.outF) myOut=gdal.Open(opts.outF, gdal.GA_Update) if [myOut.RasterXSize,myOut.RasterYSize] != DimensionsCheck: print "Error! Output exists, but is the wrong size. Use the --overwrite option to automatically overwrite the existing file" return myOutB=myOut.GetRasterBand(1) myOutNDV=myOutB.GetNoDataValue() myOutType=gdal.GetDataTypeName(myOutB.DataType) else: # remove existing file and regenerate if os.path.isfile(opts.outF): os.remove(opts.outF) # create a new file if opts.debug: print "Generating output file %s" %(opts.outF) # find data type to use if not opts.type: # use the largest type of the input files myOutType=gdal.GetDataTypeName(max(myDataTypeNum)) else: myOutType=opts.type # create file myOutDrv = gdal.GetDriverByName(opts.format) myOut=myOutDrv.Create(opts.outF, DimensionsCheck[0], DimensionsCheck[1], 1, gdal.GetDataTypeByName(myOutType)) # set output geo info based on first input layer myOut.SetGeoTransform(myFiles[0].GetGeoTransform()) myOut.SetProjection(myFiles[0].GetProjection()) myOutB=myOut.GetRasterBand(1) if opts.NoDataValue!=None: myOutNDV=opts.NoDataValue else: myOutNDV=DefaultNDVLookup[myOutType] myOutB.SetNoDataValue(myOutNDV) # write to band myOutB=None # refetch band myOutB=myOut.GetRasterBand(1) if opts.debug: print "output file: %s, dimensions: %s, %s, type: %s" %(opts.outF,myOut.RasterXSize,myOut.RasterYSize,gdal.GetDataTypeName(myOutB.DataType)) ################################################################ # find block size to chop grids into bite-sized chunks ################################################################ # use the block size of the first layer to read efficiently myBlockSize=myFiles[0].GetRasterBand(myBands[0]).GetBlockSize(); # store these numbers in variables that may change later nXValid = myBlockSize[0] nYValid = myBlockSize[1] # find total x and y blocks to be read nXBlocks = (DimensionsCheck[0] + myBlockSize[0] - 1) / myBlockSize[0]; nYBlocks = (DimensionsCheck[1] + myBlockSize[1] - 1) / myBlockSize[1]; myBufSize = myBlockSize[0]*myBlockSize[1] if opts.debug: print "using blocksize %s x %s" %(myBlockSize[0], myBlockSize[1]) # variables for displaying progress ProgressCt=-1 ProgressMk=-1 ProgressEnd=nXBlocks*nYBlocks ################################################################ # start looping through blocks of data ################################################################ # loop through X-lines for X in range(0,nXBlocks): # in the rare (impossible?) case that the blocks don't fit perfectly # change the block size of the final piece if X==nXBlocks-1: nXValid = DimensionsCheck[0] - X * myBlockSize[0] myBufSize = nXValid*nYValid # find X offset myX=X*myBlockSize[0] # reset buffer size for start of Y loop nYValid = myBlockSize[1] myBufSize = nXValid*nYValid # loop through Y lines for Y in range(0,nYBlocks): ProgressCt+=1 if 10*ProgressCt/ProgressEnd%10!=ProgressMk: ProgressMk=10*ProgressCt/ProgressEnd%10 print 10*ProgressMk, "..", # change the block size of the final piece if Y==nYBlocks-1: nYValid = DimensionsCheck[1] - Y * myBlockSize[1] myBufSize = nXValid*nYValid # find Y offset myY=Y*myBlockSize[1] # create empty buffer to mark where nodata occurs myNDVs=zeros(myBufSize) myNDVs.shape=(nYValid,nXValid) # fetch data for each input layer for i,Alpha in enumerate(myAlphaList): # populate lettered arrays with values myval=BandReadAsArray(myFiles[i].GetRasterBand(myBands[i]), xoff=myX, yoff=myY, win_xsize=nXValid, win_ysize=nYValid) # fill in nodata values myNDVs=1*logical_or(myNDVs==1, myval==myNDV[i]) # create an array of values for this block exec("%s=myval" %Alpha) myval=None # try the calculation on the array blocks try: myResult = eval(opts.calc) except: print "evaluation of calculation %s failed" %(opts.calc) raise # propogate nodata values # (set nodata cells to zero then add nodata value to these cells) myResult = ((1*(myNDVs==0))*myResult) + (myOutNDV*myNDVs) # write data block to the output file BandWriteArray(myOutB, myResult, xoff=myX, yoff=myY) print "100 - Done" #print "Finished - Results written to %s" %opts.outF return | ac160e22187f4c00e013af415ee2cf81dece60a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10289/ac160e22187f4c00e013af415ee2cf81dece60a8/gdal_calc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
305,
12,
4952,
16,
833,
4672,
225,
309,
1500,
18,
4148,
30,
1172,
315,
19016,
287,
67,
12448,
18,
2074,
5023,
11096,
738,
87,
6,
8975,
4952,
18,
12448,
13,
225,
19709,
5516,
26487... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
305,
12,
4952,
16,
833,
4672,
225,
309,
1500,
18,
4148,
30,
1172,
315,
19016,
287,
67,
12448,
18,
2074,
5023,
11096,
738,
87,
6,
8975,
4952,
18,
12448,
13,
225,
19709,
5516,
26487... |
mergeApiNodes(docTree, getApi(id)) | _mergeApiNodes(docTree, getApi(id)) | def storeApi(includeDict, dynLoadDeps, dynRunDeps, apiPath): docTree = tree.Node("doctree") todo = includeDict.keys() length = len(todo) sys.stdout.write(">>> Generating API data:") sys.stdout.flush() for pos, id in enumerate(todo): printProgress(pos, length) mergeApiNodes(docTree, getApi(id)) print " - Postprocessing..." api.postWorkPackage(docTree, docTree) print " - Storing..." packages = api.packagesToJsonString(docTree, "", " ", "\n") filetool.save(os.path.join(apiPath, "apidata.js"), packages) for classData in api.classNodeIterator(docTree): classContent = tree.nodeToJsonString(classData, "", " ", "\n") fileName = os.path.join(apiPath, classData.get("fullName") + ".js") filetool.save(fileName, classContent) print ">>> Done" | e7c75353e21ce3e8e38d14e7c3e8988f8fc76d22 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/e7c75353e21ce3e8e38d14e7c3e8988f8fc76d22/generator2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1707,
3064,
12,
6702,
5014,
16,
19417,
2563,
14430,
16,
19417,
1997,
14430,
16,
1536,
743,
4672,
997,
2471,
273,
2151,
18,
907,
2932,
2896,
299,
992,
7923,
10621,
273,
2341,
5014,
18,
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,
1707,
3064,
12,
6702,
5014,
16,
19417,
2563,
14430,
16,
19417,
1997,
14430,
16,
1536,
743,
4672,
997,
2471,
273,
2151,
18,
907,
2932,
2896,
299,
992,
7923,
10621,
273,
2341,
5014,
18,
24... |
month_name = _localized_name('%B', 12) month_abbr = _localized_name('%b', 12) | month_name = _localized_name('%B', 13) month_abbr = _localized_name('%b', 13) | def __len__(self): return self.len | 9cf84c04c84169a786c1fca2050f7ea3506d4d73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/9cf84c04c84169a786c1fca2050f7ea3506d4d73/calendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1897,
972,
12,
2890,
4672,
327,
365,
18,
1897,
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,
1001,
1897,
972,
12,
2890,
4672,
327,
365,
18,
1897,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
val = string.atoi(val,16) | b = 16 elif string.lower(val[:2]) == '0x': b = 16 val = val[2:] val = string.atoi(val,b) | def HexColor(val): """This class converts a hex string, or an actual integer number, into the corresponding color. E.g., in "AABBCC" or 0xAABBCC, AA is the red, BB is the green, and CC is the blue (00-FF). HTML uses a hex string with a preceding hash; if this is present, it is stripped off. (AR, 3-3-2000) """ if type(val) == types.StringType: if val[:1] == '#': val = val[1:] val = string.atoi(val,16) factor = 1.0 / 255 return Color(factor * ((val >> 16) & 0xFF), factor * ((val >> 8) & 0xFF), factor * (val & 0xFF)) | 0b27b1794376ae69f5568d27adffe3d64cca6730 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0b27b1794376ae69f5568d27adffe3d64cca6730/colors.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15734,
2957,
12,
1125,
4672,
3536,
2503,
667,
7759,
279,
3827,
533,
16,
578,
392,
3214,
3571,
1300,
16,
1368,
326,
4656,
2036,
18,
225,
512,
18,
75,
12990,
316,
315,
37,
2090,
38,
6743... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15734,
2957,
12,
1125,
4672,
3536,
2503,
667,
7759,
279,
3827,
533,
16,
578,
392,
3214,
3571,
1300,
16,
1368,
326,
4656,
2036,
18,
225,
512,
18,
75,
12990,
316,
315,
37,
2090,
38,
6743... |
"'fixed_dof' must be a zero based list of indices of fixed " \ "degrees of freedom." | "'bc_dof' must be a zero based list of indices of degrees of " \ "freedom at a vertex." | def validateDOF(value): """ Validate list of fixed degrees of freedom. """ try: size = len(value) num = map(int, value) for v in num: if v < 0: raise ValueError except: raise ValueError, \ "'fixed_dof' must be a zero based list of indices of fixed " \ "degrees of freedom." return num | aab2c1d53cb8312049b9473a2567115ee24481f1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8645/aab2c1d53cb8312049b9473a2567115ee24481f1/TimeDependentPoints.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
3191,
42,
12,
1132,
4672,
3536,
3554,
666,
434,
5499,
10904,
434,
28004,
362,
18,
3536,
775,
30,
963,
273,
562,
12,
1132,
13,
818,
273,
852,
12,
474,
16,
460,
13,
364,
331,
316... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
3191,
42,
12,
1132,
4672,
3536,
3554,
666,
434,
5499,
10904,
434,
28004,
362,
18,
3536,
775,
30,
963,
273,
562,
12,
1132,
13,
818,
273,
852,
12,
474,
16,
460,
13,
364,
331,
316... |
print p.hasStereoType(self.stub_stereotypes) print p.getTaggedValue('import_from',None) | def generateDependentImports(self,outfile,element): package=element.getPackage() parents = element.getGenParents() for p in parents: print p.hasStereoType(self.stub_stereotypes) print p.getTaggedValue('import_from',None) if p.hasStereoType(self.stub_stereotypes) and \ p.getTaggedValue('import_from',None): print >> outfile,'from %s import %s' % \ (p.getTaggedValue('import_from'), p.getName()) else: print >> outfile,'from %s import %s' % ( p.getQualifiedModuleName( package,forcePluginRoot=self.force_plugin_root ), p.getName()) | 9b9e19563fbb35b26f67bb8c74b3db696251db95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11941/9b9e19563fbb35b26f67bb8c74b3db696251db95/ArchetypesGenerator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
18571,
13347,
12,
2890,
16,
26050,
16,
2956,
4672,
2181,
33,
2956,
18,
588,
2261,
1435,
225,
6298,
273,
930,
18,
588,
7642,
13733,
1435,
364,
293,
316,
6298,
30,
309,
293,
18,
53... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
18571,
13347,
12,
2890,
16,
26050,
16,
2956,
4672,
2181,
33,
2956,
18,
588,
2261,
1435,
225,
6298,
273,
930,
18,
588,
7642,
13733,
1435,
364,
293,
316,
6298,
30,
309,
293,
18,
53... | |
return super(Product, self).copy(cursor, user, ids, | new_ids = [] for product in self.browse(cursor, user, ids, context=context): default['template'] = template_obj.copy(cursor, user, product.template.id, context=context) new_id = super(Product, self).copy(cursor, user, product.id, | def copy(self, cursor, user, ids, default=None, context=None): if default is None: default = {} default = default.copy() default['products'] = False return super(Product, self).copy(cursor, user, ids, default=default, context=context) | 45e213c60e6b8b135ef42a1b7ee3be03b2ba61f1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9285/45e213c60e6b8b135ef42a1b7ee3be03b2ba61f1/product.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
805,
33,
7036,
16,
819,
33,
7036,
4672,
309,
805,
353,
599,
30,
805,
273,
2618,
805,
273,
805,
18,
3530,
1435,
805,
3292,
18736,
3546... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16,
3347,
16,
729,
16,
3258,
16,
805,
33,
7036,
16,
819,
33,
7036,
4672,
309,
805,
353,
599,
30,
805,
273,
2618,
805,
273,
805,
18,
3530,
1435,
805,
3292,
18736,
3546... |
def __init__(self, symbol): """ Create a Stock object. INPUT: symbol -- string, a ticker symbol | """ Class for retrieval of stock market information. """ def __init__(self, symbol, cid=''): """ Create a Stock object. Optional initialization by cid: an identifier for each equity used by Google Finance. INPUT: symbol -- string, a ticker symbol (with or without market) format: "MARKET:SYMBOL" or "SYMBOL", if you don't supply the market, it is assumed to be NYSE or NASDAQ. eg. "goog" or "OTC:NTDOY" cid -- Integer, a Google contract ID (optional) LIMITATIONS: Currently, the symbol and cid do not have to match. When using google(), the cid will take precedence. | def __init__(self, symbol): """ Create a Stock object. | a7213fc06b60e05eff34efa07d539c0f6047977d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/a7213fc06b60e05eff34efa07d539c0f6047977d/stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3273,
4672,
3536,
1788,
279,
20296,
363,
733,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3273,
4672,
3536,
1788,
279,
20296,
363,
733,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
d2 = +np.sqrt(kmax) * ( (-185*k**2 + 168*kmin**2 -32*kmin**4/k**2) * (np.sqrt(k+kmax) - np.sqrt(kmax-k)) +(70*k*kmin +16*kmin**3/k) * (np.sqrt(k+kmax) + np.sqrt(kmax-k)) ) | d2 = +np.sqrt(kmax) * ( (-185*k**2 + 168*kmax**2 -32*kmax**4/k**2) * (np.sqrt(k+kmax) - np.sqrt(kmax-k)) +(70*k*kmax +16*kmax**3/k) * (np.sqrt(k+kmax) + np.sqrt(kmax-k)) ) | def dterm_analytic(A, B, k, kmin, kmax, bterm): d1a = ( np.log( (np.sqrt(k+kmax) + np.sqrt(kmax))/(np.sqrt(k+kmin) +np.sqrt(kmin)) ) ) d1b = ( np.log( (np.sqrt(kmax-k) + np.sqrt(kmax))/(np.sqrt(k)) ) -0.5*np.pi ) d1c = ( + np.arctan( (np.sqrt(kmin))/(np.sqrt(k-kmin)) ) ) d1 = -135*k**3 * (d1a + d1b + d1c) d2 = +np.sqrt(kmax) * ( (-185*k**2 + 168*kmin**2 -32*kmin**4/k**2) * (np.sqrt(k+kmax) - np.sqrt(kmax-k)) +(70*k*kmin +16*kmin**3/k) * (np.sqrt(k+kmax) + np.sqrt(kmax-k)) ) d3 = -np.sqrt(kmin) * ( (-185*k**2 + 168*kmin**2 -32*kmin**4/k**2) * (np.sqrt(k+kmin) - np.sqrt(k-kmin)) +(70*k*kmin +16*kmin**3/k) * (np.sqrt(k+kmin) + np.sqrt(k-kmin)) ) dhalf = (np.pi*A**2)/(B*900) * 1j * (d1 + d2 + d3) dterm = -bterm + dhalf return dterm | f6083e5ef95f75b2ff6f43738a985decf8f75a69 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7283/f6083e5ef95f75b2ff6f43738a985decf8f75a69/errors.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
6408,
67,
304,
7834,
335,
12,
37,
16,
605,
16,
417,
16,
417,
1154,
16,
417,
1896,
16,
324,
6408,
4672,
302,
21,
69,
273,
261,
1130,
18,
1330,
12,
261,
6782,
18,
24492,
12,
79,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
6408,
67,
304,
7834,
335,
12,
37,
16,
605,
16,
417,
16,
417,
1154,
16,
417,
1896,
16,
324,
6408,
4672,
302,
21,
69,
273,
261,
1130,
18,
1330,
12,
261,
6782,
18,
24492,
12,
79,... |
self.say_private(self.wolves[0],\ ("The other werewolf is %s. Confer privately."\ % self.wolves[1])) self.say_private(self.wolves[1],\ ("The other werewolf is %s. Confer privately."\ % self.wolves[0])) | if len(self.wolves) >= 2: self.say_private(self.wolves[0],\ ("The other werewolf is %s. Confer privately."\ % self.wolves[1])) self.say_private(self.wolves[1],\ ("The other werewolf is %s. Confer privately."\ % self.wolves[0])) | def night(self): "Declare a NIGHT episode of gameplay." | 3495ced770bd44121ea32bd52a4e4c83411f9e27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3953/3495ced770bd44121ea32bd52a4e4c83411f9e27/wolfbot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
750,
12,
2890,
4672,
315,
3456,
834,
279,
423,
7700,
17054,
434,
7920,
1601,
1199,
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,
290,
750,
12,
2890,
4672,
315,
3456,
834,
279,
423,
7700,
17054,
434,
7920,
1601,
1199,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.assertEqual(re.match('(x)*', 50000*'x').span(), (0, 50000)) | try: re.match('(x)*', 50000*'x') except RuntimeError, v: self.assertEqual(str(v), "maximum recursion limit exceeded") else: self.fail("re.match('(x)*', 50000*'x') should have failed") | def test_limitations(self): # Try nasty case that overflows the straightforward recursive # implementation of repeated groups. self.assertEqual(re.match('(x)*', 50000*'x').span(), (0, 50000)) | 889e3235a7c28a9126c7a11c7d966ff3e827181d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/889e3235a7c28a9126c7a11c7d966ff3e827181d/test_re.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3595,
1012,
12,
2890,
4672,
468,
6161,
290,
689,
93,
648,
716,
9391,
87,
326,
21251,
11565,
5904,
468,
4471,
434,
12533,
3252,
18,
365,
18,
11231,
5812,
12,
266,
18,
1916,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3595,
1012,
12,
2890,
4672,
468,
6161,
290,
689,
93,
648,
716,
9391,
87,
326,
21251,
11565,
5904,
468,
4471,
434,
12533,
3252,
18,
365,
18,
11231,
5812,
12,
266,
18,
1916,
26... |
return '[%s] self.ticket['summary']) | return '[%s] self.ticket['summary']) | def format_subj(self): projname = self.config.get('project', 'name') return '[%s] #%s: %s' % (projname, self.ticket['id'], self.ticket['summary']) | ded62a2a8bea3ff7ebdabe21a68b4f5e1fcdd8f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/ded62a2a8bea3ff7ebdabe21a68b4f5e1fcdd8f8/Notify.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
1717,
78,
12,
2890,
4672,
10296,
529,
273,
365,
18,
1425,
18,
588,
2668,
4406,
2187,
296,
529,
6134,
327,
21848,
87,
65,
31974,
87,
30,
738,
87,
11,
738,
261,
17995,
529,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
1717,
78,
12,
2890,
4672,
10296,
529,
273,
365,
18,
1425,
18,
588,
2668,
4406,
2187,
296,
529,
6134,
327,
21848,
87,
65,
31974,
87,
30,
738,
87,
11,
738,
261,
17995,
529,
16... |
mlen = max([len(" %s %s" % (cmd, commands[cmd][3])) for cmd in commands]) | mlen = max([len(" %s" % cmd) for cmd in commands]) | def _ParseArgs(argv, commands, aliases): """Parses the command line and return the function which must be executed together with its arguments Arguments: argv: the command line commands: dictionary with special contents, see the design doc for cmdline handling aliases: dictionary with command aliases {'alias': 'target, ...} """ if len(argv) == 0: binary = "<command>" else: binary = argv[0].split("/")[-1] if len(argv) > 1 and argv[1] == "--version": print "%s (ganeti) %s" % (binary, constants.RELEASE_VERSION) # Quit right away. That way we don't have to care about this special # argument. optparse.py does it the same. sys.exit(0) if len(argv) < 2 or not (argv[1] in commands or argv[1] in aliases): # let's do a nice thing sortedcmds = commands.keys() sortedcmds.sort() print ("Usage: %(bin)s {command} [options...] [argument...]" "\n%(bin)s <command> --help to see details, or" " man %(bin)s\n" % {"bin": binary}) # compute the max line length for cmd + usage mlen = max([len(" %s %s" % (cmd, commands[cmd][3])) for cmd in commands]) mlen = min(60, mlen) # should not get here... # and format a nice command list print "Commands:" for cmd in sortedcmds: cmdstr = " %s %s" % (cmd, commands[cmd][3]) help_text = commands[cmd][4] help_lines = textwrap.wrap(help_text, 79-3-mlen) print "%-*s - %s" % (mlen, cmdstr, help_lines.pop(0)) for line in help_lines: print "%-*s %s" % (mlen, "", line) print return None, None, None # get command, unalias it, and look it up in commands cmd = argv.pop(1) if cmd in aliases: if cmd in commands: raise errors.ProgrammerError("Alias '%s' overrides an existing" " command" % cmd) if aliases[cmd] not in commands: raise errors.ProgrammerError("Alias '%s' maps to non-existing" " command '%s'" % (cmd, aliases[cmd])) cmd = aliases[cmd] func, nargs, parser_opts, usage, description = commands[cmd] parser = OptionParser(option_list=parser_opts, description=description, formatter=TitledHelpFormatter(), usage="%%prog %s %s" % (cmd, usage)) parser.disable_interspersed_args() options, args = parser.parse_args() if nargs is None: if len(args) != 0: print >> sys.stderr, ("Error: Command %s expects no arguments" % cmd) return None, None, None elif nargs < 0 and len(args) != -nargs: print >> sys.stderr, ("Error: Command %s expects %d argument(s)" % (cmd, -nargs)) return None, None, None elif nargs >= 0 and len(args) < nargs: print >> sys.stderr, ("Error: Command %s expects at least %d argument(s)" % (cmd, nargs)) return None, None, None return func, options, args | 57d0151e9a1885304a70c8d3bc720abfb3aa1502 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/57d0151e9a1885304a70c8d3bc720abfb3aa1502/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3201,
2615,
12,
19485,
16,
4364,
16,
6900,
4672,
3536,
6656,
326,
1296,
980,
471,
327,
326,
445,
1492,
1297,
506,
7120,
9475,
598,
2097,
1775,
225,
13599,
30,
5261,
30,
326,
1296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3201,
2615,
12,
19485,
16,
4364,
16,
6900,
4672,
3536,
6656,
326,
1296,
980,
471,
327,
326,
445,
1492,
1297,
506,
7120,
9475,
598,
2097,
1775,
225,
13599,
30,
5261,
30,
326,
1296,
... |
ckmsg(s, "'continue' not supported inside 'finally' clause") | if sys.platform.startswith('java'): print "'continue' not supported inside 'finally' clause" print "ok" else: ckmsg(s, "'continue' not supported inside 'finally' clause") | def ckmsg(src, msg): try: compile(src, '<fragment>', 'exec') except SyntaxError, e: print e.msg if e.msg == msg: print "ok" else: print "expected:", msg else: print "failed to get expected SyntaxError" | 32d377df1e9ddad95fbcd3226ba9db9047b3da91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/32d377df1e9ddad95fbcd3226ba9db9047b3da91/test_exceptions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12622,
3576,
12,
4816,
16,
1234,
4672,
775,
30,
4074,
12,
4816,
16,
2368,
11956,
1870,
16,
296,
4177,
6134,
1335,
18453,
16,
425,
30,
1172,
425,
18,
3576,
309,
425,
18,
3576,
422,
1234... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12622,
3576,
12,
4816,
16,
1234,
4672,
775,
30,
4074,
12,
4816,
16,
2368,
11956,
1870,
16,
296,
4177,
6134,
1335,
18453,
16,
425,
30,
1172,
425,
18,
3576,
309,
425,
18,
3576,
422,
1234... |
akey = "1" | akey = str(random.randrange(1, 1000)) | def get_rand_dictkey(): """ Get a randomic string between '1' and '1000' for _cfunc_refs dict keys """ akey = "1" while akey in _cfunc_refs: akey = str(random.randrange(1, 1000)) return akey | 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,
336,
67,
7884,
67,
1576,
856,
13332,
3536,
968,
279,
2744,
335,
533,
3086,
296,
21,
11,
471,
296,
18088,
11,
364,
389,
71,
644,
67,
9316,
2065,
1311,
3536,
279,
856,
273,
609,
12,
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,
336,
67,
7884,
67,
1576,
856,
13332,
3536,
968,
279,
2744,
335,
533,
3086,
296,
21,
11,
471,
296,
18088,
11,
364,
389,
71,
644,
67,
9316,
2065,
1311,
3536,
279,
856,
273,
609,
12,
91... |
print("CLOSE current %s" % self.client.element) | pass | def close(self): print("CLOSE current %s" % self.client.element) | aafda75ca94ff8f2803d1d92990754394881af8a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8801/aafda75ca94ff8f2803d1d92990754394881af8a/logxmpp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
1172,
2932,
13384,
783,
738,
87,
6,
738,
365,
18,
2625,
18,
2956,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
1172,
2932,
13384,
783,
738,
87,
6,
738,
365,
18,
2625,
18,
2956,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
The characteristic must not be 2 or 3 and the j-invariant must be 1728 | The characteristic must not be 2 or 3 and the j-invariant must be 1728. | def quartic_twist(self, D): """ Return the quartic twist of this curve by D, which must be nonzero. | 4f0514b45a47cdf92a6d781876aa0dd2f3653f54 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/4f0514b45a47cdf92a6d781876aa0dd2f3653f54/ell_generic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
719,
485,
335,
67,
11246,
376,
12,
2890,
16,
463,
4672,
3536,
2000,
326,
719,
485,
335,
2339,
376,
434,
333,
8882,
635,
463,
16,
1492,
1297,
506,
16966,
18,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
719,
485,
335,
67,
11246,
376,
12,
2890,
16,
463,
4672,
3536,
2000,
326,
719,
485,
335,
2339,
376,
434,
333,
8882,
635,
463,
16,
1492,
1297,
506,
16966,
18,
2,
-100,
-100,
-100,
-100,
... |
which_properties = (self.var_graphics.get(), self.var_text.get()) self.close_dlg(which_properties) | graph=self.var_graphics_style.get() text=self.var_text_style.get() self.close_dlg((graph, text)) | def ok(self, *args): which_properties = (self.var_graphics.get(), self.var_text.get()) self.close_dlg(which_properties) | ba01bfe17652546aec6c75c6c54d001ef335c15a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3123/ba01bfe17652546aec6c75c6c54d001ef335c15a/styledlg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1529,
12,
2890,
16,
380,
1968,
4672,
1492,
67,
4738,
273,
261,
2890,
18,
1401,
67,
31586,
18,
588,
9334,
365,
18,
1401,
67,
955,
18,
588,
10756,
365,
18,
4412,
67,
5761,
75,
12,
1278... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1529,
12,
2890,
16,
380,
1968,
4672,
1492,
67,
4738,
273,
261,
2890,
18,
1401,
67,
31586,
18,
588,
9334,
365,
18,
1401,
67,
955,
18,
588,
10756,
365,
18,
4412,
67,
5761,
75,
12,
1278... |
if kr == None: | if kr is None: | def __processbody_URLquote(self, lines): # XXX a lot to do here: # 1. use lines directly, rather than source and dest # 2. make it clearer # 3. make it faster source = lines[:] dest = lines last_line_was_quoted=0 for i in xrange(0, len(source)): Lorig=L=source[i] ; prefix=suffix="" if L==None: continue # Italicise quoted text if self.IQUOTES: quoted=quotedpat.match(L) if quoted==None: last_line_was_quoted=0 else: quoted = quoted.end(0) prefix=CGIescape(L[:quoted]) + '<i>' suffix='</I>' if self.SHOWHTML: suffix=suffix+'<BR>' if not last_line_was_quoted: prefix='<BR>'+prefix L= L[quoted:] last_line_was_quoted=1 # Check for an e-mail address L2="" jr = emailpat.search(L) kr = urlpat.search(L) while jr != None or kr != None: if jr == None: j = -1 else: j = jr.start(0) if kr == None: k = -1 else: k = kr.start(0) if j != -1 and (j < k or k == -1): text = jr.group(1) URL = 'mailto:' + text pos = j elif k!=-1 and (j>k or j==-1): text = URL = kr.group(1) pos=k else: # j==k raise ValueError, "j==k: This can't happen!" length=len(text) #self.message("URL: %s %s %s \n" # % (CGIescape(L[:pos]), URL, CGIescape(text))) L2 = L2 + ('%s<A HREF="%s">%s</A>' % (CGIescape(L[:pos]), URL, CGIescape(text))) L=L[pos+length:] jr=emailpat.search(L) ; kr=urlpat.search(L) if jr==None and kr==None: L=CGIescape(L) L=prefix+L2+L+suffix if L!=Lorig: source[i], dest[i]=None, L | 469b12e8cfc912874019fdd0ddc95060d27b98f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/469b12e8cfc912874019fdd0ddc95060d27b98f4/HyperArch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2567,
3432,
67,
1785,
6889,
12,
2890,
16,
2362,
4672,
468,
11329,
279,
17417,
358,
741,
2674,
30,
468,
404,
18,
999,
2362,
5122,
16,
9178,
2353,
1084,
471,
1570,
468,
576,
18,
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,
1001,
2567,
3432,
67,
1785,
6889,
12,
2890,
16,
2362,
4672,
468,
11329,
279,
17417,
358,
741,
2674,
30,
468,
404,
18,
999,
2362,
5122,
16,
9178,
2353,
1084,
471,
1570,
468,
576,
18,
12... |
raise Failure("Command exection failed - %d"%rv) | raise Failure("Command execution failed - %d"%rv) | def run_cmd(cmd, env = os.environ, allowFailure = False, isSystem = False): """ Run a command via the shell, throwing on failure @param isSystem If True, this is a command being run by the system and failure should be reported with an Error. Else, it's being run on behalf of the user and failure should be reported with Failure. """ print "> %s"%cmd rv = subprocess.call(cmd, shell = True, env = env) if (not allowFailure) and rv != 0: if isSystem: raise Error("Command execution failed - %d"%rv) else: raise Failure("Command exection failed - %d"%rv) return rv | d20e5e0e854d4e65a04bd8465f03d725f03c0b6e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4427/d20e5e0e854d4e65a04bd8465f03d725f03c0b6e/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
4172,
12,
4172,
16,
1550,
273,
1140,
18,
28684,
16,
1699,
5247,
273,
1083,
16,
353,
3163,
273,
1083,
4672,
3536,
1939,
279,
1296,
3970,
326,
5972,
16,
19440,
603,
5166,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
4172,
12,
4172,
16,
1550,
273,
1140,
18,
28684,
16,
1699,
5247,
273,
1083,
16,
353,
3163,
273,
1083,
4672,
3536,
1939,
279,
1296,
3970,
326,
5972,
16,
19440,
603,
5166,
225,
... |
if self.field[self.pos] in self.atomends: | if self.field[self.pos] in atomends: | def getatom(self): """Parse an RFC-822 atom.""" atomlist = [''] | 9ec58aaef2d0124bd42e30e6029fe8a7bdb906e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9ec58aaef2d0124bd42e30e6029fe8a7bdb906e7/rfc822.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
7466,
12,
2890,
4672,
3536,
3201,
392,
8372,
17,
24532,
3179,
12123,
3179,
1098,
273,
10228,
3546,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
7466,
12,
2890,
4672,
3536,
3201,
392,
8372,
17,
24532,
3179,
12123,
3179,
1098,
273,
10228,
3546,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
category='Comic', pagestyledefault=ps, | category='Comic', pagestyledefault=ps, | def create_lrf(pages, profile, opts, thumbnail=None): width, height = PROFILES[profile] ps = {} ps['topmargin'] = 0 ps['evensidemargin'] = 0 ps['oddsidemargin'] = 0 ps['textwidth'] = width ps['textheight'] = height book = Book(title=opts.title, author=opts.author, bookid=uuid4().hex, publisher='%s %s'%(__appname__, __version__), thumbnail=thumbnail, category='Comic', pagestyledefault=ps, booksetting=BookSetting(screenwidth=width, screenheight=height)) for page in pages: imageStream = ImageStream(page) _page = book.create_page() _page.append(ImageBlock(refstream=imageStream, blockwidth=width, blockheight=height, xsize=width, ysize=height, x1=width, y1=height)) book.append(_page) book.renderLrf(open(opts.output, 'wb')) print _('Output written to'), opts.output | ec9111aa7fc506572e8377352d554d32d39ba5dc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/ec9111aa7fc506572e8377352d554d32d39ba5dc/convert_from.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
80,
5809,
12,
7267,
16,
3042,
16,
1500,
16,
9134,
33,
7036,
4672,
1835,
16,
2072,
273,
4629,
12669,
63,
5040,
65,
4250,
273,
2618,
4250,
3292,
3669,
10107,
3546,
1377,
273,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
80,
5809,
12,
7267,
16,
3042,
16,
1500,
16,
9134,
33,
7036,
4672,
1835,
16,
2072,
273,
4629,
12669,
63,
5040,
65,
4250,
273,
2618,
4250,
3292,
3669,
10107,
3546,
1377,
273,
37... |
raise ValueError("Sequence has a gapped alphabet, alignment does not") | raise ValueError(\ "Sequence has a gapped alphabet, alignment does not") | def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict - Optional, defaults to True. Should error checking be done? Using this function is now discouraged. Rather doing this: >>> from Bio import SeqIO >>> handle = open("Clustalw/protein.aln") >>> alignment = SeqIO.to_alignment(SeqIO.parse(handle, "clustal")) >>> handle.close() You are now encouraged to use Bio.AlignIO instead, e.g. >>> from Bio import AlignIO >>> handle = open("Clustalw/protein.aln") >>> alignment = AlignIO.read(handle, "clustal") >>> handle.close() """ #TODO - Move this functionality into the Alignment class instead? from Bio.Alphabet import generic_alphabet from Bio.Alphabet import _consensus_alphabet if alphabet is None: sequences = list(sequences) alphabet = _consensus_alphabet([rec.seq.alphabet for rec in sequences \ if rec.seq is not None]) if not (isinstance(alphabet, Alphabet) or isinstance(alphabet, AlphabetEncoder)): raise ValueError("Invalid alphabet") alignment_length = None alignment = Alignment(alphabet) for record in sequences: if strict: if alignment_length is None: alignment_length = len(record.seq) elif alignment_length != len(record.seq): raise ValueError("Sequences must all be the same length") assert isinstance(record.seq.alphabet, Alphabet) \ or isinstance(record.seq.alphabet, AlphabetEncoder), \ "Sequence does not have a valid alphabet" #TODO - Move this alphabet comparison code into the Alphabet module/class? #TODO - Is a normal alphabet "ungapped" by default, or does it just mean #undecided? if isinstance(record.seq.alphabet, Alphabet) \ and isinstance(alphabet, Alphabet): #Comparing two non-gapped alphabets if not isinstance(record.seq.alphabet, alphabet.__class__): raise ValueError("Incompatible sequence alphabet " \ + "%s for %s alignment" \ % (record.seq.alphabet, alphabet)) elif isinstance(record.seq.alphabet, AlphabetEncoder) \ and isinstance(alphabet, Alphabet): raise ValueError("Sequence has a gapped alphabet, alignment does not") elif isinstance(record.seq.alphabet, Alphabet) \ and isinstance(alphabet, Gapped): #Sequence isn't gapped, alignment is. if not isinstance(record.seq.alphabet, alphabet.alphabet.__class__): raise ValueError("Incompatible sequence alphabet " \ + "%s for %s alignment" \ % (record.seq.alphabet, alphabet)) else: #Comparing two gapped alphabets if not isinstance(record.seq.alphabet, alphabet.__class__): raise ValueError("Incompatible sequence alphabet " \ + "%s for %s alignment" \ % (record.seq.alphabet, alphabet)) if record.seq.alphabet.gap_char != alphabet.gap_char: raise ValueError("Sequence gap characters != alignment gap char") #ToDo, additional checks on the specified alignment... #Should we look at the alphabet.contains() method? if record.seq is None: raise TypeError("SeqRecord (id=%s) has None for its sequence." % record.id) #This is abusing the "private" records list, #we should really have a method like add_sequence #but which takes SeqRecord objects. See also Bug 1944 alignment._records.append(record) return alignment | a2855b4f95e94e4ef816422674d48a89ec6bbe18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7167/a2855b4f95e94e4ef816422674d48a89ec6bbe18/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
14409,
12,
17190,
16,
10877,
33,
7036,
16,
5490,
33,
5510,
4672,
3536,
1356,
279,
3229,
3102,
8710,
261,
5704,
3584,
4311,
2934,
225,
300,
8463,
300,
979,
2775,
716,
1135,
14367... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
14409,
12,
17190,
16,
10877,
33,
7036,
16,
5490,
33,
5510,
4672,
3536,
1356,
279,
3229,
3102,
8710,
261,
5704,
3584,
4311,
2934,
225,
300,
8463,
300,
979,
2775,
716,
1135,
14367... |
def setup_class(cls): | should_be_moving = True def test_weakref(self): | def test_weakref(self): py.test.skip("fails for some reason I couldn't figure out yet :-(") | 4f7dad4a319084b4cabe99281eb362f592a49397 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/4f7dad4a319084b4cabe99281eb362f592a49397/test_newgc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
26008,
1734,
12,
2890,
4672,
2395,
18,
3813,
18,
7457,
2932,
6870,
87,
364,
2690,
3971,
467,
17991,
1404,
7837,
596,
4671,
294,
17,
2932,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
26008,
1734,
12,
2890,
4672,
2395,
18,
3813,
18,
7457,
2932,
6870,
87,
364,
2690,
3971,
467,
17991,
1404,
7837,
596,
4671,
294,
17,
2932,
13,
2,
-100,
-100,
-100,
-100,
-100,
... |
""" | """ | def convertFiles(self, outname): """ Method that reads the files that user has selected """ idxs = self.sourceListbox.GetSelections() files = [] if not idxs: n = self.sourceListbox.GetCount() idxs = range(n) for i in idxs: files.append(self.sourceListbox.GetString(i)) try: self.dataSource.setFilenames(files) except Logging.GUIError, ex: ex.show() self.Close() return bxdwriter = BXDDataWriter(outname) self.resultDataset = bxdwriter.getFilename() print "Result dataset=", self.resultDataset | 24d61fb7ed3fd0784cc4231099e43bd6ab8eac45 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2877/24d61fb7ed3fd0784cc4231099e43bd6ab8eac45/ImportDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
2697,
12,
2890,
16,
596,
529,
4672,
3536,
2985,
716,
6838,
326,
1390,
716,
729,
711,
3170,
3536,
20039,
273,
365,
18,
3168,
682,
2147,
18,
967,
29913,
1435,
1390,
273,
5378,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
2697,
12,
2890,
16,
596,
529,
4672,
3536,
2985,
716,
6838,
326,
1390,
716,
729,
711,
3170,
3536,
20039,
273,
365,
18,
3168,
682,
2147,
18,
967,
29913,
1435,
1390,
273,
5378,
225,
... |
T, ylist = [], [] | T, ylist = [t0.value], [model.getStates().copy()] | def _Jac(N, J, t, y, fy, jac_data, tmp1, tmp2, tmp3): """ Set Jacobian calculated by JMI. This function is a callback function for (Py)SUNDIALS. """ data = ctypes.cast(jac_data, PUserData).contents model = data.model model.setTime(t) model.setStates(y) J_jmi = model.evalJacX() for row in xrange(len(J_jmi)): for col in xrange(len(J_jmi[row])): J[row][col] = J_jmi[row][col] return 0 | b50b5a0d061f9da771e0a0c30212562fc234a8cc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7711/b50b5a0d061f9da771e0a0c30212562fc234a8cc/shooting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
46,
1077,
12,
50,
16,
804,
16,
268,
16,
677,
16,
28356,
16,
20138,
67,
892,
16,
1853,
21,
16,
1853,
22,
16,
1853,
23,
4672,
3536,
1000,
804,
1077,
26968,
8894,
635,
804,
7492,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
46,
1077,
12,
50,
16,
804,
16,
268,
16,
677,
16,
28356,
16,
20138,
67,
892,
16,
1853,
21,
16,
1853,
22,
16,
1853,
23,
4672,
3536,
1000,
804,
1077,
26968,
8894,
635,
804,
7492,
... |
gateGump.addText( 35, 85, "Ilshenar", 61 ) | gateGump.addText( 35, 85, "Ilshenar" ) | def sendGump( char, item ): char.soundeffect( 0x58 ) # noclose, nomove gump gateGump = cGump( 1, 1, 0, 100, 120 ) # trammel gateGump.startPage( 1 ) gateGump.addBackground( 9200, 380, 280 ) gateGump.addText( 5, 10, "Pick your destination:" ) gateGump.addButton( 10, 210, 0xFA5, 0xFA7, 1 ) gateGump.addText( 45, 210, "OKAY", 0 ) gateGump.addButton( 10, 235, 0xFA5, 0xFA7, 0 ) gateGump.addText( 45, 235, "CANCEL" ) # facets gateGump.addText( 35, 35, "Trammel", 61 ) gateGump.addPageButton( 10, 35, 0x4B9, 0x4BA, 1 ) gateGump.addText( 35, 60, "Felucca" ) gateGump.addPageButton( 10, 60, 0x4B9, 0x4BA, 2 ) gateGump.addText( 35, 85, "Ilshenar" ) gateGump.addPageButton( 10, 85, 0x4B9, 0x4BA, 3 ) gateGump.addText( 35, 110, "Malas" ) gateGump.addPageButton( 10, 110, 0x4B9, 0x4BA, 4 ) gateGump.addText( 35, 135, "Tokuno Islands") gateGump.addPageButton( 10, 135, 0x4B9, 0x4BA, 5 ) # gates gateGump.addText( 225, 40, "Britain" ) gateGump.addRadioButton(200, 40, 210, 211, 10 ) gateGump.addText( 225, 65, "Magincia" ) gateGump.addRadioButton(200, 65, 210, 211, 11 ) gateGump.addText( 225, 90, "Moonglow" ) gateGump.addRadioButton(200, 90, 210, 211, 12 ) gateGump.addText( 225, 115, "Skara Brae" ) gateGump.addRadioButton(200, 115, 210, 211, 13 ) gateGump.addText( 225, 140, "Trinsic" ) gateGump.addRadioButton(200, 140, 210, 211, 14 ) gateGump.addText( 225, 165, "Vesper" ) gateGump.addRadioButton(200, 165, 210, 211, 15 ) gateGump.addText( 225, 190, "Yew" ) gateGump.addRadioButton(200, 190, 210, 211, 16 ) gateGump.addText( 225, 215, "Jhelom" ) gateGump.addRadioButton(200, 215, 210, 211, 17 ) # felucca gateGump.startPage( 2 ) gateGump.addBackground( 9200, 380, 280 ) gateGump.addText( 5, 10, "Pick your destination:" ) gateGump.addButton( 10, 210, 0xFA5, 0xFA7, 1 ) gateGump.addText( 45, 210, "OKAY", 0 ) gateGump.addButton( 10, 235, 0xFA5, 0xFA7, 0 ) gateGump.addText( 45, 235, "CANCEL" ) # facets gateGump.addText( 35, 35, "Trammel" ) gateGump.addPageButton( 10, 35, 0x4B9, 0x4BA, 1 ) gateGump.addText( 35, 60, "Felucca", 61 ) gateGump.addPageButton( 10, 60, 0x4B9, 0x4BA, 2 ) gateGump.addText( 35, 85, "Ilshenar" ) gateGump.addPageButton( 10, 85, 0x4B9, 0x4BA, 3 ) gateGump.addText( 35, 110, "Malas" ) gateGump.addPageButton( 10, 110, 0x4B9, 0x4BA, 4 ) gateGump.addText( 35, 135, "Tokuno Islands" ) gateGump.addPageButton( 10, 135, 0x4B9, 0x4BA, 5 ) # gates gateGump.addText( 225, 40, "Britain" ) gateGump.addRadioButton(200, 40, 210, 211, 18 ) gateGump.addText( 225, 65, "Magincia" ) gateGump.addRadioButton(200, 65, 210, 211, 19 ) gateGump.addText( 225, 90, "Moonglow" ) gateGump.addRadioButton(200, 90, 210, 211, 20 ) gateGump.addText( 225, 115, "Skara Brae" ) gateGump.addRadioButton(200, 115, 210, 211, 21 ) gateGump.addText( 225, 140, "Trinsic" ) gateGump.addRadioButton(200, 140, 210, 211, 22 ) gateGump.addText( 225, 165, "Vesper" ) gateGump.addRadioButton(200, 165, 210, 211, 23 ) gateGump.addText( 225, 190, "Yew" ) gateGump.addRadioButton(200, 190, 210, 211, 24 ) gateGump.addText( 225, 215, "Jhelom" ) gateGump.addRadioButton(200, 215, 210, 211, 25 ) # ilshenar gateGump.startPage( 3 ) gateGump.addBackground( 9200, 380, 280 ) gateGump.addText( 5, 10, "Pick your destination:" ) gateGump.addButton( 10, 210, 0xFA5, 0xFA7, 1 ) gateGump.addText( 45, 210, "OKAY", 0 ) gateGump.addButton( 10, 235, 0xFA5, 0xFA7, 0 ) gateGump.addText( 45, 235, "CANCEL" ) # facets gateGump.addText( 35, 35, "Trammel" ) gateGump.addPageButton( 10, 35, 0x4B9, 0x4BA, 1 ) gateGump.addText( 35, 60, "Felucca" ) gateGump.addPageButton( 10, 60, 0x4B9, 0x4BA, 2 ) gateGump.addText( 35, 85, "Ilshenar", 61 ) gateGump.addPageButton( 10, 85, 0x4B9, 0x4BA, 3 ) gateGump.addText( 35, 110, "Malas" ) gateGump.addPageButton( 10, 110, 0x4B9, 0x4BA, 4 ) gateGump.addText( 35, 135, "Tokuno Islands" ) gateGump.addPageButton( 10, 135, 0x4B9, 0x4BA, 5 ) #gates gateGump.addText( 225, 40, "Compassion" ) gateGump.addRadioButton( 200, 40, 210, 211, 26 ) gateGump.addText( 225, 65, "Honesty" ) gateGump.addRadioButton( 200, 65, 210, 211, 27 ) gateGump.addText( 225, 90, "Honor" ) gateGump.addRadioButton( 200, 90, 210, 211, 28 ) gateGump.addText( 225, 115, "Humility" ) gateGump.addRadioButton( 200, 115, 210, 211, 29 ) gateGump.addText( 225, 140, "Justice" ) gateGump.addRadioButton( 200, 140, 210, 211, 30 ) gateGump.addText( 225, 165, "Sacrifice" ) gateGump.addRadioButton( 200, 165, 210, 211, 31 ) gateGump.addText( 225, 190, "Spirituality" ) gateGump.addRadioButton( 200, 190, 210, 211, 32 ) gateGump.addText( 225, 215, "Valor" ) gateGump.addRadioButton( 200, 215, 210, 211, 33 ) gateGump.addText( 225, 240, "Chaos" ) gateGump.addRadioButton( 200, 240, 210, 211, 34 ) # Malas gateGump.startPage( 4 ) gateGump.addBackground( 9200, 380, 280 ) gateGump.addText( 5, 10, "Pick your destination:" ) gateGump.addButton( 10, 210, 0xFA5, 0xFA7, 1 ) gateGump.addText( 45, 210, "OKAY", 0 ) gateGump.addButton( 10, 235, 0xFA5, 0xFA7, 0 ) gateGump.addText( 45, 235, "CANCEL" ) # facets gateGump.addText( 35, 35, "Trammel" ) gateGump.addPageButton( 10, 35, 0x4B9, 0x4BA, 1 ) gateGump.addText( 35, 60, "Felucca" ) gateGump.addPageButton( 10, 60, 0x4B9, 0x4BA, 2 ) gateGump.addText( 35, 85, "Ilshenar" ) gateGump.addPageButton( 10, 85, 0x4B9, 0x4BA, 3 ) gateGump.addText( 35, 110, "Malas", 61 ) gateGump.addPageButton( 10, 110, 0x4B9, 0x4BA, 4 ) gateGump.addText( 35, 110, "Tokuno Islands" ) gateGump.addPageButton( 10, 110, 0x4B9, 0x4BA, 5 ) # #gates gateGump.addText( 225, 40, "Luna Moongate" ) gateGump.addRadioButton( 200, 40, 210, 211, 35 ) gateGump.addText( 225, 65, "Bank of Luna" ) gateGump.addRadioButton( 200, 65, 210, 211, 36 ) gateGump.addText( 225, 90, "Stables of Luna" ) gateGump.addRadioButton( 200, 90, 210, 211, 37 ) gateGump.addText( 225, 115, "North Entrance" ) gateGump.addRadioButton( 200, 115, 210, 211, 38 ) gateGump.addText( 225, 140, "Luna Arena" ) gateGump.addRadioButton( 200, 140, 210, 211, 39 ) gateGump.addText( 225, 165, "Umbra Moongate" ) gateGump.addRadioButton( 200, 165, 210, 211, 40 ) gateGump.addText( 225, 190, "Umbra Bridge" ) gateGump.addRadioButton( 200, 190, 210, 211, 41 ) gateGump.addText( 225, 215, "Stables of Umbra" ) gateGump.addRadioButton( 200, 215, 210, 211, 42 ) # tokuno islands gateGump.startPage( 5 ) gateGump.addBackground( 9200, 380, 280 ) gateGump.addText( 5, 10, "Pick your destination:" ) gateGump.addButton( 10, 210, 0xFA5, 0xFA7, 1 ) gateGump.addText( 45, 210, "OKAY", 0 ) gateGump.addButton( 10, 235, 0xFA5, 0xFA7, 0 ) gateGump.addText( 45, 235, "CANCEL" ) # facets gateGump.addText( 35, 35, "Trammel" ) gateGump.addPageButton( 10, 35, 0x4B9, 0x4BA, 1 ) gateGump.addText( 35, 60, "Felucca" ) gateGump.addPageButton( 10, 60, 0x4B9, 0x4BA, 2 ) gateGump.addText( 35, 85, "Ilshenar", 61 ) gateGump.addPageButton( 10, 85, 0x4B9, 0x4BA, 3 ) gateGump.addText( 35, 110, "Malas" ) gateGump.addPageButton( 10, 110, 0x4B9, 0x4BA, 4 ) gateGump.addText( 35, 135, "Tokuno Islands" ) gateGump.addPageButton( 10, 135, 0x4B9, 0x4BA, 5 ) #gates gateGump.addText( 225, 40, "Makoto-Jima" ) gateGump.addRadioButton( 200, 40, 210, 211, 43 ) gateGump.addText( 225, 65, "Isamu-Jima" ) gateGump.addRadioButton( 200, 65, 210, 211, 44 ) gateGump.addText( 225, 90, "Homare-Jima" ) gateGump.addRadioButton( 200, 90, 210, 211, 45 ) # set callback function and its arguments gateGump.setCallback( gateCallback ) # send it gateGump.setArgs( [ item ] ) gateGump.setType( 0x87654321 ) gateGump.send( char ) | 46ac451c56a951fe645ddb6977e67287f7363f64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/46ac451c56a951fe645ddb6977e67287f7363f64/moongate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
43,
2801,
12,
1149,
16,
761,
262,
30,
1149,
18,
87,
465,
536,
74,
386,
12,
374,
92,
8204,
262,
468,
30601,
2061,
16,
12457,
841,
314,
2801,
12611,
43,
2801,
273,
276,
43,
2801,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
43,
2801,
12,
1149,
16,
761,
262,
30,
1149,
18,
87,
465,
536,
74,
386,
12,
374,
92,
8204,
262,
468,
30601,
2061,
16,
12457,
841,
314,
2801,
12611,
43,
2801,
273,
276,
43,
2801,... |
TRYPYARRAYTEMPLATECHAR\\ | case PyArray_BOOL: *(Bool *)(arr->data)=(*v!=0); break;\\ | #ifdef NUMARRAY | e976023c94992967c9e8060117a5f6795102525d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/e976023c94992967c9e8060117a5f6795102525d/cfuncs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
430,
536,
9443,
8552,
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,
468,
430,
536,
9443,
8552,
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,
-1... |
lutData = file ('/Users/fpierfed/Desktop/heat.lut').readlines () | lutData = file ('%s/heat.lut' % (RESOURCES_PATH)).readlines () | def prepareOpenGL (self): """ OpenGL initialization routine """ # setup the LUT lutData = file ('/Users/fpierfed/Desktop/heat.lut').readlines () self.i2r = numarray.zeros (shape=(256), type='Float32') self.i2g = numarray.zeros (shape=(256), type='Float32') self.i2b = numarray.zeros (shape=(256), type='Float32') for i in range (len (lutData)): (r, g, b) = lutData[i].split () self.i2r[i] = float (r) self.i2g[i] = float (g) self.i2b[i] = float (b) # Setup the OpenGL maps glPixelTransferf (GL_ALPHA_SCALE, 0.0) glPixelTransferf (GL_ALPHA_BIAS, 1.0) glPixelStorei (GL_UNPACK_ALIGNMENT, 1) glPixelMapfv (GL_PIXEL_MAP_I_TO_R, self.i2r) glPixelMapfv (GL_PIXEL_MAP_I_TO_G, self.i2g) glPixelMapfv (GL_PIXEL_MAP_I_TO_B, self.i2b) glPixelMapfv (GL_PIXEL_MAP_I_TO_A, 1) glPixelTransferi (GL_INDEX_SHIFT, 0) glPixelTransferi (GL_INDEX_OFFSET, 0) glPixelTransferi (GL_MAP_COLOR, GL_TRUE) glDisable (GL_DITHER) # clear color for the view glClearColor (0.0, 0.0, 0.0, 0.0) glClearDepth (1.0) # sstart with a fresh id matrix glLoadIdentity () # clear the view glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glFlush () return | 52c2a4ca79f0690dbaca69ecc01d542f6f0eb6ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2360/52c2a4ca79f0690dbaca69ecc01d542f6f0eb6ea/PyOpenGLView.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
3678,
11261,
261,
2890,
4672,
3536,
3502,
11261,
10313,
12245,
3536,
468,
3875,
326,
511,
1693,
27171,
751,
273,
585,
7707,
9,
87,
19,
580,
270,
18,
80,
322,
11,
738,
261,
11395,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
3678,
11261,
261,
2890,
4672,
3536,
3502,
11261,
10313,
12245,
3536,
468,
3875,
326,
511,
1693,
27171,
751,
273,
585,
7707,
9,
87,
19,
580,
270,
18,
80,
322,
11,
738,
261,
11395,
... |
questionFmt = _(u'\u201c%(displayName)s\u201d is a recurring event. What do you want to add to the collection:') | questionFmt = _(u'"%(displayName)s" is a recurring event. What do you want to add to the collection:') | def runDialog(self): # Check in case the dialog somehow got cancelled if self.dialogUp: | 21f5e20bd58ce4382c5cd07c6c089d6e209d3b5a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/21f5e20bd58ce4382c5cd07c6c089d6e209d3b5a/RecurrenceDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
6353,
12,
2890,
4672,
468,
2073,
316,
648,
326,
6176,
28578,
2363,
13927,
309,
365,
18,
12730,
1211,
30,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
6353,
12,
2890,
4672,
468,
2073,
316,
648,
326,
6176,
28578,
2363,
13927,
309,
365,
18,
12730,
1211,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if interval == 2: ret = location and BTL_TITLE or BT_TITLE | if single: if interval == 2: ret = location and BTLX_TITLE or BTX_TITLE else: ret = location and WTLX_TITLE or WTX_TITLE | def buildItemDescription(mailStamp): #XXX Post Preview I will clean up # this logic since there are more # efficient ways to get the # item description strings. # Most likely will use a dict # instead of Globals for localizable strings # then build the key dynamically based on # recurrence frequency / interval and whether # the Event has a location and a recurrence # end date item = mailStamp.itsItem view = item.itsView isEvent = has_stamp(item, EventStamp) if isEvent: event = EventStamp(item) master = event.getMaster() recur = getattr(event, 'rruleset', None) noTime = event.allDay or event.anyTime location = getattr(event, 'location', u'') if location: location = location.displayName.strip() startDate, startTime = formatDateAndTime(view, event.startTime) endDate, endTime = formatDateAndTime(view, event.endTime) if getattr(event.startTime, "tzinfo", None) == view.tzinfo.floating: timezone = u"" else: timezone = getTimeZoneCode(view, event.startTime) if startDate == endDate: # The Event starts and ends on the same day endDate = None args = {'title': item.displayName, 'startTime': startTime, 'startDate': startDate, 'endTime': endTime, 'endDate': endDate, 'location': location, 'timezone': timezone, } if recur: args['masterStartDate'], args['masterStartTime'] = \ formatDateAndTime(view, master.startTime) args['masterEndDate'], args['masterEndTime'] = \ formatDateAndTime(view, master.endTime) args['masterTimeZone'] = getTimeZoneCode(view, master.startTime) if recur.isComplex(): if noTime: if endDate: return (location and CLD_TITLE or CD_TITLE) % args else: return (location and CL_TITLE or C_TITLE) % args if endDate: return (location and CLSD_TITLE or CLD_TITLE) % args else: return (location and CLS_TITLE or CL_TITLE) % args rule = recur.rrules.first() freq = rule.freq interval = rule.interval until = rule.calculatedUntil() args['recurrenceEndDate'] = until and formatDateAndTime(view, until)[0] or u'' ret = None if freq == "daily": if noTime: if until: ret = location and DUL_TITLE or DU_TITLE else: ret = location and DL_TITLE or D_TITLE else: if until: ret = location and DTUL_TITLE or DTU_TITLE else: ret = location and DTL_TITLE or DT_TITLE elif freq == "weekly": args['dayName'] = weekdayName(event.startTime) if noTime: if until: if interval == 2: ret = location and BUL_TITLE or BU_TITLE else: ret = location and WUL_TITLE or WU_TITLE else: if interval == 2: ret = location and BL_TITLE or B_TITLE else: ret = location and WL_TITLE or W_TITLE else: if until: if interval == 2: ret = location and BTUL_TITLE or BTU_TITLE else: ret = location and WTUL_TITLE or WTU_TITLE else: if interval == 2: ret = location and BTL_TITLE or BT_TITLE else: ret = location and WTL_TITLE or WT_TITLE elif freq == "monthly": num = int(PyICU.SimpleDateFormat(_(u"dd")).format(event.startTime)) args['abbreviation'] = PyICU.ChoiceFormat(DAY_OF_MONTH).format(num) args['dayOfMonth'] = num if noTime: if until: ret = location and MUL_TITLE or MU_TITLE else: ret = location and ML_TITLE or M_TITLE else: if until: ret = location and MTUL_TITLE or MTU_TITLE else: ret = location and MTL_TITLE or MT_TITLE elif freq == "yearly": if noTime: if until: ret = location and YUL_TITLE or YU_TITLE else: ret = location and YL_TITLE or Y_TITLE else: if until: if endDate: ret = location and YTULD_TITLE or YTUD_TITLE else: ret = location and YTUL_TITLE or YTU_TITLE else: if endDate: ret = location and YTLD_TITLE or YTD_TITLE else: ret = location and YTL_TITLE or YT_TITLE return ret % args if noTime: if endDate: return (location and ALD_TITLE or AD_TITLE) % args else: return (location and AL_TITLE or A_TITLE) % args else: if endDate: return (location and ELD_TITLE or ED_TITLE) % args else: return (location and EL_TITLE or E_TITLE) % args return item.displayName | 3ba7c328b2c98e3845fdea7a2d9641207c27c23a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/3ba7c328b2c98e3845fdea7a2d9641207c27c23a/mail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
1180,
3291,
12,
4408,
8860,
4672,
468,
15639,
5616,
22289,
467,
903,
2721,
731,
468,
333,
4058,
3241,
1915,
854,
1898,
468,
14382,
16226,
358,
336,
326,
468,
761,
2477,
2064,
18,
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,
1361,
1180,
3291,
12,
4408,
8860,
4672,
468,
15639,
5616,
22289,
467,
903,
2721,
731,
468,
333,
4058,
3241,
1915,
854,
1898,
468,
14382,
16226,
358,
336,
326,
468,
761,
2477,
2064,
18,
4... |
if opts.remove: dists = resolve(req_string, local, recur=not opts.no_deps, verbose=opts.verbose) for dist in dists: egg_r = filename_dist(dist) pprint_fn_action(egg_r, 'removing') egginst.EggInst(egg_r, opts.verbose).remove() return | def main(): from optparse import OptionParser p = OptionParser( usage="usage: %prog [options] [name] [version]", prog=basename(sys.argv[0]), description=("download and install eggs ...")) p.add_option("--config", action="store_true", default=False, help="display the configuration and exit") p.add_option('-f', "--force", action="store_true", default=False, help="force download and install") p.add_option('-l', "--list", action="store_true", default=False, help="list the packages currently installed on the system") p.add_option('-N', "--no-deps", action="store_true", default=False, help="don't download (or install) dependencies") p.add_option("--remove", action="store_true", default=False, help="remove tha package, and its dependencies (!) " "from the system") p.add_option('-s', "--search", action="store", default=None, help="search the index in the repo (chain) of packages " "and display versions available. Type '-s ?' to " "display available versions for all packages.", metavar='STR') p.add_option("--test", action="store_true", default=False, help="perform some internal tests (for development only)") p.add_option('-v', "--verbose", action="store_true", default=False) p.add_option('--version', action="store_true", default=False) opts, args = p.parse_args() args_n = len(args) if args_n > 0 and (opts.list or opts.config): p.error("Option takes no arguments") if opts.version: from enstaller import __version__ print "Enstaller version:", __version__ return if opts.config: cfg_path = config.get_path() print "config file:", cfg_path if cfg_path: configure(verbose=True) return if opts.list: egginst.print_active() return local, repos = configure(opts.verbose) if opts.search: print_repo(repos=repos, rx=opts.search) return if opts.test: c = Chain(local, repos, opts.verbose) c.test() return if args_n == 0: p.error("Requirement, i.e. name and optional version missing") if args_n > 2: p.error("A requirement is a name and an optional version") req_string = ' '.join(args) check_write() if opts.remove: dists = resolve(req_string, local, recur=not opts.no_deps, verbose=opts.verbose) # FIXME: # On a fresh EPD install this fails because there are no eggs # in the local repo yet, and resolve returns None. # A fix would be to add the ability to "index" the installed, # by reading the spec files in EGG-INFO in stead of the local # repo (which might not exist yet). for dist in dists: egg_r = filename_dist(dist) pprint_fn_action(egg_r, 'removing') egginst.EggInst(egg_r, opts.verbose).remove() return # 'active' is a list of the egg names which are currently active. active = ['%s.egg' % s for s in egginst.get_active()] dists = resolve(req_string, local, repos, recur=not opts.no_deps, fetch=True, fetch_force=opts.force, fetch_exclude=[] if opts.force else active, verbose=opts.verbose) if dists is None: print "No distribution found." print_versions(repos=repos, name=req_string.split()[0]) return remove = [] for dist in dists: egg_name = filename_dist(dist) if egg_name in active: continue cname = cname_eggname(egg_name) for egg_a in active: if cname == cname_eggname(egg_a): remove.append(egg_a) install = [] for dist in dists: egg_name = filename_dist(dist) if egg_name not in active: install.append(egg_name) if opts.verbose: print "These packages will be removed:" for egg_r in remove: print '\t' + egg_r[:-4] print print "These packages will be installed:" for egg_i in install: print '\t' + egg_i[:-4] print print 77 * '=' for egg_r in remove: pprint_fn_action(egg_r, 'removing') egginst.EggInst(egg_r, opts.verbose).remove() for dist in dists: egg_name = filename_dist(dist) if opts.force or egg_name in install: pprint_fn_action(egg_name, 'installing') egg_path = join(local, egg_name) egginst.EggInst(egg_path, opts.verbose).install() else: pprint_fn_action(egg_name, 'already active') if egg_name not in active: print "Hmm, %s not active" % egg_name | 057a7f6c654ebb289297bbaad7f248f13ca61002 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7707/057a7f6c654ebb289297bbaad7f248f13ca61002/enpkg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
628,
2153,
2670,
1930,
18862,
225,
293,
273,
18862,
12,
4084,
1546,
9167,
30,
738,
14654,
306,
2116,
65,
306,
529,
65,
306,
1589,
65,
3113,
11243,
33,
13909,
12,
9499,
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,
2774,
13332,
628,
2153,
2670,
1930,
18862,
225,
293,
273,
18862,
12,
4084,
1546,
9167,
30,
738,
14654,
306,
2116,
65,
306,
529,
65,
306,
1589,
65,
3113,
11243,
33,
13909,
12,
9499,
18,
... | |
return render(template_name, { | return render('authopenid/associate.html', { | def associate(request, template_name='authopenid/associate.html', openid_form=AssociateOpenID, redirect_field_name='/', on_failure=associate_failure, extra_context=None): nb_associated_openids, associated_openids = get_associate_openid(request.user) redirect_to = request.REQUEST.get(redirect_field_name, '') if request.POST: if 'a_openids' in request.POST.keys(): a_openids = [] if request.POST.get('a_openids','') is not '': a_openids = request.POST.getlist('a_openids') if len(a_openids) == nb_associated_openids and not request.user.has_usable_password(): if len(a_openids) > 1: msg = ["You can't remove these openids, You should set a password first."] else: msg = ["You can't remove this openid, You should set a password first."] return render(template_name, { redirect_field_name: redirect_to, 'associated_openids' : associated_openids, 'nb_associated_openids' : nb_associated_openids, 'msg':msg, }, context_instance=_build_context(request, extra_context=extra_context)) return render_to_response("authopenid/dissociate.html",{ 'a_openids' : a_openids }, context_instance = RequestContext(request) ) else: form = openid_form(request.user, data=request.POST) if form.is_valid(): if ' ' in form.cleaned_data['openid_url'] or form.cleaned_data['openid_url'] in OPENID_PROVIDER: msg = ['You must enter a valid OpenID url'] return render(template_name, { redirect_field_name: redirect_to, 'associated_openids' : associated_openids, 'nb_associated_openids' : nb_associated_openids, 'msg':msg, }, context_instance=_build_context(request, extra_context=extra_context)) if not redirect_to or '//' in redirect_to or ' ' in redirect_to: redirect_to = settings.LOGIN_REDIRECT_URL redirect_url = "%s%s?%s" % ( get_url_host(request), reverse('user_complete_myassociate'), urllib.urlencode({ redirect_field_name: redirect_to }) ) return ask_openid(request, form.cleaned_data['openid_url'], redirect_url, on_failure=on_failure) else: msg = ['You must enter a valid OpenID url'] return render(template_name, { redirect_field_name: redirect_to, 'associated_openids' : associated_openids, 'nb_associated_openids' : nb_associated_openids, 'msg':msg, }, context_instance=_build_context(request, extra_context=extra_context)) else: form = openid_form(request.user) msg = request.user.get_and_delete_messages() return render(template_name, { 'form': form, redirect_field_name: redirect_to, 'associated_openids' : associated_openids, 'nb_associated_openids' : nb_associated_openids, 'msg':msg, }, context_instance=_build_context(request, extra_context=extra_context)) | 281883f9c8e64cdb7ec8da00caea543243a2272d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11208/281883f9c8e64cdb7ec8da00caea543243a2272d/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13251,
12,
2293,
16,
1542,
67,
529,
2218,
1944,
20619,
19,
11577,
18,
2620,
2187,
21629,
67,
687,
33,
23880,
22414,
16,
3136,
67,
1518,
67,
529,
2218,
19,
2187,
603,
67,
12251,
33,
115... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13251,
12,
2293,
16,
1542,
67,
529,
2218,
1944,
20619,
19,
11577,
18,
2620,
2187,
21629,
67,
687,
33,
23880,
22414,
16,
3136,
67,
1518,
67,
529,
2218,
19,
2187,
603,
67,
12251,
33,
115... |
b.pack(side = LEFT) | b.pack(side=LEFT) | def build_toolbar(self): tbar = self.tbar canvas = self.canvas commands = self.commands label = TLabel(tbar, image = "toolbar_left") label.pack(side = LEFT) | 5bd05aab08ecc99debb8be46af1003105e4183ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3123/5bd05aab08ecc99debb8be46af1003105e4183ab/mainwindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
18849,
12,
2890,
4672,
268,
3215,
273,
365,
18,
88,
3215,
5953,
273,
365,
18,
15424,
4364,
273,
365,
18,
7847,
225,
1433,
273,
399,
2224,
12,
88,
3215,
16,
1316,
273,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
18849,
12,
2890,
4672,
268,
3215,
273,
365,
18,
88,
3215,
5953,
273,
365,
18,
15424,
4364,
273,
365,
18,
7847,
225,
1433,
273,
399,
2224,
12,
88,
3215,
16,
1316,
273,
315,
... |
if self.thumbnail_size: self._file.seek(self.thumbail_pos) print hex(self._file.tell()) return self._file.read(self.thumbnail_size) | size = self.thumbnail_size if size: self._file.seek(self.thumbnail_pos) return self._file.read(size) | def fget(self): if self.thumbnail_size: self._file.seek(self.thumbail_pos) print hex(self._file.tell()) return self._file.read(self.thumbnail_size) | 391ab780b30a662203a58b109a20b6a93ca1dda5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9125/391ab780b30a662203a58b109a20b6a93ca1dda5/meta.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
588,
12,
2890,
4672,
309,
365,
18,
14904,
67,
1467,
30,
365,
6315,
768,
18,
16508,
12,
2890,
18,
21639,
671,
67,
917,
13,
1172,
3827,
12,
2890,
6315,
768,
18,
88,
1165,
10756,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
588,
12,
2890,
4672,
309,
365,
18,
14904,
67,
1467,
30,
365,
6315,
768,
18,
16508,
12,
2890,
18,
21639,
671,
67,
917,
13,
1172,
3827,
12,
2890,
6315,
768,
18,
88,
1165,
10756,
3... |
if self.matrix.dim * max(int(self.CellWidth), int(self.getCellHeight())) > 32767: | if self.matrix.dim * max(int(self.CellWidth), int(self.CellHeight)) > 32767: | def drawDistanceMap(self): if not self.matrix: return | 9dec2648a439fbcedb4a6e19f89488c157b33964 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/9dec2648a439fbcedb4a6e19f89488c157b33964/OWDistanceMap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
7200,
863,
12,
2890,
4672,
309,
486,
365,
18,
5667,
30,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
7200,
863,
12,
2890,
4672,
309,
486,
365,
18,
5667,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
myjob = job(control, options) | myjob = job(control=control, drop_caches=drop_caches, options=options) | def runjob(control, options): """ Run a job using the given control file. This is the main interface to this module. @see base_job.__init__ for parameter info. """ control = os.path.abspath(control) state = control + '.state' # Ensure state file is cleaned up before the job starts to run if autotest # is not running with the --continue flag if not options.cont and os.path.isfile(state): logging.debug('Cleaning up previously found state file') os.remove(state) # instantiate the job object ready for the control file. myjob = None try: # Check that the control file is valid if not os.path.exists(control): raise error.JobError(control + ": control file not found") # When continuing, the job is complete when there is no # state file, ensure we don't try and continue. if options.cont and not os.path.exists(state): raise error.JobComplete("all done") myjob = job(control, options) # Load in the users control file, may do any one of: # 1) execute in toto # 2) define steps, and select the first via next_step() myjob.step_engine() except error.JobContinue: sys.exit(5) except error.JobComplete: sys.exit(1) except error.JobError, instance: logging.error("JOB ERROR: " + instance.args[0]) if myjob: command = None if len(instance.args) > 1: command = instance.args[1] myjob.record('ABORT', None, command, instance.args[0]) myjob._decrement_group_level() myjob.record('END ABORT', None, None, instance.args[0]) assert (myjob._group_level == 0), ('myjob._group_level must be 0,' ' not %d' % myjob._group_level) myjob.complete(1) else: sys.exit(1) except Exception, e: # NOTE: job._run_step_fn and job.step_engine will turn things into # a JobError for us. If we get here, its likely an autotest bug. msg = str(e) + '\n' + traceback.format_exc() logging.critical("JOB ERROR (autotest bug?): " + msg) if myjob: myjob._decrement_group_level() myjob.record('END ABORT', None, None, msg) assert(myjob._group_level == 0) myjob.complete(1) else: sys.exit(1) # If we get here, then we assume the job is complete and good. myjob._decrement_group_level() myjob.record('END GOOD', None, None) assert(myjob._group_level == 0) myjob.complete(0) | 8007ec50436f8300538042afe9f34896f4b0f79e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12268/8007ec50436f8300538042afe9f34896f4b0f79e/job.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
4688,
12,
7098,
16,
702,
4672,
3536,
1939,
279,
1719,
1450,
326,
864,
3325,
585,
18,
225,
1220,
353,
326,
2774,
1560,
358,
333,
1605,
18,
225,
632,
5946,
1026,
67,
4688,
16186,
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,
1086,
4688,
12,
7098,
16,
702,
4672,
3536,
1939,
279,
1719,
1450,
326,
864,
3325,
585,
18,
225,
1220,
353,
326,
2774,
1560,
358,
333,
1605,
18,
225,
632,
5946,
1026,
67,
4688,
16186,
2... |
graphicsdirs = self.config[graphicsDirectories[graphic_type]] | def processMythTvMetaData(self): '''Check each video file in the mythvideo directories download graphics files and meta data then update MythTV data base meta data with any new information. ''' # If there were directories specified move them and update the MythTV db meta data accordingly if self.config['video_dir']: if len(self.config['video_dir']) % 2 == 0: validFiles = self._moveVideoFiles(self.config['video_dir']) else: sys.stderr.write(u"\n! Error: When specifying target (file or directory) to move to a destination (directory) they must always be in pairs (target and destination directory).\nYou specified an uneven number of variables (%d) for target and destination pairs.\nVariable count (%s)\n" % (len(self.config['video_dir']), self.config['video_dir'])) sys.exit(False) | 6089d4d60f2dab84c6af9981c242684b162de38e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/6089d4d60f2dab84c6af9981c242684b162de38e/jamu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12062,
451,
56,
90,
6998,
12,
2890,
4672,
9163,
1564,
1517,
6191,
585,
316,
326,
3399,
451,
9115,
6402,
4224,
17313,
1390,
471,
2191,
501,
1508,
1089,
8005,
451,
15579,
501,
1026,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12062,
451,
56,
90,
6998,
12,
2890,
4672,
9163,
1564,
1517,
6191,
585,
316,
326,
3399,
451,
9115,
6402,
4224,
17313,
1390,
471,
2191,
501,
1508,
1089,
8005,
451,
15579,
501,
1026,
... | |
a = ByteArraySubclass(b"abcd") | a = self.subclass2test(b"abcd") | def test_copy(self): a = ByteArraySubclass(b"abcd") a.x = 10 a.y = ByteArraySubclass(b"efgh") for copy_method in (copy.copy, copy.deepcopy): b = copy_method(a) self.assertNotEqual(id(a), id(b)) self.assertEqual(a, b) self.assertEqual(a.x, b.x) self.assertEqual(a.y, b.y) self.assertEqual(type(a), type(b)) self.assertEqual(type(a.y), type(b.y)) | ba7cec6a9528c9fadb893e08b3ba866089442024 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/ba7cec6a9528c9fadb893e08b3ba866089442024/test_bytes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3530,
12,
2890,
4672,
279,
273,
365,
18,
10678,
22,
3813,
12,
70,
6,
378,
4315,
7923,
279,
18,
92,
273,
1728,
279,
18,
93,
273,
7964,
1676,
1106,
12,
70,
6,
73,
2137,
76,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3530,
12,
2890,
4672,
279,
273,
365,
18,
10678,
22,
3813,
12,
70,
6,
378,
4315,
7923,
279,
18,
92,
273,
1728,
279,
18,
93,
273,
7964,
1676,
1106,
12,
70,
6,
73,
2137,
76,... |
def __init__(self, host, debugfunc=None): | def __init__(self, host, debug=0): self.debug = debug | def __init__(self, host, debugfunc=None): if isinstance(host, tuple): host, self.weight = host else: self.weight = 1 | c1f57dc0d6776179be4c67d4a50f56eee80e6408 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11935/c1f57dc0d6776179be4c67d4a50f56eee80e6408/memcache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
16,
1198,
33,
20,
4672,
365,
18,
4148,
273,
1198,
309,
1549,
12,
2564,
16,
3193,
4672,
1479,
16,
365,
18,
4865,
273,
1479,
469,
30,
365,
18,
4865... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1479,
16,
1198,
33,
20,
4672,
365,
18,
4148,
273,
1198,
309,
1549,
12,
2564,
16,
3193,
4672,
1479,
16,
365,
18,
4865,
273,
1479,
469,
30,
365,
18,
4865... |
print "\t\t | print >> stream, "\t\t | def WriteClassBody(self, generator): # Write in alpha order. names = self.mapFuncs.keys() names.sort() specialItems = {"count":None, "item":None,"value":None,"_newenum":None} # If found, will end up with (entry, invoke_tupe) itemCount = None for name in names: entry=self.mapFuncs[name] # skip [restricted] methods, unless it is the # enumerator (which, being part of the "system", # we know about and can use) dispid = entry.desc[0] if entry.desc[9] & pythoncom.FUNCFLAG_FRESTRICTED and \ dispid != pythoncom.DISPID_NEWENUM: continue # If not accessible via IDispatch, then we can't use it here. if entry.desc[3] != pythoncom.FUNC_DISPATCH: continue if dispid==pythoncom.DISPID_VALUE: lkey = "value" elif dispid==pythoncom.DISPID_NEWENUM: specialItems["_newenum"] = (entry, entry.desc[4], None) continue # Dont build this one now! else: lkey = string.lower(name) if specialItems.has_key(lkey) and specialItems[lkey] is None: # remember if a special one. specialItems[lkey] = (entry, entry.desc[4], None) if generator.bBuildHidden or not entry.hidden: if entry.GetResultName(): print '\t# Result is of type ' + entry.GetResultName() if entry.wasProperty: print '\t# The method %s is actually a property, but must be used as a method to correctly pass the arguments' % name ret = self.MakeFuncMethod(entry,build.MakePublicAttributeName(name)) for line in ret: print line print "\t_prop_map_get_ = {" names = self.propMap.keys(); names.sort() for key in names: entry = self.propMap[key] if generator.bBuildHidden or not entry.hidden: resultName = entry.GetResultName() if resultName: print "\t\t# Property '%s' is an object of type '%s'" % (key, resultName) lkey = string.lower(key) details = entry.desc resultDesc = details[2] argDesc = () mapEntry = MakeMapLineEntry(details[0], pythoncom.DISPATCH_PROPERTYGET, resultDesc, argDesc, key, entry.GetResultCLSIDStr()) if entry.desc[0]==pythoncom.DISPID_VALUE: lkey = "value" elif entry.desc[0]==pythoncom.DISPID_NEWENUM: lkey = "_newenum" else: lkey = string.lower(key) if specialItems.has_key(lkey) and specialItems[lkey] is None: # remember if a special one. specialItems[lkey] = (entry, pythoncom.DISPATCH_PROPERTYGET, mapEntry) # All special methods, except _newenum, are written # "normally". This is a mess! if entry.desc[0]==pythoncom.DISPID_NEWENUM: continue | d465d55b4c2e9a03e3b613dd6344bf0290ff0ff6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/677/d465d55b4c2e9a03e3b613dd6344bf0290ff0ff6/genpy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
797,
2250,
12,
2890,
16,
4456,
4672,
468,
2598,
316,
4190,
1353,
18,
1257,
273,
365,
18,
1458,
10928,
18,
2452,
1435,
1257,
18,
3804,
1435,
4582,
3126,
273,
12528,
1883,
6877,
7036... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
797,
2250,
12,
2890,
16,
4456,
4672,
468,
2598,
316,
4190,
1353,
18,
1257,
273,
365,
18,
1458,
10928,
18,
2452,
1435,
1257,
18,
3804,
1435,
4582,
3126,
273,
12528,
1883,
6877,
7036... |
\sum_i {u_i-v_i}. | \sum_i {(u_i-v_i)}. | def cityblock(u, v): r""" Computes the Manhattan distance between two n-vectors u and v, which is defined as .. math:: \sum_i {u_i-v_i}. :Parameters: u : ndarray An :math:`n`-dimensional vector. v : ndarray An :math:`n`-dimensional vector. :Returns: d : double The City Block distance between vectors ``u`` and ``v``. """ u = np.asarray(u, order='c') v = np.asarray(v, order='c') return abs(u-v).sum() | dcffe95513dbb5a464da95e7b7240d3d4fbb8311 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12971/dcffe95513dbb5a464da95e7b7240d3d4fbb8311/distance.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12797,
2629,
12,
89,
16,
331,
4672,
436,
8395,
14169,
281,
326,
8660,
76,
4558,
304,
3888,
3086,
2795,
290,
17,
18535,
582,
471,
331,
16,
1492,
353,
2553,
487,
225,
6116,
4233,
2866,
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,
12797,
2629,
12,
89,
16,
331,
4672,
436,
8395,
14169,
281,
326,
8660,
76,
4558,
304,
3888,
3086,
2795,
290,
17,
18535,
582,
471,
331,
16,
1492,
353,
2553,
487,
225,
6116,
4233,
2866,
2... |
if is_new: self.rows += 1 | self.rows += 1 | def buildNodeList(self, parent, list, columns=0): for node in list: if isinstance(node, dict): for key in node.keys(): screennode, is_new = self.getScreenNode(key, (columns, self.rows)) | 5ace3feadd4a69cf867dd92e6776e730e71edd1b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/81/5ace3feadd4a69cf867dd92e6776e730e71edd1b/blockdiag.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
19914,
12,
2890,
16,
982,
16,
666,
16,
2168,
33,
20,
4672,
364,
756,
316,
666,
30,
309,
1549,
12,
2159,
16,
2065,
4672,
364,
498,
316,
756,
18,
2452,
13332,
5518,
2159,
16,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19914,
12,
2890,
16,
982,
16,
666,
16,
2168,
33,
20,
4672,
364,
756,
316,
666,
30,
309,
1549,
12,
2159,
16,
2065,
4672,
364,
498,
316,
756,
18,
2452,
13332,
5518,
2159,
16,
353... |
async_request(worksheet_command('eval'), generic_callback, "save_only=1&id="+id+"&input="+cell.value); | async_request(worksheet_command('eval'), generic_callback, "save_only=1&id="+id+"&input="+escape0(cell.value)); | def notebook_lib(): s= r""" | 752c459585221f51fce0695a3ce16d91fcd570fc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/752c459585221f51fce0695a3ce16d91fcd570fc/js.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14718,
67,
2941,
13332,
272,
33,
436,
8395,
225,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14718,
67,
2941,
13332,
272,
33,
436,
8395,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
return | def mpd_prev(self, _widget, _key=None): if self.conn: mpdh.call(self.client, 'previous') self.iterate_now() return | ad04d897e11f8bcb58bfe956cb0cedf748de7d52 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2312/ad04d897e11f8bcb58bfe956cb0cedf748de7d52/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6749,
72,
67,
10001,
12,
2890,
16,
389,
6587,
16,
389,
856,
33,
7036,
4672,
309,
365,
18,
4646,
30,
6749,
19153,
18,
1991,
12,
2890,
18,
2625,
16,
296,
11515,
6134,
365,
18,
18793,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6749,
72,
67,
10001,
12,
2890,
16,
389,
6587,
16,
389,
856,
33,
7036,
4672,
309,
365,
18,
4646,
30,
6749,
19153,
18,
1991,
12,
2890,
18,
2625,
16,
296,
11515,
6134,
365,
18,
18793,
6... | |
if opt in ( '-p', '--httpport' ): try: httpPort = int( opt_value ) except: print >>sys.stderr, 'Error: HTTP port is not valid' usage( ) sys.exit( ) | if opt in ( '-p', '--httpport' ): try: httpPort = int( opt_value ) except: print >>sys.stderr, 'Error: HTTP port is not valid' usage( ) sys.exit( ) | def main( ): httpPort = gHttpPort httpDir = gHttpDir logFile = gLogFile user = gUser group = gGroup doFork = 'true' shortOpts = 'd:p:l:u:g:fh' longOpts = [ 'httpdir=', 'httpport=', 'logfile=', 'user=', 'group=', 'help' ] try: opts, args = getopt.getopt( sys.argv[1:], shortOpts, longOpts ) except getopt.GetoptError, e: print >>sys.stderr, e usage( ) sys.exit( ) if len( args ) != 0: print >>sys.stderr, 'Error: command arguments are not supported' usage( ) sys.exit( ) for opt, opt_value in opts: if opt in ( '-h', '--help' ): usage( ) sys.exit( ) if opt in ( '-d', '--httpdir' ): httpDir = opt_value if opt in ( '-p', '--httpport' ): try: httpPort = int( opt_value ) except: print >>sys.stderr, 'Error: HTTP port is not valid' usage( ) sys.exit( ) if opt in ( '-l', '--logfile' ): logFile = opt_value if opt in ( '-u', '--user' ): user = opt_value if opt in ( '-g', '--group' ): group = opt_value if opt in ( '-f' ): doFork = 'false' pid = daemonize( httpDir, logFile, user, group, doFork ) if pid > 0: sys.exit( ) runServer( httpPort ) | d4cc2d1599d12bc73db5aa9e3c513fd4c1e1f939 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6195/d4cc2d1599d12bc73db5aa9e3c513fd4c1e1f939/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
262,
30,
1062,
2617,
273,
314,
2940,
2617,
1062,
1621,
225,
273,
314,
2940,
1621,
20169,
225,
273,
314,
19103,
729,
377,
273,
314,
1299,
1041,
565,
273,
314,
1114,
741,
22662,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
262,
30,
1062,
2617,
273,
314,
2940,
2617,
1062,
1621,
225,
273,
314,
2940,
1621,
20169,
225,
273,
314,
19103,
729,
377,
273,
314,
1299,
1041,
565,
273,
314,
1114,
741,
22662,
... |
parentalControl = ParentalControl() | def open(self): self.openListFromFile(LIST_BLACKLIST) self.openListFromFile(LIST_WHITELIST) | bc87ed9e2cbfa1a5667ac583bdace946ffff9ae0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6652/bc87ed9e2cbfa1a5667ac583bdace946ffff9ae0/ParentalControl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
4672,
365,
18,
3190,
682,
13087,
12,
7085,
67,
14618,
3649,
7085,
13,
365,
18,
3190,
682,
13087,
12,
7085,
67,
16861,
7085,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
4672,
365,
18,
3190,
682,
13087,
12,
7085,
67,
14618,
3649,
7085,
13,
365,
18,
3190,
682,
13087,
12,
7085,
67,
16861,
7085,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
return i("empty","") | return "offline" | def dz_wifi(): r = wifi_online() if r: if r[0]==0: return i("net_wired","green")+"^fg(white) "+r[1] if r[0]==1: return i("wifi_02","green")+"^fg(white) "+r[1] else: return i("empty","") | 169fd09b2ab1c8018989c04654512eea27c5d592 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14278/169fd09b2ab1c8018989c04654512eea27c5d592/statusbar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24855,
67,
91,
704,
13332,
436,
273,
341,
704,
67,
21026,
1435,
309,
436,
30,
309,
436,
63,
20,
65,
631,
20,
30,
327,
277,
2932,
2758,
67,
91,
2921,
15937,
11571,
7923,
9078,
66,
213... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24855,
67,
91,
704,
13332,
436,
273,
341,
704,
67,
21026,
1435,
309,
436,
30,
309,
436,
63,
20,
65,
631,
20,
30,
327,
277,
2932,
2758,
67,
91,
2921,
15937,
11571,
7923,
9078,
66,
213... |
if enum == 1: list = getBlock(linenum,':') print subVars("Text","before",linenum,enum) lines = "" for line in list: if line == "": lines = lines + config.get("Text","paragraph-sep") else: lines = lines + line + config.get("Text","line-sep") v["%%"] = lines print subVars("Text","text",linenum,enum), print subVars("Text","after",linenum,enum) | if enum != 1: return v["%l"] = str(outline[linenum][1]) v["%n"] = str(linenum) v["%c"] = str(enum) list = getBlock(linenum,':') print subVars("Text","before") lines = "" for line in list: if line == "": lines = lines + config.get("Text","paragraph-sep") else: lines = lines + line + config.get("Text","line-sep") v["%%"] = lines print subVars("Text","text"), print subVars("Text","after") | def handleText(linenum,enum): global outline, parents if enum == 1: # since we're working on a block, only execute once list = getBlock(linenum,':') print subVars("Text","before",linenum,enum) lines = "" for line in list: if line == "": lines = lines + config.get("Text","paragraph-sep") else: lines = lines + line + config.get("Text","line-sep") v["%%"] = lines print subVars("Text","text",linenum,enum), print subVars("Text","after",linenum,enum) | 06415efd07e1e7445f08ac0ea608650310478422 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6154/06415efd07e1e7445f08ac0ea608650310478422/otl2tags.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
1528,
12,
7511,
7924,
16,
7924,
4672,
2552,
16363,
16,
6298,
225,
309,
2792,
422,
404,
30,
468,
3241,
732,
4565,
5960,
603,
279,
1203,
16,
1338,
1836,
3647,
666,
273,
11902,
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,
1640,
1528,
12,
7511,
7924,
16,
7924,
4672,
2552,
16363,
16,
6298,
225,
309,
2792,
422,
404,
30,
468,
3241,
732,
4565,
5960,
603,
279,
1203,
16,
1338,
1836,
3647,
666,
273,
11902,
12,
... |
skip("not working yet") | def test_new_exception(self): skip("not working yet") mod = self.import_extension('foo', [ ('newexc', 'METH_VARARGS', ''' char *name = PyString_AsString(PyTuple_GetItem(args, 0)); return PyExc_NewException(name, PyTuple_GetItem(args, 1), PyTuple_GetItem(args, 2)); ''' ), ]) raises(SystemError, mod.newexc, "name", Exception, {}) | 2a29f4ff45abe62070713aa16e15b0ccf6d714a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/2a29f4ff45abe62070713aa16e15b0ccf6d714a2/test_cpyext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2704,
67,
4064,
12,
2890,
4672,
681,
273,
365,
18,
5666,
67,
6447,
2668,
11351,
2187,
306,
7707,
2704,
10075,
2187,
296,
5277,
67,
7716,
22439,
2187,
9163,
1149,
380,
529,
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,
1842,
67,
2704,
67,
4064,
12,
2890,
4672,
681,
273,
365,
18,
5666,
67,
6447,
2668,
11351,
2187,
306,
7707,
2704,
10075,
2187,
296,
5277,
67,
7716,
22439,
2187,
9163,
1149,
380,
529,
273,... | |
self.dbh.execute("""insert into msn_users set inode=%r,packet_id=%r,session_id=%r,nick=%r,user_data_type=%r,user_data=%r""",(self.fd.inode,self.get_packet_id(),self.session_id,words[5],'user_msn_passport',words[5])) self.dbh.execute("""insert into msn_users set inode=%r,packet_id=%r,session_id=%r,nick=%r,user_data_type=%r,user_data=%r""",(self.fd.inode,self.get_packet_id(),self.session_id,words[5],'url_enc_display_name',urllib.unquote(words[6]))) | self.insert_user_data(words[5],'user_msn_passport',words[5]) self.insert_user_data(words[5],'url_enc_display_name',words[6]) | def RNG(self): """ Target is being invited to a new session | cf7fac3ff0c735f3f514d4f41c9e494e2787883c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5568/cf7fac3ff0c735f3f514d4f41c9e494e2787883c/MSN.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
534,
4960,
12,
2890,
4672,
3536,
5916,
353,
3832,
2198,
16261,
358,
279,
394,
1339,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
534,
4960,
12,
2890,
4672,
3536,
5916,
353,
3832,
2198,
16261,
358,
279,
394,
1339,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
def test_it(self): def tr(frame, event, arg): | def trace(self, frame, event, arg): """A trace function that raises an exception in response to a specific trace event.""" if event == self.raiseOnEvent: | def test_it(self): def tr(frame, event, arg): raise ValueError # just something that isn't RuntimeError def f(): return 1 try: for i in xrange(sys.getrecursionlimit() + 1): sys.settrace(tr) try: f() except ValueError: pass else: self.fail("exception not thrown!") except RuntimeError: self.fail("recursion counter not reset") | b40d07afc41f9434816f5c904352a5aa416f9bf6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b40d07afc41f9434816f5c904352a5aa416f9bf6/test_trace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2606,
12,
2890,
16,
2623,
16,
871,
16,
1501,
4672,
3536,
37,
2606,
445,
716,
14183,
392,
1520,
316,
766,
358,
279,
2923,
2606,
871,
12123,
309,
871,
422,
365,
18,
11628,
1398,
1133,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2606,
12,
2890,
16,
2623,
16,
871,
16,
1501,
4672,
3536,
37,
2606,
445,
716,
14183,
392,
1520,
316,
766,
358,
279,
2923,
2606,
871,
12123,
309,
871,
422,
365,
18,
11628,
1398,
1133,
30... |
match = re.match("^ *[0-9]+: cs:([^ ]+).*$", line) | match = re.match("^ *\d+: cs:(\w+).*ds:(\w+)/(\w+).*$", line) | def GetSyncStatus(self): """Returns the sync status of the device. | 583e3f6f78548b8d1aaed3cc0bb95370f5197759 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7542/583e3f6f78548b8d1aaed3cc0bb95370f5197759/bdev.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
4047,
1482,
12,
2890,
4672,
3536,
1356,
326,
3792,
1267,
434,
326,
2346,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
4047,
1482,
12,
2890,
4672,
3536,
1356,
326,
3792,
1267,
434,
326,
2346,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
- quoteChar - string of one or more characters defining the quote delimiting string - escChar - character to escape quotes, typically backslash (default=None) - escQuote - special quote sequence to escape an embedded quote string (such as SQL's "" to escape an embedded ") (default=None) - multiline - boolean indicating whether quotes can span multiple lines (default=False) - unquoteResults - boolean indicating whether the matched text should be unquoted (default=True) - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default=None => same as quoteChar) | - quoteChar - string of one or more characters defining the quote delimiting string - escChar - character to escape quotes, typically backslash (default=None) - escQuote - special quote sequence to escape an embedded quote string (such as SQL's "" to escape an embedded ") (default=None) - multiline - boolean indicating whether quotes can span multiple lines (default=False) - unquoteResults - boolean indicating whether the matched text should be unquoted (default=True) - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default=None => same as quoteChar) | def __init__( self, quoteChar, escChar=None, escQuote=None, multiline=False, unquoteResults=True, endQuoteChar=None): """ Defined with the following parameters: - quoteChar - string of one or more characters defining the quote delimiting string - escChar - character to escape quotes, typically backslash (default=None) - escQuote - special quote sequence to escape an embedded quote string (such as SQL's "" to escape an embedded ") (default=None) - multiline - boolean indicating whether quotes can span multiple lines (default=False) - unquoteResults - boolean indicating whether the matched text should be unquoted (default=True) - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default=None => same as quoteChar) """ super(QuotedString,self).__init__() | c6e5c5fcf7fe09d7390a6d3525397e48c03606ea /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3693/c6e5c5fcf7fe09d7390a6d3525397e48c03606ea/pyparsing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
3862,
2156,
16,
2904,
2156,
33,
7036,
16,
2904,
10257,
33,
7036,
16,
19431,
33,
8381,
16,
25611,
3447,
33,
5510,
16,
679,
10257,
2156,
33,
7036,
4672,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
3862,
2156,
16,
2904,
2156,
33,
7036,
16,
2904,
10257,
33,
7036,
16,
19431,
33,
8381,
16,
25611,
3447,
33,
5510,
16,
679,
10257,
2156,
33,
7036,
4672,
353... |
if (self._checks & DocChecker.AUTHOR) and (not doc.authors()): self._warn('No authors', doc.uid().name()) if (self._checks & DocChecker.VERSION) and (not doc.version()): self._warn('No version', doc.uid().name()) | if self._checks & DocChecker.AUTHOR: for field in doc.fields(): if 'author' in field.tags: continue else: self._warn('No authors', doc.uid().name()) if self._checks & DocChecker.VERSION: for field in doc.fields(): if 'version' in field.tags: continue else: self._warn('No version', doc.uid().name()) | def _check_basic(self, doc): """ Check the description, author, version, and see-also fields of C{doc}. This is used as a helper function by L{_check_module}, L{_check_class}, and L{_check_func}. | 31a49639abf72b18b5c72d645c2a76cbb0c7a4f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/31a49639abf72b18b5c72d645c2a76cbb0c7a4f1/checker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
13240,
12,
2890,
16,
997,
4672,
3536,
2073,
326,
2477,
16,
2869,
16,
1177,
16,
471,
2621,
17,
31144,
1466,
434,
385,
95,
2434,
5496,
225,
1220,
353,
1399,
487,
279,
4222... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
13240,
12,
2890,
16,
997,
4672,
3536,
2073,
326,
2477,
16,
2869,
16,
1177,
16,
471,
2621,
17,
31144,
1466,
434,
385,
95,
2434,
5496,
225,
1220,
353,
1399,
487,
279,
4222... |
ritems=None | ritems = None | def get_users(self,name): if name.find("@")>=0: if self.roster: try: ritems=self.roster.get_items_by_name(name,self.settings["case_sensitive"]) except KeyError: ritems=None if ritems: if len(ritems)==1: return [ritems[0].jid] try: return [pyxmpp.JID(name)] except pyxmpp.JIDError: self.__logger.error(u"Invalid JID: %s" % (name,)) return None | ccaf74aaac293546ae6aab585b071a799026af33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12768/ccaf74aaac293546ae6aab585b071a799026af33/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5577,
12,
2890,
16,
529,
4672,
309,
508,
18,
4720,
2932,
36,
7923,
34,
33,
20,
30,
309,
365,
18,
303,
8190,
30,
775,
30,
436,
3319,
33,
2890,
18,
303,
8190,
18,
588,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5577,
12,
2890,
16,
529,
4672,
309,
508,
18,
4720,
2932,
36,
7923,
34,
33,
20,
30,
309,
365,
18,
303,
8190,
30,
775,
30,
436,
3319,
33,
2890,
18,
303,
8190,
18,
588,
67,
... |
addScriptCode(hf) hf.write("</body>\n</html>\n") | addScriptCode(hf, testruns) hf.write('</body>\n</html>\n') | def createHTML(): global sysvals, data data.normalizeTime() # html function templates headline_stamp = '<div class="stamp">{0} {1} {2} {3}</div>\n' html_zoombox = '<center><button id="zoomin">ZOOM IN</button><button id="zoomout">ZOOM OUT</button><button id="zoomdef">ZOOM 1:1</button></center>\n<div id="dmesgzoombox" class="zoombox">\n' html_timeline = '<div id="{0}" class="timeline" style="height:{1}px">\n' html_device = '<div id="{0}" title="{1}" class="thread" style="left:{2}%;top:{3}%;height:{4}%;width:{5}%;">{6}</div>\n' html_phase = '<div class="phase" style="left:{0}%;width:{1}%;top:{2}%;height:{3}%;background-color:{4}">{5}</div>\n' html_legend = '<div class="square" style="left:{0}%;background-color:{1}"> {2}</div>\n' html_timetotal = '<table class="time1">\n<tr>'\ '<td class="gray">{2} Suspend Time: <b>{0} ms</b></td>'\ '<td class="gray">{2} Resume Time: <b>{1} ms</b></td>'\ '</tr>\n</table>\n' html_timegroups = '<table class="time2">\n<tr>'\ '<td class="green">Kernel Suspend: {0} ms</td>'\ '<td class="purple">Firmware Suspend: {1} ms</td>'\ '<td class="purple">Firmware Resume: {2} ms</td>'\ '<td class="yellow">Kernel Resume: {3} ms</td>'\ '</tr>\n</table>\n' # device timeline (dmesg) if(data.usedmesg): data.vprint("Creating Device Timeline...") devtl = Timeline() # Generate the header for this timeline t0 = data.start tMax = data.end tTotal = tMax - t0 if(tTotal == 0): print("ERROR: No timeline data") sys.exit() suspend_time = "%.0f"%(-data.start*1000) resume_time = "%.0f"%(data.end*1000) if data.fwValid: devtl.html['timeline'] = html_timetotal.format(suspend_time, resume_time, "Total") sktime = "%.3f"%((data.dmesg['suspend_cpu']['end'] - data.dmesg['suspend_general']['start'])*1000) sftime = "%.3f"%(data.fwSuspend / 1000000.0) rftime = "%.3f"%(data.fwResume / 1000000.0) rktime = "%.3f"%((data.dmesg['resume_general']['end'] - data.dmesg['resume_cpu']['start'])*1000) devtl.html['timeline'] += html_timegroups.format(sktime, sftime, rftime, rktime) else: devtl.html['timeline'] = html_timetotal.format(suspend_time, resume_time, "Kernel") # determine the maximum number of rows we need to draw timelinerows = 0 for phase in data.dmesg: list = data.dmesg[phase]['list'] rows = setTimelineRows(list, list) data.dmesg[phase]['row'] = rows if(rows > timelinerows): timelinerows = rows # calculate the timeline height and create its bounding box devtl.setRows(timelinerows + 1) devtl.html['timeline'] += html_zoombox; devtl.html['timeline'] += html_timeline.format("dmesg", devtl.height); # draw the colored boxes for each of the phases for b in data.dmesg: phase = data.dmesg[b] left = "%.3f" % (((phase['start']-data.start)*100)/tTotal) width = "%.3f" % (((phase['end']-phase['start'])*100)/tTotal) devtl.html['timeline'] += html_phase.format(left, width, "%.3f"%devtl.scaleH, "%.3f"%(100-devtl.scaleH), data.dmesg[b]['color'], "") # draw the time scale, try to make the number of labels readable devtl.html['scale'] = createTimeScale(t0, tMax, data.tSuspended) devtl.html['timeline'] += devtl.html['scale'] for b in data.dmesg: phaselist = data.dmesg[b]['list'] for d in phaselist: name = d if(d in data.altdevname): name = data.altdevname[d] dev = phaselist[d] height = (100.0 - devtl.scaleH)/data.dmesg[b]['row'] top = "%.3f" % ((dev['row']*height) + devtl.scaleH) left = "%.3f" % (((dev['start']-data.start)*100)/tTotal) width = "%.3f" % (((dev['end']-dev['start'])*100)/tTotal) len = " (%0.3f ms) " % ((dev['end']-dev['start'])*1000) color = "rgba(204,204,204,0.5)" devtl.html['timeline'] += html_device.format(dev['id'], name+len+b, left, top, "%.3f"%height, width, name) # timeline is finished devtl.html['timeline'] += "</div>\n</div>\n" # draw a legend which describes the phases by color devtl.html['legend'] = "<div class=\"legend\">\n" pdelta = 100.0/data.phases.__len__() pmargin = pdelta / 4.0 for phase in data.phases: order = "%.2f" % ((data.dmesg[phase]['order'] * pdelta) + pmargin) name = string.replace(phase, "_", " ") devtl.html['legend'] += html_legend.format(order, data.dmesg[phase]['color'], name) devtl.html['legend'] += "</div>\n" hf = open(sysvals.htmlfile, 'w') thread_height = 0 # write the html header first (html head, css code, everything up to the start of body) html_header = "<!DOCTYPE html>\n<html>\n<head>\n\ <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n\ <title>AnalyzeSuspend</title>\n\ <style type='text/css'>\n\ body {overflow-y: scroll;}\n\ .stamp {width: 100%;text-align:center;background-color:gray;line-height:30px;color:white;font: 25px Arial;}\n\ .callgraph {margin-top: 30px;box-shadow: 5px 5px 20px black;}\n\ .callgraph article * {padding-left: 28px;}\n\ h1 {color:black;font: bold 30px Times;}\n\ table {width:100%;}\n\ .gray {background-color:rgba(80,80,80,0.1);}\n\ .green {background-color:rgba(204,255,204,0.4);}\n\ .purple {background-color:rgba(128,0,128,0.2);}\n\ .yellow {background-color:rgba(255,255,204,0.4);}\n\ .time1 {font: 22px Arial;border:1px solid;}\n\ .time2 {font: 15px Arial;border-bottom:1px solid;border-left:1px solid;border-right:1px solid;}\n\ td {text-align: center;}\n\ .tdhl {color: red;}\n\ .hide {display: none;}\n\ .pf {display: none;}\n\ .pf:checked + label {background: url(\'data:image/svg+xml;utf,<?xml version=\"1.0\" standalone=\"no\"?><svg xmlns=\"http://www.w3.org/2000/svg\" height=\"18\" width=\"18\" version=\"1.1\"><circle cx=\"9\" cy=\"9\" r=\"8\" stroke=\"black\" stroke-width=\"1\" fill=\"white\"/><rect x=\"4\" y=\"8\" width=\"10\" height=\"2\" style=\"fill:black;stroke-width:0\"/><rect x=\"8\" y=\"4\" width=\"2\" height=\"10\" style=\"fill:black;stroke-width:0\"/></svg>\') no-repeat left center;}\n\ .pf:not(:checked) ~ label {background: url(\'data:image/svg+xml;utf,<?xml version=\"1.0\" standalone=\"no\"?><svg xmlns=\"http://www.w3.org/2000/svg\" height=\"18\" width=\"18\" version=\"1.1\"><circle cx=\"9\" cy=\"9\" r=\"8\" stroke=\"black\" stroke-width=\"1\" fill=\"white\"/><rect x=\"4\" y=\"8\" width=\"10\" height=\"2\" style=\"fill:black;stroke-width:0\"/></svg>\') no-repeat left center;}\n\ .pf:checked ~ *:not(:nth-child(2)) {display: none;}\n\ .zoombox {position: relative; width: 100%; overflow-x: scroll;}\n\ .timeline {position: relative; font-size: 14px;cursor: pointer;width: 100%; overflow: hidden; background-color:#dddddd;}\n\ .thread {position: absolute; height: "+"%.3f"%thread_height+"%; overflow: hidden; line-height: 30px; border:1px solid;text-align:center;white-space:nowrap;background-color:rgba(204,204,204,0.5);}\n\ .thread:hover {background-color:white;border:1px solid red;z-index:10;}\n\ .phase {position: absolute;overflow: hidden;border:0px;text-align:center;}\n\ .t {position: absolute; top: 0%; height: 100%; border-right:1px solid black;}\n\ .legend {position: relative; width: 100%; height: 40px; text-align: center;margin-bottom:20px}\n\ .legend .square {position:absolute;top:10px; width: 0px;height: 20px;border:1px solid;padding-left:20px;}\n\ button {height:40px;width:200px;margin-bottom:20px;margin-top:20px;font-size:24px;}\n\ </style>\n</head>\n<body>\n" hf.write(html_header) # write the test title and general info header if(data.stamp['time'] != ""): hf.write(headline_stamp.format(data.stamp['host'], data.stamp['kernel'], data.stamp['mode'], data.stamp['time'])) # write the dmesg data (device timeline) if(data.usedmesg): hf.write(devtl.html['timeline']) hf.write(devtl.html['legend']) hf.write('<div id="devicedetail"></div>\n') hf.write('<div id="devicetree"></div>\n') # write the ftrace data (callgraph) if(data.useftrace): hf.write('<section id="callgraphs" class="callgraph">\n') # write out the ftrace data converted to html html_func_top = '<article id="{0}" class="atop" style="background-color:{1}">\n<input type="checkbox" class="pf" id="f{2}" checked/><label for="f{2}">{3} {4}</label>\n' html_func_start = '<article>\n<input type="checkbox" class="pf" id="f{0}" checked/><label for="f{0}">{1} {2}</label>\n' html_func_end = '</article>\n' html_func_leaf = '<article>{0} {1}</article>\n' num = 0 for p in data.phases: list = data.dmesg[p]['list'] for devname in data.sortedDevices(p): if('ftrace' not in list[devname]): continue name = devname if(devname in data.altdevname): name = data.altdevname[devname] devid = list[devname]['id'] cg = list[devname]['ftrace'] flen = "(%.3f ms)" % ((cg.end - cg.start)*1000) hf.write(html_func_top.format(devid, data.dmesg[p]['color'], num, name+" "+p, flen)) num += 1 for line in cg.list: if(line.length < 0.000000001): flen = "" else: flen = "(%.3f ms)" % (line.length*1000) if(line.freturn and line.fcall): hf.write(html_func_leaf.format(line.name, flen)) elif(line.freturn): hf.write(html_func_end) else: hf.write(html_func_start.format(num, line.name, flen)) num += 1 hf.write(html_func_end) hf.write("\n\n </section>\n") # write the footer and close addScriptCode(hf) hf.write("</body>\n</html>\n") hf.close() return True | 0c52bda8f6c5785b5982bc3636b627b4ccd59c3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5327/0c52bda8f6c5785b5982bc3636b627b4ccd59c3f/analyze_suspend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
4870,
13332,
2552,
2589,
4524,
16,
501,
225,
501,
18,
12237,
950,
1435,
225,
468,
1729,
445,
5539,
910,
1369,
67,
14317,
273,
2368,
2892,
667,
1546,
14317,
6441,
95,
20,
97,
288,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4870,
13332,
2552,
2589,
4524,
16,
501,
225,
501,
18,
12237,
950,
1435,
225,
468,
1729,
445,
5539,
910,
1369,
67,
14317,
273,
2368,
2892,
667,
1546,
14317,
6441,
95,
20,
97,
288,
... |
See get_calendar_user. | See get_calendar_user_list. | def get_events(self, calendar_user, start_date=None, end_date=None, title=None, query=None, max_results=100, expand_recurrence=True): """Get events. Keyword arguments: calendar_user: "user" of the calendar to get events for. See get_calendar_user. start_date: Start date of the event(s). Must follow the RFC 3339 timestamp format and be in UTC. Default None. end_date: End date of the event(s). Must follow the RFC 3339 timestamp format and be in UTC. Default None. title: Title to look for in the event, supporting regular expressions. Default None for any title. query: Query string (not encoded) for doing full-text searches on event titles and content. max_results: Maximum number of events to get. Default 100. expand_recurrence: If true, expand recurring events per the 'singleevents' query parameter. Otherwise, don't. Returns: List of events from primary calendar that match the given params. """ query = gdata.calendar.service.CalendarEventQuery(user=calendar_user, text_query=query) if start_date: query.start_min = start_date if end_date: query.start_max = end_date if expand_recurrence: query.singleevents = 'true' query.orderby = 'starttime' query.sortorder = 'ascend' query.max_results = max_results return self.GetEntries(query.ToUri(), title, converter=gdata.calendar.CalendarEventFeedFromString) | f846a2afa8ac791418b89ed03bd00a3c62cf31be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2899/f846a2afa8ac791418b89ed03bd00a3c62cf31be/service.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5989,
12,
2890,
16,
5686,
67,
1355,
16,
787,
67,
712,
33,
7036,
16,
679,
67,
712,
33,
7036,
16,
2077,
33,
7036,
16,
843,
33,
7036,
16,
943,
67,
4717,
33,
6625,
16,
4542,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5989,
12,
2890,
16,
5686,
67,
1355,
16,
787,
67,
712,
33,
7036,
16,
679,
67,
712,
33,
7036,
16,
2077,
33,
7036,
16,
843,
33,
7036,
16,
943,
67,
4717,
33,
6625,
16,
4542,
... |
localdata = data.createCopy(d) data.setVar('OVERRIDES', "svn:%s" % data.getVar('OVERRIDES', localdata), localdata) data.update_data(localdata) data.setVar('SVNROOT', "%s://%s/%s" % (proto, svnroot, ud.module), localdata) data.setVar('SVNCOOPTS', " ".join(options), localdata) data.setVar('SVNMODULE', ud.module, localdata) svncmd = data.getVar('FETCHCOMMAND', localdata, 1) svnupcmd = data.getVar('UPDATECOMMAND', localdata, 1) | if command is "fetch": svncmd = "%s co %s %s://%s/%s %s" % (basecmd, " ".join(options), proto, svnroot, ud.module, ud.module) elif command is "update": svncmd = "%s update %s" % (basecmd, " ".join(options)) elif command is "info": svncmd = "%s info %s %s://%s/%s" % (basecmd, " ".join(options), proto, svnroot, ud.module) else: raise FetchError("Invalid svn command %s" % command) | def go(self, loc, ud, d): """Fetch url""" | 8f7194038c3bd45794988096b5a295417ce36b89 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2672/8f7194038c3bd45794988096b5a295417ce36b89/svn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1960,
12,
2890,
16,
1515,
16,
23969,
16,
302,
4672,
3536,
5005,
880,
8395,
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,
1960,
12,
2890,
16,
1515,
16,
23969,
16,
302,
4672,
3536,
5005,
880,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
s = m.group (2) out += [ m.group (1) ] | out += [ prfx + m.group (1) ] s = m.group (3) | def csym_split (s): out = [] go = True while go and len (s) > LINE_LEN: m = csym_split_rxx.match (s) if m: s = m.group (2) out += [ m.group (1) ] else: go = False out += [ s ] return '\\n '.join (out) | 28008532aef10b3cdeb86e9d6e2ab1cf4b2e7903 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11834/28008532aef10b3cdeb86e9d6e2ab1cf4b2e7903/profile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2873,
2942,
67,
4939,
261,
87,
4672,
596,
273,
5378,
1960,
273,
1053,
1323,
1960,
471,
562,
261,
87,
13,
405,
14340,
67,
13017,
30,
312,
273,
2873,
2942,
67,
4939,
67,
86,
5279,
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,
2873,
2942,
67,
4939,
261,
87,
4672,
596,
273,
5378,
1960,
273,
1053,
1323,
1960,
471,
562,
261,
87,
13,
405,
14340,
67,
13017,
30,
312,
273,
2873,
2942,
67,
4939,
67,
86,
5279,
18,
... |
self.channelTabs = util.getSingletonDDBObject(views.channelTabOrder) self.playlistTabs = util.getSingletonDDBObject(views.playlistTabOrder) | self.video_feed_tabs = tabs.TabOrder.video_feed_order() self.audio_feed_tabs = tabs.TabOrder.audio_feed_order() self.playlist_tabs = tabs.TabOrder.playlist_order() | def init_database_objects(self): self.channelTabs = util.getSingletonDDBObject(views.channelTabOrder) self.playlistTabs = util.getSingletonDDBObject(views.playlistTabOrder) self.tab_changed() | ba7e51e3e03d9068a7e95e9beba806bfd19f9f19 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/ba7e51e3e03d9068a7e95e9beba806bfd19f9f19/interpreter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
6231,
67,
6911,
12,
2890,
4672,
365,
18,
9115,
67,
7848,
67,
16056,
273,
10920,
18,
5661,
2448,
18,
9115,
67,
7848,
67,
1019,
1435,
365,
18,
11509,
67,
7848,
67,
16056,
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,
1208,
67,
6231,
67,
6911,
12,
2890,
4672,
365,
18,
9115,
67,
7848,
67,
16056,
273,
10920,
18,
5661,
2448,
18,
9115,
67,
7848,
67,
1019,
1435,
365,
18,
11509,
67,
7848,
67,
16056,
273,
... |
BaseObject.__init__(self, api_key, secret, session_key) | _BaseObject.__init__(self, api_key, secret, session_key) | def __init__(self, country_name, api_key, secret, session_key): BaseObject.__init__(self, api_key, secret, session_key) self.name = country_name | 903c9b1622fe56617e5099f20abdc69f2090f8e0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9926/903c9b1622fe56617e5099f20abdc69f2090f8e0/pylast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5251,
67,
529,
16,
1536,
67,
856,
16,
4001,
16,
1339,
67,
856,
4672,
389,
2171,
921,
16186,
2738,
972,
12,
2890,
16,
1536,
67,
856,
16,
4001,
16,
1339,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5251,
67,
529,
16,
1536,
67,
856,
16,
4001,
16,
1339,
67,
856,
4672,
389,
2171,
921,
16186,
2738,
972,
12,
2890,
16,
1536,
67,
856,
16,
4001,
16,
1339,... |
NumTypeGL = self.LogoState.NumType[0] if NumTypeGL == "f": | if self.LogoState.NumType == "float": | def GetCppBuiltinMove(self, IndentText, Arg, DirSign): NumTypeGL = self.LogoState.NumType[0] if NumTypeGL == "f": NumTypeMath = "f" else: NumTypeMath = "" NextIndent = IndentText + " " * self.IndentSize ScrunchText = "" CppText = "" # get the code text for the argument ArgText = self.GetCppArgument(Arg) if ArgText is None: return None if len(Arg.Elements) > 1: ArgText = "(" + ArgText + ")" # write expression to calculate the new X position if self.LogoState.bUseScrunch: ScrunchText = " * tt_ScrunchXY[0]" NewXText = "tt_TurtlePos[0] %s sin%s(tt_TurtleDir*tt_RadDegree) * %s%s;\n" % (DirSign, NumTypeMath, ArgText, ScrunchText) # write expression to calculate the new Y position if self.LogoState.bUseScrunch: ScrunchText = " * tt_ScrunchXY[1]" NewYText = "tt_TurtlePos[1] %s cos%s(tt_TurtleDir*tt_RadDegree) * %s%s;\n" % (DirSign, NumTypeMath, ArgText, ScrunchText) # write code to draw the line if self.LogoState.bUseWrap: CppText += IndentText + "if (tt_PenDown)\n" + IndentText + "{\n" CppText += NextIndent + "%s NewPos[2];\n" % self.LogoState.NumType CppText += NextIndent + "NewPos[0] = " + NewXText CppText += NextIndent + "NewPos[1] = " + NewYText CppText += NextIndent + "wrapper_DrawLineSegment(tt_TurtlePos, NewPos, tt_UseWrap);\n" CppText += NextIndent + "tt_TurtlePos[0] = NewPos[0];\n" + NextIndent + "tt_TurtlePos[1] = NewPos[1];\n" CppText += IndentText + "} else {\n" else: CppText += IndentText + "if (tt_PenDown)\n" + IndentText + "{\n" CppText += NextIndent + "glVertex2%s(tt_TurtlePos[0], tt_TurtlePos[1]);\n" % NumTypeGL CppText += NextIndent + "tt_TurtlePos[0] = " + NewXText CppText += NextIndent + "tt_TurtlePos[1] = " + NewYText CppText += NextIndent + "glVertex2%s(tt_TurtlePos[0], tt_TurtlePos[1]);\n" % NumTypeGL CppText += IndentText + "} else {\n" # write code for the PenUp case CppText += NextIndent + "tt_TurtlePos[0] = " + NewXText CppText += NextIndent + "tt_TurtlePos[1] = " + NewYText CppText += IndentText + "}\n" return CppText | bababbffcfffb2cb7b8c7a966a17e88685da5c1d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2419/bababbffcfffb2cb7b8c7a966a17e88685da5c1d/tt_cppwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
39,
11858,
28032,
7607,
12,
2890,
16,
28653,
1528,
16,
14448,
16,
8446,
2766,
4672,
309,
365,
18,
26604,
1119,
18,
2578,
559,
422,
315,
5659,
6877,
6805,
559,
10477,
273,
315,
74,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
39,
11858,
28032,
7607,
12,
2890,
16,
28653,
1528,
16,
14448,
16,
8446,
2766,
4672,
309,
365,
18,
26604,
1119,
18,
2578,
559,
422,
315,
5659,
6877,
6805,
559,
10477,
273,
315,
74,
... |
'name': repr(result["message"]), | 'name': result["message"] if isinstance(result["message"], str) or \ isinstance(result["message"], unicode) else repr(result["message"]), | def send_ping(self, cr, uid, ids, cron_mode=True, context={}): """ Send a message to OpenERP's publisher warranty server to check the validity of the contracts, get notifications, etc... @param cron_mode: If true, catch all exceptions (appropriate for usage in a cron). @type cron_mode: boolean """ try: try: result = send_ping(cr, uid) except: _logger.debug("Exception while sending a ping", exc_info=1) raise osv.except_osv(_("Error"), _("Error during communication with the publisher warranty server.")) contracts = result["contracts"] for contract in contracts: c_id = self.search(cr, uid, [("name","=",contract)])[0] date_from = contracts[contract][0] date_to = contracts[contract][1] state = contracts[contract][2] self.write(cr, uid, c_id, { "date_start": date_from, "date_stop": date_to, "state": state, }) if cron_mode and result["interval_type"] and result["interval_number"]: modosv = self.pool.get("ir.model.data") sched_id = modosv.get_object_reference(cr, uid, "base", "ir_cron_ping_scheduler")[1] cronosv = self.pool.get("ir.cron") cronosv.write(cr, uid, sched_id, { "interval_type": result["interval_type"], "interval_number": result["interval_number"], }) self.pool.get('res.log').create(cr, uid, { 'name': repr(result["message"]), 'res_model': "Maintenance Notifications", "read": True, "broadcast": True, }, context=context ) except: _logger.debug("Exception while interpreting the result of a ping", exc_info=1) if cron_mode: return False # same as before else: raise return True | b2666aa17999d0be3d811938a2ee72976d39ac57 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/b2666aa17999d0be3d811938a2ee72976d39ac57/publisher_warranty.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
1382,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
9998,
67,
3188,
33,
5510,
16,
819,
12938,
4672,
3536,
2479,
279,
883,
358,
3502,
654,
52,
1807,
12855,
341,
5399,
970,
93,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
1382,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
9998,
67,
3188,
33,
5510,
16,
819,
12938,
4672,
3536,
2479,
279,
883,
358,
3502,
654,
52,
1807,
12855,
341,
5399,
970,
93,
... |
In the above example, the message was accepted for delivery to three of the four addresses, and one was rejected, with the error code 550. If all addresses are accepted, then the method will return an empty dictionary. | In the above example, the message was accepted for delivery to three of the four addresses, and one was rejected, with the error code 550. If all addresses are accepted, then the method will return an empty dictionary. | def sendmail(self,from_addr,to_addrs,msg): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. | 4bb51b93b77dd262f068f20a082d1889dd85ca07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/4bb51b93b77dd262f068f20a082d1889dd85ca07/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
4408,
12,
2890,
16,
2080,
67,
4793,
16,
869,
67,
23305,
16,
3576,
4672,
3536,
1220,
1296,
11199,
392,
7278,
4791,
2492,
18,
1021,
1775,
854,
30,
300,
628,
67,
4793,
294,
1021,
17... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
4408,
12,
2890,
16,
2080,
67,
4793,
16,
869,
67,
23305,
16,
3576,
4672,
3536,
1220,
1296,
11199,
392,
7278,
4791,
2492,
18,
1021,
1775,
854,
30,
300,
628,
67,
4793,
294,
1021,
17... |
else: m = re.match(r'\{===>\}\s*sg=\s*"(\S+)"\s*;', line) if (m): p.space_group_info = sgtbx.space_group_info(m.group(1)) | def multi_sdb_parser(lines, file_name=None): # Parser for one or more cns sdb files. # Lines interpreted: # {+ file: heavy_search_1.sdb +} # sg= P6 a= 116.097 b= 116.097 c= 44.175 alpha= 90 beta= 90 gamma= 120 # {===>} site.action_1="refine"; # {===>} site.segid_1="SITE"; site.type_1="SE"; # {===>} site.x_1=18.7869; site.y_1=12.1257; site.z_1=0.163635; # {===>} site.b_1=65.6408; site.q_1=1; site.g_1=""; # Sites must be sorted. import re sdb_files = [] block_name = None p = 0 for line in lines: m = re.search(r'\{\+\s+file:\s*(\S*)', line) if (m): block_name = m.group(1) m = re.search( r'\{\-\s+begin\s+block\s+parameter\s+definition\s+\-\}', line) if (m): if (block_name is None): i = len(sdb_files) + 1 if (p): i += 1 if (file_name is None): block_name = "block_%d" % i else: block_name = file_name + "_%d" % i if (p): sdb_files.append(p.as_sdb_sites()) p = raw_parameters(block_name) block_name = None if (not p): continue m = re.match( r'sg=\s*(\S+)\s*a=\s*(\S+)\s*b=\s*(\S+)\s*c=\s*(\S+)' + r'\s*alpha=\s*(\S+)\s*beta=\s*(\S+)\s*gamma=\s*(\S+)', line) if (m): p.unit_cell = uctbx.unit_cell( [float(m.group(i+2)) for i in xrange(6)]) p.space_group_info = sgtbx.space_group_info(m.group(1)) else: m = re.match(r'\{===>\}\s*sg=\s*"(\S+)"\s*;', line) if (m): p.space_group_info = sgtbx.space_group_info(m.group(1)) p.add_action(re.search(r'site\.action_(\d+)\s*=\s*"([^"]*)"', line)) p.add_segid(re.search(r'site\.segid_(\d+)\s*=\s*"([^"]*)"', line)) p.add_type(re.search(r'site\.type_(\d+)\s*=\s*"([^"]*)"', line)) p.add_x(re.search(r'site\.x_(\d+)\s*=\s*([^\s;]*)', line)) p.add_y(re.search(r'site\.y_(\d+)\s*=\s*([^\s;]*)', line)) p.add_z(re.search(r'site\.z_(\d+)\s*=\s*([^\s;]*)', line)) p.add_b(re.search(r'site\.b_(\d+)\s*=\s*([^\s;]*)', line)) p.add_q(re.search(r'site\.q_(\d+)\s*=\s*([^\s;]*)', line)) p.add_g(re.search(r'site\.g_(\d+)\s*=\s*"([^"]*)"', line)) if (p): sdb_files.append(p.as_sdb_sites()) return sdb_files | fe3d1cac44b09ff443d18179b96ee734bca9cd0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/fe3d1cac44b09ff443d18179b96ee734bca9cd0c/sdb_reader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3309,
67,
27056,
67,
4288,
12,
3548,
16,
585,
67,
529,
33,
7036,
4672,
468,
6783,
364,
1245,
578,
1898,
276,
2387,
272,
1966,
1390,
18,
468,
29682,
19898,
30,
468,
282,
288,
15,
585,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3309,
67,
27056,
67,
4288,
12,
3548,
16,
585,
67,
529,
33,
7036,
4672,
468,
6783,
364,
1245,
578,
1898,
276,
2387,
272,
1966,
1390,
18,
468,
29682,
19898,
30,
468,
282,
288,
15,
585,
... | |
expected_win_rate = 0.5 | expected_win_rate = 1.0 | def do_some_calc(self): left_count = -1 | 0a8ed4a7a2841eea9e31e545295a7c297994ed09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/600/0a8ed4a7a2841eea9e31e545295a7c297994ed09/process.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
19068,
67,
12448,
12,
2890,
4672,
2002,
67,
1883,
273,
300,
21,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
19068,
67,
12448,
12,
2890,
4672,
2002,
67,
1883,
273,
300,
21,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.within_title = len(self.body) | self.in_document_title = len(self.body) | def visit_title(self, node): """Only 6 section levels are supported by HTML.""" check_id = 0 close_tag = '</p>\n' if isinstance(node.parent, nodes.topic): self.body.append( self.starttag(node, 'p', '', CLASS='topic-title first')) check_id = 1 elif isinstance(node.parent, nodes.sidebar): self.body.append( self.starttag(node, 'p', '', CLASS='sidebar-title first')) check_id = 1 elif isinstance(node.parent, nodes.admonition): self.body.append( self.starttag(node, 'p', '', CLASS='admonition-title first')) check_id = 1 elif isinstance(node.parent, nodes.table): self.body.append( self.starttag(node, 'caption', '')) check_id = 1 close_tag = '</caption>\n' elif self.section_level == 0: # document title self.head.append('<title>%s</title>\n' % self.encode(node.astext())) self.body.append(self.starttag(node, 'h1', '', CLASS='title')) self.context.append('</h1>\n') self.within_title = len(self.body) else: h_level = self.section_level + self.initial_header_level - 1 self.body.append( self.starttag(node, 'h%s' % h_level, '')) atts = {} if node.parent.hasattr('id'): atts['name'] = node.parent['id'] if node.hasattr('refid'): atts['class'] = 'toc-backref' atts['href'] = '#' + node['refid'] self.body.append(self.starttag({}, 'a', '', **atts)) self.context.append('</a></h%s>\n' % (h_level)) if check_id: if node.parent.hasattr('id'): self.body.append( self.starttag({}, 'a', '', name=node.parent['id'])) self.context.append('</a>' + close_tag) else: self.context.append(close_tag) | 2365213fc4da8ea05f4fbc6eb6920c063c39570c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/2365213fc4da8ea05f4fbc6eb6920c063c39570c/html4css1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2649,
12,
2890,
16,
756,
4672,
3536,
3386,
1666,
2442,
7575,
854,
3260,
635,
3982,
12123,
866,
67,
350,
273,
374,
1746,
67,
2692,
273,
4357,
84,
5333,
82,
11,
309,
1549,
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,
3757,
67,
2649,
12,
2890,
16,
756,
4672,
3536,
3386,
1666,
2442,
7575,
854,
3260,
635,
3982,
12123,
866,
67,
350,
273,
374,
1746,
67,
2692,
273,
4357,
84,
5333,
82,
11,
309,
1549,
12,
... |
GraphicsImportComponent = OpaqueByValueType('GraphicsImportComponent', 'CmpObj') GraphicsExportComponent = OpaqueByValueType('GraphicsExportComponent', 'CmpObj') ImageTranscoderComponent = OpaqueByValueType('ImageTranscoderComponent', 'CmpObj') DataCodecComponent = OpaqueByValueType('DataCodecComponent', 'CmpObj') GraphicImageMovieImportComponent = OpaqueByValueType('GraphicImageMovieImportComponent', 'CmpObj') MovieExportComponent = OpaqueByValueType('MovieExportComponent', 'CmpObj') MovieImportComponent = OpaqueByValueType('MovieImportComponent', 'CmpObj') QTVideoOutputComponent = OpaqueByValueType('QTVideoOutputComponent', 'CmpObj') SeqGrabComponent = OpaqueByValueType('SeqGrabComponent', 'CmpObj') TextExportComponent = OpaqueByValueType('TextExportComponent', 'CmpObj') TweenerComponent = OpaqueByValueType('TweenerComponent', 'CmpObj') pnotComponent = OpaqueByValueType('pnotComponent', 'CmpObj') VideoDigitizerComponent = OpaqueByValueType('VideoDigitizerComponent', 'CmpObj') | GraphicsImportComponent = OpaqueByValueType('GraphicsImportComponent', 'CmpInstObj') GraphicsExportComponent = OpaqueByValueType('GraphicsExportComponent', 'CmpInstObj') ImageTranscoderComponent = OpaqueByValueType('ImageTranscoderComponent', 'CmpInstObj') MovieImportComponent = OpaqueByValueType('MovieImportComponent', 'CmpInstObj') MovieExportComponent = OpaqueByValueType('MovieExportComponent', 'CmpInstObj') TextExportComponent = OpaqueByValueType('TextExportComponent', 'CmpInstObj') GraphicImageMovieImportComponent = OpaqueByValueType('GraphicImageMovieImportComponent', 'CmpInstObj') pnotComponent = OpaqueByValueType('pnotComponent', 'CmpInstObj') DataCodecComponent = OpaqueByValueType('DataCodecComponent', 'CmpInstObj') TweenerComponent = OpaqueByValueType('TweenerComponent', 'CmpInstObj') QTVideoOutputComponent = OpaqueByValueType('QTVideoOutputComponent', 'CmpInstObj') SeqGrabComponent = OpaqueByValueType('SeqGrabComponent', 'CmpInstObj') VideoDigitizerComponent = OpaqueByValueType('VideoDigitizerComponent', 'CmpInstObj') | #ifdef USE_TOOLBOX_OBJECT_GLUE | 4d06fd02263607b99a445dab89691c379e715423 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/4d06fd02263607b99a445dab89691c379e715423/qtsupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
430,
536,
14988,
67,
26263,
16876,
67,
9422,
67,
11261,
1821,
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,
468,
430,
536,
14988,
67,
26263,
16876,
67,
9422,
67,
11261,
1821,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if os.path.exists("test/"+fname+".bak"): os.remove("test/"+fname+".bak") os.rename("test/"+fname, "test/"+fname+".bak") | if os.path.exists(fname+".bak"): os.remove(fname+".bak") os.rename(fname, fname+".bak") | def updatefile(self, fname, version, md): dname = os.path.dirname(fname) if dname and not os.path.exists(dname): os.makedirs(dname) | d8d65e757e885ef1615e182a5bd52449cd54aa19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/d8d65e757e885ef1615e182a5bd52449cd54aa19/updateOrange.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
768,
12,
2890,
16,
5299,
16,
1177,
16,
3481,
4672,
302,
529,
273,
1140,
18,
803,
18,
12287,
12,
12749,
13,
309,
302,
529,
471,
486,
1140,
18,
803,
18,
1808,
12,
72,
529,
4672,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
768,
12,
2890,
16,
5299,
16,
1177,
16,
3481,
4672,
302,
529,
273,
1140,
18,
803,
18,
12287,
12,
12749,
13,
309,
302,
529,
471,
486,
1140,
18,
803,
18,
1808,
12,
72,
529,
4672,
... |
UDP UNIDIRECTIONAL SEND TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to foo (10.1.1.1) port 0 AF_INET | UDP UNIDIRECTIONAL SEND TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET \ to foo.bar.com (10.10.10.3) port 0 AF_INET | def process_udp_stream(self, output): """Parses the following and returns a touple containing throughput and the number of errors. | 6993d7951b92c075ed4b9898f681fed8ed695618 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10349/6993d7951b92c075ed4b9898f681fed8ed695618/netperf2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
26029,
67,
3256,
12,
2890,
16,
876,
4672,
3536,
6656,
326,
3751,
471,
1135,
279,
358,
2268,
4191,
24677,
471,
326,
1300,
434,
1334,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
26029,
67,
3256,
12,
2890,
16,
876,
4672,
3536,
6656,
326,
3751,
471,
1135,
279,
358,
2268,
4191,
24677,
471,
326,
1300,
434,
1334,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
tmp = "/tmp/tmp_%s_%s"%(name, n) | tmp = "/temp/tmp_%s_%s"%(name, n) | def tmp_dir(name): r""" Create and return a temporary directory in \code{\$HOME/.sage/tmp/pid/} """ name = str(name) n = 0 while True: tmp = "%s/%s_%s"%(SAGE_TMP, name, n) if not os.path.exists(tmp): break n += 1 try: os.makedirs(tmp) except IOError: # Put in local directory instead, e.g., because user doesn't # have privileges to write in SAGE's tmp directory. That's OK. n = 0 while True: tmp = "/tmp/tmp_%s_%s"%(name, n) if not os.path.exists(tmp): break n += 1 os.makedirs(tmp) return os.path.abspath(tmp) | 18ac0e8eb8b06f3dfaa785c2a01e2e833a107da4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/18ac0e8eb8b06f3dfaa785c2a01e2e833a107da4/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1853,
67,
1214,
12,
529,
4672,
436,
8395,
1788,
471,
327,
279,
6269,
1867,
316,
521,
710,
95,
14433,
14209,
15865,
87,
410,
19,
5645,
19,
6610,
19,
97,
3536,
508,
273,
609,
12,
529,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1853,
67,
1214,
12,
529,
4672,
436,
8395,
1788,
471,
327,
279,
6269,
1867,
316,
521,
710,
95,
14433,
14209,
15865,
87,
410,
19,
5645,
19,
6610,
19,
97,
3536,
508,
273,
609,
12,
529,
... |
rc1 += utils._process_text(self, node.tail or '') | def _textual(self, node): rc1 = utils._process_text(self, node.text or '') for n in utils._child_get(node,self): txt_n = copy.deepcopy(n) for key in txt_n.attrib.keys(): if key in ('rml_except', 'rml_loop', 'rml_tag'): del txt_n.attrib[key] if not self._textual(n).isspace(): txt_n.text = self._textual(n) txt_n.tail = '' rc1 += etree.tostring(txt_n) rc1 += utils._process_text(self, node.tail or '') return rc1 | 6e77121fb6c2f27bac6c01aefdf6f4d1abc6b0d1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/6e77121fb6c2f27bac6c01aefdf6f4d1abc6b0d1/trml2pdf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
955,
1462,
12,
2890,
16,
756,
4672,
4519,
21,
273,
2990,
6315,
2567,
67,
955,
12,
2890,
16,
756,
18,
955,
578,
28707,
364,
290,
316,
2990,
6315,
3624,
67,
588,
12,
2159,
16,
289... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
955,
1462,
12,
2890,
16,
756,
4672,
4519,
21,
273,
2990,
6315,
2567,
67,
955,
12,
2890,
16,
756,
18,
955,
578,
28707,
364,
290,
316,
2990,
6315,
3624,
67,
588,
12,
2159,
16,
289... | |
return processed_pdb_file | if (len(args) > 0): return processed_pdb_file return None | def run( args, params=None, strict_conflict_handling=True, max_atoms=None, log=None): if (log is None): log = sys.stdout mon_lib_srv = server.server() ener_lib = server.ener_lib() for file_name in args: processed_pdb_file = process( mon_lib_srv=mon_lib_srv, ener_lib=ener_lib, params=params, file_name=file_name, strict_conflict_handling=strict_conflict_handling, max_atoms=max_atoms, log=log) processed_pdb_file.geometry_restraints_manager() processed_pdb_file.xray_structure() return processed_pdb_file | 28924231cc375da3c0aeabc79c86bdb64c7b33a5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/696/28924231cc375da3c0aeabc79c86bdb64c7b33a5/pdb_interpretation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
833,
16,
859,
33,
7036,
16,
5490,
67,
20340,
67,
26822,
33,
5510,
16,
943,
67,
14937,
33,
7036,
16,
613,
33,
7036,
4672,
309,
261,
1330,
353,
599,
4672,
613,
273,
2589,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
833,
16,
859,
33,
7036,
16,
5490,
67,
20340,
67,
26822,
33,
5510,
16,
943,
67,
14937,
33,
7036,
16,
613,
33,
7036,
4672,
309,
261,
1330,
353,
599,
4672,
613,
273,
2589,
18,... |
twistd.checkPID(self['pidfile']) S = self.parent.getStore() | def _constructApplication(self): application = service.Application("Axiom Service") service.IService(self.parent.getStore()).setServiceParent(application) return application def postOptions(self): if platform.isWinNT(): self._win32PostOptions() else: self._unixPostOptions() def _checkPID(self): if not platform.isWinNT(): twistd.checkPID(self['pidfile']) def _removePID(self): if not platform.isWinNT(): twistd.removePID(self['pidfile']) def _startApplication(self): if not platform.isWinNT(): twistd.startApplication(self, self.application) else: service.IService(self.application).privilegedStartService() app.startApplication(self.application, False) def _startLogging(self): if not platform.isWinNT(): twistd.startLogging( self['logfile'], self['syslog'], self['prefix'], self['nodaemon']) else: twistd.startLogging('-') def postOptions(self): app.installReactor(self['reactor']) self._fixConfig() self._checkPID() S = self.parent.getStore() | def postOptions(self): | 64547264e4551504169bd38961218fedd7cd5360 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6981/64547264e4551504169bd38961218fedd7cd5360/axiomatic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
1320,
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,
... | [
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,
1603,
1320,
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,
-... |
gad[x,y]=math.hypot(gi[x,y][0],gi[x,y][1])/mi[x,y] | gad[x,y] = math.hypot(gi[x,y][0],gi[x,y][1])/mi[x,y] | def calcGradAngDisp(grad,n): ki=GrayImage(2*n+1,2*n+1) for x in range(0,ki.width()): for y in range(0,ki.height()): ki[x,y]=1.0 kernel=customKernel(ki,(n,n)) mi=convolveImage(transformImage(grad, '\l x: sqrt(sq(x[0])+sq(x[1]))'),kernel) gi=convolveImage(grad,kernel) gad=GrayImage(grad.size()) for x in range(0,gad.width()): for y in range(0,gad.height()): if (mi[x,y]>0): gad[x,y]=math.hypot(gi[x,y][0],gi[x,y][1])/mi[x,y] return gad | 8925518c2ae9f74de3b734317beccbc4670dbd43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10394/8925518c2ae9f74de3b734317beccbc4670dbd43/statistics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
30420,
22757,
1669,
84,
12,
9974,
16,
82,
4672,
29027,
33,
23521,
2040,
12,
22,
14,
82,
15,
21,
16,
22,
14,
82,
15,
21,
13,
364,
619,
316,
1048,
12,
20,
16,
15299,
18,
2819,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
30420,
22757,
1669,
84,
12,
9974,
16,
82,
4672,
29027,
33,
23521,
2040,
12,
22,
14,
82,
15,
21,
16,
22,
14,
82,
15,
21,
13,
364,
619,
316,
1048,
12,
20,
16,
15299,
18,
2819,
... |
self.main.editor.openModule(mod) | editor.openModule(mod) | def OnInit(self): wxInitAllImageHandlers() | 444e2520a8ccc660ae6a418201f1cc173ecc0f01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/444e2520a8ccc660ae6a418201f1cc173ecc0f01/Boa.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
2570,
12,
2890,
4672,
7075,
2570,
1595,
2040,
6919,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
2755,
2570,
12,
2890,
4672,
7075,
2570,
1595,
2040,
6919,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.add_latex_line(code,"BEFORE_PSPICTURE") | self.add_latex_line(code,"BEFORE PSPICTURE") | def initialize_newwrite(self): if not self.newwriteDone : code = r""" \makeatletter \@ifundefined{%s} {\newwrite{\%s} \immediate\openout\%s=%s } \makeatother"""%(newwriteName(),newwriteName(),newwriteName(),self.interWriteFile) self.add_latex_line(code,"BEFORE_PSPICTURE") self.newwriteDone = True | 9d2efc3d6c32e84b237b0b8c846aa8aeaf38faf4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5111/9d2efc3d6c32e84b237b0b8c846aa8aeaf38faf4/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
67,
2704,
2626,
12,
2890,
4672,
309,
486,
365,
18,
2704,
2626,
7387,
294,
981,
273,
436,
8395,
521,
6540,
270,
13449,
521,
36,
430,
5978,
95,
9,
87,
97,
18890,
2704,
2626,
23241,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
67,
2704,
2626,
12,
2890,
4672,
309,
486,
365,
18,
2704,
2626,
7387,
294,
981,
273,
436,
8395,
521,
6540,
270,
13449,
521,
36,
430,
5978,
95,
9,
87,
97,
18890,
2704,
2626,
23241,... |
title = title.replace(prep, '') + ', ' + prep | title = title[len(prep):] + ', ' + prep | def title_sort(title): match = _title_pat.search(title) if match: prep = match.group(1) title = title.replace(prep, '') + ', ' + prep return title.strip() | a12b6d043c657eb2dc419d232f7dd0ab57070258 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/a12b6d043c657eb2dc419d232f7dd0ab57070258/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2077,
67,
3804,
12,
2649,
4672,
845,
273,
389,
2649,
67,
16330,
18,
3072,
12,
2649,
13,
309,
845,
30,
13237,
273,
845,
18,
1655,
12,
21,
13,
2077,
273,
2077,
63,
1897,
12,
19109,
467... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2077,
67,
3804,
12,
2649,
4672,
845,
273,
389,
2649,
67,
16330,
18,
3072,
12,
2649,
13,
309,
845,
30,
13237,
273,
845,
18,
1655,
12,
21,
13,
2077,
273,
2077,
63,
1897,
12,
19109,
467... |
assert type(s) is str | # function def block, then self.def_name will be its name; | f9c9a0d88a419c9fb0675ebd6017719efd4b9710 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/f9c9a0d88a419c9fb0675ebd6017719efd4b9710/html_colorize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
445,
1652,
1203,
16,
1508,
365,
18,
536,
67,
529,
903,
506,
2097,
508,
31,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
445,
1652,
1203,
16,
1508,
365,
18,
536,
67,
529,
903,
506,
2097,
508,
31,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
self.assertEqual(binascii.a2b_base64(fillers), '') | self.assertEqual(binascii.a2b_base64(self.type2test(fillers)), '') | def addnoise(line): noise = fillers ratio = len(line) // len(noise) res = "" while line and noise: if len(line) // len(noise) > ratio: c, line = line[0], line[1:] else: c, noise = noise[0], noise[1:] res += c return res + noise + line | 17a549a67eb93f5303f060fc8481745716520cf0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/17a549a67eb93f5303f060fc8481745716520cf0/test_binascii.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
17814,
12,
1369,
4672,
10825,
273,
661,
3135,
7169,
273,
562,
12,
1369,
13,
368,
562,
12,
17814,
13,
400,
273,
1408,
1323,
980,
471,
10825,
30,
309,
562,
12,
1369,
13,
368,
562,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
17814,
12,
1369,
4672,
10825,
273,
661,
3135,
7169,
273,
562,
12,
1369,
13,
368,
562,
12,
17814,
13,
400,
273,
1408,
1323,
980,
471,
10825,
30,
309,
562,
12,
1369,
13,
368,
562,
... |
root.tk.call('console', 'hide') | try: root.tk.call('console', 'hide') except Tkinter.TclError: pass | def hideTkConsole(root): root.tk.call('console', 'hide') | 9b0bcc1f4b7aeb6eb2591aebf4688fa2ffe46f4d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/9b0bcc1f4b7aeb6eb2591aebf4688fa2ffe46f4d/macosxSupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6853,
56,
79,
10215,
12,
3085,
4672,
775,
30,
1365,
18,
16099,
18,
1991,
2668,
8698,
2187,
296,
11248,
6134,
1335,
399,
79,
2761,
18,
56,
830,
668,
30,
225,
1342,
225,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6853,
56,
79,
10215,
12,
3085,
4672,
775,
30,
1365,
18,
16099,
18,
1991,
2668,
8698,
2187,
296,
11248,
6134,
1335,
399,
79,
2761,
18,
56,
830,
668,
30,
225,
1342,
225,
2,
-100,
-100,
... |
self.in_p = 1 | def _check_p(self, opening_tag=None): if (opening_tag is not None) and (opening_tag not in self.need_p): return for tag in self.tag_stack: if tag[0] in self.no_p_after: return if self.in_p: return self.in_p = 1 self._open_tag('p', type=str(opening_tag)) | 87fa6079ec04f4d4cbb22a957725f660aa9f3b6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/87fa6079ec04f4d4cbb22a957725f660aa9f3b6c/dom_xml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
84,
12,
2890,
16,
10890,
67,
2692,
33,
7036,
4672,
309,
261,
3190,
310,
67,
2692,
353,
486,
599,
13,
471,
261,
3190,
310,
67,
2692,
486,
316,
365,
18,
14891,
67,
84,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
84,
12,
2890,
16,
10890,
67,
2692,
33,
7036,
4672,
309,
261,
3190,
310,
67,
2692,
353,
486,
599,
13,
471,
261,
3190,
310,
67,
2692,
486,
316,
365,
18,
14891,
67,
84,
... | |
Return value for given attribute of the parent of given XML DOM Element. XML DOM Element passed into returned lambda function. e.g. getParentAttribute('ovf:id')(<DOM Element: VirtualHardwareSection>) @note: lambda arg(xmlElement): type - DOM Element | Returns a boolean value, after testing if the parent of the DOM Node argument has an attribute with the given value. @param elem: node @type elem: DOM Node @param attrName: parent attribute name @type attrName: String @param value: parent attribute value @type value: String @return: truth value @rtype: boolean """ if isElement(elem): return (elem.parentNode.getAttribute(attrName) == value) else: return False def hasAttribute(elem, attrName, value): """ Returns a boolean value, after testing if the DOM Node argument has an attribute with the given value. @param elem: node @type elem: DOM Node | def hasParentAttribute(elem, attrName, value): """ Return value for given attribute of the parent of given XML DOM Element. XML DOM Element passed into returned lambda function. e.g. getParentAttribute('ovf:id')(<DOM Element: VirtualHardwareSection>) @note: lambda arg(xmlElement): type - DOM Element @param attrName: attribute name @type attrName: String @return: function that returns parent attribute value @rtype: lambda function """ if isElement(elem): return (elem.parentNode.getAttribute(attrName) == value) else: return False | 96a8973cd6b36ba54dd1baf026418110883ea73e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9789/96a8973cd6b36ba54dd1baf026418110883ea73e/Ovf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
3054,
1499,
12,
10037,
16,
11583,
16,
460,
4672,
3536,
2860,
279,
1250,
460,
16,
1839,
7769,
309,
326,
982,
434,
326,
4703,
2029,
1237,
711,
392,
1566,
598,
326,
864,
460,
18,
225... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
3054,
1499,
12,
10037,
16,
11583,
16,
460,
4672,
3536,
2860,
279,
1250,
460,
16,
1839,
7769,
309,
326,
982,
434,
326,
4703,
2029,
1237,
711,
392,
1566,
598,
326,
864,
460,
18,
225... |
print 'parsed OK, frags=', frags | def testNakedAmpersands(self): txt = "1 & 2" parser = ParaParser() parser.caseSensitive = True style, frags, bulletTextFrags = ParaParser().parse(txt, self.style)[1] print 'parsed OK, frags=', frags from reportlab.platypus.paragraph import Paragraph p = Paragraph(txt, self.style) #self.assertEquals(map(lambda x:x.text, fragList), [u'Hello ',u'',u' World']) #self.assertEquals(fragList[1].lineBreak, True) | 82c510a1910365d5f83bb07e7a90e6ddffb7d5e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3878/82c510a1910365d5f83bb07e7a90e6ddffb7d5e4/test_platypus_paraparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
50,
9477,
26895,
414,
5708,
12,
2890,
4672,
6463,
273,
315,
21,
473,
931,
31,
576,
6,
2082,
273,
2280,
69,
2678,
1435,
2082,
18,
3593,
14220,
273,
1053,
2154,
16,
3812,
1341,
16,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
50,
9477,
26895,
414,
5708,
12,
2890,
4672,
6463,
273,
315,
21,
473,
931,
31,
576,
6,
2082,
273,
2280,
69,
2678,
1435,
2082,
18,
3593,
14220,
273,
1053,
2154,
16,
3812,
1341,
16,... | |
return StatusKeeper(app, status='404 Not Found', url='/error') | return StatusKeeper(app, status='404 Not Found', url='/error', headers=[]) | def factory(app): return StatusKeeper(app, status='404 Not Found', url='/error') | c80f470920306b5f75202ff24cba18ee300a649f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/c80f470920306b5f75202ff24cba18ee300a649f/test_recursive.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3272,
12,
2910,
4672,
327,
2685,
17891,
12,
2910,
16,
1267,
2218,
11746,
2288,
10750,
2187,
880,
2218,
19,
1636,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3272,
12,
2910,
4672,
327,
2685,
17891,
12,
2910,
16,
1267,
2218,
11746,
2288,
10750,
2187,
880,
2218,
19,
1636,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
elif w < self._min[0]: | elif self._min[0] and w < self._min[0]: | def _max_set(self, value): if self._max != value: w, h = value if w < 0: w = 0 elif w < self._min[0]: w = self._min[0] if h < 0: h = 0 elif h < self._min[1]: h = self._min[1] self._max = (w, h) self._edje_group.w_max = w self._edje_group.h_max = h self.event_emit("group.max.changed", self._max) | 674e9473f70d6be1ed3ad7b883647fdc87921172 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12343/674e9473f70d6be1ed3ad7b883647fdc87921172/editable.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1896,
67,
542,
12,
2890,
16,
460,
4672,
309,
365,
6315,
1896,
480,
460,
30,
341,
16,
366,
273,
460,
309,
341,
411,
374,
30,
341,
273,
374,
1327,
365,
6315,
1154,
63,
20,
65,
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,
389,
1896,
67,
542,
12,
2890,
16,
460,
4672,
309,
365,
6315,
1896,
480,
460,
30,
341,
16,
366,
273,
460,
309,
341,
411,
374,
30,
341,
273,
374,
1327,
365,
6315,
1154,
63,
20,
65,
4... |
if md.current.failed(): | if self.__current.failed(): | def notify_me(): self.__cv.acquire() self.__cv.notify() self.__cv.release() | c7947691a7d1e74878c1ce8b43802ac05047e694 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2459/c7947691a7d1e74878c1ce8b43802ac05047e694/activity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
67,
3501,
13332,
365,
16186,
19774,
18,
1077,
1039,
1435,
365,
16186,
19774,
18,
12336,
1435,
365,
16186,
19774,
18,
9340,
1435,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
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,
5066,
67,
3501,
13332,
365,
16186,
19774,
18,
1077,
1039,
1435,
365,
16186,
19774,
18,
12336,
1435,
365,
16186,
19774,
18,
9340,
1435,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
except InvalidLoop as e: | except InvalidLoop: | def compile_new_loop(metainterp, old_loop_tokens, greenkey, start, full_preamble_needed=True): """Try to compile a new loop by closing the current history back to the first operation. """ history = metainterp.history loop = create_empty_loop(metainterp) loop.inputargs = history.inputargs for box in loop.inputargs: assert isinstance(box, Box) # make a copy, because optimize_loop can mutate the ops and descrs h_ops = history.operations loop.operations = [h_ops[i].clone() for i in range(start, len(h_ops))] metainterp_sd = metainterp.staticdata jitdriver_sd = metainterp.jitdriver_sd loop_token = make_loop_token(len(loop.inputargs), jitdriver_sd) loop.token = loop_token loop.operations[-1].setdescr(loop_token) # patch the target of the JUMP loop.preamble = create_empty_loop(metainterp, 'Preamble ') loop.preamble.inputargs = loop.inputargs loop.preamble.token = make_loop_token(len(loop.inputargs), jitdriver_sd) try: old_loop_token = jitdriver_sd.warmstate.optimize_loop( metainterp_sd, old_loop_tokens, loop) except InvalidLoop as e: #import traceback; import pdb; pdb.set_trace() return None if old_loop_token is not None: metainterp.staticdata.log("reusing old loop") return old_loop_token if loop.preamble.operations is not None: send_loop_to_backend(metainterp_sd, loop, "loop") record_loop_or_bridge(metainterp_sd, loop) token = loop.preamble.token if full_preamble_needed or not loop.preamble.token.short_preamble: send_loop_to_backend(metainterp_sd, loop.preamble, "entry bridge") insert_loop_token(old_loop_tokens, loop.preamble.token) jitdriver_sd.warmstate.attach_unoptimized_bridge_from_interp( greenkey, loop.preamble.token) record_loop_or_bridge(metainterp_sd, loop.preamble) return token else: send_loop_to_backend(metainterp_sd, loop, "loop") insert_loop_token(old_loop_tokens, loop_token) jitdriver_sd.warmstate.attach_unoptimized_bridge_from_interp( greenkey, loop.token) record_loop_or_bridge(metainterp_sd, loop) return loop_token | 17894469dfc4c7dff7116b0bdb04b9722f025041 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/17894469dfc4c7dff7116b0bdb04b9722f025041/compile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
67,
2704,
67,
6498,
12,
10578,
11606,
84,
16,
1592,
67,
6498,
67,
7860,
16,
10004,
856,
16,
787,
16,
1983,
67,
84,
793,
7119,
67,
17471,
33,
5510,
4672,
3536,
7833,
358,
4074,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
67,
2704,
67,
6498,
12,
10578,
11606,
84,
16,
1592,
67,
6498,
67,
7860,
16,
10004,
856,
16,
787,
16,
1983,
67,
84,
793,
7119,
67,
17471,
33,
5510,
4672,
3536,
7833,
358,
4074,
... |
Abelian variety factor of dimension 4 of J0(65) x J0(65) x J0(11) | Abelian subvariety of dimension 4 of J0(65) x J0(65) x J0(11) | def __mul__(self, other): """ Compute the direct product of self and other. EXAMPLES: Some modular Jacobians: sage: J0(11) * J0(33) Abelian variety J0(11) x J0(33) sage: J0(11) * J0(33) * J0(11) Abelian variety J0(11) x J0(33) x J0(11) | 231a556974015ed454b20c5783447e82495d8183 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/231a556974015ed454b20c5783447e82495d8183/abvar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16411,
972,
12,
2890,
16,
1308,
4672,
3536,
8155,
326,
2657,
3017,
434,
365,
471,
1308,
18,
225,
5675,
8900,
11386,
30,
10548,
681,
2490,
804,
1077,
947,
19657,
30,
272,
410,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16411,
972,
12,
2890,
16,
1308,
4672,
3536,
8155,
326,
2657,
3017,
434,
365,
471,
1308,
18,
225,
5675,
8900,
11386,
30,
10548,
681,
2490,
804,
1077,
947,
19657,
30,
272,
410,
30,
... |
words = string.splitfields(url, ';') | words = url.split(';') | def splitattr(url): """splitattr('/path;attr1=value1;attr2=value2;...') -> '/path', ['attr1=value1', 'attr2=value2', ...].""" words = string.splitfields(url, ';') return words[0], words[1:] | 2a3596c7d04c9635576a712f85db07ce4de4bff2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2a3596c7d04c9635576a712f85db07ce4de4bff2/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
1747,
12,
718,
4672,
3536,
4939,
1747,
2668,
19,
803,
31,
1747,
21,
33,
1132,
21,
31,
1747,
22,
33,
1132,
22,
31,
7821,
13,
317,
1173,
803,
2187,
10228,
1747,
21,
33,
1132,
21,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
1747,
12,
718,
4672,
3536,
4939,
1747,
2668,
19,
803,
31,
1747,
21,
33,
1132,
21,
31,
1747,
22,
33,
1132,
22,
31,
7821,
13,
317,
1173,
803,
2187,
10228,
1747,
21,
33,
1132,
21,... |
self.emit('CALL_FUNCTION', 1) self.emit('POP_TOP') | self.emit('LIST_APPEND',) | def visitListComp(self, node): self.set_lineno(node) # setup list append = "$append%d" % self.__list_count self.__list_count = self.__list_count + 1 self.emit('BUILD_LIST', 0) self.emit('DUP_TOP') self.emit('LOAD_ATTR', 'append') self._implicitNameOp('STORE', append) | 5addf7007818bd05f5a1c26f8c71b5ee839a7659 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5addf7007818bd05f5a1c26f8c71b5ee839a7659/pycodegen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
682,
2945,
12,
2890,
16,
756,
4672,
365,
18,
542,
67,
17782,
12,
2159,
13,
468,
3875,
666,
714,
273,
4662,
6923,
9,
72,
6,
738,
365,
16186,
1098,
67,
1883,
365,
16186,
1098,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
682,
2945,
12,
2890,
16,
756,
4672,
365,
18,
542,
67,
17782,
12,
2159,
13,
468,
3875,
666,
714,
273,
4662,
6923,
9,
72,
6,
738,
365,
16186,
1098,
67,
1883,
365,
16186,
1098,
67... |
gLogger.info("TransferAgent.execute: Attempting to execute %s sub-request." % operation) diracSE = str(subRequestAttributes['TargetSE']) | gLogger.info( "TransferAgent.execute: Attempting to execute %s sub-request." % operation ) diracSE = str( subRequestAttributes['TargetSE'] ) | def executeRequest(self): ################################################ # Get a request from request DB gMonitor.addMark( "Iteration", 1 ) res = self.RequestDBClient.getRequest('transfer') if not res['OK']: gLogger.info("TransferAgent.execute: Failed to get request from database.") return S_OK() elif not res['Value']: gLogger.info("TransferAgent.execute: No requests to be executed found.") return S_OK() requestString = res['Value']['RequestString'] requestName = res['Value']['RequestName'] sourceServer= res['Value']['Server'] try: jobID = int(res['Value']['JobID']) except: jobID = 0 gLogger.info("TransferAgent.execute: Obtained request %s" % requestName) | e9b27a9be4536012e60823ee81099deb0a1fbe85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/e9b27a9be4536012e60823ee81099deb0a1fbe85/TransferAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
691,
12,
2890,
4672,
19709,
26487,
13151,
468,
968,
279,
590,
628,
590,
2383,
314,
7187,
18,
1289,
3882,
12,
315,
10795,
3113,
404,
262,
400,
273,
365,
18,
691,
2290,
1227,
18,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
691,
12,
2890,
4672,
19709,
26487,
13151,
468,
968,
279,
590,
628,
590,
2383,
314,
7187,
18,
1289,
3882,
12,
315,
10795,
3113,
404,
262,
400,
273,
365,
18,
691,
2290,
1227,
18,
5... |
colWidths = "cm,".join(map(str, cols_widhts)) | colWidths = "cm,".join(map(tools.ustr, cols_widhts)) | def divide_list(lst, n): return [lst[i::n] for i in range(n)] | 359c4ac3c3deec88d37b44f93123f5d4ba02f3b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/359c4ac3c3deec88d37b44f93123f5d4ba02f3b3/survey_form.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12326,
67,
1098,
12,
16923,
16,
290,
4672,
327,
306,
16923,
63,
77,
2866,
82,
65,
364,
277,
316,
1048,
12,
82,
25887,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12326,
67,
1098,
12,
16923,
16,
290,
4672,
327,
306,
16923,
63,
77,
2866,
82,
65,
364,
277,
316,
1048,
12,
82,
25887,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.scale = float( part.bbox.scale() ) | scale = float( part.bbox.scale() * .75) | def setViewFitToWindow(self): "Change current view so that our model's bbox fits in our window, and gl_update." #Recalculate center and bounding box for the current part part = self.part part.computeBoundingBox() self.scale = float( part.bbox.scale() ) #bruce 050616 added float() as a precaution, probably not needed # appropriate height to show everything, for square or wide glpane [bruce 050616 comment] aspect = float(self.width) / self.height if aspect < 1.0: # tall (narrow) glpane -- need to increase self.scale # (defined in terms of glpane height) so part bbox fits in width # [bruce 050616 comment] self.scale /= aspect self.pov = V(-part.center[0], -part.center[1], -part.center[2]) self.setZoomFactor(1.0) self.gl_update() | dc06c760dbe5ded748eaa71389af2211878d2189 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/dc06c760dbe5ded748eaa71389af2211878d2189/GLPane.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19923,
14219,
774,
3829,
12,
2890,
4672,
315,
3043,
783,
1476,
1427,
716,
3134,
938,
1807,
8472,
13351,
316,
3134,
2742,
16,
471,
5118,
67,
2725,
1199,
468,
426,
11162,
4617,
471,
7552,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19923,
14219,
774,
3829,
12,
2890,
4672,
315,
3043,
783,
1476,
1427,
716,
3134,
938,
1807,
8472,
13351,
316,
3134,
2742,
16,
471,
5118,
67,
2725,
1199,
468,
426,
11162,
4617,
471,
7552,
... |
def get_instruments_from_id(self, experiment_id): """ Gets instrument set with the given experiment_id. """ for row in self: if row.experiment_id == experiment_id: return row.instruments raise KeyError, "id %s not found in table" %(`experiment_id`) | def get_row_from_id(self, experiment_id): """ Returns row in matching the given experiment_id. """ row = [row for row in self if row.experiment_id == experiment_id] if len(row) > 1: raise ValueError, "Duplicate ids in experiment table" if len(row) == 0: raise ValueError, "id %s not found in table" %(`experiment_id`) return row[0] | def get_instruments_from_id(self, experiment_id): """ Gets instrument set with the given experiment_id. """ | dfe3d85912672995cb0fa14433ff3e15442ac4c5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/dfe3d85912672995cb0fa14433ff3e15442ac4c5/lsctables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
22818,
87,
67,
2080,
67,
350,
12,
2890,
16,
8724,
67,
350,
4672,
3536,
11881,
10353,
444,
598,
326,
864,
8724,
67,
350,
18,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
22818,
87,
67,
2080,
67,
350,
12,
2890,
16,
8724,
67,
350,
4672,
3536,
11881,
10353,
444,
598,
326,
864,
8724,
67,
350,
18,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
- ``r`` - the number of rows in the state array (default: 1) - ``c`` - the number of columns in the state array (default: 1) - ``e`` - the exponent of the finite extension field (default: 4) - ``star`` - determines if SR\* or SR should be constructed (default: False) - ``aes_mode`` - as the SR key schedule specification differs slightly from the AES key schedule, this parameter controls which schedule to use (default: True) - ``gf2`` - generate polynomial systems over `\mathrm{GF}(2)` rather than over `\mathrm{GF}(2^n)` (default: False) polybori - use the ``BooleanPolynomialRing`` as polynomial representation - ``order`` - a string to specify the term ordering of the variables - ``postfix`` - a string which is appended after the variable name (default: '') - ``allow_zero_inversions`` - a boolean to control whether zero inversions raise an exception (default: False) - ``correct_only`` - only include correct inversion polynomials (default: False, GF2 only) - ``biaffine_only`` - only include bilinear and biaffine inversion polynomials (default: True, GF2 only) | - ``r`` - the number of rows in the state array (default: 1) - ``c`` - the number of columns in the state array (default: 1) - ``e`` - the exponent of the finite extension field (default: 4) - ``star`` - determines if SR\* or SR should be constructed (default: ``False``) - ``aes_mode`` - as the SR key schedule specification differs slightly from the AES key schedule, this parameter controls which schedule to use (default: ``True``) - ``gf2`` - generate polynomial systems over `\mathbb{F}_2` rather than over `\mathbb{F}_{2^e}` (default: ``False``) - ``polybori`` - use the ``BooleanPolynomialRing`` as polynomial representation (default=False, `\mathbb{F}_2` only) - ``order`` - a string to specify the term ordering of the variables - ``postfix`` - a string which is appended after the variable name (default: '') - ``allow_zero_inversions`` - a boolean to control whether zero inversions raise an exception (default: ``False``) - ``correct_only`` - only include correct inversion polynomials (default: ``False``, `\mathbb{F}_2` only) - ``biaffine_only`` - only include bilinear and biaffine inversion polynomials (default: ``True``, `\mathbb{F}_2` only) | def SR(n=1, r=1, c=1, e=4, star=False, **kwargs): r""" Return a small scale variant of the AES polynomial system constructor subject to the following conditions: INPUT: - ``n`` - the number of rounds (default: 1) - ``r`` - the number of rows in the state array (default: 1) - ``c`` - the number of columns in the state array (default: 1) - ``e`` - the exponent of the finite extension field (default: 4) - ``star`` - determines if SR\* or SR should be constructed (default: False) - ``aes_mode`` - as the SR key schedule specification differs slightly from the AES key schedule, this parameter controls which schedule to use (default: True) - ``gf2`` - generate polynomial systems over `\mathrm{GF}(2)` rather than over `\mathrm{GF}(2^n)` (default: False) polybori - use the ``BooleanPolynomialRing`` as polynomial representation - ``order`` - a string to specify the term ordering of the variables - ``postfix`` - a string which is appended after the variable name (default: '') - ``allow_zero_inversions`` - a boolean to control whether zero inversions raise an exception (default: False) - ``correct_only`` - only include correct inversion polynomials (default: False, GF2 only) - ``biaffine_only`` - only include bilinear and biaffine inversion polynomials (default: True, GF2 only) EXAMPLES:: sage: sr = mq.SR(1, 1, 1, 4) sage: ShiftRows = sr.shift_rows_matrix() sage: MixColumns = sr.mix_columns_matrix() sage: Lin = sr.lin_matrix() sage: M = MixColumns * ShiftRows * Lin sage: print sr.hex_str_matrix(M) 5 1 C 5 2 2 1 F A 4 4 1 1 8 3 3 :: sage: sr = mq.SR(1, 2, 1, 4) sage: ShiftRows = sr.shift_rows_matrix() sage: MixColumns = sr.mix_columns_matrix() sage: Lin = sr.lin_matrix() sage: M = MixColumns * ShiftRows * Lin sage: print sr.hex_str_matrix(M) F 3 7 F A 2 B A A A 5 6 8 8 4 9 7 8 8 2 D C C 3 4 6 C C 5 E F F A 2 B A F 3 7 F 8 8 4 9 A A 5 6 D C C 3 7 8 8 2 5 E F F 4 6 C C :: sage: sr = mq.SR(1, 2, 2, 4) sage: ShiftRows = sr.shift_rows_matrix() sage: MixColumns = sr.mix_columns_matrix() sage: Lin = sr.lin_matrix() sage: M = MixColumns * ShiftRows * Lin sage: print sr.hex_str_matrix(M) F 3 7 F 0 0 0 0 0 0 0 0 A 2 B A A A 5 6 0 0 0 0 0 0 0 0 8 8 4 9 7 8 8 2 0 0 0 0 0 0 0 0 D C C 3 4 6 C C 0 0 0 0 0 0 0 0 5 E F F A 2 B A 0 0 0 0 0 0 0 0 F 3 7 F 8 8 4 9 0 0 0 0 0 0 0 0 A A 5 6 D C C 3 0 0 0 0 0 0 0 0 7 8 8 2 5 E F F 0 0 0 0 0 0 0 0 4 6 C C 0 0 0 0 A 2 B A F 3 7 F 0 0 0 0 0 0 0 0 8 8 4 9 A A 5 6 0 0 0 0 0 0 0 0 D C C 3 7 8 8 2 0 0 0 0 0 0 0 0 5 E F F 4 6 C C 0 0 0 0 0 0 0 0 F 3 7 F A 2 B A 0 0 0 0 0 0 0 0 A A 5 6 8 8 4 9 0 0 0 0 0 0 0 0 7 8 8 2 D C C 3 0 0 0 0 0 0 0 0 4 6 C C 5 E F F 0 0 0 0 """ if not kwargs.get("gf2", False): return SR_gf2n(n, r, c, e, star, **kwargs) else: return SR_gf2(n, r, c, e, star, **kwargs) | 64b5e0e9186de5235119791631990329cc9aecfa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/64b5e0e9186de5235119791631990329cc9aecfa/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19145,
12,
82,
33,
21,
16,
436,
33,
21,
16,
276,
33,
21,
16,
425,
33,
24,
16,
10443,
33,
8381,
16,
2826,
4333,
4672,
436,
8395,
2000,
279,
5264,
3159,
5437,
434,
326,
15986,
16991,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19145,
12,
82,
33,
21,
16,
436,
33,
21,
16,
276,
33,
21,
16,
425,
33,
24,
16,
10443,
33,
8381,
16,
2826,
4333,
4672,
436,
8395,
2000,
279,
5264,
3159,
5437,
434,
326,
15986,
16991,
... |
def _getPackageClasses(self, parts): | def _getPackages(self, parts): | def _getPackageClasses(self, parts): # Generating list of all classes allClasses = {} for part in parts.values(): for classId in part.deps: allClasses[classId] = True | 1cfd1ed58337950233d32892a0095dbf1ce44a81 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/1cfd1ed58337950233d32892a0095dbf1ce44a81/PartBuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
11425,
12,
2890,
16,
2140,
4672,
468,
3055,
1776,
666,
434,
777,
3318,
777,
4818,
273,
2618,
364,
1087,
316,
2140,
18,
2372,
13332,
364,
31181,
316,
1087,
18,
14877,
30,
777,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
588,
11425,
12,
2890,
16,
2140,
4672,
468,
3055,
1776,
666,
434,
777,
3318,
777,
4818,
273,
2618,
364,
1087,
316,
2140,
18,
2372,
13332,
364,
31181,
316,
1087,
18,
14877,
30,
777,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.