rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
elif token[0] in FirstAtom: lst.append(self.parseAtom()) else: log.info("assuming text in _parseHTMLList", token) lst.append(Text(token[1])) | else: if token[1].strip(): log.info("skipping in _parseHTMLList", token) | def _parseHTMLList(self, numbered): lst = ItemList() lst.numbered = numbered end = EndTagToken(self.token[0].t) | ac290f7558f4d03dca28e77c391ed5ecd26bde42 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/ac290f7558f4d03dca28e77c391ed5ecd26bde42/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
4870,
682,
12,
2890,
16,
1300,
329,
4672,
9441,
273,
4342,
682,
1435,
9441,
18,
2696,
329,
273,
1300,
329,
225,
679,
273,
4403,
1805,
1345,
12,
2890,
18,
2316,
63,
20,
8009,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
4870,
682,
12,
2890,
16,
1300,
329,
4672,
9441,
273,
4342,
682,
1435,
9441,
18,
2696,
329,
273,
1300,
329,
225,
679,
273,
4403,
1805,
1345,
12,
2890,
18,
2316,
63,
20,
8009,... |
self.playlistIOInternal.save(resolveFilename(SCOPE_CONFIG, "playlist.e2pls")) | if not self.isAudioCD: self.playlistIOInternal.save(resolveFilename(SCOPE_CONFIG, "playlist.e2pls")) | def exitCB(self, answer): if answer == True: self.playlistIOInternal.clear() for x in self.playlist.list: self.playlistIOInternal.addService(ServiceReference(x[0])) self.playlistIOInternal.save(resolveFilename(SCOPE_CONFIG, "playlist.e2pls")) self.close() | fea429e03ad502d4667041a245d3b492c49d55d7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6652/fea429e03ad502d4667041a245d3b492c49d55d7/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2427,
8876,
12,
2890,
16,
5803,
4672,
309,
5803,
422,
1053,
30,
365,
18,
1601,
1098,
4294,
3061,
18,
8507,
1435,
364,
619,
316,
365,
18,
1601,
1098,
18,
1098,
30,
365,
18,
1601,
1098,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2427,
8876,
12,
2890,
16,
5803,
4672,
309,
5803,
422,
1053,
30,
365,
18,
1601,
1098,
4294,
3061,
18,
8507,
1435,
364,
619,
316,
365,
18,
1601,
1098,
18,
1098,
30,
365,
18,
1601,
1098,
... |
logger.info("Moved recurrence series %s to NOW", alias) | logger.info("Moved recurrence series %s to NOW; %s", alias, rs) | def changeAgreedForNewInboundMod(modAlias): if not rsNewBase.has_key(modAlias): return eim.RecordSet() state = self.getState(modAlias) state.agreed += eim.RecordSet( getInheritRecords(rsNewBase[modAlias].inclusions, modAlias)) | 0e48d535a65820aef389d27dd2d505f2cfe8f701 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/0e48d535a65820aef389d27dd2d505f2cfe8f701/recordset_conduit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
2577,
15656,
1290,
1908,
20571,
1739,
12,
1711,
2936,
4672,
309,
486,
3597,
1908,
2171,
18,
5332,
67,
856,
12,
1711,
2936,
4672,
327,
425,
381,
18,
2115,
694,
1435,
919,
273,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
2577,
15656,
1290,
1908,
20571,
1739,
12,
1711,
2936,
4672,
309,
486,
3597,
1908,
2171,
18,
5332,
67,
856,
12,
1711,
2936,
4672,
327,
425,
381,
18,
2115,
694,
1435,
919,
273,
365,
... |
"""Decide whether a particular character needs to be quoted. | """Decide whether a particular character needs to be quoted. | def needsquoting(c, quotetabs): """Decide whether a particular character needs to be quoted. The 'quotetabs' flag indicates whether tabs should be quoted.""" if c == '\t': return not quotetabs return c == ESCAPE or not(' ' <= c <= '~') | 7ad3eb0691b28b7bbfefbfe6d3feaf80fa53186d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/7ad3eb0691b28b7bbfefbfe6d3feaf80fa53186d/quopri.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4260,
9270,
310,
12,
71,
16,
4914,
278,
5113,
4672,
3536,
1799,
831,
2856,
279,
6826,
3351,
4260,
358,
506,
9298,
18,
225,
1021,
296,
9270,
278,
5113,
11,
2982,
8527,
2856,
10920,
1410,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4260,
9270,
310,
12,
71,
16,
4914,
278,
5113,
4672,
3536,
1799,
831,
2856,
279,
6826,
3351,
4260,
358,
506,
9298,
18,
225,
1021,
296,
9270,
278,
5113,
11,
2982,
8527,
2856,
10920,
1410,
... |
i = 0 x = 0 | i = 0 x = 0 | def PyUnicode_DecodeRawUnicodeEscape(s, size,errors): if (size == 0): return u'' pos = 0 p = [] while (pos < len(s)): ch = s[pos] #/* Non-escape characters are interpreted as Unicode ordinals */ if (ch != '\\'): p += ch pos += 1 continue startinpos = pos pos += 1 | 5efa14154184eac5ee6ca6162a67c199654ad7fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/5efa14154184eac5ee6ca6162a67c199654ad7fc/unicodecodec.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4707,
16532,
67,
6615,
4809,
16532,
8448,
12,
87,
16,
963,
16,
4324,
4672,
225,
309,
261,
1467,
422,
374,
4672,
327,
582,
6309,
949,
273,
374,
293,
273,
5378,
1323,
261,
917,
411,
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,
4707,
16532,
67,
6615,
4809,
16532,
8448,
12,
87,
16,
963,
16,
4324,
4672,
225,
309,
261,
1467,
422,
374,
4672,
327,
582,
6309,
949,
273,
374,
293,
273,
5378,
1323,
261,
917,
411,
562,... |
for destDQ2ID in destDQ2IDs: if replicaMap.has_key(destDQ2ID): self.putLog("skip EOS sub for %s:%s since replica is already there" % (destDQ2ID,datasetName)) else: statSubEx,subExist = self.checkSubscriptionInfo(destDQ2ID,datasetName) if not statSubEx: self.putLog("failed to check subscription for %s:%s" % (destDQ2ID,datasetName),type='error') continue if subExist: self.putLog("skip EOS sub for %s:%s since subscription is already there" % (destDQ2ID,datasetName)) | for tmpDsName,replicaMap in replicaMaps.iteritems(): for destDQ2ID in destDQ2IDs: if replicaMap.has_key(destDQ2ID): self.putLog("skip EOS sub for %s:%s since replica is already there" % (destDQ2ID,tmpDsName)) | def makeSubscriptionToEOS(self,datasetName): self.putLog("start making EOS subscription for %s" % datasetName) destDQ2IDs = ['CERN-PROD_EOSDATADISK'] # get dataset replica locations statRep,replicaMap = self.getListDatasetReplicas(datasetName) if not statRep: self.putLog("failed to get replica map for EOS",type='error') return False # check if replica is already there for destDQ2ID in destDQ2IDs: if replicaMap.has_key(destDQ2ID): self.putLog("skip EOS sub for %s:%s since replica is already there" % (destDQ2ID,datasetName)) else: statSubEx,subExist = self.checkSubscriptionInfo(destDQ2ID,datasetName) if not statSubEx: self.putLog("failed to check subscription for %s:%s" % (destDQ2ID,datasetName),type='error') continue # make subscription if subExist: self.putLog("skip EOS sub for %s:%s since subscription is already there" % (destDQ2ID,datasetName)) else: statMkSub,retMkSub = self.makeSubscription(datasetName,'',destDQ2ID) if statMkSub: self.putLog("made subscription to %s for %s" % (destDQ2ID,datasetName)) else: self.putLog("failed to make subscription to %s for %s" % (destDQ2ID,datasetName),type='error') # return self.putLog("end making EOS subscription for %s" % datasetName) return True | cc7692103dd3e07f0903e6eb5758b8da774a7bec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7525/cc7692103dd3e07f0903e6eb5758b8da774a7bec/DynDataDistributer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
6663,
774,
41,
4618,
12,
2890,
16,
8682,
461,
4672,
365,
18,
458,
1343,
2932,
1937,
10480,
512,
4618,
4915,
364,
738,
87,
6,
738,
3709,
461,
13,
1570,
40,
53,
22,
5103,
273,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
6663,
774,
41,
4618,
12,
2890,
16,
8682,
461,
4672,
365,
18,
458,
1343,
2932,
1937,
10480,
512,
4618,
4915,
364,
738,
87,
6,
738,
3709,
461,
13,
1570,
40,
53,
22,
5103,
273,
10... |
sage: print T1 [ 0 -1 3 1] [-1 1 0 2] | sage: T1 [ 0 2 -1 1] [-1 0 1 3] [ 3 -1 0 2] | def alternating_group_bitrade_generators(m): """ Construct generators a, b, c for the alternating group on 3m+1 points, such that a*b*c = 1. EXAMPLES: sage: from sage.combinat.matrices.latin import * sage: a, b, c, G = alternating_group_bitrade_generators(1) ((1,2,3), (1,4,2), (2,4,3), Permutation Group with generators [(1,2,3), (1,4,2)]) sage: a*b*c () sage: (T1, T2) = bitrade_from_group(a, b, c, G) sage: print T1 [ 0 -1 3 1] [-1 1 0 2] [ 1 3 2 -1] [ 2 0 -1 3] sage: print T2 [ 1 -1 0 3] [-1 0 2 1] [ 2 1 3 -1] [ 0 3 -1 2] """ assert m >= 1 a = tuple(range(1, 2*m+1 + 1)) b = tuple(range(m+1, 0, -1) + range(2*m+2, 3*m+1 + 1)) a = PermutationGroupElement(a) b = PermutationGroupElement(b) c = PermutationGroupElement((a*b)**(-1)) G = PermutationGroup([a, b]) return (a, b, c, G) | 79588eb9f6225f31a0fe90ef3cb590193d4561c1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/79588eb9f6225f31a0fe90ef3cb590193d4561c1/latin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6416,
1776,
67,
1655,
67,
3682,
354,
323,
67,
25959,
12,
81,
4672,
3536,
14291,
13327,
279,
16,
324,
16,
276,
364,
326,
6416,
1776,
1041,
603,
890,
81,
15,
21,
3143,
16,
4123,
716,
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,
6416,
1776,
67,
1655,
67,
3682,
354,
323,
67,
25959,
12,
81,
4672,
3536,
14291,
13327,
279,
16,
324,
16,
276,
364,
326,
6416,
1776,
1041,
603,
890,
81,
15,
21,
3143,
16,
4123,
716,
2... |
@dec.knownfailureif(True, "Overflowing ndmin arg of array ctor segfaults.") | def test_for_zero_length_in_choose(self, level=rlevel): "Ticket #882" a = np.array(1) self.failUnlessRaises(ValueError, lambda x: x.choose([]), a) | 7d75121a4d11bd31ec322523da9283790ac30f75 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/7d75121a4d11bd31ec322523da9283790ac30f75/test_regression.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1884,
67,
7124,
67,
2469,
67,
267,
67,
25777,
12,
2890,
16,
1801,
33,
86,
2815,
4672,
315,
13614,
468,
5482,
22,
6,
279,
273,
1130,
18,
1126,
12,
21,
13,
365,
18,
6870,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1884,
67,
7124,
67,
2469,
67,
267,
67,
25777,
12,
2890,
16,
1801,
33,
86,
2815,
4672,
315,
13614,
468,
5482,
22,
6,
279,
273,
1130,
18,
1126,
12,
21,
13,
365,
18,
6870,
9... | |
bin.objects.append(cache_entry) | newbins[-1].add(cache_entry) | def split_bins(cafepacker, extentlimit, verbose = False): """ Split bins in CafePacker so that each bin has an extent no longer than extentlimit. """ # # loop over all bins in cafepacker.bins # idx = 0 while idx < len(cafepacker.bins): # # retrieve bin # origbin = cafepacker.bins[idx] # # how many pieces? if bin doesn't need splitting move to # next # n = int(math.ceil(float(abs(origbin.extent)) / extentlimit)) if n <= 1: idx += 1 continue # # calculate the times of the splits, and then build # segmentlistdicts for clipping. # splits = [-segments.infinity()] + [lsctables.LIGOTimeGPS(origbin.extent[0] + i * float(origbin.extent[1] - origbin.extent[0]) / n) for i in range(1, n)] + [+segments.infinity()] if verbose: print >>sys.stderr, "\tsplitting cache spanning %s at %s" % (str(origbin.extent), ", ".join(str(split) for split in splits[1:-1])) splits = [segments.segmentlist([segments.segment(*bounds)]) for bounds in zip(splits[:-1], splits[1:])] splits = [segments.segmentlistdict.fromkeys(origbin.size, seglist) for seglist in splits] # # build new bins, populate sizes and extents # newbins = [] for split in splits: newbins.append(LALCacheBin()) newbins[-1].size = origbin.size & split for key in tuple(newbins[-1].size): if not newbins[-1].size[key]: del newbins[-1].size[key] newbins[-1].extent = newbins[-1].size.extent_all() # # pack objects from origbin into new bins # for bin in newbins: bin_extent_plus_max_gap = bin.extent.protract(cafepacker.max_gap) for cache_entry in origbin.objects: # # quick check of gap # if cache_entry.segment.disjoint(bin_extent_plus_max_gap): continue # # apply each offset vector # cache_entry_segs = cache_entry.to_segmentlistdict() for offset_vector in cafepacker.offset_vectors: cache_entry_segs.offsets.update(offset_vector) # # test against bin # if cache_entry_segs.intersects_segment(bin.extent): # # object is coicident with # bin # bin.objects.append(cache_entry) break # # replace original bin with split bins. increment idx to # skip over all new bins # cafepacker.bins[idx:idx+1] = newbins idx += len(newbins) # # done # | 6919fdcc32ae7785ae5d13621be098432be0abdf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/6919fdcc32ae7785ae5d13621be098432be0abdf/ligolw_cafe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
67,
11862,
12,
71,
1727,
881,
484,
264,
16,
11933,
3595,
16,
3988,
273,
1083,
4672,
3536,
5385,
8963,
316,
385,
2513,
4420,
264,
1427,
716,
1517,
4158,
711,
392,
11933,
1158,
7144,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
67,
11862,
12,
71,
1727,
881,
484,
264,
16,
11933,
3595,
16,
3988,
273,
1083,
4672,
3536,
5385,
8963,
316,
385,
2513,
4420,
264,
1427,
716,
1517,
4158,
711,
392,
11933,
1158,
7144,... |
stringPtr=cast(stringPtr,POINTER(c_char*stringSize)) identityString=stringPtr.contents.raw fields=struct.unpack('IIiI',identityString) | try: stringPtr=cast(stringPtr,POINTER(c_char*stringSize)) fields=struct.unpack('IIiI',stringPtr.contents.raw) finally: windll.ole32.CoTaskMemFree(stringPtr) | def getIAccIdentity(pacc,childID): IAccIdentityObject=pacc.QueryInterface(IAccIdentity) stringPtr,stringSize=IAccIdentityObject.getIdentityString(childID) stringPtr=cast(stringPtr,POINTER(c_char*stringSize)) identityString=stringPtr.contents.raw fields=struct.unpack('IIiI',identityString) d={} d['childID']=fields[3] if fields[0]&2: d['menuHandle']=fields[2] else: d['objectID']=fields[2] d['windowHandle']=fields[1] return d | 0accbfe008df574f95ebaa0c4c18331b73019d47 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9340/0accbfe008df574f95ebaa0c4c18331b73019d47/IAccessibleHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8974,
8973,
4334,
12,
8774,
952,
16,
3624,
734,
4672,
467,
8973,
4334,
921,
33,
8774,
952,
18,
1138,
1358,
12,
45,
8973,
4334,
13,
533,
5263,
16,
1080,
1225,
33,
45,
8973,
4334,
921,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8974,
8973,
4334,
12,
8774,
952,
16,
3624,
734,
4672,
467,
8973,
4334,
921,
33,
8774,
952,
18,
1138,
1358,
12,
45,
8973,
4334,
13,
533,
5263,
16,
1080,
1225,
33,
45,
8973,
4334,
921,
... |
except LookupError: | lines = map(lambda l, e=encoder: e(l)[0], f.readlines()) except (LookupError, UnicodeError): | def _parse_msvc7_overrides(version): """ Parse any overridden defaults for MSVS directory locations in MSVS .NET. """ # First, we get the shell folder for this user: if not SCons.Util.can_read_reg: raise SCons.Errors.InternalError, "No Windows registry module was found" comps = "" try: (comps, t) = SCons.Util.RegGetValue(SCons.Util.HKEY_CURRENT_USER, r'Software\Microsoft\Windows\CurrentVersion' +\ r'\Explorer\Shell Folders\Local AppData') except SCons.Util.RegError: raise SCons.Errors.InternalError, "The Local AppData directory was not found in the registry." comps = comps + '\\Microsoft\\VisualStudio\\' + version + '\\VCComponents.dat' dirs = {} if os.path.exists(comps): # now we parse the directories from this file, if it exists. # We only look for entries after: [VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories], # since this file could contain a number of things... lines = None try: import codecs except ImportError: pass else: try: f = codecs.open(comps, 'r', 'utf16') encoder = codecs.getencoder('ascii') except LookupError: lines = codecs.open(comps, 'r', 'utf8').readlines() else: lines = map(lambda l, e=encoder: e(l)[0], f.readlines()) if lines is None: lines = open(comps, 'r').readlines() found = 0 for line in lines: line.strip() if line.find(r'[VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories]') >= 0: found = 1 elif line == '' or line[:1] == '[': found = 0 elif found == 1: kv = line.split('=', 1) if len(kv) == 2: (key, val) = kv key = key.replace(' Dirs','') dirs[key.upper()] = val f.close() else: # since the file didn't exist, we have only the defaults in # the registry to work with. try: K = 'SOFTWARE\\Microsoft\\VisualStudio\\' + version K = K + r'\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories' k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,K) i = 0 while 1: try: (key,val,t) = SCons.Util.RegEnumValue(k,i) key = key.replace(' Dirs','') dirs[key.upper()] = val i = i + 1 except SCons.Util.RegError: break except SCons.Util.RegError: # if we got here, then we didn't find the registry entries: raise SCons.Errors.InternalError, "Unable to find MSVC paths in the registry." return dirs | d60222a91b3e5b8536c09001d81a7e6a80204c78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12817/d60222a91b3e5b8536c09001d81a7e6a80204c78/msvc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
959,
4227,
27,
67,
19775,
12,
1589,
4672,
3536,
2884,
1281,
11000,
3467,
364,
9238,
14640,
1867,
7838,
316,
9238,
14640,
263,
14843,
18,
3536,
225,
468,
5783,
16,
732,
336... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
959,
4227,
27,
67,
19775,
12,
1589,
4672,
3536,
2884,
1281,
11000,
3467,
364,
9238,
14640,
1867,
7838,
316,
9238,
14640,
263,
14843,
18,
3536,
225,
468,
5783,
16,
732,
336... |
for builder in results_json: tests = results_json[builder][self.TESTS] for path in tests: test = tests[path] test[self.RESULTS] = self._RunLengthEncode(test[self.RESULTS]) test[self.TIMES] = self._RunLengthEncode(test[self.TIMES]) | def _ConvertJSONToCurrentVersion(self, results_json): """If the JSON does not match the current version, converts it to the current version and adds in the new version number. """ if (self.VERSION_KEY in results_json and results_json[self.VERSION_KEY] == self.VERSION): return | 2c6b40896d0e00da22bb251a63b504e9e28c97a3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/2c6b40896d0e00da22bb251a63b504e9e28c97a3/json_results_generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2723,
2986,
774,
3935,
1444,
12,
2890,
16,
1686,
67,
1977,
4672,
3536,
2047,
326,
1796,
1552,
486,
845,
326,
783,
1177,
16,
7759,
518,
358,
326,
783,
1177,
471,
4831,
316,
326,
39... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2723,
2986,
774,
3935,
1444,
12,
2890,
16,
1686,
67,
1977,
4672,
3536,
2047,
326,
1796,
1552,
486,
845,
326,
783,
1177,
16,
7759,
518,
358,
326,
783,
1177,
471,
4831,
316,
326,
39... | |
for label, offset in buttons: | self.keys = {} for label, keyname, offset in buttons: | def create_ui(self, title, icon): # buttons at the top hbox1 = gtk.HBox() self.stop_button = gtk.ToggleButton("Stopped") self.stop_button.connect("toggled", self.stop_cb) hbox1.add(self.stop_button) | addf9c98454ab58b64b6848df3b2fa600a478bcc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8501/addf9c98454ab58b64b6848df3b2fa600a478bcc/debugui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
4881,
12,
2890,
16,
2077,
16,
4126,
4672,
468,
9502,
622,
326,
1760,
366,
2147,
21,
273,
22718,
18,
44,
3514,
1435,
365,
18,
5681,
67,
5391,
273,
22718,
18,
17986,
3616,
2932,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4881,
12,
2890,
16,
2077,
16,
4126,
4672,
468,
9502,
622,
326,
1760,
366,
2147,
21,
273,
22718,
18,
44,
3514,
1435,
365,
18,
5681,
67,
5391,
273,
22718,
18,
17986,
3616,
2932,... |
return publitext | return unicode(publitext).strip() | def get_publisher(self, entry): publisher = entry.find("div[@id='book-info']/dl[@title='Informations sur le livre']") publitext = None for x in publisher.getiterator('dt'): if self.repub.match(x.text): publitext = x.getnext().text_content() break return publitext | fd711e6075e2dec43ab37c76fad9ed299fcdc71d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/fd711e6075e2dec43ab37c76fad9ed299fcdc71d/nicebooks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
26018,
12,
2890,
16,
1241,
4672,
12855,
273,
1241,
18,
4720,
2932,
2892,
14782,
350,
2218,
3618,
17,
1376,
3546,
19,
5761,
14782,
2649,
2218,
25541,
1012,
5056,
884,
328,
427,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
26018,
12,
2890,
16,
1241,
4672,
12855,
273,
1241,
18,
4720,
2932,
2892,
14782,
350,
2218,
3618,
17,
1376,
3546,
19,
5761,
14782,
2649,
2218,
25541,
1012,
5056,
884,
328,
427,
2... |
GetSubLanguages(language) | return GetSubLanguages(language) | def GetSubLanguages(self, language): GetSubLanguages = TimeoutFunction(self._GetSubLanguages) try: GetSubLanguages(language) except TimeoutFunctionException: self.log.error("GetSubLanguages timed out") | 2033a99ae2988e0695bd459d6809685cb1c16fdc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1108/2033a99ae2988e0695bd459d6809685cb1c16fdc/OSDBServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
1676,
12912,
12,
2890,
16,
2653,
4672,
968,
1676,
12912,
273,
7804,
2083,
12,
2890,
6315,
967,
1676,
12912,
13,
775,
30,
327,
968,
1676,
12912,
12,
4923,
13,
1335,
7804,
2083,
503,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
968,
1676,
12912,
12,
2890,
16,
2653,
4672,
968,
1676,
12912,
273,
7804,
2083,
12,
2890,
6315,
967,
1676,
12912,
13,
775,
30,
327,
968,
1676,
12912,
12,
4923,
13,
1335,
7804,
2083,
503,
... |
print("got here") | def SampleFromIS(G, delta, sigma, (transition_matrices, state_to_index_in_transition_matrices, index_in_transition_matrices_to_state)): """ This function assigns migrations (i.e., character state changes) to the branches of G, with migrations being drawn from a probability distribition such that the density of one assignment of migrations M is Pr(M | G, delta, sigma). migrations will be assigned to branches with known time-order, but without specifying the actual times of migrations. "all_delta_earlier" will be created. "all_delta_earlier" is dictionary mapping the indices of all lineages in all levels to their character states right before the lineages were created in a branching event. Also, "all_delta_later" will be created. "all_delta_later" is dictionary mapping the indices of all lineages in all levels to their most recent character states. Input parameters ---------------- G, delta, sigma see function LikelihoodOfParameters The fourth parameter is a 3-tuple. Each of its elements is described below. transition_matrices The migrations are assigned by running a discrete-time Markov chain (the conditional jump chain) once. transition_matrices[k] should contain the transition matrix for level n-k, where n is the number of leaves in G, and 0 <= k <= n-1 (A level is the portion of G between two speciation events.) state_to_index_in_transition_matrices is a list of dictionaries, one for each level. state_to_index_in_transition_matrices[k] is a dictionary for level n-k, which maps each state (of the jump chain) in level k to its index in that level's transition matrix. index_in_transition_matrices_to_state is a list of dictionaries, one for each level. is the reverse map of state_to_index_in_transition_matrices[k] Return value(s) --------------- a real number density_A, where A is a a time-order event history A (for use in the right side of Equation 8) all_delta_earlier a dictionary mapping the indices of all lineages in all levels to their character states right before the lineages coalesce all_delta_later a dictionary mapping the indices of all lineages in all levels to their most recent character states - The time-order event history A is generated using a probabilistic process, and hence along with A the probability of A is also returned, which we denote density_A. - essentially, A is the input phylogenetic tree G augmented so that migrations (i.e., character state transitions) are assigned to each branch of the phylogenetic tree. The order of occurrence (i.e., the time order) of the migrations will be known, but not the actual times. See Figure 3. * all classes are defined in is_classes.py* G is an instance of class Tree, and has a data attribute levels[], which contains a level-by-level representation of the tree (G.levels[k] contains level n-k, where n is the total number of leaves in G, and 0 <= k <= n-1). Each level is an instance of class Level, and has a data attribute event_history which is left unpopulated when the level instance is created. This (the current) function populates the event history. Suppose level = 4, and that there are 4 lineages 1, 2, 3, & 4. And let the character state assignments be {1:0, 2:1, 3:1, 4:1}. And let following events happen before the chain goes to level 3: a. lineage 2 goes from character state 1 to character state 0 b. lineage 3 goes from character state 1 to character state 0 c. lineages 2 & 3 coalesce to form a parent lineage 5; and this ends level 4. The event history for level 4 will be a list: [{1:0, 2:1, 3:1, 4:1}, 2, 3]. The first element is the character state at the beginning. The other elements are the lineages that undergo migration. Given that lineages only migrate between 2 states, it is sufficient to list the lineages that migrated (their states can be inferred). For the next level, (i.e., level 3) the initial character state assignment will be: {1:0, 4:1, 5:0} (since 2 & 3 were in state 0, their parent 5 also will be in state 0). Details: ------- if the event_history is [{0: 1, 1: 1, 2: 1, 3: 1}] [{2: 1, 3: 1, 4: 1}, 4] [{4: 0, 5: 1}, 5] all_delta_earlier is {0: 1, 1: 1, 2: 1, 3: 1, 4: 0, 5: 0} all_delta_later is {0: 1, 1: 1, 2: 1, 3: 1, 4: 1, 5: 1} The input phylogenetic tree can be viewed as a tuple (tau, BRL(tau)) (see also page 7, bullet point entitled "Sample history") where tau is the tree topology with *with known time order of branching events*, BRL(tau) are the actual time durations assigned to the branches of tau. The function follows the following basic scheme in assigning migrations to the branches of G as follows: G = (tau, BRL(tau)) ===> tau ===> (tau, MIG(tau)) ===> (tau, MIG(tau), BRL(tau)) / | 1 / | 1---------------> here we are just sticking BRL(tau) back. / V / the migrations assigned to / branches of tau | | V this is a stochastic process (a discrete-time Markov chain, to be precise); MIG(tau) is sampled from a probability distribution such that its density under the distribution is Pr(MIG(tau) | tau, delta, sigma). Sections 5.1-5.3 are devoted to this. THE DISCRETE-TIME MARKOV CHAIN INVOLVED IN THIS IS THE CONDITIONAL JUMP CHAIN OF SECTION 5.3 # A detailed description of the conditional jump chain(PLEASE READ, HIGHLY IMPORTANT) # ------------------------------------------------------------------------------------ # # IMPORTANT: A LINEAGE IS A SPECIES IN THE SAMPLE OR AN ANCESTOR OF # A SPECIES IN THE SAMPLE. # # 1. The conditional jump chain has the following properties. # ========================== # # a. it is characterized by a 4-tuple: (set of states, # designated initial state, # designated set of terminal states, # matrix of probabilities of transitions between states # ) # # b. each state is a 4-tuple: # # n_lineages_in_state_zero the number of lineages in state 0 # n_lineages_in_state_one the number of lineages in state 1 # # |the states of the two lineages # state_of_next_coalescing_lineages_1 |involved in the next (going # state_of_next_coalescing_lineages_2 |backwards in time) speciation # |event. # # The next_coalescing_lineages are known since the tree # is known. Thus, this jump chain is constructed # conditional on the tree being known (and hence its # name). # # The 4 variables are equivalent, respectively, to q, r, x_1 and x_2 in page # 19, paragraph 3, line 4. # # When there there are k lineages (i.e., # n_lineages_in_state_zero + n_lineages_in_state_one = k), the # chain is said to be in level-k. # ======= # # c. its state transitions represent either migration (i.e., change # of state of lineages), or speciation events. Migrations leave # the number of lineages unchanged, while the speciation events # reduce the number by 1. Thus migrations are "within-level" # ============= # transitions and speciations are "between-level" transitions. # =============== # # d. the initial state of the chain reflects the situation at the # tips of the input phylogenetic tree and delta: n_lineages_in_state_zero # and n_lineages_in_state_one depend on delta; the next-coalescing # lineages are the two lineages involved in the most recent # speciation event in the tree. # # e. the terminal state(s) of the chain are such that # n_lineages_in_state_zero + n_lineages_in_state_one = 1. # # f. the chain is designed (i.e., the state transition matrix is # set up) in such a way that the within-level # transitions (i.e., speciation) are exactly those that occur # in the input phylogenetic trees, and occur in the same # order. # # # 2. The transition matrix and the operation of the conditional jump chain. # ================= # # The conditional jump chain starts from the initial state, and repeatedly # transitions to other states until a terminal state (i.e., one # where the total number of lineages is 1) is reached. As noted # above in (b), each state transition represents an event - either # migration or speciation - in the history of the sample. # # Generally, if a discrete-Time Markov chain has N states, the # transition matrix is an N x N matrix T such that T[i, j] is the # probability that the next state is j, given that the current state # is i. # # In our case, we don't define the entire transition matrix all at # once, since it is convenient to do so level-by-level. At each # level, we define a matrix for within-level transitions, and also # calculate the probability of the one between-level transition # that's allowed (namely, that of the speciation involving the two # next-coalescing lineages), and a within-level or between-level # transition is made based on the probabilities. # # The whole operation of the Markov chain can be characterized as # follows: # # level <- n, where n is the number of tips of the input # phylogenetic tree # # UNTIL level 1 is reached, do: # # while remaining within the level: # choose either a within-level transition or between-level # transition based on their probabilities. # # level <- level - 1 """ alpha=sigma[3] mu=sigma[4] if(alpha>mu): return("error, alpha is greater than mu") # In what follows, uncond is short for unconditional (i.e., not # conditioned on the tree), and cond is short for conditional (i.e., # conditioned on the tree). And prob, of course, is short for probability. state_of_cond_jump_chain = GetInitialStateofCondJumpChain(G, delta) n_leaves = G.num_leaves # at first we are at the n-th level, where n is the number of leaves in # G. current_level_number = n_leaves # We will generate a time-order event history backwards. # This history is a list of states the chain passes through, # The probability_of_history is initially set to 1. # the 1.0 will ensure that probability_of_history is a float. # Otherwise, python will assume it is an int. probability_of_history = 1.0 # with each event, the assignment states to # lineages changes. current_delta keeps track of the current assignment # of states to lineages. # VERY IMPORTANT: delta is a dictionary. And # "current_delta = delta.copy()" is very different from saying # current_delta = delta (this holds for any *mutable* (that is, # changeable) object like lists or tuples.). The former, called a "deep # copy" creates a copy of delta and maps the name current_delta. # Thus after this assignment, # current_delta and delta are pointing to two different objects. # Whereas after saying "current_delta = delta", both the names point to # the same object - the one which delta was pointing to before the # assignment. # I am doing a deep copy since I don't want to mess with the original # delta. current_delta = delta.copy() all_delta_earlier=delta.copy() all_delta_later=delta.copy() while not current_level_number == 1: print("level "+str(current_level_number)) # Note: the following, and all assignments in fact, are copies by # reference, since all an assignment does in python # is to map a name to an object. current_level = G.levels[n_leaves - current_level_number] current_level.event_history.append(current_delta.copy()) # when the conditional jump chain is in level k (i.e., the total # number of lineages = k), the number of states at that level # is 4(k-1) (see paragraph 3, page 19). Further, there is one # possible transition to level k-1 (which is the speciation # involving the next-coalesceing lineages). # Thus, # transition_matrix_for_the_level will be a 4(k-1)+1 x 4(k-1)+1 # matrix. # # NOTE: it is not known in advance which state in level k-1 the # chain will transition to from level k. But that knowledge is not # necessary. From each of the 4(k+1) states in level k, it is # possible to calculate the probability of transitioning to level # k-1. In fact, that's precisely the reason why we include the # character state of the next coalescing lineages in description of # the jump chain states. # The left side variable is the state-to-index dictionary for the # current level. state_to_index_in_transition_matrix = state_to_index_in_transition_matrices[n_leaves - current_level_number] # also get the reverse map. # The left side variable is the index-to-state dictionary for the # current level. index_in_transition_matrix_to_state = index_in_transition_matrices_to_state[n_leaves - current_level_number] index_of_current_state = state_to_index_in_transition_matrix[state_of_cond_jump_chain] transition_matrix_for_the_level = transition_matrices[n_leaves - current_level_number] # transition_matrix_for_the_level[index_of_current_state] is a row # of probabilities of transitions from the current state. # the probabilities in the row must sum up to 1. We can verify that # by placing an assert. If the condition fails, the program exits # with a message. In python, sum(some_list) returns the sum of the # elements of some_list, if list consists of real numbers. assert(1.0-1e5<(sum(transition_matrix_for_the_level[index_of_current_state]))< 1.0+1e-5) whether_in_the_same_level = "True" while whether_in_the_same_level == "True": print("got here") # pick a next state to transition to such that # Pr(index of next state = j | index of current state = index_of_current_state) = transition_matrix_for_the_level[index_of_current_state][j] (index_of_next_state, probability_of_transition) = PickNextStateofChain(transition_matrix_for_the_level[index_of_current_state]) print("prob 1 "+str(index_of_next_state)+" "+str(probability_of_transition)) print("current_state "+str(state_of_cond_jump_chain)) if(index_of_next_state==len(index_in_transition_matrix_to_state)): whether_in_the_same_level = "False" # check if current state and the proposed next state are in the same level #whether_in_the_same_level = WhetherInTheSameLevel(state_of_cond_jump_chain, next_state_of_cond_jump_chain) if whether_in_the_same_level == "True": # migration event is happening. So pick a lineage to # migrate. For our specific model we need to pick one of # the 1 (neotropical lineages) to migrate to 0 (remember # that we are going back in time, so backward migrations # are from 1->0. The function ChooseLineageandUpdateDelta # updates current_delta and also returns a lineage that # migrates. The function should choose one lineage # uniformly at random among # all lineages that *could* migrate and return it. next_state_of_cond_jump_chain = index_in_transition_matrix_to_state[index_of_next_state] print("next state "+str(next_state_of_cond_jump_chain)) migration_type = MigrationType(state_of_cond_jump_chain, next_state_of_cond_jump_chain) (migrating_lineage, current_delta, all_delta_earlier) = ChooseLineageandUpdateDelta(G, current_level_number, migration_type, current_delta, all_delta_earlier) current_level.event_history.append(migrating_lineage) print("appended migrating lineage "+str(migrating_lineage)) # updating the state of the chain. state_of_cond_jump_chain = next_state_of_cond_jump_chain index_of_current_state = index_of_next_state else: next_level_number = current_level_number-1 if(next_level_number!=1): next_level = G.levels[n_leaves - next_level_number] # The chain wants to move to the next level (to level k-1 if # the current level is k). # Basically, the chain wants to effect a speciation # involving the next_coalescing_lineages, and if we know # the character state (0/1) of the next_coalescing_lineages # in the current state of the cond. jump chain, we can use # that to figure out the state of the parent lineage. # Look at Figure 1 (page # 6). The the two daughter lineages are in states (0, 0), # the parent will be in in state 0. Similaly, (1, 1) -> 1, # and (0, 1) -> 0. # # Note 1: The next coalescing lineages are the children of from # current_level.end_node # # Note 2. The character state of the next coalescing # lineages can be got from current_delta # # The function MovetoNextLevel will apply these rules and # (a) update current_delta, # (b) return the initial state for the next level's conditional jump chain # (c) initialize the event history for the next level with # the updated delta (initial_state_in_the_next_level,current_delta,all_delta_earlier, all_delta_later) = MovetoNextLevel(state_of_cond_jump_chain, current_delta, all_delta_earlier, all_delta_later, current_level, next_level) # and *now* update the state of the chain state_of_cond_jump_chain = initial_state_in_the_next_level # update current level number current_level_number=next_level_number probability_of_history = probability_of_history * probability_of_transition print("prob 2"+str(probability_of_history)) return(probability_of_history,all_delta_earlier, all_delta_later) | 7faf202b1836f91fc50c86fe3b92f5a5d79dc08b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7945/7faf202b1836f91fc50c86fe3b92f5a5d79dc08b/cjumpchain.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11474,
1265,
5127,
12,
43,
16,
3622,
16,
7299,
16,
261,
14936,
67,
7373,
12660,
16,
919,
67,
869,
67,
1615,
67,
267,
67,
14936,
67,
7373,
12660,
16,
770,
67,
267,
67,
14936,
67,
7373... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11474,
1265,
5127,
12,
43,
16,
3622,
16,
7299,
16,
261,
14936,
67,
7373,
12660,
16,
919,
67,
869,
67,
1615,
67,
267,
67,
14936,
67,
7373,
12660,
16,
770,
67,
267,
67,
14936,
67,
7373... | |
Return a two-dimensional AES like representation of the matrix M. | Return a two-dimensional AES-like representation of the matrix M. | def hex_str_matrix(self, M): r""" Return a two-dimensional AES like representation of the matrix M. That is, show the finite field elements as hex strings. INPUT: - ``M`` - an AES state array EXAMPLE:: sage: sr = mq.SR(2, 2, 2, 4) sage: k = sr.base_ring() sage: A = matrix(k, 2, 2, [1, k.gen(), 0, k.gen()^2]) sage: sr.hex_str_matrix(A) ' 1 2 \n 0 4 \n' """ e = M.base_ring().degree() st = [""] for x in range(M.nrows()): for y in range(M.ncols()): if e == 8: st.append("%02X"%(int(str(M[x, y].int_repr())))) else: st.append("%X"%(int(str(M[x, y].int_repr())))) st.append("\n") return " ".join(st) | 019849b2438f7aac031134d883a8d8c124e94dfe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/019849b2438f7aac031134d883a8d8c124e94dfe/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3827,
67,
701,
67,
5667,
12,
2890,
16,
490,
4672,
436,
8395,
2000,
279,
2795,
17,
31236,
15986,
17,
5625,
4335,
434,
326,
3148,
490,
18,
225,
12466,
353,
16,
2405,
326,
25922,
652,
218... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3827,
67,
701,
67,
5667,
12,
2890,
16,
490,
4672,
436,
8395,
2000,
279,
2795,
17,
31236,
15986,
17,
5625,
4335,
434,
326,
3148,
490,
18,
225,
12466,
353,
16,
2405,
326,
25922,
652,
218... |
jmol_path = "" | console.stdoutln("ERROR: Unexpected error:", sys.exc_info()[0]) jmol_file = "" | def html_tls_graph_path(self, chain, ntls): """Generates the HTML table describing the path (set of tls groups) for the given number of segments(h, or ntls) """ cpartition = chain.partition_collection.get_chain_partition(ntls) if cpartition == None: return None | 81092918682cb3b404793cc6abd4020f9621498a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10674/81092918682cb3b404793cc6abd4020f9621498a/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
67,
17116,
67,
4660,
67,
803,
12,
2890,
16,
2687,
16,
9513,
3251,
4672,
3536,
6653,
326,
3982,
1014,
16868,
326,
589,
261,
542,
434,
6871,
3252,
13,
364,
326,
864,
1300,
434,
515... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
67,
17116,
67,
4660,
67,
803,
12,
2890,
16,
2687,
16,
9513,
3251,
4672,
3536,
6653,
326,
3982,
1014,
16868,
326,
589,
261,
542,
434,
6871,
3252,
13,
364,
326,
864,
1300,
434,
515... |
if types: template(f, n-1, False, ('class A%d, ' % n)+types, ('A%d& a%d, ' %(n,n)) + params, ('a%d, '%n) + args) template(f, n-1, True, ('class A%d, ' % n)+types, ('A%d& a%d, ' %(n,n)) + params, ('a%d, '%n) + args) else: template(f, n-1, False, ('class A%d ' % n), ('A%d& a%d' %(n,n)), ('a%d'%n)) template(f, n-1, True, ('class A%d ' % n), ('A%d& a%d' %(n,n)), ('a%d'%n)) elif const: | template(f, n-1, True, ('class A%d ' % n), ('const A%d& a%d' %(n,n)), ('a%d'%n)) else: | def template(f, n, const, types = '', params = '', args = ''): if n > 0: if const: if types: template(f, n-1, False, ('class A%d, ' % n)+types, ('const A%d& a%d, ' %(n,n)) + params, ('a%d, '%n) + args) template(f, n-1, True, ('class A%d, ' % n)+types, ('const A%d& a%d, ' %(n,n)) + params, ('a%d, '%n) + args) else: template(f, n-1, False, ('class A%d ' % n), ('const A%d& a%d' %(n,n)), ('a%d'%n)) template(f, n-1, True, ('class A%d ' % n), ('const A%d& a%d' %(n,n)), ('a%d'%n)) else: if types: template(f, n-1, False, ('class A%d, ' % n)+types, ('A%d& a%d, ' %(n,n)) + params, ('a%d, '%n) + args) template(f, n-1, True, ('class A%d, ' % n)+types, ('A%d& a%d, ' %(n,n)) + params, ('a%d, '%n) + args) else: template(f, n-1, False, ('class A%d ' % n), ('A%d& a%d' %(n,n)), ('a%d'%n)) template(f, n-1, True, ('class A%d ' % n), ('A%d& a%d' %(n,n)), ('a%d'%n)) elif const: if types : f.write('template< int ARENA, %s > static inline be_pointer_<T> create(%s)\n' % (types, params)) f.write('{\n') f.write(' void* mem = BugEngine::Memory<ARENA>::alloc(sizeof(T), be_alignof(T));\n') f.write(' return be_pointer_<T>(new(mem) T(%s), &BugEngine::Memory<ARENA>::free);\n' % args) f.write('}\n'); else: f.write('template< int ARENA > static inline be_pointer_<T> create()\n') f.write('{\n') f.write(' void* mem = BugEngine::Memory<ARENA>::alloc(sizeof(T), be_alignof(T));\n') f.write(' return be_pointer_<T>(new(mem) T, &BugEngine::Memory<ARENA>::free);\n') f.write('}\n'); | 54a6c0fcd5d69c35347d03211df2bcc28fe91034 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7302/54a6c0fcd5d69c35347d03211df2bcc28fe91034/generate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1542,
12,
74,
16,
290,
16,
1866,
16,
1953,
273,
10226,
859,
273,
10226,
833,
273,
875,
4672,
309,
290,
405,
374,
30,
309,
1866,
30,
309,
1953,
30,
1542,
12,
74,
16,
290,
17,
21,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1542,
12,
74,
16,
290,
16,
1866,
16,
1953,
273,
10226,
859,
273,
10226,
833,
273,
875,
4672,
309,
290,
405,
374,
30,
309,
1866,
30,
309,
1953,
30,
1542,
12,
74,
16,
290,
17,
21,
16... |
print filepath | def on_speak_clicked(self, widget=None, event=None): filepath = audio_file_path+'/'+self.tree_value+'.ogg' print filepath if os.path.isfile(filepath): self.player.set_property("uri", "file://" + filepath) self.player.set_state(gst.STATE_PLAYING) else: self.player.set_state(gst.STATE_NULL) | 9a1c110e26ca2c1de615e4d844f3eb2b1058bb80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10994/9a1c110e26ca2c1de615e4d844f3eb2b1058bb80/wordgroupz_new.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
87,
10244,
67,
7475,
329,
12,
2890,
16,
3604,
33,
7036,
16,
871,
33,
7036,
4672,
3608,
273,
7447,
67,
768,
67,
803,
6797,
2473,
15,
2890,
18,
3413,
67,
1132,
6797,
18,
23972... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
87,
10244,
67,
7475,
329,
12,
2890,
16,
3604,
33,
7036,
16,
871,
33,
7036,
4672,
3608,
273,
7447,
67,
768,
67,
803,
6797,
2473,
15,
2890,
18,
3413,
67,
1132,
6797,
18,
23972... | |
logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: loading objects' % package.name) migrations.migrate_module(package, 'pre') register_class(package.name) modules = pool.instanciate(package.name, cr) if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'): init_module_objects(cr, package.name, modules) cr.commit() for package in graph: status['progress'] = (float(statusi)+0.1) / len(graph) | def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs): # **kwargs is passed directly to convert_xml_import if not status: status = {} status = status.copy() package_todo = [] statusi = 0 pool = pooler.get_pool(cr.dbname) migrations = MigrationManager(cr, graph) has_updates = False modobj = None for package in graph: logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: loading objects' % package.name) migrations.migrate_module(package, 'pre') register_class(package.name) modules = pool.instanciate(package.name, cr) if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'): init_module_objects(cr, package.name, modules) cr.commit() for package in graph: status['progress'] = (float(statusi)+0.1) / len(graph) m = package.name mid = package.id if modobj is None: modobj = pool.get('ir.module.module') if modobj and perform_checks: modobj.check(cr, 1, [mid]) idref = {} status['progress'] = (float(statusi)+0.4) / len(graph) mode = 'update' if hasattr(package, 'init') or package.state == 'to install': mode = 'init' if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'): has_updates = True for kind in ('init', 'update'): for filename in package.data.get('%s_xml' % kind, []): logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: loading %s' % (m, filename)) name, ext = os.path.splitext(filename) fp = tools.file_open(opj(m, filename)) if ext == '.csv': tools.convert_csv_import(cr, m, os.path.basename(filename), fp.read(), idref, mode=mode) elif ext == '.sql': queries = fp.read().split(';') for query in queries: new_query = ' '.join(query.split()) if new_query: cr.execute(new_query) else: tools.convert_xml_import(cr, m, fp, idref, mode=mode, **kwargs) fp.close() if hasattr(package, 'demo') or (package.dbdemo and package.state != 'installed'): status['progress'] = (float(statusi)+0.75) / len(graph) for xml in package.data.get('demo_xml', []): name, ext = os.path.splitext(xml) logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: loading %s' % (m, xml)) fp = tools.file_open(opj(m, xml)) if ext == '.csv': tools.convert_csv_import(cr, m, os.path.basename(xml), fp.read(), idref, mode=mode, noupdate=True) else: tools.convert_xml_import(cr, m, fp, idref, mode=mode, noupdate=True, **kwargs) fp.close() cr.execute('update ir_module_module set demo=%s where id=%s', (True, mid)) package_todo.append(package.name) migrations.migrate_module(package, 'post') if modobj: ver = release.major_version + '.' + package.data.get('version', '1.0') # Set new modules and dependencies modobj.write(cr, 1, [mid], {'state': 'installed', 'latest_version': ver}) cr.commit() # Update translations for all installed languages modobj.update_translations(cr, 1, [mid], None) cr.commit() package.state = 'installed' for kind in ('init', 'demo', 'update'): if hasattr(package, kind): delattr(package, kind) statusi += 1 cr.execute('select model from ir_model where state=%s', ('manual',)) for model in cr.dictfetchall(): pool.get('ir.model').instanciate(cr, 1, model['model'], {}) pool.get('ir.model.data')._process_end(cr, 1, package_todo) cr.commit() return has_updates | 2895633576940cdd40c0c735b82756d1daafd3e7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/2895633576940cdd40c0c735b82756d1daafd3e7/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
2978,
67,
4660,
12,
3353,
16,
2667,
16,
1267,
33,
7036,
16,
3073,
67,
12366,
33,
5510,
16,
2826,
4333,
4672,
468,
2826,
4333,
353,
2275,
5122,
358,
1765,
67,
2902,
67,
5666,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
2978,
67,
4660,
12,
3353,
16,
2667,
16,
1267,
33,
7036,
16,
3073,
67,
12366,
33,
5510,
16,
2826,
4333,
4672,
468,
2826,
4333,
353,
2275,
5122,
358,
1765,
67,
2902,
67,
5666,
... | |
def getRetrylimit(wifi, wifi_details): | def getRetrylimit(wifi): | def getRetrylimit(wifi, wifi_details): """ Return formatted string with Retry info. """ try: retry = wifi_details.getRetry() except IOError, (errno, strerror): return None else: return "Retry limit:%s " % (wifi.getRetrylimit(), ) | 00a2b457b7ea878745c9bf3776fc596fe42089a9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3159/00a2b457b7ea878745c9bf3776fc596fe42089a9/iwconfig.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4170,
2559,
3595,
12,
91,
704,
4672,
3536,
2000,
4955,
533,
598,
9954,
1123,
18,
3536,
775,
30,
3300,
273,
341,
704,
67,
6395,
18,
588,
7539,
1435,
1335,
8340,
16,
261,
19088,
16,
609,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4170,
2559,
3595,
12,
91,
704,
4672,
3536,
2000,
4955,
533,
598,
9954,
1123,
18,
3536,
775,
30,
3300,
273,
341,
704,
67,
6395,
18,
588,
7539,
1435,
1335,
8340,
16,
261,
19088,
16,
609,... |
print cmd + " " + str(args) self.pid = os.spawnv(os.P_NOWAIT, cmd, args) | self.procid = os.spawnv(os.P_NOWAIT, cmd, args) | def get_connection(self,dev_mac): # fire up a connection # don't forget to set up your phone not to ask for a connection # (at least for this computer) args = ["rfcomm", "connect" ,"1", dev_mac, str(self.config['device_channel'])] cmd = "/usr/bin/rfcomm" print cmd + " " + str(args) self.pid = os.spawnv(os.P_NOWAIT, cmd, args) # take some time to connect time.sleep(5) | ed66cf90a3b28dd4e359fd8c8f9a9369301f189d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/61/ed66cf90a3b28dd4e359fd8c8f9a9369301f189d/proximity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4071,
12,
2890,
16,
5206,
67,
5821,
4672,
468,
4452,
731,
279,
1459,
468,
2727,
1404,
13776,
358,
444,
731,
3433,
7353,
486,
358,
6827,
364,
279,
1459,
468,
261,
270,
4520,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4071,
12,
2890,
16,
5206,
67,
5821,
4672,
468,
4452,
731,
279,
1459,
468,
2727,
1404,
13776,
358,
444,
731,
3433,
7353,
486,
358,
6827,
364,
279,
1459,
468,
261,
270,
4520,
36... |
returnvals.append(raw_input(prompt) or ddb) | returnvals.append(raw_input(prompt).strip() or ddb) | def get_initenv_args(self): returnvals = [] print 'Creating a new Trac environment at %s' % self.envname print print 'Trac will first ask a few questions about your environment ' print 'in order to initalize and prepare the project database.' print print " Please enter the name of your project." print " This name will be used in page titles and descriptions." print dp = 'My Project' returnvals.append(raw_input('Project Name [%s]> ' % dp) or dp) print print ' Please specify the connection string for the database to use.' print ' By default, a local SQLite database is created in the environment ' print ' directory. It is also possible to use an already existing ' print ' PostgreSQL database (check the Trac documentation for the exact ' print ' connection string syntax).' print ddb = 'sqlite:db/trac.db' prompt = 'Database connection string [%s]> ' % ddb returnvals.append(raw_input(prompt) or ddb) print print ' Please specify the absolute path to the project Subversion repository.' print ' Repository must be local, and trac-admin requires read+write' print ' permission to initialize the Trac database.' print drp = '/var/svn/test' prompt = 'Path to repository [%s]> ' % drp returnvals.append(raw_input(prompt) or drp) print print ' Please enter location of Trac page templates.' print ' Default is the location of the site-wide templates installed with Trac.' print dt = default_dir('templates') prompt = 'Templates directory [%s]> ' % dt returnvals.append(raw_input(prompt) or dt) return returnvals | 55a08c75bdec3808eee5fed5c5989cc730862d94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/55a08c75bdec3808eee5fed5c5989cc730862d94/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2738,
3074,
67,
1968,
12,
2890,
4672,
327,
4524,
273,
5378,
1172,
296,
11092,
279,
394,
2197,
71,
3330,
622,
738,
87,
11,
738,
365,
18,
3074,
529,
1172,
1172,
296,
1609,
71,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2738,
3074,
67,
1968,
12,
2890,
4672,
327,
4524,
273,
5378,
1172,
296,
11092,
279,
394,
2197,
71,
3330,
622,
738,
87,
11,
738,
365,
18,
3074,
529,
1172,
1172,
296,
1609,
71,
... |
def update_cursor(self, mode, wpos): | def update_cursor(self, graphicsMode, wpos): | def update_cursor(self, mode, wpos): "MouseEventHandler_API method; change cursor based on current state and event position" assert self.glpane is mode.o win = mode.w # for access to cursors wX, wY = wpos bc = self.button_region_for_event_position(wX, wY) # figure out want_cursor (False or a button code; in future there may be other codes for modified cursors) if not self.pressed_button: # mouse is not down; cursor reflects where we are at the moment (False or a button code) want_cursor = bc else: # a button is pressed; cursor reflects whether this button will act or not # (based on whether we're over it now or not) # (for now, if the button will act, the cursor does not look any different # than if we're hovering over the button, but revising that would be easy) if self.pressed_button == bc: want_cursor = bc else: want_cursor = False # show the cursor indicated by want_cursor if want_cursor: assert want_cursor in BUTTON_CODES if want_cursor == 'Done': cursor = win._confcorner_OKCursor else: cursor = win._confcorner_CancelCursor self.glpane.setCursor(cursor) else: # We want to set a cursor which indicates that we'll do nothing. # Modes won't tell us that cursor, but they'll set it as a side effect of mode.update_cursor_for_no_MB(). # Actually, they may set the wrong cursor then (e.g. cookieMode, which looks at glpane.modkeys, but if we're # here with modkeys we're going to ignore them). If that proves to be misleading, we'll revise this. self.glpane.setCursor(win.ArrowCursor) # in case the following method does nothing (can happen) try: mode.update_cursor_for_no_MB() # _no_MB is correct, even though a button is presumably pressed. except: print_compact_traceback("bug: exception (ignored) in %r.update_cursor_for_no_MB(): " % (mode,) ) pass return | 4c7e2270990be6237f630dea9e2cecae12aed18d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/4c7e2270990be6237f630dea9e2cecae12aed18d/confirmation_corner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
9216,
12,
2890,
16,
17313,
2309,
16,
341,
917,
4672,
315,
9186,
16402,
67,
2557,
707,
31,
2549,
3347,
2511,
603,
783,
919,
471,
871,
1754,
6,
1815,
365,
18,
7043,
29009,
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,
1089,
67,
9216,
12,
2890,
16,
17313,
2309,
16,
341,
917,
4672,
315,
9186,
16402,
67,
2557,
707,
31,
2549,
3347,
2511,
603,
783,
919,
471,
871,
1754,
6,
1815,
365,
18,
7043,
29009,
353,... |
if gpodder.interface == gpodder.MAEMO: fmt_id = 17 else: fmt_id = 18 | def get_real_download_url(url, proxy=None): # IDs from http://forum.videohelp.com/topic336882-1800.html#1912972 if gpodder.interface == gpodder.MAEMO: # Use 3GP with AAC on Maemo fmt_id = 17 else: # Use MP4 with AAC by default fmt_id = 18 vid = get_youtube_id(url) if vid is not None: page = None url = 'http://www.youtube.com/watch?v=' + vid while page is None: req = util.proxy_request(url, proxy, method='GET') if 'location' in req.msg: url = req.msg['location'] else: page = req.read() r2 = re.compile('.*"t"\:\s+"([^"]+)".*').search(page) if gpodder.interface != gpodder.MAEMO: # Try to find the best video format available r3 = re.compile('.*"fmt_map"\:\s+"([^"]+)".*').search(page) formats = r3.group(1).split(",") if '18/512000/9/0/115' in formats: #[avc1] 480x270 fmt_id = 18 elif '35/640000/9/0/115' in formats: #[H264] 480x360 fmt_id = 35 elif '34/0/9/0/115' in formats: #[H264] 320x240 fmt_id = 34 elif '5/0/7/0/0' in formats: #[FLV1] 320x240 fmt_id = 5 if r2: next = 'http://www.youtube.com/get_video?video_id=' + vid + '&t=' + r2.group(1) + '&fmt=%d' % fmt_id log('YouTube link resolved: %s => %s', url, next) return next return url | 3853d4980be554c18684736a122dbc72b08108ad /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12778/3853d4980be554c18684736a122dbc72b08108ad/youtube.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7688,
67,
7813,
67,
718,
12,
718,
16,
2889,
33,
7036,
4672,
468,
7115,
628,
1062,
2207,
11725,
18,
9115,
5201,
18,
832,
19,
10476,
3707,
26,
5482,
22,
17,
2643,
713,
18,
262... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7688,
67,
7813,
67,
718,
12,
718,
16,
2889,
33,
7036,
4672,
468,
7115,
628,
1062,
2207,
11725,
18,
9115,
5201,
18,
832,
19,
10476,
3707,
26,
5482,
22,
17,
2643,
713,
18,
262... | |
subkey = win32api.RegOpenKeyEx(win32con.HKEY_USERS, subkey_name, 0, win32con.KEY_READ | win32con.KEY_SET_VALUE) | subkey = win32api.RegOpenKeyEx(win32con.HKEY_CURRENT_USER, subkey_name, 0, win32con.KEY_READ | win32con.KEY_SET_VALUE) | def configure_outlook_express(key): """Configure OE to use the SpamBayes POP3 and SMTP proxies, and configure SpamBayes to proxy the servers that OE was connecting to.""" # OE stores its configuration in the registry, not a file. key = key + "\\Software\\Microsoft\\Internet Account Manager\\Accounts" import win32api import win32con translate = {("POP3 Server", "POP3 Port") : "pop3proxy", ("SMTP Server", "SMTP Port") : "smtpproxy", } pop_proxy = pop_proxy_port smtp_proxy = smtp_proxy_port reg = win32api.RegOpenKeyEx(win32con.HKEY_USERS, key) account_index = 0 while True: # Loop through all the accounts config = {} try: subkey_name = "%s\\%s" % \ (key, win32api.RegEnumKey(reg, account_index)) except win32api.error: break account_index += 1 index = 0 subkey = win32api.RegOpenKeyEx(win32con.HKEY_USERS, subkey_name, 0, win32con.KEY_READ | win32con.KEY_SET_VALUE) while True: # Loop through all the keys try: raw = win32api.RegEnumValue(subkey, index) except win32api.error: break config[raw[0]] = (raw[1], raw[2]) index += 1 # Process this account if config.has_key("POP3 Server"): for (server_key, port_key), sect in translate.items(): server = "%s:%s" % (config[server_key][0], config[port_key][0]) if sect[:4] == "pop3": pop_proxy = move_to_next_free_port(pop_proxy) proxy = pop_proxy else: smtp_proxy = move_to_next_free_port(smtp_proxy) proxy = smtp_proxy options[sect, "remote_servers"] += (server,) options[sect, "listen_ports"] += (proxy,) win32api.RegSetValueEx(subkey, server_key, 0, win32con.REG_SZ, "127.0.0.1") win32api.RegSetValueEx(subkey, port_key, 0, win32con.REG_SZ, str(proxy)) if options["globals", "verbose"]: print "[%s] Proxy %s on localhost:%s" % \ (config["Account Name"][0], server, proxy) elif config.has_key("IMAP Server"): # Setup imapfilter instead. pass options.update_file(optionsPathname) # Outlook Express rules are done in much the same way. Should one # be set up to work with notate_to or notate_subject? (and set that # option, obviously) | 813f9608b28caf07b0f7e73215fe7d9179e857f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/813f9608b28caf07b0f7e73215fe7d9179e857f0/autoconfigure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
67,
659,
7330,
67,
338,
1028,
12,
856,
4672,
3536,
11207,
531,
41,
358,
999,
326,
5878,
301,
38,
528,
281,
26839,
23,
471,
18102,
13263,
16,
471,
5068,
5878,
301,
38,
528,
281,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
67,
659,
7330,
67,
338,
1028,
12,
856,
4672,
3536,
11207,
531,
41,
358,
999,
326,
5878,
301,
38,
528,
281,
26839,
23,
471,
18102,
13263,
16,
471,
5068,
5878,
301,
38,
528,
281,
... |
parser.add_option("-o", "--ouput", dest="output", default="stdout", | parser.add_option("-o", "--output", dest="output", default="stdout", | def main(): import optparse import os import sys reports=("summary", "popular", "aggregate", "individual") parser=optparse.OptionParser(usage="%prog [options] pythonscript.py [pythonscriptoptions]", description="This script runs a Python program that uses APSW " "and reports on SQL queries without modifying the program. This is " "done by using connection_hooks and registering row and execution " "tracers. See APSW documentation for more details on the output.") parser.add_option("-o", "--ouput", dest="output", default="stdout", help="Where to send the output. Use a filename, a single dash for stdout, or the words stdout and stderr. [%default]") parser.add_option("-s", "--sql", dest="sql", default=False, action="store_true", help="Log SQL statements as they are executed. [%default]") parser.add_option("-r", "--rows", dest="rows", default=False, action="store_true", help="Log returned rows as they are returned (turns on sql). [%default]") parser.add_option("-t", "--timestamps", dest="timestamps", default=False, action="store_true", help="Include timestamps in logging") parser.add_option("-i", "--thread", dest="thread", default=False, action="store_true", help="Include thread id in logging") parser.add_option("-l", "--length", dest="length", default=30, type="int", help="Max amount of a string to print [%default]") parser.add_option("--no-report", dest="report", default=True, action="store_false", help="A summary report is normally generated at program exit. This turns off the report and saves memory.") parser.add_option("--report-items", dest="reportn", metavar="N", default=15, type="int", help="How many items to report in top lists [%default]") parser.add_option("--reports", dest="reports", default=",".join(reports), help="Which reports to show [%default]") parser.disable_interspersed_args() options, args=parser.parse_args() options.reports=[x.strip() for x in options.reports.split(",") if x.strip()] for r in options.reports: if r not in reports: parser.error(r+" is not a valid report. You should supply one or more of "+", ".join(reports)) if options.rows: options.sql=True if not args: parser.error("You must specify a python script to execute") if not os.path.exists(args[0]): parser.error("Unable to find script %r\n" % (args[0],)) sys.argv=args sys.path[0]=os.path.split(os.path.abspath(sys.argv[0]))[0] t=APSWTracer(options) try: t.run() finally: t.report() | 73d1d9647c0c7ce2a41ff7b325a2dc71f1c72326 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/993/73d1d9647c0c7ce2a41ff7b325a2dc71f1c72326/apswtrace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1930,
2153,
2670,
1930,
1140,
1930,
2589,
225,
10557,
33,
2932,
7687,
3113,
315,
5120,
2490,
3113,
315,
18573,
3113,
315,
22032,
5557,
7923,
225,
2082,
33,
3838,
2670,
18,
189... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1930,
2153,
2670,
1930,
1140,
1930,
2589,
225,
10557,
33,
2932,
7687,
3113,
315,
5120,
2490,
3113,
315,
18573,
3113,
315,
22032,
5557,
7923,
225,
2082,
33,
3838,
2670,
18,
189... |
c = Client("jobqueue_update", [file_name, content]) c.ConnectList(node_list, address_list=address_list) result = c.GetResults() return result @staticmethod def call_jobqueue_purge(node): | return cls._StaticMultiNodeCall(node_list, "jobqueue_update", [file_name, content], address_list=address_list) @classmethod def call_jobqueue_purge(cls, node): | def call_jobqueue_update(node_list, address_list, file_name, content): """Update job queue. | 9a525d83b2a75f44cc1171e7d715b5bee7a76756 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/9a525d83b2a75f44cc1171e7d715b5bee7a76756/rpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
67,
4688,
4000,
67,
2725,
12,
2159,
67,
1098,
16,
1758,
67,
1098,
16,
585,
67,
529,
16,
913,
4672,
3536,
1891,
1719,
2389,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
67,
4688,
4000,
67,
2725,
12,
2159,
67,
1098,
16,
1758,
67,
1098,
16,
585,
67,
529,
16,
913,
4672,
3536,
1891,
1719,
2389,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'_valid' : 'Total up to %s' % (lts.strftime("%d %B %Y %I %p %Z"),), | '_valid' : 'Total up to %s' % ( (lts - mx.DateTime.RelativeDateTime(minutes=1)).strftime("%d %B %Y %I:%M %p %Z"),), | def doday(ts): """ Create a plot of precipitation stage4 estimates for some day """ sts = ts + mx.DateTime.RelativeDateTime(hour=1) ets = ts + mx.DateTime.RelativeDateTime(hour=1, days=1) interval = mx.DateTime.RelativeDateTime(hours=1) now = sts total = None lts = None while now < ets: fp = "/mesonet/ARCHIVE/data/%s/stage4/ST4.%s.01h.grib" % ( now.gmtime().strftime("%Y/%m/%d"), now.gmtime().strftime("%Y%m%d%H") ) if os.path.isfile(fp): lts = now grbs = pygrib.open(fp) if total is None: g = grbs[1] total = g["values"] lats, lons = g.latlons() else: total += grbs[1]["values"] grbs.close() now += interval # Now we dance cfg = { 'wkColorMap': 'BlAqGrYeOrRe', 'nglSpreadColorStart': -1, 'nglSpreadColorEnd' : 2, '_MaskZero' : True, 'lbTitleString' : "[inch]", '_valid' : 'Total up to %s' % (lts.strftime("%d %B %Y %I %p %Z"),), '_title' : "NCEP StageIV Today's Precipitation [inch]", } tmpfp = iemplot.simple_grid_fill(lons, lats, total / 25.4, cfg) pqstr = "plot ac %s00 iowa_stage4_1d.png iowa_stage4_1d.png png" % ( ts.strftime("%Y%m%d%H"), ) iemplot.postprocess(tmpfp, pqstr) # Midwest cfg['_midwest'] = True tmpfp = iemplot.simple_grid_fill(lons, lats, total / 25.4, cfg) pqstr = "plot ac %s00 midwest_stage4_1d.png midwest_stage4_1d.png png" % ( ts.strftime("%Y%m%d%H"), ) iemplot.postprocess(tmpfp, pqstr) del(cfg['_midwest']) # CONUS cfg['_conus'] = True tmpfp = iemplot.simple_grid_fill(lons, lats, total / 25.4, cfg) pqstr = "plot ac %s00 conus_stage4_1d.png conus_stage4_1d.png png" % ( ts.strftime("%Y%m%d%H"), ) iemplot.postprocess(tmpfp, pqstr) del(cfg['_conus']) | f6995fa15a23d8a1eac1cca2c2d950ee0798911e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11189/f6995fa15a23d8a1eac1cca2c2d950ee0798911e/stage4_today_total.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
20136,
12,
3428,
4672,
3536,
1788,
279,
3207,
434,
675,
3449,
8773,
6009,
24,
27585,
364,
2690,
2548,
3536,
27099,
273,
3742,
397,
7938,
18,
5096,
18,
8574,
5096,
12,
12091,
33,
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,
302,
20136,
12,
3428,
4672,
3536,
1788,
279,
3207,
434,
675,
3449,
8773,
6009,
24,
27585,
364,
2690,
2548,
3536,
27099,
273,
3742,
397,
7938,
18,
5096,
18,
8574,
5096,
12,
12091,
33,
21,... |
msghdr += "Subject: BC Results for " + str(item.computationResult.chartImage.name) + '\n\n' | msghdr += "Subject: BC Results for " + str(item.computationResult.chartImage.name) + '\n' | def checkResults(self): ''' Refer GmailResultsFramework.checkResults for documentation ''' tags = self.grestags + " IANA" gmail_user = setting.get("username") gmail_pwd = setting.get("password") smtpserver = smtplib.SMTP("smtp.gmail.com",587) smtpserver.ehlo() smtpserver.starttls() smtpserver.ehlo() smtpserver.login(gmail_user, gmail_pwd) self.log.info("Checking Results... {0}".format(str(setting.get("poll_interval"))), extra=tags) for item in SuryaIANAResult.objects(isEmailed=False): try: misc = item.item.misc misc_dict = json.loads(misc) except ValueError as ve: self.log.error('[ Sanity ] The misc input is not a json syntax string. Store it as { "rawstring": (...input...)} . The orignial Input:' + str(misc)+ "Reason:" + str(ve), extra=tags) misc = '{ "rawString":"' + str(misc) + '"}' if misc_dict.has_key("fromemail"): | 9206ee111fbf04e6a9269d7b54c1e0fede9e3a88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13935/9206ee111fbf04e6a9269d7b54c1e0fede9e3a88/IANAGmailResults.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
3447,
12,
2890,
4672,
9163,
868,
586,
611,
4408,
3447,
13701,
18,
1893,
3447,
364,
7323,
9163,
225,
2342,
273,
365,
18,
75,
8792,
1341,
397,
315,
467,
1258,
37,
6,
225,
314,
4408,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
3447,
12,
2890,
4672,
9163,
868,
586,
611,
4408,
3447,
13701,
18,
1893,
3447,
364,
7323,
9163,
225,
2342,
273,
365,
18,
75,
8792,
1341,
397,
315,
467,
1258,
37,
6,
225,
314,
4408,... |
self.set_window_title() iconname = 'mirage.png' if os.path.exists(iconname): icon_path = iconname elif os.path.exists('../share/pixmaps/' + iconname): icon_path = '../share/pixmaps/' + iconname elif os.path.exists('/usr/local/share/pixmaps/' + iconname): icon_path = '/usr/local/share/pixmaps/' + iconname elif os.path.exists('/usr/share/pixmaps/' + iconname): icon_path = '/usr/share/pixmaps/' + iconname try: gtk.window_set_default_icon_from_file(icon_path) except: pass vbox = gtk.VBox(False, 0) self.UIManager = gtk.UIManager() actionGroup = gtk.ActionGroup('Actions') actionGroup.add_actions(actions) actionGroup.add_toggle_actions(toggle_actions) self.UIManager.insert_action_group(actionGroup, 0) self.UIManager.add_ui_from_string(uiDescription) self.window.add_accel_group(self.UIManager.get_accel_group()) self.menubar = self.UIManager.get_widget('/MainMenu') self.set_slideshow_sensitivities() vbox.pack_start(self.menubar, False, False, 0) self.toolbar = self.UIManager.get_widget('/MainToolbar') vbox.pack_start(self.toolbar, False, False, 0) self.toolbar.set_property('visible', self.toolbar_show) self.layout = gtk.Layout() self.vscroll = gtk.VScrollbar(None) self.vscroll.set_adjustment(self.layout.get_vadjustment()) self.hscroll = gtk.HScrollbar(None) self.hscroll.set_adjustment(self.layout.get_hadjustment()) self.table = gtk.Table(2, 2, False) self.table.attach(self.layout, 0, 1, 0, 1, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 0, 0) self.table.attach(self.hscroll, 0, 1, 1, 2, gtk.FILL|gtk.SHRINK, gtk.FILL|gtk.SHRINK, 0, 0) self.table.attach(self.vscroll, 1, 2, 0, 1, gtk.FILL|gtk.SHRINK, gtk.FILL|gtk.SHRINK, 0, 0) vbox.pack_start(self.table, True, True, 0) if bgcolor_found == False: self.bgcolor = gtk.gdk.Color(0, 0, 0) | self.set_window_title() iconname = 'mirage.png' if os.path.exists(iconname): icon_path = iconname elif os.path.exists('../share/pixmaps/' + iconname): icon_path = '../share/pixmaps/' + iconname elif os.path.exists('/usr/local/share/pixmaps/' + iconname): icon_path = '/usr/local/share/pixmaps/' + iconname elif os.path.exists('/usr/share/pixmaps/' + iconname): icon_path = '/usr/share/pixmaps/' + iconname try: gtk.window_set_default_icon_from_file(icon_path) except: pass vbox = gtk.VBox(False, 0) self.UIManager = gtk.UIManager() actionGroup = gtk.ActionGroup('Actions') actionGroup.add_actions(actions) actionGroup.add_toggle_actions(toggle_actions) self.UIManager.insert_action_group(actionGroup, 0) self.UIManager.add_ui_from_string(uiDescription) self.window.add_accel_group(self.UIManager.get_accel_group()) self.menubar = self.UIManager.get_widget('/MainMenu') self.set_slideshow_sensitivities() vbox.pack_start(self.menubar, False, False, 0) self.toolbar = self.UIManager.get_widget('/MainToolbar') vbox.pack_start(self.toolbar, False, False, 0) self.toolbar.set_property('visible', self.toolbar_show) self.layout = gtk.Layout() self.vscroll = gtk.VScrollbar(None) self.vscroll.set_adjustment(self.layout.get_vadjustment()) self.hscroll = gtk.HScrollbar(None) self.hscroll.set_adjustment(self.layout.get_hadjustment()) self.table = gtk.Table(2, 2, False) self.table.attach(self.layout, 0, 1, 0, 1, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 0, 0) self.table.attach(self.hscroll, 0, 1, 1, 2, gtk.FILL|gtk.SHRINK, gtk.FILL|gtk.SHRINK, 0, 0) self.table.attach(self.vscroll, 1, 2, 0, 1, gtk.FILL|gtk.SHRINK, gtk.FILL|gtk.SHRINK, 0, 0) vbox.pack_start(self.table, True, True, 0) if bgcolor_found == False: self.bgcolor = gtk.gdk.Color(0, 0, 0) | def __init__(self): | a4d6024d09d807bd2a142bf54daca1a7d1873c7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/a4d6024d09d807bd2a142bf54daca1a7d1873c7f/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
return InstallTools.addDefaultOptionsToCS( gConfig, componentType, system, component, gConfig.getValue( '/DIRAC/Extensions', [] ), overwrite = overwrite) | return InstallTools.addDefaultOptionsToCS( gConfig, componentType, system, component, getCSExtensions(), overwrite = overwrite ) | def export_addDefaultOptionsToCS( self, componentType, system, component, overwrite = False ): """ Add default component options to the global CS or to the local options """ return InstallTools.addDefaultOptionsToCS( gConfig, componentType, system, component, gConfig.getValue( '/DIRAC/Extensions', [] ), overwrite = overwrite) | 1a39061cbe8c426f97cd62e1939b4621f5328450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/1a39061cbe8c426f97cd62e1939b4621f5328450/SystemAdministratorHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
1289,
1868,
1320,
774,
4596,
12,
365,
16,
20065,
16,
2619,
16,
1794,
16,
6156,
273,
1083,
262,
30,
3536,
1436,
805,
1794,
702,
358,
326,
2552,
6761,
578,
358,
326,
1191,
702,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
1289,
1868,
1320,
774,
4596,
12,
365,
16,
20065,
16,
2619,
16,
1794,
16,
6156,
273,
1083,
262,
30,
3536,
1436,
805,
1794,
702,
358,
326,
2552,
6761,
578,
358,
326,
1191,
702,... |
if self.__options.docstrings: | if opts.docstrings and not opts.nodocstrings.get(self.__curfile): | def __waiting(self, ttype, tstring, lineno): # Do docstring extractions, if enabled if self.__options.docstrings: # module docstring? if self.__freshmodule: if ttype == tokenize.STRING: self.__addentry(safe_eval(tstring), lineno, isdocstring=1) self.__freshmodule = 0 elif ttype not in (tokenize.COMMENT, tokenize.NL): self.__freshmodule = 0 return # class docstring? if ttype == tokenize.NAME and tstring in ('class', 'def'): self.__state = self.__suiteseen return if ttype == tokenize.NAME and tstring in self.__options.keywords: self.__state = self.__keywordseen | 63ce5af49660181d129aabb9c096cab07807b54b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/63ce5af49660181d129aabb9c096cab07807b54b/pygettext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
20241,
12,
2890,
16,
27963,
16,
268,
1080,
16,
7586,
4672,
468,
2256,
14525,
7582,
4905,
16,
309,
3696,
309,
1500,
18,
2434,
10219,
471,
486,
1500,
18,
30631,
10219,
18,
588,
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,
20241,
12,
2890,
16,
27963,
16,
268,
1080,
16,
7586,
4672,
468,
2256,
14525,
7582,
4905,
16,
309,
3696,
309,
1500,
18,
2434,
10219,
471,
486,
1500,
18,
30631,
10219,
18,
588,
12,
... |
res = self.RequestDB.updateRequest(requestName,requestString) | res = self.RequestDB.updateRequest( requestName, requestString ) | def execute(self): """ The main agent execution method """ # This allows dynamic changing of the throughput timescale self.throughputTimescale = self.am_getOption('ThroughputTimescale',3600) self.throughputTimescale = 60*60*1 #print 'ThroughputTimescale:',self.throughputTimescale ###################################################################################### # # Obtain information on the current state of the channel queues # res = self.TransferDB.getChannelQueues() if not res['OK']: errStr = "ReplicationScheduler._execute: Failed to get channel queues from TransferDB." gLogger.error(errStr, res['Message']) return S_OK() if not res['Value']: gLogger.info("ReplicationScheduler._execute: No active channels found for replication.") return S_OK() channels = res['Value'] res = self.TransferDB.getChannelObservedThroughput(self.throughputTimescale) if not res['OK']: errStr = "ReplicationScheduler._execute: Failed to get observed throughput from TransferDB." gLogger.error(errStr,res['Message']) return S_OK() if not res['Value']: gLogger.info("ReplicationScheduler._execute: No active channels found for replication.") return S_OK() bandwidths = res['Value'] self.strategyHandler = StrategyHandler(bandwidths,channels,self.section) requestsPresent = True while requestsPresent: ###################################################################################### # # The first step is to obtain a transfer request from the RequestDB which should be scheduled. # gLogger.info("ReplicationScheduler._execute: Contacting RequestDB for suitable requests.") res = self.RequestDB.getRequest('transfer') if not res['OK']: gLogger.error("ReplicationScheduler._execute: Failed to get a request list from RequestDB.", res['Message']) continue if not res['Value']: gLogger.info("ReplicationScheduler._execute: No requests found in RequestDB.") requestsPresent = False return S_OK() requestString = res['Value']['RequestString'] requestName = res['Value']['RequestName'] gLogger.info("ReplicationScheduler._execute: Obtained Request %s from RequestDB." % (requestName)) | 9005c0a96ba1bc0698c543bcb4c1886f4eeee344 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9005c0a96ba1bc0698c543bcb4c1886f4eeee344/ReplicationScheduler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
3536,
1021,
2774,
4040,
4588,
707,
3536,
225,
468,
1220,
5360,
5976,
12770,
434,
326,
24677,
1658,
31402,
365,
18,
10064,
458,
10178,
31402,
273,
365,
18,
301,
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,
1836,
12,
2890,
4672,
3536,
1021,
2774,
4040,
4588,
707,
3536,
225,
468,
1220,
5360,
5976,
12770,
434,
326,
24677,
1658,
31402,
365,
18,
10064,
458,
10178,
31402,
273,
365,
18,
301,
67,
... |
search_request_retry = 6 | search_request_retry = config.copyright_connection_tries | def get_results(query, numresults = 10): url = list() query = re.sub("[()\"<>]", "", query) #wikipedia.output(query) if search_in_google: import google google.LICENSE_KEY = config.google_key print " google query..." search_request_retry = 6 while search_request_retry: #SOAP.faultType: <Fault SOAP-ENV:Server: Exception from service object: # Daily limit of 1000 queries exceeded for key xxx> try: data = google.doGoogleSearch('-Wikipedia "' + query + '"') search_request_retry = 0 for entry in data.results: url.append((entry.URL, 'google')) except Exception, err: print "Got an error ->", err search_request_retry -= 1 if search_in_yahoo: import yahoo.search.web print " yahoo query..." data = yahoo.search.web.WebSearch(config.yahoo_appid, query='"' + query.encode('utf_8') + '" -Wikipedia', results=numresults) search_request_retry = 6 while search_request_retry: try: for entry in data.parse_results(): if check_in_source_yahoo: if check_in_source(entry.Url): continue if not check_urllist(url, entry.Url): url.append((entry.Url, 'yahoo')) search_request_retry = 0 except Exception, err: print "Got an error ->", err search_request_retry -= 1 #if search_in_msn: # from __SOAPpy import WSDL # print " msn query..." # wsdl_url = 'http://soap.search.msn.com/webservices.asmx?wsdl' # server = WSDL.Proxy(wsdl_url) # params = {'AppID': config.msn_appid, 'Query': query, 'CultureInfo': 'en-US', 'SafeSearch': 'Off', 'Requests': { # 'SourceRequest':{'Source': 'Web', 'Offset': 0, 'Count': 10, 'ResultFields': 'All',}}} # server_results = server.Search(Request=params) # if server_results.Responses[0].Results: # results = server_results.Responses[0].Results[0] # for entry in results: # url.append((entry.Url, 'msn')) offset = 0 for i in range(len(url)): if check_list(url[i+offset][0], excl_list, debug=True): url.pop(i+offset) offset+=-1 return url | d445bcd2a4d71b17d4de9993e4f333dc7419cfb5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/d445bcd2a4d71b17d4de9993e4f333dc7419cfb5/copyright.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4717,
12,
2271,
16,
818,
4717,
273,
1728,
4672,
880,
273,
666,
1435,
843,
273,
283,
18,
1717,
2932,
63,
1435,
2412,
29667,
65,
3113,
23453,
843,
13,
468,
11999,
13744,
18,
284... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4717,
12,
2271,
16,
818,
4717,
273,
1728,
4672,
880,
273,
666,
1435,
843,
273,
283,
18,
1717,
2932,
63,
1435,
2412,
29667,
65,
3113,
23453,
843,
13,
468,
11999,
13744,
18,
284... |
self.fail("a * 1431655766 didn't raise MemoryError") | self.fail("Array of size > maxsize created - MemoryError expected") | def test_alloc_overflow(self): a = array.array('d', [-1]*65536) try: a *= 65536 except MemoryError: pass else: self.fail("a *= 2**16 didn't raise MemoryError") b = array.array('d', [ 2.71828183, 3.14159265, -1]) try: b * 1431655766 except MemoryError: pass else: self.fail("a * 1431655766 didn't raise MemoryError") | c5327ae32af9c711e00448582d178ccb7aabffd5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/c5327ae32af9c711e00448582d178ccb7aabffd5/test_array.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9853,
67,
11512,
12,
2890,
4672,
279,
273,
526,
18,
1126,
2668,
72,
2187,
23059,
21,
5772,
26,
2539,
5718,
13,
775,
30,
279,
6413,
28652,
1335,
9251,
668,
30,
1342,
469,
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,
1842,
67,
9853,
67,
11512,
12,
2890,
4672,
279,
273,
526,
18,
1126,
2668,
72,
2187,
23059,
21,
5772,
26,
2539,
5718,
13,
775,
30,
279,
6413,
28652,
1335,
9251,
668,
30,
1342,
469,
30,
... |
if language == "Ocaml": | if language == "OCaml": | def compile_function(language): if language == "Java": out_message = "" err_message = "" nukeglob('*.class') nukeglob('*.jar') sources = safeglob('*.java') out, err = system(['javac'] + sources) out_message += out err_message += err out, err = system(['jar', 'cfe', 'MyBot.jar', 'MyBot'] + \ safeglob('*.class')) out_message += out err_message += err err_message += check_path('MyBot.jar') if os.path.exists("MyBot.jar"): os.chmod("MyBot.jar", 0644) return out_message, err_message if language == "CoffeeScript": for script in safeglob('*.coffee'): os.chmod(script, 0644) check_path('MyBot.coffee') return "CoffeeScript scripts do not need to be compiled.", "" if language == "Haskell": nukeglob('MyBot') out, err = system(['ghc', '--make', 'MyBot.hs', '-O2', '-v0']) err += check_path('MyBot') return out, err if language == "C#": nukeglob('MyBot.exe') sources = safeglob('*.cs') out, err = system(['gmcs', '-warn:0', '-out:MyBot.exe'] + sources) err += check_path('MyBot.exe') return out, err if language == "C++": out_message = "" err_message = "" nukeglob('*.o') nukeglob('MyBot') sources = safeglob('*.c') + safeglob('*.cc') + safeglob('*.cpp') for source in sources: object_file = \ source.replace(".cc", "").replace(".cpp", "").replace(".c", "") + ".o" out, err = system(['g++', '-O3', '-funroll-loops', '-c', '-o', \ object_file, source]) out_message += out err_message += err out, err = system(['g++', '-O2', '-o', 'MyBot'] + safeglob('*.o') + ['-lm']) out_message += out err_message += err err_message += check_path('MyBot') return out_message, err_message if language == "C": nukeglob('*.o') nukeglob('MyBot') sources = safeglob('*.c') for source in sources: object_file = source.replace(".c", "") + ".o" system(['gcc', '-O3', '-funroll-loops', '-c', '-o', object_file, source]) system(['gcc', '-O2', '-o', 'MyBot'] + safeglob('*.o') + ['-lm']) check_path('MyBot') if language == "Go": nukeglob('*.6') nukeglob('MyBot') sources = safeglob('*.go') system(['/usr/local/bin/6g', '-o', '_go_.6'] + sources) system(['/usr/local/bin/6l', '-o', 'MyBot', '_go_.6']) check_path('MyBot') if language == "Python": nukeglob('*.pyc') for script in safeglob('*.py'): os.chmod(script, 0644) check_path('MyBot.py') return "Python scripts do not need to be compiled.", "" if language == "PHP": for script in safeglob('*.php'): os.chmod(script, 0644) check_path('MyBot.php') return "Php scripts need not be compiled", "" if language == "Ruby": for script in safeglob('*.rb'): os.chmod(script, 0644) check_path('MyBot.rb') return "Ruby scripts need not be compiled", "" if language == "Perl": for script in safeglob('*.pl'): os.chmod(script, 0644) check_path('MyBot.pl') return "Perl scripts need not be compiled", "" if language == "Javascript": for script in safeglob('*.js'): os.chmod(script, 0644) check_path('MyBot.js') return "Javascript scripts do not need to be compiled.", "" if language == "Scheme": print "Scheme scripts need not be compiled" for script in safeglob('*.ss'): os.chmod(script, 0644) check_path('MyBot.ss') if language == "Lua": print "Lua scripts need not be compiled" for script in safeglob('*.lua'): os.chmod(script, 0644) check_path('MyBot.lua') if language == "Clojure": print "Clojure scripts need not be compiled" for script in safeglob('*.clj'): os.chmod(script, 0644) check_path('MyBot.clj') if language == "Ocaml": nukeglob('MyBot.native') out, err = system(['ocamlbuild', 'MyBot.native']) check_path('MyBot.native') return out, err if language == "Lisp": nukeglob('MyBot') out, err = system(['sbcl', '--end-runtime-options', '--no-sysinit', '--no-userinit', '--disable-debugger', '--load MyBot.lisp', '--eval', "(save-lisp-and-die \"MyBot\" :executable t :toplevel #'pwbot::main)"]) check_path('MyBot') return out, err | 47636ae73110439260ea76805e1b52fa94dafc17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13129/47636ae73110439260ea76805e1b52fa94dafc17/compile_anything.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
67,
915,
12,
4923,
4672,
309,
2653,
422,
315,
5852,
6877,
596,
67,
2150,
273,
1408,
393,
67,
2150,
273,
1408,
9244,
79,
1332,
1295,
2668,
11146,
1106,
6134,
9244,
79,
1332,
1295,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
915,
12,
4923,
4672,
309,
2653,
422,
315,
5852,
6877,
596,
67,
2150,
273,
1408,
393,
67,
2150,
273,
1408,
9244,
79,
1332,
1295,
2668,
11146,
1106,
6134,
9244,
79,
1332,
1295,
... |
def next(self): if not self.running: self.start() | self.threadid = thread.start_new_thread(self.do_control, ()) def do_control(self): singlestep = True self.debug(3, "Starting control thread [tid=%i]" % self.threadid) stop = False while not stop: c = self.cmdin.recv() self.debug(5, "Received command %s" % c.type) if c.type == _ATMT_Command.RUN: singlestep = False elif c.type == _ATMT_Command.NEXT: singlestep = True elif c.type == _ATMT_Command.STOP: break while True: try: state = self.do_next() except KeyboardInterrupt: self.debug(1,"Interrupted by user") stop=True break except self.CommandMessage: break except StopIteration,e: c = Message(type=_ATMT_Command.END, result=e.args[0]) self.cmdout.send(c) stop=True break if singlestep: c = Message(type=_ATMT_Command.SINGLESTEP,state=state) self.cmdout.send(c) break self.debug(3, "Stopping control thread (tid=%i)"%self.threadid) self.threadid = None def do_next(self): | def next(self): if not self.running: self.start() try: self.debug(1, "## state=[%s]" % self.state.state) | 0d01db6641eeeb9aa67937be073aa8ef54c9e1c0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7311/0d01db6641eeeb9aa67937be073aa8ef54c9e1c0/automaton.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
365,
18,
5930,
350,
273,
2650,
18,
1937,
67,
2704,
67,
5930,
12,
2890,
18,
2896,
67,
7098,
16,
1832,
13,
225,
1652,
741,
67,
7098,
12,
2890,
4672,
4864,
80,
395,
881,
273,
1053,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
365,
18,
5930,
350,
273,
2650,
18,
1937,
67,
2704,
67,
5930,
12,
2890,
18,
2896,
67,
7098,
16,
1832,
13,
225,
1652,
741,
67,
7098,
12,
2890,
4672,
4864,
80,
395,
881,
273,
1053,
365,
18,
... |
'partner_id': fields.many2one('res.partner', 'Partner', change_default=True, readonly=True, required=True, states={'draft':[('readonly',False)]}, relate=False), | 'partner_id': fields.many2one('res.partner', 'Partner', change_default=True, readonly=True, required=True, states={'draft':[('readonly',False)]}, relate=True), | def _get_journal_analytic(self, cr, uid, type_inv, context={}): type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale', 'in_refund': 'purchase'} tt = type2journal.get(type_inv, 'sale') cr.execute("select id from account_analytic_journal where type=%s limit 1", (tt,)) result = cr.fetchone() if not result: raise osv.except_osv('No Analytic Journal !', "You have to define an analytic journal of type '%s' !" % (tt,)) return result[0] | 133cc253edccb2ec738cea18b986b2092f61be05 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/133cc253edccb2ec738cea18b986b2092f61be05/invoice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
22644,
67,
304,
7834,
335,
12,
2890,
16,
4422,
16,
4555,
16,
618,
67,
5768,
16,
819,
12938,
4672,
618,
22,
22644,
273,
13666,
659,
67,
16119,
4278,
296,
87,
5349,
2187,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
22644,
67,
304,
7834,
335,
12,
2890,
16,
4422,
16,
4555,
16,
618,
67,
5768,
16,
819,
12938,
4672,
618,
22,
22644,
273,
13666,
659,
67,
16119,
4278,
296,
87,
5349,
2187,
... |
if len(self.data) != 5 or True: | if len(self.data) != 5: | def processEnded(self, reason): self.data = self.data.lstrip("a") if len(self.data) != 5 or True: self.elapsed = ValueError # XXX! else: self.elapsed = float(self.data) | a42caf7f2ab5d61279ff42fce0991058afe6ad1b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a42caf7f2ab5d61279ff42fce0991058afe6ad1b/test_process.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
28362,
12,
2890,
16,
3971,
4672,
365,
18,
892,
273,
365,
18,
892,
18,
80,
6406,
2932,
69,
7923,
309,
562,
12,
2890,
18,
892,
13,
480,
1381,
30,
365,
18,
26201,
273,
2068,
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
28362,
12,
2890,
16,
3971,
4672,
365,
18,
892,
273,
365,
18,
892,
18,
80,
6406,
2932,
69,
7923,
309,
562,
12,
2890,
18,
892,
13,
480,
1381,
30,
365,
18,
26201,
273,
2068,
225,
... |
styles.stylize(styles.ST_DEBUG, 'DEBUG'), mesg) ) | stylize(ST_DEBUG, 'DEBUG'), mesg) ) | def debug(mesg): """Display a styles.stylized debug message on stderr.""" if options.verbose >= verbose.DEBUG: sys.stderr.write( "%s: %s\n" % ( styles.stylize(styles.ST_DEBUG, 'DEBUG'), mesg) ) | a4712f82b2f0d14c0f1c465fc523b05667dfb57d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a4712f82b2f0d14c0f1c465fc523b05667dfb57d/logging.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
12,
26244,
75,
4672,
3536,
4236,
279,
5687,
18,
334,
93,
80,
1235,
1198,
883,
603,
4514,
12123,
309,
702,
18,
11369,
1545,
3988,
18,
9394,
30,
2589,
18,
11241,
18,
2626,
12,
2213... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
12,
26244,
75,
4672,
3536,
4236,
279,
5687,
18,
334,
93,
80,
1235,
1198,
883,
603,
4514,
12123,
309,
702,
18,
11369,
1545,
3988,
18,
9394,
30,
2589,
18,
11241,
18,
2626,
12,
2213... |
def f(comm, size, reps, dtype): | def f(comm, size, reps): | def f(comm, size, reps, dtype): """Benchmark da.random.rand""" for i in range(reps): a = da.random.rand((size,size), dtype=dtype, comm=comm) | 100c7c9366f6c979e86927be1999df9ea5d7dd79 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8770/100c7c9366f6c979e86927be1999df9ea5d7dd79/bench_random.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
12,
5702,
16,
963,
16,
283,
1121,
4672,
3536,
30672,
5248,
18,
9188,
18,
7884,
8395,
364,
277,
316,
1048,
12,
266,
1121,
4672,
279,
273,
5248,
18,
9188,
18,
7884,
12443,
1467,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
12,
5702,
16,
963,
16,
283,
1121,
4672,
3536,
30672,
5248,
18,
9188,
18,
7884,
8395,
364,
277,
316,
1048,
12,
266,
1121,
4672,
279,
273,
5248,
18,
9188,
18,
7884,
12443,
1467,
16,... |
try: group = str( args[0] ) except Exception, x: print 'Expected string for DIRAC proxy group', args DIRAC.exit( 2 ) | group = args[0] | def usage(): print 'Usage: %s <DIRAC group>' % ( Script.scriptName ) DIRAC.exit( 2 ) | 8cece5cd8d8d645b044e7984241b0627787b8677 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/8cece5cd8d8d645b044e7984241b0627787b8677/dirac-admin-upload-proxy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
4537,
2226,
1041,
1870,
738,
261,
7739,
18,
4263,
461,
262,
18544,
2226,
18,
8593,
12,
576,
262,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
4537,
2226,
1041,
1870,
738,
261,
7739,
18,
4263,
461,
262,
18544,
2226,
18,
8593,
12,
576,
262,
225,
2,
-100,
-100,
-100,
-100,
-100,
-... |
acquire_timeout = timeout_strategy.CalcRemainingTimeout() if self._AcquireLocks(locking.LEVEL_CLUSTER, locking.BGL, not lu_class.REQ_BGL, acquire_timeout) is None: raise _LockAcquireTimeout() try: lu = lu_class(self, op, self.context, self.rpc) lu.ExpandNames() assert lu.needed_locks is not None, "needed_locks not set by LU" try: return self._LockAndExecLU(lu, locking.LEVEL_INSTANCE, timeout_strategy.CalcRemainingTimeout) finally: if self._ec_id: self.context.cfg.DropECReservations(self._ec_id) finally: self.context.glm.release(locking.LEVEL_CLUSTER) except _LockAcquireTimeout: pass timeout_strategy = timeout_strategy.NextAttempt() | return self._LockAndExecLU(lu, locking.LEVEL_INSTANCE, calc_timeout) finally: if self._ec_id: self.context.cfg.DropECReservations(self._ec_id) finally: self.context.glm.release(locking.LEVEL_CLUSTER) | def ExecOpCode(self, op, cbs): """Execute an opcode. | 831bbbc1854e11504af780daa17b176eeebff262 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7542/831bbbc1854e11504af780daa17b176eeebff262/mcpu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3889,
3817,
1085,
12,
2890,
16,
1061,
16,
276,
2038,
4672,
3536,
5289,
392,
11396,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3889,
3817,
1085,
12,
2890,
16,
1061,
16,
276,
2038,
4672,
3536,
5289,
392,
11396,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
('uid', '=', user), | ('uid', '=', Transaction().user), | def _choice(self, data): shipment_internal_obj = self.pool.get('stock.shipment.in.return') user_group_obj = self.pool.get('res.user-res.group') model_data_obj = self.pool.get('ir.model.data') transition_obj = self.pool.get('workflow.transition') | 4673fa843846780063630f4b804014c5bb5ecb01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9298/4673fa843846780063630f4b804014c5bb5ecb01/shipment.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11569,
12,
2890,
16,
501,
4672,
26990,
67,
7236,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
15381,
18,
3261,
475,
18,
267,
18,
2463,
6134,
729,
67,
1655,
67,
2603,
273,
365,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11569,
12,
2890,
16,
501,
4672,
26990,
67,
7236,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
15381,
18,
3261,
475,
18,
267,
18,
2463,
6134,
729,
67,
1655,
67,
2603,
273,
365,
1... |
if (type==float): il=1 | if type == float: il = 1 | def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' for i in range(-100, 100): if (pow(type(i),3)!=i*i*i): raise ValueError, 'pow('+str(i)+',3) != '+str(i*i*i) pow2=1 for i in range(0,31): if (pow(2,i)!=pow2): raise ValueError, 'pow(2,'+str(i)+') != '+str(pow2) if (i!=30): pow2=pow2*2 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 71ad688d0e5dc7c63a0b38f3c28dcef6dff55a39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/71ad688d0e5dc7c63a0b38f3c28dcef6dff55a39/test_pow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7602,
3813,
12,
723,
4672,
309,
261,
723,
5,
33,
5659,
4672,
1172,
315,
565,
7766,
310,
576,
17,
3446,
7602,
1435,
445,
7070,
364,
277,
316,
1048,
19236,
18088,
16,
4336,
4672,
309,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7602,
3813,
12,
723,
4672,
309,
261,
723,
5,
33,
5659,
4672,
1172,
315,
565,
7766,
310,
576,
17,
3446,
7602,
1435,
445,
7070,
364,
277,
316,
1048,
19236,
18088,
16,
4336,
4672,
309,
26... |
hc_poly = rings.PolynomialRing(FF)(DBCP[D]) | hc_poly = rings.PolynomialRing(FF, 'x')(DBCP[D]) | def supersingular_j(FF): """ Find a supersingular j-invariant. Example: p = 15073 has no class number one cm_j_invariant """ prime = FF.characteristic() if not(rings.Integer(prime).is_prime()): raise ValueError, "%s is not a prime"%prime if rings.kronecker(-1, prime) != 1: j_invss = 1728 #(2^2 * 3)^3 elif rings.kronecker(-2, prime) != 1: j_invss = 8000 #(2^2 * 5)^3 elif rings.kronecker(-3, prime) != 1: j_invss = 0 #0^3 elif rings.kronecker(-7, prime) != 1: j_invss = 16581375 #(3 * 5 * 17)^3 elif rings.kronecker(-11, prime) != 1: j_invss = -32768 #-(2^5)^3 elif rings.kronecker(-19, prime) != 1: j_invss = -884736 #-(2^5 * 3)^3 elif rings.kronecker(-43, prime) != 1: j_invss = -884736000 #-(2^6 * 3 * 5)^3 elif rings.kronecker(-67, prime) != 1: j_invss = -147197952000 #-(2^5 * 3 * 5 * 11)^3 elif rings.kronecker(-163, prime) != 1: j_invss = -262537412640768000 #-(2^6 * 3 * 5 * 23 * 29)^3 else: D = supersingular_D(prime) DBCP = HilbertClassPolynomialDatabase() hc_poly = rings.PolynomialRing(FF)(DBCP[D]) root_hc_poly_list = list(hc_poly.roots()) j_invss = root_hc_poly_list[0][0] return FF(j_invss) | e6e6626021ad58c5841ccd38f11181ced39c8182 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/e6e6626021ad58c5841ccd38f11181ced39c8182/ssmod.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1169,
414,
17830,
67,
78,
12,
2246,
4672,
3536,
4163,
279,
1169,
414,
17830,
525,
17,
267,
8688,
18,
225,
5090,
30,
293,
273,
18478,
9036,
711,
1158,
667,
1300,
1245,
5003,
67,
78,
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,
1169,
414,
17830,
67,
78,
12,
2246,
4672,
3536,
4163,
279,
1169,
414,
17830,
525,
17,
267,
8688,
18,
225,
5090,
30,
293,
273,
18478,
9036,
711,
1158,
667,
1300,
1245,
5003,
67,
78,
67,... |
gLogger.error('Failed to obtain directory PFN from LFN','%s %s' % (directory,error)) | gLogger.error( 'Failed to obtain directory PFN from LFN', '%s %s' % ( directory, error ) ) | def __removeStorageDirectory(self,directory,storageElement): gLogger.info('Removing the contents of %s at %s' % (directory,storageElement)) res = self.getPfnForLfn([directory],storageElement) if not res['OK']: gLogger.error("Failed to get PFN for directory",res['Message']) return res for directory, error in res['Value']['Failed'].items(): gLogger.error('Failed to obtain directory PFN from LFN','%s %s' % (directory,error)) if res['Value']['Failed']: return S_ERROR('Failed to obtain directory PFN from LFNs') storageDirectory = res['Value']['Successful'].values()[0] res = self.getStorageFileExists(storageDirectory,storageElement,singleFile=True) if not res['OK']: gLogger.error("Failed to obtain existance of directory",res['Message']) return res exists = res['Value'] if not exists: gLogger.info("The directory %s does not exist at %s " % (directory,storageElement)) return S_OK() res = self.removeStorageDirectory(storageDirectory,storageElement,recursive=True,singleDirectory=True) if not res['OK']: gLogger.error("Failed to remove storage directory",res['Message']) return res gLogger.info("Successfully removed %d files from %s at %s" % (res['Value']['FilesRemoved'],directory,storageElement)) return S_OK() | 9fabceb719d19d46d8b75011d2932552dbe360f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9fabceb719d19d46d8b75011d2932552dbe360f9/ReplicaManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4479,
3245,
2853,
12,
2890,
16,
5149,
16,
5697,
1046,
4672,
314,
3328,
18,
1376,
2668,
18939,
326,
2939,
434,
738,
87,
622,
738,
87,
11,
738,
261,
5149,
16,
5697,
1046,
3719,
400... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4479,
3245,
2853,
12,
2890,
16,
5149,
16,
5697,
1046,
4672,
314,
3328,
18,
1376,
2668,
18939,
326,
2939,
434,
738,
87,
622,
738,
87,
11,
738,
261,
5149,
16,
5697,
1046,
3719,
400... |
field_id = field_obj.search(cursor, user, [ | field_id = ir_field_obj.search(cursor, user, [ | def set_default(self, cursor, user, model, field, clause, value, user_default, context=None): model_obj = self.pool.get('ir.model') field_obj = self.pool.get('ir.model.field') model_id = model_obj.search(cursor, user, [ ('model', '=', model), ], context=context)[0] field_id = field_obj.search(cursor, user, [ ('name', '=', field), ('model', '=', model_id), ], context=context)[0] default_ids = self.search(cursor, user, [ ('model', '=', model_id), ('field', '=', field_id), ('clause', '=', clause), ('user', '=', user_default), ], context=context) if default_ids: self.delete(cursor, user, default_ids, context=context) self.create(cursor, user, { 'model': model_id, 'field': field_id, 'value': str(value), 'clause': clause, 'user': user_default, }, context=context) | b39329bc2a77191ee76d0fd5de4470a88293005c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9266/b39329bc2a77191ee76d0fd5de4470a88293005c/default.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
1886,
12,
2890,
16,
3347,
16,
729,
16,
938,
16,
652,
16,
6591,
16,
460,
16,
729,
67,
1886,
16,
819,
33,
7036,
4672,
938,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
481,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
1886,
12,
2890,
16,
3347,
16,
729,
16,
938,
16,
652,
16,
6591,
16,
460,
16,
729,
67,
1886,
16,
819,
33,
7036,
4672,
938,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
481,
... |
f.write(" CFR="+str(cvt(circ_from_rate,2))+"\n") f.write(" CTR="+str(cvt(circ_to_rate,2))+"\n") f.write(" CBR="+str(cvt(circ_bi_rate,2))+"\n") f.write(" CFE="+str(cvt(avg_first_ext,2))+"\n") f.write(" SBW="+str(cvt(sbw,2))+"\n") f.write(" FBW="+str(cvt(filt_sbw,2))+"\n") f.write(" PR="+str(cvt(percentile,2))+"\n\n") | f.write(" CFR="+str(cvt(circ_from_rate,2))+" ") f.write(" CTR="+str(cvt(circ_to_rate,2))+" ") f.write(" CBR="+str(cvt(circ_bi_rate,2))+" ") f.write(" CFE="+str(cvt(avg_first_ext,2))+" ") f.write(" SBW="+str(cvt(sbw,2,1024))+" ") f.write(" FBW="+str(cvt(filt_sbw,2,1024))+" ") f.write(" PR="+str(cvt(percentile,2))+"\n\n\n") | def cvt(a,b): if type(a) == float: return round(a,b) elif type(a) == type(None): return "None" else: return type(a) | 214161fd88385a0fbb87f98dfaec088a7b40907b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3224/214161fd88385a0fbb87f98dfaec088a7b40907b/SQLSupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8951,
88,
12,
69,
16,
70,
4672,
309,
618,
12,
69,
13,
422,
1431,
30,
327,
3643,
12,
69,
16,
70,
13,
1327,
618,
12,
69,
13,
422,
618,
12,
7036,
4672,
327,
315,
7036,
6,
469,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8951,
88,
12,
69,
16,
70,
4672,
309,
618,
12,
69,
13,
422,
1431,
30,
327,
3643,
12,
69,
16,
70,
13,
1327,
618,
12,
69,
13,
422,
618,
12,
7036,
4672,
327,
315,
7036,
6,
469,
30,
... |
print("%f (%02d): %s} (%.3f us)" % (l.time, l.depth, l.name, l.length*1000000)) | print('%f (%02d): %s} (%.3f us)' % (l.time, \ l.depth, l.name, l.length*1000000)) | def debugPrint(self, filename): if(filename == "stdout"): print("[%f - %f]") % (self.start, self.end) for l in self.list: if(l.freturn and l.fcall): print("%f (%02d): %s(); (%.3f us)" % (l.time, l.depth, l.name, l.length*1000000)) elif(l.freturn): print("%f (%02d): %s} (%.3f us)" % (l.time, l.depth, l.name, l.length*1000000)) else: print("%f (%02d): %s() { (%.3f us)" % (l.time, l.depth, l.name, l.length*1000000)) print(" ") else: fp = open(filename, 'w') print(filename) for l in self.list: if(l.freturn and l.fcall): fp.write("%f (%02d): %s(); (%.3f us)\n" % (l.time, l.depth, l.name, l.length*1000000)) elif(l.freturn): fp.write("%f (%02d): %s} (%.3f us)\n" % (l.time, l.depth, l.name, l.length*1000000)) else: fp.write("%f (%02d): %s() { (%.3f us)\n" % (l.time, l.depth, l.name, l.length*1000000)) fp.close() | 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,
1198,
5108,
12,
2890,
16,
1544,
4672,
309,
12,
3459,
422,
315,
10283,
6,
4672,
1172,
2932,
14451,
74,
300,
738,
74,
4279,
13,
738,
261,
2890,
18,
1937,
16,
365,
18,
409,
13,
364,
328... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
5108,
12,
2890,
16,
1544,
4672,
309,
12,
3459,
422,
315,
10283,
6,
4672,
1172,
2932,
14451,
74,
300,
738,
74,
4279,
13,
738,
261,
2890,
18,
1937,
16,
365,
18,
409,
13,
364,
328... |
def start(self, test): cmd = "mpstat -P ALL %d" % self.interval logfile = open(os.path.join(test.profdir, "mpstat"), 'w') p = subprocess.Popen(cmd, shell=True, stdout=logfile, stderr=subprocess.STDOUT) self.pid = p.pid | def start(self, test): cmd = "mpstat -P ALL %d" % self.interval logfile = open(os.path.join(test.profdir, "mpstat"), 'w') p = subprocess.Popen(cmd, shell=True, stdout=logfile, stderr=subprocess.STDOUT) self.pid = p.pid | def start(self, test): cmd = "mpstat -P ALL %d" % self.interval logfile = open(os.path.join(test.profdir, "mpstat"), 'w') p = subprocess.Popen(cmd, shell=True, stdout=logfile, stderr=subprocess.STDOUT) self.pid = p.pid | 46ab3c36e51ca9f7ff06baa7936f610952c325a5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12268/46ab3c36e51ca9f7ff06baa7936f610952c325a5/mpstat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
16,
1842,
4672,
1797,
273,
315,
1291,
5642,
300,
52,
8061,
738,
72,
6,
738,
365,
18,
6624,
15204,
273,
1696,
12,
538,
18,
803,
18,
5701,
12,
3813,
18,
16121,
1214,
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,
787,
12,
2890,
16,
1842,
4672,
1797,
273,
315,
1291,
5642,
300,
52,
8061,
738,
72,
6,
738,
365,
18,
6624,
15204,
273,
1696,
12,
538,
18,
803,
18,
5701,
12,
3813,
18,
16121,
1214,
16,... |
def _check_hankel1(self): | def check_hankel1(self): | def _check_hankel1(self): cephes.hankel1(1,1) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
76,
2304,
292,
21,
12,
2890,
4672,
5898,
844,
281,
18,
76,
2304,
292,
21,
12,
21,
16,
21,
13,
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,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
76,
2304,
292,
21,
12,
2890,
4672,
5898,
844,
281,
18,
76,
2304,
292,
21,
12,
21,
16,
21,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_) | matrix_.export(outfile, level, namespace_, name_='matrix') | def exportChildren(self, outfile, level, namespace_='', name_='AbstractSeqs'): super(AbstractSeqs, self).exportChildren(outfile, level, namespace_, name_) for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_) | 9c12e50d449fa27d6f8f3415ece228ae97bb0266 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14016/9c12e50d449fa27d6f8f3415ece228ae97bb0266/_nexml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
4212,
12,
2890,
16,
8756,
16,
1801,
16,
1981,
67,
2218,
2187,
508,
67,
2218,
7469,
6926,
87,
11,
4672,
2240,
12,
7469,
6926,
87,
16,
365,
2934,
6530,
4212,
12,
26050,
16,
1801,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
4212,
12,
2890,
16,
8756,
16,
1801,
16,
1981,
67,
2218,
2187,
508,
67,
2218,
7469,
6926,
87,
11,
4672,
2240,
12,
7469,
6926,
87,
16,
365,
2934,
6530,
4212,
12,
26050,
16,
1801,
... |
(x(t),y(t)) such that y(t)^2 = f(x(t)) and t | (x(t),y(t)) such that y(t)^2 = f(x(t)), where t | def local_coord(self, P, prec = 20, name = 't'): """ If P is not infinity, calls the appropriate local_coordinates function. | d7bac827859bd8b14065ddd251609f968f4b30b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/d7bac827859bd8b14065ddd251609f968f4b30b1/hyperelliptic_generic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
67,
5732,
12,
2890,
16,
453,
16,
13382,
273,
4200,
16,
508,
273,
296,
88,
11,
4672,
3536,
971,
453,
353,
486,
27272,
16,
4097,
326,
5505,
1191,
67,
16941,
8227,
445,
18,
2,
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,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
67,
5732,
12,
2890,
16,
453,
16,
13382,
273,
4200,
16,
508,
273,
296,
88,
11,
4672,
3536,
971,
453,
353,
486,
27272,
16,
4097,
326,
5505,
1191,
67,
16941,
8227,
445,
18,
2,
-10... |
print "No need to rollover: %d, %d" % (t, self.rolloverAt) | def shouldRollover(self, record): """ Determine if rollover should occur | dde4dc25f59403a6279aff216bdf3df43f106fb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dde4dc25f59403a6279aff216bdf3df43f106fb7/handlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1410,
4984,
21896,
12,
2890,
16,
1409,
4672,
3536,
10229,
309,
10643,
21896,
1410,
3334,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1410,
4984,
21896,
12,
2890,
16,
1409,
4672,
3536,
10229,
309,
10643,
21896,
1410,
3334,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
def create_stopwords_dict(filename=cfg_path_to_stopwords_file): | def create_stopwords(filename=cfg_path_to_stopwords_file): | def create_stopwords_dict(filename=cfg_path_to_stopwords_file): """Create stopword dictionary out of FILENAME.""" try: filename = open(filename, 'r') except: return {} lines = filename.readlines() filename.close() stopdict = {} for line in lines: stopdict[string.rstrip(line)] = 1 return stopdict | c57d65a641a7a390ca9f837118ea46466381cc89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/c57d65a641a7a390ca9f837118ea46466381cc89/bibindex_engine_stopwords.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
5681,
3753,
12,
3459,
33,
7066,
67,
803,
67,
869,
67,
5681,
3753,
67,
768,
4672,
3536,
1684,
2132,
1095,
3880,
596,
434,
7527,
1985,
12123,
775,
30,
1544,
273,
1696,
12,
3459,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5681,
3753,
12,
3459,
33,
7066,
67,
803,
67,
869,
67,
5681,
3753,
67,
768,
4672,
3536,
1684,
2132,
1095,
3880,
596,
434,
7527,
1985,
12123,
775,
30,
1544,
273,
1696,
12,
3459,... |
self._label = gtk.Label(_("(Empty)")) | self._label = gtk.Label("(Empty)") | def __init__(self, application): """Initialize a :class:`SidePane` object.""" aeidon.Observable.__init__(self) self._conf = gaupol.conf.extensions.side_pane self._focus_handler_id = None self._has_focus = False self._label = gtk.Label(_("(Empty)")) self._notebook = gtk.Notebook() self._paned = gtk.HPaned() self._toggle_button = gtk.ToggleButton() self.application = application self._init_gui() self._init_signal_handlers() | adb37ace1fba44a28fe06f59f8add961ceb3e493 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12852/adb37ace1fba44a28fe06f59f8add961ceb3e493/side-pane.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2521,
4672,
3536,
7520,
279,
294,
1106,
28288,
8895,
8485,
68,
733,
12123,
14221,
350,
265,
18,
15279,
16186,
2738,
972,
12,
2890,
13,
365,
6315,
3923,
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,
1001,
2738,
972,
12,
2890,
16,
2521,
4672,
3536,
7520,
279,
294,
1106,
28288,
8895,
8485,
68,
733,
12123,
14221,
350,
265,
18,
15279,
16186,
2738,
972,
12,
2890,
13,
365,
6315,
3923,
273... |
_fl_set_browser_vscroll_callback(ob, c_cb, data) _fl_get_browser_line_yoffset = cfuncproto(so_libforms, "fl_get_browser_line_yoffset", cty.c_int, [cty.POINTER(FL_OBJECT), cty.c_int], | _fl_set_browser_vscroll_callback(pObject, c_cb, data) _fl_get_browser_line_yoffset = cfuncproto(so_libforms, "fl_get_browser_line_yoffset", cty.c_int, [cty.POINTER(FL_OBJECT), cty.c_int], | def fl_set_browser_vscroll_callback(ob, py_cb, data): """ fl_set_browser_vscroll_callback(ob, py_cb, data) """ c_cb = FL_BROWSER_SCROLL_CALLBACK(py_cb) _cfunc_refs[get_rand_dictkey()] = c_cb _fl_set_browser_vscroll_callback(ob, c_cb, data) | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
67,
11213,
67,
90,
12033,
67,
3394,
12,
947,
16,
2395,
67,
7358,
16,
501,
4672,
3536,
1183,
67,
542,
67,
11213,
67,
90,
12033,
67,
3394,
12,
947,
16,
2395,
67,
7358,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
67,
11213,
67,
90,
12033,
67,
3394,
12,
947,
16,
2395,
67,
7358,
16,
501,
4672,
3536,
1183,
67,
542,
67,
11213,
67,
90,
12033,
67,
3394,
12,
947,
16,
2395,
67,
7358,
... |
conn.close (); | conn.close () | def test_03 (): # call to initialize a context ctx = vortex.Ctx (); # call to init ctx if not ctx.init (): error ("Failed to init Vortex context"); return False; # call to create a connection conn = vortex.Connection (ctx, host, port); # check connection status after if if not conn.is_ok (): error ("Expected to find proper connection result, but found error. Error code was: " + str(conn.status) + ", message: " + conn.error_msg); return False; # now shutdown conn.shutdown (); # now close the connection (already shutted down) conn.close (); ctx.exit () # finish ctx del ctx return True; | 44bc361f3b497230e1d601079e2df89085d4b1cd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1306/44bc361f3b497230e1d601079e2df89085d4b1cd/vortex-regression-client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4630,
1832,
30,
468,
745,
358,
4046,
279,
819,
1103,
273,
331,
20873,
18,
6442,
261,
1769,
225,
468,
745,
358,
1208,
1103,
309,
486,
1103,
18,
2738,
1832,
30,
555,
7566,
2925... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4630,
1832,
30,
468,
745,
358,
4046,
279,
819,
1103,
273,
331,
20873,
18,
6442,
261,
1769,
225,
468,
745,
358,
1208,
1103,
309,
486,
1103,
18,
2738,
1832,
30,
555,
7566,
2925... |
__metaclass__ = QComponentMeta | __metaclass__ = ComponentMeta | def implements(*interfaces): """ Can be used in the class definiton of `Component` subclasses to declare the extension points that are extended. """ import sys frame = sys._getframe(1) locals = frame.f_locals # Some sanity checks assert locals is not frame.f_globals and '__module__' in frame.f_locals, \ 'implements() can only be used in a class definition' assert not '_implements' in locals, \ 'implements() can only be used once in a class definition' locals['_implements'] = interfaces | 6fa60d9d4ce6b6f11212e3da26e0d57aa59d7600 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12415/6fa60d9d4ce6b6f11212e3da26e0d57aa59d7600/component.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4792,
30857,
15898,
4672,
3536,
4480,
506,
1399,
316,
326,
667,
2217,
26949,
434,
1375,
1841,
68,
15320,
358,
14196,
326,
2710,
3143,
716,
854,
7021,
18,
3536,
1930,
2589,
225,
2623,
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,
4792,
30857,
15898,
4672,
3536,
4480,
506,
1399,
316,
326,
667,
2217,
26949,
434,
1375,
1841,
68,
15320,
358,
14196,
326,
2710,
3143,
716,
854,
7021,
18,
3536,
1930,
2589,
225,
2623,
273,
... |
w("\t%s = { isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"lib%s.a\" ; sourceTree = BUILT_PRODUCTS_DIR; };\n" % (d.applicationId, d.projectName)) | w("\t%s = {\n\t\tisa = PBXFileReference;\n\t\texplicitFileType = archive.ar;\n\t\tincludeInIndex = 0;\n\t\tpath = \"lib%s.a\";\n\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t};\n" % (d.applicationId, d.projectName)) | def writePBXFileReference(self): w = self.file.write w("/* Begin PBXFileReference section */\n") for name, setting, buildfile, fileref in self.buildSettingsId[1]: w("\t%s = { isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = \"%s\"; path = \"%s\" ; sourceTree = \"SOURCE_ROOT\"; };\n" % (fileref, name+'.xcconfig', os.path.join('mak', 'xcode', name+'.xcconfig'))) for d in self.projects: d.targetId = newid() d.phaseId = [newid(), newid(), newid()] d.applicationId = newid() if d.usemaster: w("\t%s = { isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.cpp; name = \"%s\"; path = \"%s\" ; sourceTree = \"SOURCE_ROOT\"; };\n" % (d.masterid, os.path.split(d.masterfilename)[1], d.masterfilename)) self.pbxFileRefTree(d.sourceTree) if d.type in ['game', 'tool']: w("\t%s = { isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"%s.app\" ; sourceTree = BUILT_PRODUCTS_DIR; };\n" % (d.applicationId, d.projectName)) elif d.type in ['library', 'static_library', 'plugin']: w("\t%s = { isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"lib%s.a\" ; sourceTree = BUILT_PRODUCTS_DIR; };\n" % (d.applicationId, d.projectName)) d.buildSettingsId = (newid(), [('iphone-debug', newid()), ('iphone-profile', newid()), ('iphone-final', newid()), ('osx-debug', newid()), ('osx-profile', newid()), ('osx-final', newid())]) w("/* End PBXFileReference section */\n\n") | d7aadbc0a472761177dc3ee9ceac6f02c9a19b91 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7302/d7aadbc0a472761177dc3ee9ceac6f02c9a19b91/xcode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
20724,
60,
812,
2404,
12,
2890,
4672,
341,
273,
365,
18,
768,
18,
2626,
341,
2932,
20308,
14323,
20819,
60,
812,
2404,
2442,
1195,
64,
82,
7923,
364,
508,
16,
3637,
16,
1361,
768... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
20724,
60,
812,
2404,
12,
2890,
4672,
341,
273,
365,
18,
768,
18,
2626,
341,
2932,
20308,
14323,
20819,
60,
812,
2404,
2442,
1195,
64,
82,
7923,
364,
508,
16,
3637,
16,
1361,
768... |
item.move(item.x()+minx, item.y()+miny) | item.moveBy(minx, miny) | def fillPainter(self, painter, rect): if isinstance(self.graph, QwtPlot): self.graph.printPlot(painter, rect) elif isinstance(self.graph, QCanvas): # draw background self.graph.drawBackground(painter, rect) minx,maxx,miny,maxy = self.getQCanvasBoundaries() | 08cbcd5a756f1d5ab4a9304213d05c089c2cfc47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/08cbcd5a756f1d5ab4a9304213d05c089c2cfc47/OWDlgs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
15775,
12,
2890,
16,
21295,
16,
4917,
4672,
309,
1549,
12,
2890,
18,
4660,
16,
2238,
6046,
11532,
4672,
365,
18,
4660,
18,
1188,
11532,
12,
84,
11606,
16,
4917,
13,
1327,
1549,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
15775,
12,
2890,
16,
21295,
16,
4917,
4672,
309,
1549,
12,
2890,
18,
4660,
16,
2238,
6046,
11532,
4672,
365,
18,
4660,
18,
1188,
11532,
12,
84,
11606,
16,
4917,
13,
1327,
1549,
1... |
portal(2, 50) | portal(2, 5) | def portal(codeno, j): i = 0 while 1: driver.jit_merge_point(codeno=codeno, i=i, j=j) if i == 1: if j == 0: return portal(2, j - 1) elif i == 3: return i += 1 driver.can_enter_jit(codeno=codeno, i=i, j=j) | 9778d86ed49ed3c6c44a7107e955a21aaa50975f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/9778d86ed49ed3c6c44a7107e955a21aaa50975f/test_recursive.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11899,
12,
1559,
5764,
16,
525,
4672,
277,
273,
374,
1323,
404,
30,
3419,
18,
78,
305,
67,
2702,
67,
1153,
12,
1559,
5764,
33,
1559,
5764,
16,
277,
33,
77,
16,
525,
33,
78,
13,
309... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11899,
12,
1559,
5764,
16,
525,
4672,
277,
273,
374,
1323,
404,
30,
3419,
18,
78,
305,
67,
2702,
67,
1153,
12,
1559,
5764,
33,
1559,
5764,
16,
277,
33,
77,
16,
525,
33,
78,
13,
309... |
subject = req.args.get('subject', '') | subject = req.args.get('subject', '').strip() | def render_admin_panel(self, req, cat, page, path_info): perm = PermissionSystem(self.env) all_permissions = perm.get_all_permissions() all_actions = perm.get_actions() | 6006c3581891da00b6338022ce610bbe03da2745 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/6006c3581891da00b6338022ce610bbe03da2745/web_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
3666,
67,
13916,
12,
2890,
16,
1111,
16,
6573,
16,
1363,
16,
589,
67,
1376,
4672,
4641,
273,
8509,
3163,
12,
2890,
18,
3074,
13,
777,
67,
9612,
273,
4641,
18,
588,
67,
454,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
3666,
67,
13916,
12,
2890,
16,
1111,
16,
6573,
16,
1363,
16,
589,
67,
1376,
4672,
4641,
273,
8509,
3163,
12,
2890,
18,
3074,
13,
777,
67,
9612,
273,
4641,
18,
588,
67,
454,... |
percent_error = int(scatter_info[int(quantity_number)]['%error']) | percent_error = float(scatter_info[int(quantity_number)]['%error']) | def scatter_plot(group_info,scatter_info,data_set): #data_set is a dictionary keyed by quantity containing lists of groups and X and Y data points. #print "Group Info:", group_info for quantity_number in scatter_info: #print "Dataset for quantity number "+str(quantity_number)+": ", data_set[quantity_number] if data_set[quantity_number] == []: print "No Scatter Plot Data in Quantity "+str(quantity_number)+" Dataset.\n" else: print "Scatter Plot Data for Quantity "+str(quantity_number)+" Dataset." # Set variables for Plot extracted from the first group of lines in config file starting with 'q'. # Variables for plot. plot_title = scatter_info[int(quantity_number)]['Scatter_Plot_Title'] print plot_title x_title = scatter_info[int(quantity_number)]['X_Title'] y_title = scatter_info[int(quantity_number)]['Y_Title'] min_x = float(scatter_info[int(quantity_number)]['Plot_Min']) #print min_x max_x = float(scatter_info[int(quantity_number)]['Plot_Max']) #print max_x min_y = float(scatter_info[int(quantity_number)]['Plot_Min']) max_y = float(scatter_info[int(quantity_number)]['Plot_Max']) percent_error = int(scatter_info[int(quantity_number)]['%error']) title_quadrant = int(scatter_info[int(quantity_number)]['Title_Quadrant']) key_pos = scatter_info[int(quantity_number)]['Key_Position'] key_dist = 0.2*unit.v_cm plot_width = int(scatter_info[int(quantity_number)]['Plot_Width(cm)']) #Create filename from fields in input file record. plot_file_name = scatter_info[int(quantity_number)]['Plot_Filename'] #print plot_file_name # Determine the location for the key, alignment based on key_quadrant setting. if key_pos == "tl" or "tc" or "tr" or "ml" or "mc" or "mr" or "bl" or "bc" or "br": () #print "Key Position =", key_pos else: print "The key position was not specified./nUsing the default bottom right position." key_pos = "br" #Begin Plotting #print exp_data #print mod_data # Initialize graph object g = graph.graphxy(width=plot_width, ratio=1/1, key=graph.key.key(pos=key_pos, dist=key_dist), x=graph.axis.linear(title=x_title, min=min_x, max=max_x), y=graph.axis.linear(title=y_title, min=min_y, max=max_y)) #Plot Midline and Error bounds lines. errorLineCenterPoints = [[min_x,min_y],[max_x,max_y]] #print errorLineCenterPoints lower_bound = max_y - max_y * percent_error / 100 #print lower_bound errorLineLowerPoints = [[min_x,min_y],[max_x,lower_bound]] #print errorLineLowerPoints upper_bound = max_y + max_y * percent_error / 100.0 #print upper_bound errorLineUpperPoints = [[min_x,min_y],[max_x,upper_bound]] #print errorLineUpperPoints g.plot(graph.data.points(errorLineCenterPoints, title=None, x=1, y=2), [graph.style.line([style.linewidth.Thin, style.linestyle.solid])]) g.plot(graph.data.points(errorLineLowerPoints, title=None, x=1, y=2), [graph.style.line([style.linewidth.Thin, style.linestyle.dashed])]) g.plot(graph.data.points(errorLineUpperPoints, title=None, x=1, y=2), [graph.style.line([style.linewidth.Thin, style.linestyle.dashed])]) # mystyle = graph.style.symbol(graph.style.symbol.changetriangletwice, size=0.1*unit.v_cm, # symbolattrs=[graph.style.symbol.changefilledstroked, # attr.changelist([color.rgb.red, color.rgb.green, color.rgb.blue])]) #One point at a time added to plot from each data set. # Iterate over items in scatter data dictionary key for items that are not []. # Append data sets to scatter_plot_data_list # colors for symbols are from http://pyx.sourceforge.net/manual/colorname.html scatter_plot_data_list = [] grouped_data = {} grouped_data_list = range(len(group_quantity_data_dicts[0])+1) #print "Grouped Data List:", grouped_data_list #print "DataSet for Quantity "+str(quantity_number)+":", data_set[quantity_number] if len(data_set[quantity_number]) > 1: #print "Grouped Scatter Data:" #print data_set[quantity_number] for arr_temp in grouped_data_list: grouped_data_list[arr_temp] = [] for data_set_item in data_set[quantity_number]: #print data_set_item #print "Data for group "+data_set_item[0]+":", data_set_item[1] grouped_data_list[int(data_set_item[0])].append(data_set_item[1]) print "Grouped data list:", grouped_data_list #g.plot(graph.data.points(scatter_plot_data, x=1, y=2, title=group_info[int(data_set[quantity_number][0][0])]["Group_Title"]), [mystyle]) group_counter = 0 for j in grouped_data_list: print "J =", j if j != []: print group_counter # Pull group symbol specifications from config file. config_group_symbol = group_info[group_counter]["Symbol"] #print config_group_symbol group_symbol = "graph.style.symbol."+config_group_symbol #print group_symbol config_group_symbol_color = group_info[group_counter]["Color"] #print config_group_symbol_color #group_color = "color.rgb."+config_group_symbol_color config_group_symbol_filled = group_info[group_counter]["Filled"] #print config_group_symbol_filled if config_group_symbol_filled == 'yes': fillstyle = "deco.filled([color.rgb."+config_group_symbol_color+"])" else: fillstyle = "deco.stroked([color.rgb."+config_group_symbol_color+"])" print group_symbol, fillstyle #Create temporary symbol style. tempstyle = "graph.style.symbol("+group_symbol+", size=0.1*unit.v_cm, symbolattrs=["+fillstyle+"])" print "TempStyle:", tempstyle scatterpointstyle = eval(tempstyle) #print group_info[group_counter]["Group_Title"] g.plot(graph.data.points(j, x=1, y=2, title=group_info[group_counter]["Group_Title"]), [scatterpointstyle]) else: pass group_counter = group_counter + 1 else: print "Non-Grouped Scatter Data:" print data_set[quantity_number] scatter_plot_data = [] scatter_plot_data.append(data_set[quantity_number][0][1]) print scatter_plot_data #print grouped_data_list # Now plot the Title text, alignment based on title quadrant setting. if title_quadrant == 1: g.text(0.1, g.height - 0.2, plot_title, [text.halign.left, text.valign.top, text.size.small]) elif title_quadrant == 2: g.text(g.width-0.1, g.height - 0.2, plot_title, [text.halign.right, text.valign.top, text.size.normalsize]) elif title_quadrant == 3: g.text(0.1, 0.2, plot_title, [text.halign.left, text.valign.bottom, text.size.normalsize]) elif title_quadrant == 4: g.text(g.width-0.1, 0.2, plot_title, [text.halign.right, text.valign.bottom, text.size.normalsize]) else: print "A title location was not specified./nUsing the default top left quadrant." g.text(0.1, g.height - 0.2, plot_title, [text.halign.left, text.valign.top, text.size.small]) # Write the output plot_file_path = output_directory+plot_file_name #print plot_file_path g.writePDFfile(plot_file_path) print "Plot to: \n", plot_file_path+".PDF\n" | ad91d4eb3f67d10bfa5d623cd1280d36462603e1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12/ad91d4eb3f67d10bfa5d623cd1280d36462603e1/Validation_Data_Processor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14644,
67,
4032,
12,
1655,
67,
1376,
16,
31320,
67,
1376,
16,
892,
67,
542,
4672,
468,
892,
67,
542,
353,
279,
3880,
17408,
635,
10457,
4191,
6035,
434,
3252,
471,
1139,
471,
1624,
501... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14644,
67,
4032,
12,
1655,
67,
1376,
16,
31320,
67,
1376,
16,
892,
67,
542,
4672,
468,
892,
67,
542,
353,
279,
3880,
17408,
635,
10457,
4191,
6035,
434,
3252,
471,
1139,
471,
1624,
501... |
_form_proxypass(base64.encodestring(form['proxypass'].value.strip())) | _form_proxypass(base64.encodestring(getval(form, 'proxypass').strip())) | def exec_form (form): # reset info/error del info[:] del error[:] # proxy port if form.has_key('port'): _form_proxyport(form['port'].value) # proxy user if form.has_key('proxyuser'): _form_proxyuser(form['proxyuser'].value.strip()) # proxy pass if form.has_key('proxypass'): _form_proxypass(base64.encodestring(form['proxypass'].value.strip())) # parent proxy host if form.has_key('parentproxy'): _form_parentproxy(form['parentproxy'].value.strip()) # parent proxy port if form.has_key('parentproxyport'): _form_parentproxyport(form['parentproxyport'].value) # parent proxy user if form.has_key('parentproxyuser'): _form_parentproxyuser(form['parentproxyuser'].value.strip()) # parent proxy pass if form.has_key('parentproxypass'): _form_parentproxypass( base64.encodestring(form['parentproxypass'].value)) # timeout if form.has_key('timeout'): _form_timeout(form['timeout'].value) # filter modules _form_filtermodules(form) # allowed hosts if form.has_key('addallowed') and form.has_key('newallowed'): _form_addallowed(form['newallowed'].value.strip()) elif form.has_key('delallowed') and form.has_key('allowedhosts'): _form_delallowed(form['allowedhosts']) # no filter hosts if form.has_key('addnofilter') and form.has_key('newnofilter'): _form_addnofilter(form['newnofilter'].value.strip()) elif form.has_key('delnofilter') and form.has_key('nofilterhosts'): _form_delnofilter(form['nofilterhosts']) if info: # write changed config config.write_proxyconf() | 98aca97370c8fe2057b4b424343b612a4590773e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/98aca97370c8fe2057b4b424343b612a4590773e/config_html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1196,
67,
687,
261,
687,
4672,
468,
2715,
1123,
19,
1636,
1464,
1123,
10531,
65,
1464,
555,
10531,
65,
468,
2889,
1756,
309,
646,
18,
5332,
67,
856,
2668,
655,
11,
4672,
389,
687,
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,
1196,
67,
687,
261,
687,
4672,
468,
2715,
1123,
19,
1636,
1464,
1123,
10531,
65,
1464,
555,
10531,
65,
468,
2889,
1756,
309,
646,
18,
5332,
67,
856,
2668,
655,
11,
4672,
389,
687,
67,
... |
print "Will rollover at %d, %d seconds from now" % (self.rolloverAt, self.rolloverAt - currentTime) | def __init__(self, filename, when='h', interval=1, backupCount=0): BaseRotatingHandler.__init__(self, filename, 'a') self.when = string.upper(when) self.backupCount = backupCount # Calculate the real rollover interval, which is just the number of # seconds between rollovers. Also set the filename suffix used when # a rollover occurs. Current 'when' events supported: # S - Seconds # M - Minutes # H - Hours # D - Days # midnight - roll over at midnight # W{0-6} - roll over on a certain day; 0 - Monday # # Case of the 'when' specifier is not important; lower or upper case # will work. currentTime = int(time.time()) if self.when == 'S': self.interval = 1 # one second self.suffix = "%Y-%m-%d_%H-%M-%S" elif self.when == 'M': self.interval = 60 # one minute self.suffix = "%Y-%m-%d_%H-%M" elif self.when == 'H': self.interval = 60 * 60 # one hour self.suffix = "%Y-%m-%d_%H" elif self.when == 'D' or self.when == 'MIDNIGHT': self.interval = 60 * 60 * 24 # one day self.suffix = "%Y-%m-%d" elif self.when.startswith('W'): self.interval = 60 * 60 * 24 * 7 # one week if len(self.when) != 2: raise ValueError("You must specify a day for weekly rollover from 0 to 6 (0 is Monday): %s" % self.when) if self.when[1] < '0' or self.when[1] > '6': raise ValueError("Invalid day specified for weekly rollover: %s" % self.when) self.dayOfWeek = int(self.when[1]) self.suffix = "%Y-%m-%d" else: raise ValueError("Invalid rollover interval specified: %s" % self.when) | 5e9e9e19f7fae86e5d234a5cd8386bc6e34a36ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5e9e9e19f7fae86e5d234a5cd8386bc6e34a36ab/handlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1544,
16,
1347,
2218,
76,
2187,
3673,
33,
21,
16,
5114,
1380,
33,
20,
4672,
3360,
8570,
1776,
1503,
16186,
2738,
972,
12,
2890,
16,
1544,
16,
296,
69,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1544,
16,
1347,
2218,
76,
2187,
3673,
33,
21,
16,
5114,
1380,
33,
20,
4672,
3360,
8570,
1776,
1503,
16186,
2738,
972,
12,
2890,
16,
1544,
16,
296,
69,
... | |
correct_ident = self.xml.find(query).text for answer in self.answers: if answer['ident'] == correct_ident: | correct_elem = self.xml.find(query) if correct_elem: correct_ident = correct_elem.text for answer in self.answers: if answer['ident'] == correct_ident: answer['points'] = 1 answer['feedback'] = self.cor_fb else: answer['points'] = 0 answer['feedback'] = self.incor_fb answer['id'] = elixer.m_hash(answer) else: for answer in self.answers: | def build_answers(self): self.single_answer = 1 | cf63ddff404b0bab9edcec3e700be8ea842ee0e3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12927/cf63ddff404b0bab9edcec3e700be8ea842ee0e3/bb9_course.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
22340,
12,
2890,
4672,
365,
18,
7526,
67,
13490,
273,
404,
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,
1361,
67,
22340,
12,
2890,
4672,
365,
18,
7526,
67,
13490,
273,
404,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
dblQuotedString = Regex(r'"(?:[^"\n\r\\]|(?:"")|(?:\\.))*"').setName("string enclosed in double quotes") sglQuotedString = Regex(r"'(?:[^'\n\r\\]|(?:'')|(?:\\.))*'").setName("string enclosed in single quotes") quotedString = Regex(r'''(?:"(?:[^"\n\r\\]|(?:"")|(?:\\.))*")|(?:'(?:[^'\n\r\\]|(?:'')|(?:\\.))*')''').setName("quotedString using single or double quotes") | dblQuotedString = Regex(r'"(?:[^"\n\r\\]|(?:"")|(?:\\x[0-9a-fA-F]+)|(?:\\.))*"').setName("string enclosed in double quotes") sglQuotedString = Regex(r"'(?:[^'\n\r\\]|(?:'')|(?:\\x[0-9a-fA-F]+)|(?:\\.))*'").setName("string enclosed in single quotes") quotedString = Regex(r'''(?:"(?:[^"\n\r\\]|(?:"")|(?:\\x[0-9a-fA-F]+)|(?:\\.))*")|(?:'(?:[^'\n\r\\]|(?:'')|(?:\\x[0-9a-fA-F]+)|(?:\\.))*')''').setName("quotedString using single or double quotes") unicodeString = Combine('u' + quotedString.copy()) | def operatorPrecedence( baseExpr, opList ): """Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or binary, left- or right-associative. Parse actions can also be attached to operator expressions. Parameters: - baseExpr - expression representing the most basic element for the nested - opList - list of tuples, one for each operator precedence level in the expression grammar; each tuple is of the form (opExpr, numTerms, rightLeftAssoc, parseAction), where: - opExpr is the pyparsing expression for the operator; may also be a string, which will be converted to a Literal - numTerms is the number of terms for this operator (must be 1 or 2) - rightLeftAssoc is the indicator whether the operator is right or left associative, using the pyparsing-defined constants opAssoc.RIGHT and opAssoc.LEFT. - parseAction is the parse action to be associated with expressions matching this operator expression (the parse action tuple member may be omitted) """ ret = Forward() lastExpr = baseExpr | ( Suppress('(') + ret + Suppress(')') ) for i,operDef in enumerate(opList): opExpr,arity,rightLeftAssoc,pa = (operDef + (None,))[:4] thisExpr = Forward()#.setName("expr%d" % i) if rightLeftAssoc == opAssoc.LEFT: if arity == 1: matchExpr = Group( lastExpr + ZeroOrMore( opExpr ) ) elif arity == 2: matchExpr = Group( lastExpr + ZeroOrMore( opExpr + lastExpr ) ) else: raise ValueError, "operator must be unary (1) or binary (2)" elif rightLeftAssoc == opAssoc.RIGHT: if arity == 1: # try to avoid LR with this extra test if not isinstance(opExpr, Optional): opExpr = Optional(opExpr) matchExpr = FollowedBy(opExpr.expr + thisExpr) + Group( opExpr + thisExpr ) matchExpr |= lastExpr elif arity == 2: matchExpr = Group( lastExpr + ZeroOrMore( opExpr + thisExpr ) ) else: raise ValueError, "operator must be unary (1) or binary (2)" else: raise ValueError, "operator must indicate right or left associativity" if pa: matchExpr.setParseAction( pa ) thisExpr << ( matchExpr ) lastExpr = thisExpr ret << lastExpr ret.setParseAction(_flattenOpPrecTokens) return Group(ret) | 85e0d38c151a83bab482361329bc5873d14c959a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12364/85e0d38c151a83bab482361329bc5873d14c959a/pyparsing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3726,
1386,
24092,
12,
1026,
4742,
16,
27571,
262,
30,
3536,
2276,
707,
364,
27389,
6473,
87,
434,
8041,
7165,
731,
434,
12213,
5960,
316,
279,
14172,
9360,
18,
225,
7692,
3062,
2026,
50... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3726,
1386,
24092,
12,
1026,
4742,
16,
27571,
262,
30,
3536,
2276,
707,
364,
27389,
6473,
87,
434,
8041,
7165,
731,
434,
12213,
5960,
316,
279,
14172,
9360,
18,
225,
7692,
3062,
2026,
50... |
if (revstart > revend): | if revstart > revend: | def merge_notify_line(revstart, revend=None): """Return an expected output line that describes the beginning of a merge operation on revisions REVSTART through REVEND.""" if (revend is None): if (revstart < 0): return "--- Undoing r%ld:\n" % abs(revstart) else: return "--- Merging r%ld:\n" % revstart else: if (revstart > revend): return "--- Undoing r%ld through r%ld:\n" % (revstart, revend) else: return "--- Merging r%ld through r%ld:\n" % (revstart, revend) | 0fb57cb3754adb068999218d5c2cd5d847087264 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1387/0fb57cb3754adb068999218d5c2cd5d847087264/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2691,
67,
12336,
67,
1369,
12,
9083,
1937,
16,
5588,
409,
33,
7036,
4672,
3536,
990,
392,
2665,
876,
980,
716,
19605,
326,
8435,
434,
279,
2691,
1674,
603,
18325,
2438,
58,
7570,
3059,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2691,
67,
12336,
67,
1369,
12,
9083,
1937,
16,
5588,
409,
33,
7036,
4672,
3536,
990,
392,
2665,
876,
980,
716,
19605,
326,
8435,
434,
279,
2691,
1674,
603,
18325,
2438,
58,
7570,
3059,
... |
self.error_msg("Offline mode, cannot do search") return else: coord = locations[location] print "%s at %f, %f" % (location, coord[0], coord[1]) self.center = self.ctx_map.coord_to_tile(coord[2], coord[0], coord[1]) self.current_zoom_level = coord[2] self.do_scale(coord[2], force=True) | coord = locations[location] print "%s at %f, %f" % (location, coord[0], coord[1]) self.center = self.ctx_map.coord_to_tile(coord[2], coord[0], coord[1]) self.current_zoom_level = coord[2] self.do_scale(coord[2], force=True) | def confirm_clicked(self, button): location = self.entry.get_text() if (0 == len(location)): self.error_msg("Need location") return locations = self.ctx_map.get_locations() if (not location in locations.keys()): if (not self.cb_offline.get_active()): l = self.ctx_map.search_location(location) if (False == l): self.error_msg( "Can't find %s in google map" % location) self.entry.set_text("") return location = l; self.entry.set_text(l) self.set_completion() coord = self.ctx_map.get_locations()[location] else: self.error_msg("Offline mode, cannot do search") return else: coord = locations[location] print "%s at %f, %f" % (location, coord[0], coord[1]) | 0cbfc61564ea417700459fc0ad128aafd1101acf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5373/0cbfc61564ea417700459fc0ad128aafd1101acf/maps.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6932,
67,
7475,
329,
12,
2890,
16,
3568,
4672,
2117,
273,
365,
18,
4099,
18,
588,
67,
955,
1435,
309,
261,
20,
422,
562,
12,
3562,
3719,
30,
365,
18,
1636,
67,
3576,
2932,
14112,
211... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6932,
67,
7475,
329,
12,
2890,
16,
3568,
4672,
2117,
273,
365,
18,
4099,
18,
588,
67,
955,
1435,
309,
261,
20,
422,
562,
12,
3562,
3719,
30,
365,
18,
1636,
67,
3576,
2932,
14112,
211... |
self.poll_LC = None | def __init__(self, default_mimetype='audio/mpeg'): self.player = None self.source = None self.sink = None self.bus = None self.poll_LC = None | 0fc5f370207fa1828fce237ae25cf479914de8e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11626/0fc5f370207fa1828fce237ae25cf479914de8e6/gstreamer_renderer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
805,
67,
22571,
2218,
11509,
19,
19951,
11,
4672,
365,
18,
14872,
273,
599,
365,
18,
3168,
273,
599,
365,
18,
17074,
273,
599,
365,
18,
9274,
273,
599,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
805,
67,
22571,
2218,
11509,
19,
19951,
11,
4672,
365,
18,
14872,
273,
599,
365,
18,
3168,
273,
599,
365,
18,
17074,
273,
599,
365,
18,
9274,
273,
599,
... | |
{'message' : 'foo', 'args' : ('foo',)}), | {'message' : 'foo', 'args' : ('foo',), 'filename' : None, 'errno' : None, 'strerror' : None}), | def testAttributes(self): # test that exception attributes are happy | 00fdbb0ae71076b3ec37c7d26811482a66fd0268 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/00fdbb0ae71076b3ec37c7d26811482a66fd0268/test_exceptions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2498,
12,
2890,
4672,
468,
1842,
716,
1520,
1677,
854,
5622,
2074,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2498,
12,
2890,
4672,
468,
1842,
716,
1520,
1677,
854,
5622,
2074,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
[[] []] | [[]] | def __iter__(self): """ Returns a generator object which iterates through the elements of self. The order in which the elements are generated is based on a 'weight' of a matrix which is the number of iterations on the base ring that are required to reach that matrix. | f8362b2d3b0fc786a0f90a349f9f147373a4f0f5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/f8362b2d3b0fc786a0f90a349f9f147373a4f0f5/matrix_space.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
3536,
2860,
279,
4456,
733,
1492,
16960,
3059,
326,
2186,
434,
365,
18,
225,
1021,
1353,
316,
1492,
326,
2186,
854,
4374,
353,
2511,
603,
279,
296,
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,
1,
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,
2165,
972,
12,
2890,
4672,
3536,
2860,
279,
4456,
733,
1492,
16960,
3059,
326,
2186,
434,
365,
18,
225,
1021,
1353,
316,
1492,
326,
2186,
854,
4374,
353,
2511,
603,
279,
296,
4865,... |
patch = q.lookup(f) if patch in patches or patch == parent: ui.warn(_('Skipping already folded patch %s') % patch) if q.isapplied(patch): raise util.Abort(_('qfold cannot fold already applied patch %s') % patch) patches.append(patch) for patch in patches: | p = q.lookup(f) if p in patches or p == parent: ui.warn(_('Skipping already folded patch %s') % p) if q.isapplied(p): raise util.Abort(_('qfold cannot fold already applied patch %s') % p) patches.append(p) for p in patches: | def fold(ui, repo, *files, **opts): """fold the named patches into the current patch Patches must not yet be applied. Each patch will be successively applied to the current patch in the order given. If all the patches apply successfully, the current patch will be refreshed with the new cumulative patch, and the folded patches will be deleted. With -k/--keep, the folded patch files will not be removed afterwards. The header for each folded patch will be concatenated with the current patch header, separated by a line of '* * *'.""" q = repo.mq if not files: raise util.Abort(_('qfold requires at least one patch name')) if not q.check_toppatch(repo): raise util.Abort(_('No patches applied\n')) message = commands.logmessage(opts) if opts['edit']: if message: raise util.Abort(_('option "-e" incompatible with "-m" or "-l"')) parent = q.lookup('qtip') patches = [] messages = [] for f in files: patch = q.lookup(f) if patch in patches or patch == parent: ui.warn(_('Skipping already folded patch %s') % patch) if q.isapplied(patch): raise util.Abort(_('qfold cannot fold already applied patch %s') % patch) patches.append(patch) for patch in patches: if not message: messages.append(q.readheaders(patch)[0]) pf = q.join(patch) (patchsuccess, files, fuzz) = q.patch(repo, pf) if not patchsuccess: raise util.Abort(_('Error folding patch %s') % patch) if not message: message, comments, user = q.readheaders(parent)[0:3] for msg in messages: message.append('* * *') message.extend(msg) message = '\n'.join(message) if opts['edit']: message = ui.edit(message, user or ui.username()) q.refresh(repo, msg=message) for patch in patches: q.delete(repo, patch, keep=opts['keep']) q.save_dirty() | 55520daac301e92f009b7855c2df9d3bfbea47b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/55520daac301e92f009b7855c2df9d3bfbea47b4/mq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11590,
12,
4881,
16,
3538,
16,
380,
2354,
16,
2826,
4952,
4672,
3536,
16007,
326,
4141,
16482,
1368,
326,
783,
4729,
225,
12042,
281,
1297,
486,
4671,
506,
6754,
18,
8315,
4729,
903,
506... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11590,
12,
4881,
16,
3538,
16,
380,
2354,
16,
2826,
4952,
4672,
3536,
16007,
326,
4141,
16482,
1368,
326,
783,
4729,
225,
12042,
281,
1297,
486,
4671,
506,
6754,
18,
8315,
4729,
903,
506... |
out_file.write(binascii.b2a_uu(data)) | out_file.write(str(binascii.b2a_uu(data), "ascii")) | def encode(in_file, out_file, name=None, mode=None): """Uuencode file""" # # If in_file is a pathname open it and change defaults # if in_file == '-': in_file = sys.stdin elif isinstance(in_file, basestring): if name is None: name = os.path.basename(in_file) if mode is None: try: mode = os.stat(in_file).st_mode except AttributeError: pass in_file = open(in_file, 'rb') # # Open out_file if it is a pathname # if out_file == '-': out_file = sys.stdout elif isinstance(out_file, basestring): out_file = open(out_file, 'w') # # Set defaults for name and mode # if name is None: name = '-' if mode is None: mode = 0o666 # # Write the data # out_file.write('begin %o %s\n' % ((mode & 0o777),name)) data = in_file.read(45) while len(data) > 0: out_file.write(binascii.b2a_uu(data)) data = in_file.read(45) out_file.write(' \nend\n') | 0592279e9d60facf1e986dda1c9040a998ba1c89 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/0592279e9d60facf1e986dda1c9040a998ba1c89/uu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
267,
67,
768,
16,
596,
67,
768,
16,
508,
33,
7036,
16,
1965,
33,
7036,
4672,
3536,
57,
89,
3015,
585,
8395,
468,
468,
971,
316,
67,
768,
353,
279,
9806,
1696,
518,
471,
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,
2017,
12,
267,
67,
768,
16,
596,
67,
768,
16,
508,
33,
7036,
16,
1965,
33,
7036,
4672,
3536,
57,
89,
3015,
585,
8395,
468,
468,
971,
316,
67,
768,
353,
279,
9806,
1696,
518,
471,
2... |
b[i] = tuple(list(b[i]) + ['?']*100) c = b[i] eul = format(c, 13) reg = format(c, 2) plan = format(c, 16) perf = format(c, 19) vtran = format(c, 12) etran = format(c, 15) | eul = multiple_replace(to_bool,'%s'%b[i][13]) reg = multiple_replace(to_bool,'%s'%b[i][2]) plan = multiple_replace(to_bool,'%s'%b[i][16]) perf = multiple_replace(to_bool,'%s'%b[i][19]) vtran = multiple_replace(to_bool,'%s'%b[i][12]) etran = multiple_replace(to_bool,'%s'%b[i][15]) | def display_properties(self, properties=None, layout='circular', query=None, graph6=None, \ num_vertices=None, num_edges=None, num_cycles=None, num_hamiltonian_cycles=None, \ eulerian=None, planar=None, perfect=None, lovasz_number=None, \ complement_graph6=None, aut_grp_size=None, num_orbits=None, \ num_fixed_points=None, vertex_transitive=None, edge_transitive=None, \ degree_sequence=None, min_degree=None, max_degree=None, \ average_degree=None, degrees_sd=None, regular=None, \ vertex_connectivity=None, edge_connectivity=None, \ num_components=None, girth=None, radius=None, diameter=None, \ clique_number=None, independence_number=None, num_cut_vertices=None, \ min_vertex_cover_size=None, num_spanning_trees=None, \ induced_subgraphs=None, spectrum=None, min_eigenvalue=None, \ max_eigenvalue=None, eigenvalues_sd=None, energy=None): r""" Displays the results of a query in a table, including all specified properties and an image for each graph. INPUT: query -- (GenericSQLQuery) A sqlite query for graphs.db (See examples below). properties -- (List) A list of strings that are the exact name (as the following parameters) of the properties to display with the results. layout -- (String) The layout option for the graph image. Options include: 'circular' -- plots the graph with vertices evenly distributed on a circle 'spring' -- uses the traditional spring layout aut_grp_size -- (Integer) The desired size of the automorphism group. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' average_degree -- (Real) The desired average degree. (List) Format: [<String>,<Real>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' clique_number -- (Integer) The desired clique number. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' complement_graph6 -- (String) A graph6 string isomorphic to the desired complement graph. (List) A list of graph6 strings. Will search for graphs with complement isomorphic to any string in the list. degree_sequence -- (Integer) The desired sequence of degrees. (Ordered highest to lowest). degrees_sd -- (Real) The desired standard deviation of degrees. (List) Format: [<String>,<Real>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' diameter -- (Real) The desired diameter. (List) Format: [<String>,<Real>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' edge_connectivity -- (Integer) The desired edge connectivity. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' edge_transitive -- (Boolean) eigenvalues_sd -- (Real) The desired standard deviation of eigenvalues. (List) Format: [<String>,<Real>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' energy -- (Real) The desired energy. (List) Format: [<String>,<Real>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' eulerian -- (Boolean) girth -- (Integer) The desired girth. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' graph6 -- (String) A graph6 string isomorphic to the desired graph. (List) A list of graph6 strings. Will search for graphs isomorphic to any string in the list. independence_number -- (Integer) The desired independence number. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' induced_subgraphs -- (String) graph6 string isomorphic to desired subgraph. (List) Format options: 1. ['one_of',<String>,...,<String>] Will search for graphs containing a subgraph isomorphic to any of the graph6 strings in the list. 2. ['all_of',<String>,...,<String>] Will search for graphs containing a subgraph isomorphic to each of the graph6 strings in the list. lovasz_number -- (Real) The desired lovasz number. (List) Format: [<String>,<Real>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' max_degree -- (Integer) The desired maximum degree. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' max_eigenvalue -- (Real) The desired maximum eigenvalue. (List) Format: [<String>,<Real>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' min_degree -- (Integer) The desired minimum degree. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' min_eigenvalue -- (Real) The desired minimum eigenvalue. (List) Format: [<String>,<Real>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' min_vertex_cover_size -- (Integer) The desired minimum vertex cover size. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' num_components -- (Integer) The desired number of components. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' num_cut_vertices -- (Integer) The desired number of cut vertices. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' num_cycles -- (Integer) The desired number of cycles. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' num_edges -- (Integer) The desired number of edges. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' num_fixed_points -- (Integer) The desired number of fixed points. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' num_hamiltonian_cycles -- (Integer) The desired number of hamiltonian cycles. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' num_orbits -- (Integer) The desired number of orbits. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' num_spanning_trees -- (Integer) The desired number of spanning trees. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' num_vertices -- (Integer) The desired number of vertices. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' perfect -- (Boolean) planar -- (Boolean) radius -- (Integer) The desired radius. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' regular -- (Boolean) spectrum -- (String) The desired spectrum. (Ordered highest to lowest, delimited by ', ' and rounded to 6 decimal places). vertex_connectivity -- (Integer) The desired vertex connectivity. (List) Format: [<String>,<Integer>] WHERE the first entry represents an inequality: '=','>','<','>=','<=' vertex_transitive -- (Boolean) EXAMPLES: The basics: sage: graphs_query = GraphDatabase() sage: graphs_query.display_properties(properties=['num_vertices','lovasz_number',\ ... 'girth','radius','diameter'], num_vertices=5,\ ... lovasz_number=3.0, girth=4, radius=2, diameter=3) <html>... sage: graphs_query.display_properties(properties=['num_hamiltonian_cycles','regular',\ ... 'perfect','num_cycles','num_edges','spectrum'], \ ... layout='spring', num_hamiltonian_cycles=2,\ ... regular=True, perfect=False) <html>... sage: graphs_query.display_properties(properties=['min_degree','max_degree',\ ... 'degrees_sd','average_degree','regular',\ ... 'induced_subgraphs'],layout='spring',\ ... degree_sequence=433211) <html>... Using Inequalities: sage: graphs_query.display_properties(properties=['energy','spectrum','eigenvalues_sd',\ ... 'complement_graph6'], layout='circular', \ ... min_eigenvalue=['=',-1], eigenvalues_sd=['<=',1], \ ... energy=['>',5]) <html>... The query argument: sage: Q = GenericGraphQuery(graphs_query, 'SELECT graph_data.graph6 \ ... FROM graph_data WHERE num_vertices<=4 \ ... and num_edges>3') sage: graphs_query.display_properties(properties=['eulerian','perfect','planar','regular',\ ... 'edge_transitive','vertex_transitive','num_cycles','degree_sequence',\ ... 'induced_subgraphs','num_vertices','max_degree'], layout='spring', \ ... query=Q) <html>... sage: R = GenericGraphQuery(graphs_query, 'SELECT graph_data.graph6 FROM graph_data \ ... INNER JOIN degrees on graph_data.graph_id=degrees.graph_id \ ... WHERE num_vertices>6 and eulerian=1 and regular=0 and planar=1 \ ... and num_cycles<=2') sage: graphs_query.display_properties(query=R, properties=['clique_number','independence_number']) <html>... sage: S = GenericGraphQuery(graphs_query, "SELECT graph_data.graph6 \ ... FROM graph_data INNER JOIN misc on \ ... misc.graph_id=graph_data.graph_id WHERE \ ... misc.induced_subgraphs regexp '.*E~~w.*'") sage: graphs_query.display_properties(query=S, \ ... properties=['induced_subgraphs']) <html>... """ from sage.plot.plot import plot | 39c21a6146eac32ae20be7ed49354c695f7c125d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/39c21a6146eac32ae20be7ed49354c695f7c125d/graph_database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
4738,
12,
2890,
16,
1790,
33,
7036,
16,
3511,
2218,
11614,
9559,
2187,
843,
33,
7036,
16,
2667,
26,
33,
7036,
16,
521,
818,
67,
17476,
33,
7036,
16,
818,
67,
8746,
33,
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,
2562,
67,
4738,
12,
2890,
16,
1790,
33,
7036,
16,
3511,
2218,
11614,
9559,
2187,
843,
33,
7036,
16,
2667,
26,
33,
7036,
16,
521,
818,
67,
17476,
33,
7036,
16,
818,
67,
8746,
33,
7036... |
self.handler = RedfootHandler() | self.handler = RedfootServerConnection.handler | def __init__(self): ServerConnection.__init__(self, None) self.handler = RedfootHandler() | 2b90daf028c27dacda57092bd25c2f2a606fc61e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7049/2b90daf028c27dacda57092bd25c2f2a606fc61e/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
3224,
1952,
16186,
2738,
972,
12,
2890,
16,
599,
13,
365,
18,
4176,
273,
4621,
10923,
2081,
1952,
18,
4176,
225,
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,
1001,
2738,
972,
12,
2890,
4672,
3224,
1952,
16186,
2738,
972,
12,
2890,
16,
599,
13,
365,
18,
4176,
273,
4621,
10923,
2081,
1952,
18,
4176,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
evt.Skip(False) | evt.Skip() | def OnDoDelete(self, evt): if evt.GetKeyCode() == wx.WXK_DELETE: text = self if text.GetChildren(): text = text.GetChildren()[0] f, t = text.GetSelection() if f == t: t += 1 text.Remove(f, t) evt.Skip(True) else: evt.Skip(False) | d4f172a3b6a9c20612d992db1b64b36526795734 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9228/d4f172a3b6a9c20612d992db1b64b36526795734/DragAndDropTextCtrl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
3244,
2613,
12,
2890,
16,
6324,
4672,
309,
6324,
18,
967,
653,
1085,
1435,
422,
7075,
18,
59,
60,
47,
67,
6460,
30,
977,
273,
365,
309,
977,
18,
967,
4212,
13332,
977,
273,
977... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
3244,
2613,
12,
2890,
16,
6324,
4672,
309,
6324,
18,
967,
653,
1085,
1435,
422,
7075,
18,
59,
60,
47,
67,
6460,
30,
977,
273,
365,
309,
977,
18,
967,
4212,
13332,
977,
273,
977... |
self._processForm(data=data, metadata=metadata) | self._processForm(data=data, metadata=metadata, REQUEST=REQUEST) | def processForm(self, data=1, metadata=0): """Process the schema looking for data in the form""" self._processForm(data=data, metadata=metadata) | 4d0dc97ac589ae509c1ec8d8870103e415905e03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/4d0dc97ac589ae509c1ec8d8870103e415905e03/BaseObject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
1204,
12,
2890,
16,
501,
33,
21,
16,
1982,
33,
20,
4672,
3536,
2227,
326,
1963,
7849,
364,
501,
316,
326,
646,
8395,
365,
6315,
2567,
1204,
12,
892,
33,
892,
16,
1982,
33,
4165... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
1204,
12,
2890,
16,
501,
33,
21,
16,
1982,
33,
20,
4672,
3536,
2227,
326,
1963,
7849,
364,
501,
316,
326,
646,
8395,
365,
6315,
2567,
1204,
12,
892,
33,
892,
16,
1982,
33,
4165... |
from skolesys.conf import conf | from skolesys.lib.conf import conf | def startserver(): global sessions # Check root privilegdes if not os.getuid()==0: print "This command requires root priviledges" sys.exit(1) from skolesys.conf import conf session_timeout = int(conf.get("SOAP_SERVICE","session_timeout")) sessions = sessionhandler.SessionHandler(session_timeout) certfile = None keyfile = None # Old style filenames before SkoleSYS ver 0.8.1 oldstyle_cert_filename = os.path.join('/etc/skolesys/cert',"cert_%s.pem" % conf.get("DOMAIN","domain_name")) if os.path.exists(oldstyle_cert_filename): certfile = oldstyle_cert_filename oldstyle_key_filename = os.path.join('/etc/skolesys/cert',"key_%s.pem" % conf.get("DOMAIN","domain_name")) if os.path.exists(oldstyle_key_filename): keyfile = oldstyle_key_filename # New style filenames from SkoleSYS ver 0.8.1 and after newstyle_cert_filename = os.path.join('/etc/skolesys/cert',"%s.cert" % conf.get("DOMAIN","domain_name")) if os.path.exists(newstyle_cert_filename): certfile = newstyle_cert_filename newstyle_key_filename = os.path.join('/etc/skolesys/cert',"%s.key" % conf.get("DOMAIN","domain_name")) if os.path.exists(newstyle_key_filename): keyfile = newstyle_key_filename if certfile == None or keyfile == None: print "Missing a certificate file" print "cert-file shold be: %s ot %s" % (oldstyle_cert_filename,newstyle_cert_filename) print "key-file shold be: %s ot %s" % (oldstyle_key_filename,newstyle_key_filename) sys.exit(1) netif = conf.get("SOAP_SERVICE","interface") addr = if2ip(netif) if not addr: print "Interface %s has not been configured. No SOAP service started" % netif sys.exit(0) ssl_context = SSL.Context() ssl_context.load_cert(certfile,keyfile=keyfile) server = MyServer((addr, 8443),ssl_context = ssl_context) print "Starting SOAP service on interface %s (%s)" % (netif,addr) # Security server.registerFunction(get_id) server.registerFunction(challenge_response_key) server.registerFunction(bind) server.registerFunction(test_session_id) server.registerFunction(test_binded) # Real functionality # ------------------ # User Management server.registerFunction(domain_name) server.registerFunction(user_exists) server.registerFunction(list_users) server.registerFunction(list_usergroups) server.registerFunction(createuser) server.registerFunction(changeuser) server.registerFunction(removeuser) server.registerFunction(groupadd) server.registerFunction(groupdel) # Group Management server.registerFunction(group_exists) server.registerFunction(list_groups) server.registerFunction(list_members) server.registerFunction(creategroup) server.registerFunction(changegroup) server.registerFunction(removegroup) # Group Services server.registerFunction(attach_groupservice) server.registerFunction(detach_groupservice) server.registerFunction(restart_groupservice) server.registerFunction(list_groupservices) server.registerFunction(list_groupservice_options_available) server.registerFunction(get_groupservice_option_values) server.registerFunction(set_groupservice_option_value) server.registerFunction(unset_groupservice_option) # Host Management server.registerFunction(register_host) server.registerFunction(hostname_exists) server.registerFunction(hwaddr_exists) server.registerFunction(hostinfo_by_hwaddr) server.registerFunction(hostinfo_by_hostname) server.registerFunction(listhosts) server.registerFunction(getconf) # File Management server.registerFunction(findfiles) server.registerFunction(removefiles) if os.fork()==0: os.setsid() sys.stdout=open("/dev/null", 'w') sys.stdin=open("/dev/null", 'r') while 1: try: server.serve_forever() except: print "SOAP Service malfunctioned - Reenaging..." | fa5ae12b8bb077b672eae475545705f5f5f727d5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2487/fa5ae12b8bb077b672eae475545705f5f5f727d5/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
3567,
13332,
2552,
8856,
468,
2073,
1365,
11334,
75,
5489,
309,
486,
1140,
18,
588,
1911,
1435,
631,
20,
30,
1172,
315,
2503,
1296,
4991,
1365,
6015,
1411,
2852,
6,
2589,
18,
8593,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
3567,
13332,
2552,
8856,
468,
2073,
1365,
11334,
75,
5489,
309,
486,
1140,
18,
588,
1911,
1435,
631,
20,
30,
1172,
315,
2503,
1296,
4991,
1365,
6015,
1411,
2852,
6,
2589,
18,
8593,
... |
font-family: "Courier New",courier, monospace; | font-family: courier, monospace; | def css(color='default'): r""" Return the CSS header used by the SAGE Notebook. INPUT: color -- string or pair of html colors, e.g., 'gmail' 'grey' \code{('#ff0000', '#0000ff')} EXAMPLES: sage: import sage.server.notebook.css as c sage: type(c.css()) <type 'str'> """ s = r""" | 7edb180e91b2e48f567f53d59d4294938a615b84 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/7edb180e91b2e48f567f53d59d4294938a615b84/css.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3747,
12,
3266,
2218,
1886,
11,
4672,
436,
8395,
2000,
326,
6765,
1446,
1399,
635,
326,
348,
2833,
3609,
3618,
18,
225,
12943,
30,
2036,
1493,
533,
578,
3082,
434,
1729,
5740,
16,
425,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3747,
12,
3266,
2218,
1886,
11,
4672,
436,
8395,
2000,
326,
6765,
1446,
1399,
635,
326,
348,
2833,
3609,
3618,
18,
225,
12943,
30,
2036,
1493,
533,
578,
3082,
434,
1729,
5740,
16,
425,
... |
obj = getattr(self.folder(), name, None) | obj = getattr(self.folder(), name+'.pt', getattr(self.folder(), name+'.dtml', getattr(self.folder(), name, None))) | def getSkinTemplate(self,name): """ Get the named skin template from the ZODB or filesystem. | 56a051ea4b5f24ae84cbdcc5e6aab3c398d298a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5225/56a051ea4b5f24ae84cbdcc5e6aab3c398d298a3/Views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1322,
15984,
2283,
12,
2890,
16,
529,
4672,
3536,
968,
326,
4141,
18705,
1542,
628,
326,
2285,
19786,
578,
6496,
18,
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,
1322,
15984,
2283,
12,
2890,
16,
529,
4672,
3536,
968,
326,
4141,
18705,
1542,
628,
326,
2285,
19786,
578,
6496,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
font-family: courier, monospace; | font-family: monospace; | def css(color='default'): r""" Return the CSS header used by the SAGE Notebook. INPUT: color -- string or pair of html colors, e.g., 'gmail' 'grey' \code{('#ff0000', '#0000ff')} EXAMPLES: sage: import sage.server.notebook.css as c sage: type(c.css()) <type 'str'> """ s = r""" | 82aa8bf8730f6ffcf9f83b66f4df7edb18da69a0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/82aa8bf8730f6ffcf9f83b66f4df7edb18da69a0/css.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3747,
12,
3266,
2218,
1886,
11,
4672,
436,
8395,
2000,
326,
6765,
1446,
1399,
635,
326,
348,
2833,
3609,
3618,
18,
225,
12943,
30,
2036,
1493,
533,
578,
3082,
434,
1729,
5740,
16,
425,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3747,
12,
3266,
2218,
1886,
11,
4672,
436,
8395,
2000,
326,
6765,
1446,
1399,
635,
326,
348,
2833,
3609,
3618,
18,
225,
12943,
30,
2036,
1493,
533,
578,
3082,
434,
1729,
5740,
16,
425,
... |
dict_op = {'not in':'!=','in':'='} if isinstance(right,tuple): right = list(right) if (not isinstance(right,list)) and operator in ['not in','in']: operator = dict_op[operator] | def _get_expression(field_obj,cr, uid, left, right, operator, context=None): if context is None: context = {} c = context.copy() c['active_test'] = False dict_op = {'not in':'!=','in':'='} if isinstance(right,tuple): right = list(right) if (not isinstance(right,list)) and operator in ['not in','in']: operator = dict_op[operator] res_ids = field_obj.name_search(cr, uid, right, [], operator, limit=None, context=c) if not res_ids: return ('id','=',0) else: right = map(lambda x: x[0], res_ids) return (left, 'in', right) | 02fd0108fd3281fb28d9513e9c5fb27a42a28298 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/02fd0108fd3281fb28d9513e9c5fb27a42a28298/expression.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
8692,
12,
1518,
67,
2603,
16,
3353,
16,
4555,
16,
2002,
16,
2145,
16,
3726,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
276,
273,
819,
18,
3530,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
8692,
12,
1518,
67,
2603,
16,
3353,
16,
4555,
16,
2002,
16,
2145,
16,
3726,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
276,
273,
819,
18,
3530,
... | |
return {'value': {'factor': round(1/value['rate'], 6)}} | return {'factor': round(1/value['rate'], 6)} def _compute_qty(self, cursor, user, from_uom_id, qty, to_uom=False): """ Convert quantity for given uom's. from_uom and to_uom should be browse records. """ if not from_uom or not qty or not to_uom: return qty if from_uom.category.id <> to_uom.category.id: return qty if from_uom.factor_data: amount = qty * from_uom.factor_data else: amount = qty / from_uom.factor if to_uom: if to_uom.factor_data: amount = rounding(amount / to_uom.factor_data, to_uom.rounding) else: amount = rounding(amount * to_uom.factor, to_uom.rounding) return amount def _compute_price(self, cursor, user, from_uom, price, to_uom=False): """ Convert price for given uom's. from_uom and to_uom should be browse records. """ if not from_uom or not price or not to_uom: return price if from_uom.category.id <> to_uom.category.id: return price if from_uom.factor_data: new_price = float(price) / from_uom.factor_data else: new_price = float(price) * from_uom.factor if to_uom.factor_data: new_price = new_price * to_uom.factor_data else: new_price = new_price / to_uom.factor return new_price | def on_change_rate(self, cursor, user, ids, value, context=None): if value.get('rate', 0.0) == 0.0: return {'value': {'factor': 0}} return {'value': {'factor': round(1/value['rate'], 6)}} | 506efce969bdcb40960962eb0d6677c62711b226 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9285/506efce969bdcb40960962eb0d6677c62711b226/uom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
3427,
67,
5141,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
460,
16,
819,
33,
7036,
4672,
309,
460,
18,
588,
2668,
5141,
2187,
374,
18,
20,
13,
422,
374,
18,
20,
30,
327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
3427,
67,
5141,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
460,
16,
819,
33,
7036,
4672,
309,
460,
18,
588,
2668,
5141,
2187,
374,
18,
20,
13,
422,
374,
18,
20,
30,
327,
... |
msys_root = msys.msys_root destination_dir = os.path.abspath(options.destination_dir) environ['BDWD'] = msys.windows_to_msys(destination_dir) environ['BDBIN'] = '/usr/local/bin' environ['BDLIB'] = '/usr/local/lib' subsystem = '-mwindows' if options.console: subsystem = '-mconsole' | msys_root_wp = msys.msys_root destination_dir_wp = os.path.abspath(options.destination_dir) environ['BDWD'] = msys.windows_to_msys(destination_dir_wp) source_mp = default_source_mp if options.source_directory: source_mp = msys.windows_to_msys(options.source_directory) environ['BDBIN'] = source_mp + '/bin' environ['BDLIB'] = source_mp + '/lib' | def set_environment_variables(msys, options): """Set the environment variables used by the scripts""" environ = msys.environ msys_root = msys.msys_root destination_dir = os.path.abspath(options.destination_dir) environ['BDWD'] = msys.windows_to_msys(destination_dir) environ['BDBIN'] = '/usr/local/bin' environ['BDLIB'] = '/usr/local/lib' subsystem = '-mwindows' if options.console: subsystem = '-mconsole' strip = '' if options.strip: strip = '-Wl,--strip-all' environ['LDFLAGS'] = merge_strings(environ.get('LDFLAGS', ''), subsystem, strip, sep=' ') library_path = os.path.join(msys_root, 'local', 'lib') msvcr90_path = os.path.join(destination_dir, 'msvcr90') environ['DBMSVCR90'] = msys.windows_to_msys(msvcr90_path) # For dependency libraries and msvcrt hiding. environ['LIBRARY_PATH'] = merge_strings(msvcr90_path, environ.get('LIBRARY_PATH', ''), sep=';') | 5ed962a58a84830cbe0f649aee7072426feb4c22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1298/5ed962a58a84830cbe0f649aee7072426feb4c22/msys_link_VC_2008_dlls.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
10274,
67,
7528,
12,
959,
1900,
16,
702,
4672,
3536,
694,
326,
3330,
3152,
1399,
635,
326,
8873,
8395,
225,
5473,
273,
4086,
1900,
18,
28684,
4086,
1900,
67,
3085,
67,
8612,
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,
444,
67,
10274,
67,
7528,
12,
959,
1900,
16,
702,
4672,
3536,
694,
326,
3330,
3152,
1399,
635,
326,
8873,
8395,
225,
5473,
273,
4086,
1900,
18,
28684,
4086,
1900,
67,
3085,
67,
8612,
2... |
if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(CDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') | m=matrix(CDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) elif str_dtype.count('int') == 1: m = matrix(ZZ, map(list, list(arg0))) | def matrix(arg0=None, arg1=None, arg2=None, arg3=None, sparse=None): """ Create a matrix. INPUT: Supported formats 1. matrix([sparse=True]): the 0x0 matrix over ZZ 2. matrix(list_of_rows, [sparse=True]): matrix with each row constructed from the list_of_rows 3. matrix(nrows, entries, [sparse=True]): matrix with given number of rows and flat list of entries 4. matrix(nrows, ncols, entries, [sparse=True]): matrix with given number of rows and columns with flat list of entries 5. matrix(ring, list_of_row, [sparse=True]): matrix over ring with rows the elements of the list_of_rows 6. matrix(ring, nrows, entries, [sparse=True]): matrix over ring with given number of rows and entries from the flat list 7. matrix(ring, nrows, ncols, entries, [sparse=True]): matrix over the given ring with given number of rows and columns and entries. 8. matrix(numpy_array) The sparse option is optional, must be explicitly named (i.e., sparse=True), and may be either True or False. The entries can instead be a dictionary of key:value pairs of the form (i,j):x, where i,j are integers instead of a list. If sparse is not specified and the entries are a dictionary, it default to True. OUTPUT: a matrix EXAMPLES: 1. The degenerate matrix input format: sage: m = matrix(); m [] sage: parent(m) Full MatrixSpace of 0 by 0 dense matrices over Integer Ring sage: m = matrix(sparse=True); m [] sage: parent(m) Full MatrixSpace of 0 by 0 sparse matrices over Integer Ring 2. The "matrix(list_of_rows, [sparse])" input format. Notice that SAGE is careful to find a sensible common ring for all the entries (using the Sequence object): sage: x = polygen(QQ) sage: m = matrix([[1/3,2+x],[3,4]]); m [ 1/3 x + 2] [ 3 4] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in x over Rational Field sage: m = matrix([[1,2],[3,4/7]]); m [ 1 2] [ 3 4/7] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: m = matrix([[1,2,3], [RDF(2), CDF(1,2), 3]]); m [ 1.0 2.0 3.0] [ 2.0 1.0 + 2.0*I 3.0] sage: parent(m) Full MatrixSpace of 2 by 3 dense matrices over Complex Double Field sage: V = GF(7)^2 sage: m = matrix([V.0, V.0+2*V.1], sparse=True); m [1 0] [1 2] sage: parent(m) Full MatrixSpace of 2 by 2 sparse matrices over Finite Field of size 7 3. matrix(nrows, entries, [sparse]): sage: matrix(2,[1,2,3, 4,5,6]) [1 2 3] [4 5 6] sage: matrix(3, [1,2, 3/4, 5/6, 7*x, 8*x]) [ 1 2] [3/4 5/6] [7*x 8*x] The number of rows must divide the number of entries. sage: matrix(5,[1,2,3, 4,5,6]) Traceback (most recent call last): ... TypeError: entries has the wrong length 4. matrix(nrows, ncols, entries, [sparse]): sage: matrix(2,3, [1,2,3, 4,5,6]) [1 2 3] [4 5 6] sage: matrix(3,2, [1,2, 3/4, 5/6, 7*x, 8*x]) [ 1 2] [3/4 5/6] [7*x 8*x] The length of the entry list must be the same as the number of rows times columns. sage: matrix(3,3, [1,2, 3/4, 5/6, 7*x, 8*x]) Traceback (most recent call last): ... TypeError: entries has the wrong length 5. matrix(ring, list_of_row, [sparse]): sage: m = matrix(QQ, [[1,2], [3,4]]); m [1 2] [3 4] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: m = matrix(GF(7), [[1/3,2/3,1/2], [3/4,4/5,7]]); m [5 3 4] [6 5 0] sage: parent(m) Full MatrixSpace of 2 by 3 dense matrices over Finite Field of size 7 6. matrix(ring, nrows, entries, [sparse]): sage: M = ZZ^4 sage: m = matrix(QQ, [M([1,2,3,4]), M([-1,0,3,4])]); m [ 1 2 3 4] [-1 0 3 4] sage: parent(m) Full MatrixSpace of 2 by 4 dense matrices over Rational Field 7. matrix(ring, nrows, ncols, entries, [sparse]) sage: matrix(QQ, 2, 2, [1,2,3,4]) [1 2] [3 4] sage: matrix(GF(5), 2, 3, range(6)) [0 1 2] [3 4 0] sage: matrix(ZZ, 10, 10, range(100)).parent() Full MatrixSpace of 10 by 10 dense matrices over Integer Ring sage: matrix(ZZ, 10, 10, range(100), sparse=True).parent() Full MatrixSpace of 10 by 10 sparse matrices over Integer Ring sage: R = PolynomialRing(QQ, 9, 'x') sage: A = matrix(R, 3, 3, R.gens()); A [x0 x1 x2] [x3 x4 x5] [x6 x7 x8] sage: det(A) -x2*x4*x6 + x1*x5*x6 + x2*x3*x7 - x0*x5*x7 - x1*x3*x8 + x0*x4*x8 CREATING SPARSE MATRICES FROM DICTS: sage: a = matrix({(1,2):10, (2,3):5/1}) sage: print a, a.parent() [ 0 0 0 0] [ 0 0 10 0] [ 0 0 0 5] Full MatrixSpace of 3 by 4 sparse matrices over Rational Field sage: a = matrix({(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] True sage: a = matrix(3,{(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(3,5,{(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0 0 0] [ 0 0 10 0 0] [ 0 0 0 0 0] True sage: a = matrix(QQ, 3, {(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(QQ, 3, {(1,2):10}, sparse=True) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(QQ, 3, 5, {(1,2):10}, sparse=True) sage: print a, a.is_sparse() [ 0 0 0 0 0] [ 0 0 10 0 0] [ 0 0 0 0 0] True 8. Creating a matrix from a numpy array Any numpy array with a datatype of float or complex may be passed to matrix If the data type is float the result will be a matrix over the real double field. complex numpy arrays will give matrices over the complex double field. The data of the numpy array must be contiguous, so slices of other matrices will raise an exception. sage: import numpy sage: n=numpy.array([[1,2],[3,4]],float) sage: m=matrix(n) sage: n=numpy.array([[numpy.complex(0,1),numpy.complex(0,2)],[3,4]],complex) sage: m=matrix(n) TESTS: sage: import numpy sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'float32') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'float64') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'complex64') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'complex128') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = matrix([[1,2],[3,4]]) sage: b = matrix(a.numpy()); b [1 2] [3 4] sage: a == b True sage: c = matrix(a.numpy('float32')); c [1.0 2.0] [3.0 4.0] """ if hasattr(arg0, '_matrix_'): if arg1 is None: arg1 = rings.ZZ return arg0._matrix_(arg1) if hasattr(arg1, '_matrix_'): return arg1._matrix_(arg0) if arg0 is None: # 1. matrix([sparse]): # the 0x0 matrix over ZZ # the degenerate matrix ring = rings.ZZ nrows = 0 ncols = 0 entries = [] elif isinstance(arg0, (list, tuple)): # 2. matrix(list_of_rows, [sparse]): # matrix with each row constructed from the list_of_rows # list of rows if not (arg1 is None and arg2 is None and arg3 is None): raise TypeError, "invalid input" nrows = len(arg0) if nrows == 0: ncols = 0 else: ncols = len(arg0[0]) w = sum([list(v) for v in arg0], []) entries, ring = prepare(w) elif isinstance(arg0, dict): # 2. matrix(dict_of_rows, sparse=True): if sparse is None: sparse = True entries, ring = prepare_dict(arg0) nrows = nrows_from_dict(entries) ncols = ncols_from_dict(entries) elif not rings.is_Ring(arg0) and isinstance(arg1, (list, tuple)) and arg2 is None and arg3 is None: # 3. matrix(nrows, entries, [sparse]): # matrix with given number of rows and flat list of entries nrows = int(arg0) entries, ring = prepare(arg1) ncols = len(entries) // nrows elif not rings.is_Ring(arg0) and isinstance(arg1, dict) and arg2 is None and arg3 is None: # 3. matrix(nrows, entries, sparse=True): # matrix with given number of rows and sparse dict of entries if sparse is None: sparse = True nrows = int(arg0) entries, ring = prepare_dict(arg1) ncols = ncols_from_dict(entries) elif not rings.is_Ring(arg0) and isinstance(arg2, (list, tuple)) and arg3 is None: # 4. matrix(nrows, ncols, entries, [sparse]): # matrix with given number of rows and columns with flat list of entries nrows = int(arg0) ncols = int(arg1) entries, ring = prepare(arg2) elif not rings.is_Ring(arg0) and isinstance(arg2, dict) and arg3 is None: # 4. matrix(nrows, ncols, entries, sparse=True): # matrix with given number of rows and columns with flat list of entries if sparse is None: sparse = True nrows = int(arg0) ncols = int(arg1) entries, ring = prepare_dict(arg2) elif rings.is_Ring(arg0) and isinstance(arg1, (list, tuple)) and arg2 is None and arg3 is None: # 5. matrix(ring, list_of_row, [sparse]): # matrix over ring with rows the elements of the list_of_rows ring = arg0 nrows = len(arg1) if nrows == 0: ncols = 0 else: try: ncols = len(arg1[0]) except TypeError: raise TypeError, "If making a matrix with the matrix(ring, list_of_row, [sparse]) constructor, the second input must be a list of rows." entries = sum([list(v) for v in arg1], []) elif rings.is_Ring(arg0) and isinstance(arg1, dict) and arg2 is None and arg3 is None: # 5. matrix(ring, dict, sparse=True): # matrix over ring with rows the elements the dict if sparse is None: sparse = True ring = arg0 entries = arg1 nrows = nrows_from_dict(entries) elif rings.is_Ring(arg0) and isinstance(arg2, (list, tuple)) and arg3 is None: # 6. matrix(ring, nrows, entries, [sparse]): # matrix over ring with given number of rows and entries from the flat list ring = arg0 nrows = int(arg1) entries = arg2 if nrows == 0: ncols = 0 else: ncols = len(entries) // nrows elif rings.is_Ring(arg0) and isinstance(arg2, dict) and arg3 is None: # 6. matrix(ring, nrows, entries, sparse=True) # matrix over ring with given number of rows and entries from the dict if sparse is None: sparse = True ring = arg0 nrows = int(arg1) entries = arg2 if nrows == 0: ncols = 0 else: ncols = ncols_from_dict(entries) elif rings.is_Ring(arg0): # 7. matrix(ring, nrows, ncols, entries, [sparse]): # matrix over the given ring with given number of rows and columns and entries. ring = arg0 nrows = int(arg1) if arg2 is None: ncols = nrows else: ncols = int(arg2) entries = arg3 if isinstance(entries, dict): if sparse is None: sparse = True else: import numpy if isinstance(arg0,numpy.ndarray): str_dtype = str(arg0.dtype) if str_dtype.count('float32')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy32(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('float64')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('complex64')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(CDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy32(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('complex128')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(CDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('object') == 1: #Get the raw nested list from the numpy array #and feed it back into matrix try: return matrix( map(list, list(arg0)) ) except TypeError: raise TypeError("cannot convert numpy matrix to SAGE matrix") else: raise TypeError("cannot convert numpy matrix to SAGE matrix") else: raise TypeError, "unknown matrix constructor format. Type matrix? for help" if sparse is None: sparse = False return matrix_space.MatrixSpace(ring, nrows, ncols, sparse=sparse)(entries) | afaca1e12ee60ebc48a960e19c48135538784f50 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/afaca1e12ee60ebc48a960e19c48135538784f50/constructor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3148,
12,
3175,
20,
33,
7036,
16,
1501,
21,
33,
7036,
16,
1501,
22,
33,
7036,
16,
1501,
23,
33,
7036,
16,
9387,
33,
7036,
4672,
3536,
1788,
279,
3148,
18,
225,
12943,
30,
19503,
6449... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3148,
12,
3175,
20,
33,
7036,
16,
1501,
21,
33,
7036,
16,
1501,
22,
33,
7036,
16,
1501,
23,
33,
7036,
16,
9387,
33,
7036,
4672,
3536,
1788,
279,
3148,
18,
225,
12943,
30,
19503,
6449... |
self.assertRaises(barrier.BarrierError, | self.assertRaises(error.BarrierError, | def test_rendevous_servers_timeout(self): # The rendevous should time out here and throw a # BarrierError since we are specifying a timeout of 0 self.assertRaises(barrier.BarrierError, self.rendevous_test, 0, port=63002, rendevous_servers=True) | 62e3176b1c56319ebac58383a1d32ec32eb1a38a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/62e3176b1c56319ebac58383a1d32ec32eb1a38a/barrier_unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1187,
5206,
1481,
67,
14247,
67,
4538,
12,
2890,
4672,
468,
1021,
1654,
5206,
1481,
1410,
813,
596,
2674,
471,
604,
279,
468,
16654,
10342,
668,
3241,
732,
854,
13664,
279,
202... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1187,
5206,
1481,
67,
14247,
67,
4538,
12,
2890,
4672,
468,
1021,
1654,
5206,
1481,
1410,
813,
596,
2674,
471,
604,
279,
468,
16654,
10342,
668,
3241,
732,
854,
13664,
279,
202... |
meta = self.get_meta() qn = self.connection.ops.quote_name | meta = self.get_meta() | def as_sql(self, with_limits=True, with_col_aliases=False): self._using_row_number = False # Get out of the way if we're not a select query or there's no limiting involved. check_limits = with_limits and (self.low_mark or self.high_mark is not None) if not isinstance(self, SqlServerQuery) or not check_limits: return super(SqlServerQuery, self).as_sql(with_limits, with_col_aliases) | 84296e99de66123e569a464b8019a01dabe63cc3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1254/84296e99de66123e569a464b8019a01dabe63cc3/query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
487,
67,
4669,
12,
2890,
16,
598,
67,
14270,
33,
5510,
16,
598,
67,
1293,
67,
13831,
33,
8381,
4672,
365,
6315,
9940,
67,
492,
67,
2696,
273,
1083,
225,
468,
968,
596,
434,
326,
4031... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
487,
67,
4669,
12,
2890,
16,
598,
67,
14270,
33,
5510,
16,
598,
67,
1293,
67,
13831,
33,
8381,
4672,
365,
6315,
9940,
67,
492,
67,
2696,
273,
1083,
225,
468,
968,
596,
434,
326,
4031... |
doLast.extend(('RFC822', hdrs + '\r\n' + body)) | response.extend(('RFC822', hdrs + '\r\n' + body)) | def _sendMessageFetchResponse(self, msgId, msg, query, uid): seenUID = False response = [] doLast = [] for part in query: if part.type == 'envelope': response.extend(('ENVELOPE', getEnvelope(msg))) elif part.type == 'flags': response.extend(('FLAGS', msg.getFlags())) elif part.type == 'internaldate': response.extend(('INTERNALDATE', msg.getInternalDate())) elif part.type == 'rfc822header': hdrs = _formatHeaders(msg.getHeaders(True)) doLast.extend(('RFC822.HEADER', hdrs)) elif part.type == 'rfc822text': doLast.extend(('RFC822.TEXT', msg.getBodyFile())) elif part.type == 'rfc822size': response.extend(('RFC822.SIZE', str(msg.getSize()))) elif part.type == 'rfc822': hdrs = _formatHeaders(msg.getHeaders(True)) body = msg.getBodyFile().read() doLast.extend(('RFC822', hdrs + '\r\n' + body)) elif part.type == 'uid': seenUID = True response.extend(('UID', str(msg.getUID()))) elif part.type == 'bodystructure': response.extend(('BODYSTRUCTURE', getBodyStructure(msg, True))) elif part.type == 'body': subMsg = msg for p in part.part or (): subMsg = subMsg.getSubPart(p) if part.header: if not part.header.fields: doLast.extend((str(part), _formatHeaders(msg.getHeaders(True)))) else: hdrs = subMsg.getHeaders(part.header.negate, *part.header.fields) doLast.extend((str(part), _formatHeaders(hdrs, part.header.fields))) elif part.text: doLast.extend((str(part), subMsg.getBodyFile())) elif part.mime: doLast.extend((str(part), _formatHeaders(msg.getHeaders(True)))) elif part.empty: doLast.extend((str(part), _formatHeaders(msg.getHeaders(True)) + '\r\n' + subMsg.getBodyFile().read())) else: # Simplified bodystructure request response.extend(('BODY', getBodyStructure(msg, False))) | 91f4292b4c9a7bb539c860f586f691c41e2a3363 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/91f4292b4c9a7bb539c860f586f691c41e2a3363/imap4.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4661,
1079,
5005,
1064,
12,
2890,
16,
1234,
548,
16,
1234,
16,
843,
16,
4555,
4672,
5881,
3060,
273,
1083,
766,
273,
5378,
741,
3024,
273,
5378,
364,
1087,
316,
843,
30,
309,
1087... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4661,
1079,
5005,
1064,
12,
2890,
16,
1234,
548,
16,
1234,
16,
843,
16,
4555,
4672,
5881,
3060,
273,
1083,
766,
273,
5378,
741,
3024,
273,
5378,
364,
1087,
316,
843,
30,
309,
1087... |
res = dict.fromkeys(ids) | res = dict.fromkeys(ids, False) | def _get_email_from(self, cr, uid, ids, context=None): if not isinstance(ids, list): ids = [ids] res = dict.fromkeys(ids) for user in self.browse(cr, uid, ids, context=context): if user.user_email: res[user.id] = "%s <%s>" % (user.name, user.user_email) return res | 281b839de8532c5316afef6dad67e2881894561c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/281b839de8532c5316afef6dad67e2881894561c/res_user.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
3652,
67,
2080,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
309,
486,
1549,
12,
2232,
16,
666,
4672,
3258,
273,
306,
2232,
65,
400,
273,
2065,
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,
389,
588,
67,
3652,
67,
2080,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
309,
486,
1549,
12,
2232,
16,
666,
4672,
3258,
273,
306,
2232,
65,
400,
273,
2065,
18,
... |
return Image.open(os.path.join(os.path.expanduser("~/images"), path)) | return Image.open(self.images.getDiskPath(obj.target, size=max(width, height))) | def getimg(): return Image.open(os.path.join(os.path.expanduser("~/images"), path)) | 0435654086aff8072a196e09b7b34a1b3a94d0d4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12391/0435654086aff8072a196e09b7b34a1b3a94d0d4/htmlwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
6081,
13332,
327,
3421,
18,
3190,
12,
538,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12320,
1355,
2932,
98,
19,
7369,
6,
3631,
589,
3719,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
6081,
13332,
327,
3421,
18,
3190,
12,
538,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12320,
1355,
2932,
98,
19,
7369,
6,
3631,
589,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
print "sending data" | print "sending %s bytes of data" % dataLen | def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending data" s.send(dataLenBytes) s.send(data) print "waiting on response" response = s.recv(999999) print "Got:" + response s.close() return response | 874f52a8e03dee37f084fab25d7015b8d5b0d982 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13527/874f52a8e03dee37f084fab25d7015b8d5b0d982/pgmserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1004,
12,
3567,
16,
655,
16,
892,
4672,
272,
273,
2987,
1435,
1172,
315,
3612,
310,
358,
738,
87,
5319,
87,
6,
738,
261,
3567,
16,
655,
13,
272,
18,
3612,
12443,
3567,
16,
1756,
3719... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1004,
12,
3567,
16,
655,
16,
892,
4672,
272,
273,
2987,
1435,
1172,
315,
3612,
310,
358,
738,
87,
5319,
87,
6,
738,
261,
3567,
16,
655,
13,
272,
18,
3612,
12443,
3567,
16,
1756,
3719... |
t += " && e.a" | v+=1 | def js_test(self): t = "(((e.k == %s) || (e.m == %s))"%(self.key, self.key) if self.alt: t += " && e.a" if self.ctrl: t += " && e.c" if self.shift: t += " && e.s" t+= ")" return t | 4f05329cffcfb9ff0747b695ac1e7e1cced68539 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/4f05329cffcfb9ff0747b695ac1e7e1cced68539/js.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3828,
67,
3813,
12,
2890,
4672,
268,
273,
7751,
12443,
73,
18,
79,
422,
738,
87,
13,
747,
261,
73,
18,
81,
422,
738,
87,
30743,
17105,
2890,
18,
856,
16,
365,
18,
856,
13,
309,
365... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3828,
67,
3813,
12,
2890,
4672,
268,
273,
7751,
12443,
73,
18,
79,
422,
738,
87,
13,
747,
261,
73,
18,
81,
422,
738,
87,
30743,
17105,
2890,
18,
856,
16,
365,
18,
856,
13,
309,
365... |
percentR = re.compile(r'(\d) %') text = percentR.sub(r'\1 %', text) | text = wikipedia.replaceExcept(text, r'(\d) %', r'\1 %', ['timeline']) | def removeNonBreakingSpaceBeforePercent(self, text): ''' Newer MediaWiki versions automatically place a non-breaking space in front of a percent sign, so it is no longer required to place it manually. ''' percentR = re.compile(r'(\d) %') text = percentR.sub(r'\1 %', text) return text | 928ae379ec0a2891720bba38b3eb1aa917f1475b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/928ae379ec0a2891720bba38b3eb1aa917f1475b/cosmetic_changes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
3989,
7634,
310,
3819,
4649,
8410,
12,
2890,
16,
977,
4672,
9163,
1166,
264,
6128,
25438,
5244,
6635,
3166,
279,
1661,
17,
8820,
310,
3476,
316,
6641,
434,
279,
5551,
1573,
16,
142... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
3989,
7634,
310,
3819,
4649,
8410,
12,
2890,
16,
977,
4672,
9163,
1166,
264,
6128,
25438,
5244,
6635,
3166,
279,
1661,
17,
8820,
310,
3476,
316,
6641,
434,
279,
5551,
1573,
16,
142... |
def logRaw(label, raw): | def logRaw(self, label, raw): | def logRaw(label, raw): if hasattr(raw, "upper"): amfast.logger.debug("<%s>%s</%s>" % (label, amfast.format_byte_string(raw_packet), label)) | eeee1df9bd22a566858d749cf9cf1fb51ef12cf5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5028/eeee1df9bd22a566858d749cf9cf1fb51ef12cf5/endpoint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
4809,
12,
2890,
16,
1433,
16,
1831,
4672,
309,
3859,
12,
1899,
16,
315,
5797,
6,
4672,
2125,
8076,
18,
4901,
18,
4148,
2932,
32,
9,
87,
9822,
87,
1757,
9,
87,
2984,
738,
261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
4809,
12,
2890,
16,
1433,
16,
1831,
4672,
309,
3859,
12,
1899,
16,
315,
5797,
6,
4672,
2125,
8076,
18,
4901,
18,
4148,
2932,
32,
9,
87,
9822,
87,
1757,
9,
87,
2984,
738,
261,
... |
print_directory() print_arguments() | def g(f=f): f() | a3c6a8a30ea6fe481aa7397c8acb53f8a483c93d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a3c6a8a30ea6fe481aa7397c8acb53f8a483c93d/cgi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
314,
12,
74,
33,
74,
4672,
284,
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,
0,
0,
0,
0,
0,
0,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
314,
12,
74,
33,
74,
4672,
284,
1435,
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,
-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.