rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
def system(cmd): | def nmake(makefile, command="", **kw): defines = ' '.join(k+'='+v for k, v in kw.items()) cmd = NMAKE % (makefile, defines, command) print("\n\n"+cmd+"\n") | def system(cmd): if os.system(cmd) != 0: raise RuntimeError(cmd) | 1bbd9096793bdcc08d40eb182c0b93829147f9cf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/1bbd9096793bdcc08d40eb182c0b93829147f9cf/build_tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
6540,
12,
6540,
768,
16,
1296,
1546,
3113,
2826,
9987,
4672,
11164,
273,
296,
2418,
5701,
12,
79,
6797,
2218,
15,
90,
364,
417,
16,
331,
316,
5323,
18,
3319,
10756,
1797,
273,
423... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
6540,
12,
6540,
768,
16,
1296,
1546,
3113,
2826,
9987,
4672,
11164,
273,
296,
2418,
5701,
12,
79,
6797,
2218,
15,
90,
364,
417,
16,
331,
316,
5323,
18,
3319,
10756,
1797,
273,
423... |
if value is not None: | if value is not None and value != "None": | def apply (self, data): values = {} for page in [self.appearance, self.behaviour, self.globals, self.colours]: for property in page: widget = self.widgets[property] | 6a83961bc10b2ed9749a44c4bd0e41ad0c433980 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1032/6a83961bc10b2ed9749a44c4bd0e41ad0c433980/prefs_profile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
261,
2890,
16,
501,
4672,
924,
273,
2618,
364,
1363,
316,
306,
2890,
18,
438,
27668,
16,
365,
18,
31772,
477,
16,
365,
18,
16227,
16,
365,
18,
1293,
4390,
14542,
364,
1272,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
261,
2890,
16,
501,
4672,
924,
273,
2618,
364,
1363,
316,
306,
2890,
18,
438,
27668,
16,
365,
18,
31772,
477,
16,
365,
18,
16227,
16,
365,
18,
1293,
4390,
14542,
364,
1272,
316,
... |
return self.store.getDimensionNames() | return self.store.dimensionorder[:] | def getDimensions(self): return self.store.getDimensionNames() | 0cefcd100f374a4903a8727d77d7cdd4ed6d7a80 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/381/0cefcd100f374a4903a8727d77d7cdd4ed6d7a80/data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2343,
23124,
12,
2890,
4672,
327,
365,
18,
2233,
18,
588,
8611,
1557,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2343,
23124,
12,
2890,
4672,
327,
365,
18,
2233,
18,
588,
8611,
1557,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
shoreObj = alc_ObjClasses.plSceneObject.FindCreate(self.getRoot(), shoreName) | shoreObj = refparser.MixedRef_FindCreate(shoreName) | def export_obj(self, obj): # now we get all the values. >.< objscript = AlcScript.objects.Find(obj.name) # add shore refs shoreNames = list(FindInDict(objscript, 'waveset.shores', [])) for shoreName in shoreNames: shoreObj = alc_ObjClasses.plSceneObject.FindCreate(self.getRoot(), shoreName) self.fShores.append(shoreObj.data.getRef()) # add decal refs decalNames = list(FindInDict(objscript, 'waveset.decals', [])) for decalName in decalNames: decalObj = alc_ObjClasses.plSceneObject.FindCreate(self.getRoot(),decalName) self.fDecals.append(shoreObj.data.getRef()) # make a dummy dyanmic envmap for the waveset # dunno why cyan uses 1x1x4 maps and it works. :P envmap = plDynamicEnvMap.FindCreate(self.getRoot(),obj.getName() + "_Env") envmap.data.export_obj(obj) self.fEnvMap = envmap.data.getRef() # now we create a default waveset based on a nb01's LakeBasin waveset # this currently renders the surface invisible. # Anyone who feels like tweaking the values for a while is welcome to it self.fMaxLen = FindInDict(objscript,'waveset.maxlen',0.0) geostate = self.fState.fGeoState geostate.fMaxLength = FindInDict(objscript,'waveset.geostate.maxlen',0.0) geostate.fMinLength = FindInDict(objscript,'waveset.geostate.minlen',0.0) geostate.fAmpOverLen = FindInDict(objscript,'waveset.geostate.ampoverlen',0.0) geostate.fChop = FindInDict(objscript,'waveset.geostate.chop',0.0) geostate.fAngleDev = FindInDict(objscript,'waveset.geostate.angledev',0.0) texstate = self.fState.fTexState texstate.fMaxLength = FindInDict(objscript,'waveset.texstate.maxlen',6.25) texstate.fMinLength = FindInDict(objscript,'waveset.texstate.minlen',0.78125) texstate.fAmpOverLen = FindInDict(objscript,'waveset.texstate.ampoverlen',0.013) texstate.fChop = FindInDict(objscript,'waveset.texstate.chop',0.5) texstate.fAngleDev = FindInDict(objscript,'waveset.texstate.angledev',1.00356) self.fState.fRippleScale = FindInDict(objscript,'waveset.ripplescale',100) # this should be based on an empty used as a vector. I'm not doin it now. :P self.fState.fWindDir = Vertex(0.0871562,0.996195,0) # expects list [noise, start, end] specnoise = FindInDict(objscript,'waveset.specnoise',0.5) specstart = FindInDict(objscript,'waveset.specstart',250) specend = FindInDict(objscript, 'waveset.specend', 1000) self.fState.fSpecVec = Vertex(specnoise,specstart,specend) self.fState.fWaterHeight = obj.loc[2] opac = FindInDict(objscript,'waveset.depthrange.opac.start',0) refl = FindInDict(objscript,'waveset.depthrange.refl.start',0) wave = FindInDict(objscript,'waveset.depthrange.wave.start',0) self.fState.fWaterOffset = Vertex(opac, refl, wave) self.fState.fMaxAtten = Vertex(1, 1, 1) self.fState.fMinAtten = Vertex(0, 0, 0) opac = FindInDict(objscript,'waveset.depthrange.opac.end',12) refl = FindInDict(objscript,'waveset.depthrange.refl.end',1) wave = FindInDict(objscript,'waveset.depthrange.wave.end',1) self.fState.fDepthFalloff = Vertex(opac, refl, wave) self.fState.fWispiness = FindInDict(objscript,'waveset.wispiness',0.5) self.fState.fShoreTint = RGBA(1, 1, 1, 1, type=1) self.fState.fMaxColor = RGBA(1, 1, 1, 1, type=1) self.fState.fMinColor = RGBA(0.184314, 0.172549, 0.113725, 1, type=1) self.fState.fEdgeOpac = FindInDict(objscript,'waveset.edgeopac',1) self.fState.fEdgeRadius = FindInDict(objscript,'waveset.edgeradius',1) self.fState.fPeriod = FindInDict(objscript,'waveset.period',1) self.fState.fFingerLength = FindInDict(objscript,'waveset.fingerlength',1) # should be able to set these colors, the mat color will do for now. self.fState.fWaterTint = RGBA(1, 1, 1, 1, type=1) self.fState.fSpecularTint = RGBA(1, 1, 1, 0.983333, type=1) self.fState.fEnvCenter = Vertex(obj.loc[0], obj.loc[1], obj.loc[2]) self.fState.fEnvRefresh = FindInDict(objscript,'waveset.envrefresh',3) self.fState.fEnvRadius = FindInDict(objscript,'waveset.envradius',1000) | 469113b2c8880ac0a13bd50159a0cebbf6f170e7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12286/469113b2c8880ac0a13bd50159a0cebbf6f170e7/alc_MatClasses.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
2603,
12,
2890,
16,
1081,
4672,
468,
2037,
732,
336,
777,
326,
924,
18,
405,
22782,
1081,
4263,
273,
2262,
71,
3651,
18,
6911,
18,
3125,
12,
2603,
18,
529,
13,
225,
468,
52... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2603,
12,
2890,
16,
1081,
4672,
468,
2037,
732,
336,
777,
326,
924,
18,
405,
22782,
1081,
4263,
273,
2262,
71,
3651,
18,
6911,
18,
3125,
12,
2603,
18,
529,
13,
225,
468,
52... |
class RLSServices(MainListElement): _xml_tag = _rls_services_prefix + 'rls-services' | class RLSServices(RLSServicesElement, XMLRoot, SimpleList): _xml_tag = 'rls-services' | def __cmp__(self, other): return cmp(self.uri, other.uri) or \ cmp(self._list, other._list) or \ cmp(self._packages, other._packages) | 3a6f8ef591b8d187eeffafcb45f678e86136c6e9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5703/3a6f8ef591b8d187eeffafcb45f678e86136c6e9/resourcelists.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
327,
9411,
12,
2890,
18,
1650,
16,
1308,
18,
1650,
13,
578,
521,
9411,
12,
2890,
6315,
1098,
16,
1308,
6315,
1098,
13,
578,
521,
9411,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
327,
9411,
12,
2890,
18,
1650,
16,
1308,
18,
1650,
13,
578,
521,
9411,
12,
2890,
6315,
1098,
16,
1308,
6315,
1098,
13,
578,
521,
9411,
12,
... |
Block.finishEdits() | Block.Block.finishEdits() | def onRunSelectedScriptEvent(self, event): # Triggered from "Tests | Run a Script" items = self.__getSelectedItems() if len(items) > 0: for item in items: if hasattr(item, 'execute'): # in case the user was just editing the script, # ask the focus to finish changes, if it can Block.finishEdits() | fe18335a3f273985840c217244c4b7b2dcc31781 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/fe18335a3f273985840c217244c4b7b2dcc31781/PimBlocks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
1997,
7416,
3651,
1133,
12,
2890,
16,
871,
4672,
468,
11321,
329,
628,
315,
14650,
571,
1939,
279,
7739,
6,
1516,
273,
365,
16186,
588,
7416,
3126,
1435,
309,
562,
12,
3319,
13,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
1997,
7416,
3651,
1133,
12,
2890,
16,
871,
4672,
468,
11321,
329,
628,
315,
14650,
571,
1939,
279,
7739,
6,
1516,
273,
365,
16186,
588,
7416,
3126,
1435,
309,
562,
12,
3319,
13,
4... |
return Argument( arg_parts[-1], " ".join(arg_parts[0:-1])) | return Argument(arg_parts[-1], " ".join(arg_parts[0:-1])) | def CreateArg(arg_string): """Creates an Argument.""" arg_parts = arg_string.split() if len(arg_parts) == 1 and arg_parts[0] == 'void': return None # Is this a pointer argument? elif arg_string.find('*') >= 0: if arg_parts[0] == 'NonImmediate': return NonImmediatePointerArgument( arg_parts[-1], " ".join(arg_parts[1:-1])) else: return PointerArgument( arg_parts[-1], " ".join(arg_parts[0:-1])) # Is this a resource argument? Must come after pointer check. elif arg_parts[0] == 'GLResourceId': return ResourceIdArgument( arg_parts[-1], " ".join(arg_parts[0:-1])) else: return Argument( arg_parts[-1], " ".join(arg_parts[0:-1])) | eee4cf7e01957632963833a437e10a3a6073fa95 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/eee4cf7e01957632963833a437e10a3a6073fa95/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
4117,
12,
3175,
67,
1080,
4672,
3536,
2729,
392,
5067,
12123,
1501,
67,
6019,
273,
1501,
67,
1080,
18,
4939,
1435,
309,
562,
12,
3175,
67,
6019,
13,
422,
404,
471,
1501,
67,
6019... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
4117,
12,
3175,
67,
1080,
4672,
3536,
2729,
392,
5067,
12123,
1501,
67,
6019,
273,
1501,
67,
1080,
18,
4939,
1435,
309,
562,
12,
3175,
67,
6019,
13,
422,
404,
471,
1501,
67,
6019... |
self._parser = expat.ParserCreate(intern = self._interning) | self._parser = expat.ParserCreate(self._source.getEncoding(), intern = self._interning) | def reset(self): if self._namespaces: self._parser = expat.ParserCreate(None, " ", intern=self._interning) self._parser.namespace_prefixes = 1 self._parser.StartElementHandler = self.start_element_ns self._parser.EndElementHandler = self.end_element_ns else: self._parser = expat.ParserCreate(intern = self._interning) self._parser.StartElementHandler = self.start_element self._parser.EndElementHandler = self.end_element | 9207f3e9ba8dff8fc0d111f8e73d4c505aab0b54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9207f3e9ba8dff8fc0d111f8e73d4c505aab0b54/expatreader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
12,
2890,
4672,
309,
365,
6315,
16078,
30,
365,
6315,
4288,
273,
1329,
270,
18,
2678,
1684,
12,
7036,
16,
315,
3104,
8216,
33,
2890,
6315,
267,
798,
310,
13,
365,
6315,
4288,
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,
2715,
12,
2890,
4672,
309,
365,
6315,
16078,
30,
365,
6315,
4288,
273,
1329,
270,
18,
2678,
1684,
12,
7036,
16,
315,
3104,
8216,
33,
2890,
6315,
267,
798,
310,
13,
365,
6315,
4288,
18,... |
assert len(foreign_keys) == 2, 'internal error, wrong .foreign_keys on %(assoc_klas)s' % locals() | assert len(foreign_keys) == 2, '''association %(assoc_klas)s between more than 2 items cannot be DBCOOK_hidden (which one to give as other side)''' % locals() | def make( me, builder, klas, name ): 'return relation_klas, actual_relation_klas, relation_kargs' dbg = 'relation' in config.debug assoc_klas = me.assoc_klas #print '?', name, assoc_klas if isinstance( assoc_klas, str): try: assoc_klas = builder.klasi[ assoc_klas] except KeyError: assert 0, '''undefined relation/association class %(assoc_klas)r in %(klas)s.%(name)s''' % locals() | 99992ae1538a52f5dbb324c3c9025f47ca38c2d4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10808/99992ae1538a52f5dbb324c3c9025f47ca38c2d4/relation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
12,
1791,
16,
2089,
16,
417,
9521,
16,
508,
262,
30,
296,
2463,
2533,
67,
79,
9521,
16,
3214,
67,
5488,
67,
79,
9521,
16,
2533,
67,
79,
1968,
11,
28966,
273,
296,
5488,
11,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
12,
1791,
16,
2089,
16,
417,
9521,
16,
508,
262,
30,
296,
2463,
2533,
67,
79,
9521,
16,
3214,
67,
5488,
67,
79,
9521,
16,
2533,
67,
79,
1968,
11,
28966,
273,
296,
5488,
11,
3... |
sage: M = ModularForms(25,4) | sage: M = ModularForms(2,14) | def prec(self): """ Return the precision to which self.q_expansion() is currently known. Note that this may be 0. | ba43fcd42d37de9db531414c47fc1954ab094a50 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/ba43fcd42d37de9db531414c47fc1954ab094a50/element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13382,
12,
2890,
4672,
3536,
2000,
326,
6039,
358,
1492,
365,
18,
85,
67,
2749,
12162,
1435,
353,
4551,
4846,
18,
3609,
716,
333,
2026,
506,
374,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13382,
12,
2890,
4672,
3536,
2000,
326,
6039,
358,
1492,
365,
18,
85,
67,
2749,
12162,
1435,
353,
4551,
4846,
18,
3609,
716,
333,
2026,
506,
374,
18,
2,
-100,
-100,
-100,
-100,
-100,
-... |
if ((obj==0)|(src==0)): sys.exit("syntax error in CompileC directive"); ipath = ["built/tmp"] + ipath + ["built/include"] | global VERBOSE if ((obj==0)|(src==0)): sys.exit("syntax error in CompileC directive") ipath = [PREFIX+"/tmp"] + ipath + [PREFIX+"/include"] | def CompileC(obj=0,src=0,ipath=[],opts=[]): if ((obj==0)|(src==0)): sys.exit("syntax error in CompileC directive"); ipath = ["built/tmp"] + ipath + ["built/include"] fullsrc = CxxFindSource(src, ipath) if (fullsrc == 0): sys.exit("Cannot find source file "+src) dep = CxxCalcDependencies(fullsrc, ipath, []) if (COMPILER=="MSVC7"): wobj = "built/tmp/"+obj if (older(wobj, dep)): global VERBOSE if VERBOSE >= 0: checkIfNewDir(ipath[1]) cmd = 'cl.exe /Fo"' + wobj + '" /nologo /c'; cmd = cmd + " /I\"built/python/include\"" if (opts.count("DXSDK")): cmd = cmd + ' /I"' + DirectXSDK + '/include"' if (opts.count("MAYA5")): cmd = cmd + ' /I"' + Maya5SDK + 'include"' if (opts.count("MAYA6")): cmd = cmd + ' /I"' + Maya6SDK + 'include"' for max in ["MAX5","MAX6","MAX7"]: if (PkgSelected(opts,max)): cmd = cmd + ' /I"' + MAXSDK[max] + 'include" /I"' + MAXSDKCS[max] + '" /D' + max for pkg in PACKAGES: if (pkg != "MAYA5") and (pkg != "MAYA6") and PkgSelected(opts,pkg): cmd = cmd + ' /I"' + THIRDPARTY + pkg.lower() + "/include" + '"' for x in ipath: cmd = cmd + " /I \"" + x + "\""; if (opts.count('NOFLOATWARN')): cmd = cmd + ' /wd4244 /wd4305' if (opts.count("WITHINPANDA")): cmd = cmd + ' /DWITHIN_PANDA' if (OPTIMIZE==1): cmd = cmd + " /D_DEBUG /Zc:forScope /MDd /Zi /RTCs /GS " if (OPTIMIZE==2): cmd = cmd + " /D_DEBUG /Zc:forScope /MDd /Zi /RTCs /GS " if (OPTIMIZE==3): cmd = cmd + " /Zc:forScope /MD /O2 /Ob2 /G6 /Zi /DFORCE_INLINING " if (OPTIMIZE==4): cmd = cmd + " /Zc:forScope /MD /O2 /Ob2 /G6 /GL /Zi /DFORCE_INLINING /DNDEBUG " cmd = cmd + " /Fd\"" + wobj[:-4] + ".pdb\""; building = buildingwhat(opts) if (building): cmd = cmd + " /DBUILDING_"+building cmd = cmd + " /EHsc /Zm300 /DWIN32_VC /DWIN32 /W3 \"" + fullsrc + "\"" oscmd(cmd) updatefiledate(wobj) if (COMPILER=="LINUXA"): wobj = "built/tmp/" + obj[:-4] + ".o" if (older(wobj, dep)): global VERBOSE if VERBOSE >= 0: checkIfNewDir(ipath[1]) if (src[-2:]==".c"): cmd = "gcc -c -o "+wobj else: cmd = "g++ -ftemplate-depth-30 -c -o "+wobj cmd = cmd + ' -I"' + PythonSDK + '"' if (PkgSelected(opts,"VRPN")): cmd = cmd + ' -I"' + THIRDPARTY + 'vrpn/include"' if (PkgSelected(opts,"FFTW")): cmd = cmd + ' -I"' + THIRDPARTY + 'fftw/include"' if (PkgSelected(opts,"FMOD")): cmd = cmd + ' -I"' + THIRDPARTY + 'fmod/include"' if (PkgSelected(opts,"NVIDIACG")): cmd = cmd + ' -I"' + THIRDPARTY + 'nvidiacg/include"' if (PkgSelected(opts,"NSPR")): cmd = cmd + ' -I"' + THIRDPARTY + 'nspr/include"' if (PkgSelected(opts,"FREETYPE")): cmd = cmd + ' -I/usr/include/freetype2' for x in ipath: cmd = cmd + ' -I"' + x + '"' if (opts.count("WITHINPANDA")): cmd = cmd + ' -DWITHIN_PANDA' if (OPTIMIZE==1): cmd = cmd + " -g" if (OPTIMIZE==2): cmd = cmd + " -O1" if (OPTIMIZE==3): cmd = cmd + " -O2" if (OPTIMIZE==4): cmd = cmd + " -O2" building = buildingwhat(opts) if (building): cmd = cmd + " -DBUILDING_" + building cmd = cmd + " " + fullsrc oscmd(cmd) updatefiledate(wobj) | aa9700942409f59dfc63d4542d0bad0a01230726 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/aa9700942409f59dfc63d4542d0bad0a01230726/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16143,
39,
12,
2603,
33,
20,
16,
4816,
33,
20,
16,
625,
421,
22850,
6487,
4952,
33,
8526,
4672,
2552,
27857,
309,
14015,
2603,
631,
20,
14047,
12,
4816,
631,
20,
3719,
30,
2589,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16143,
39,
12,
2603,
33,
20,
16,
4816,
33,
20,
16,
625,
421,
22850,
6487,
4952,
33,
8526,
4672,
2552,
27857,
309,
14015,
2603,
631,
20,
14047,
12,
4816,
631,
20,
3719,
30,
2589,
18,
... |
plotdata = self.data[subdata] | plotdata = bin.data[subdata] | def plotSurf(self,det,axisX,axisY,start=None,stop=None): bin = self.detector[det] try: bin.data except NameError: self.arrayRead(det) sumaxis = [2,1,0] sumaxis.remove(axisX) sumaxis.remove(axisY) low,high = self.__ranges(det,start,stop) subdata = (slice(low[0],high[0]),slice(low[1],high[1]),slice(low[2],high[2])) plotdata = self.data[subdata] plotdata = sum(plotdata,sumaxis[0]) #Renormalize data if (bin.type in [1,7,11,17]): #Cylinder bins plotdata = plotdata/((high[0]**2*high[2]*high[1]/(2*pi))-(low[0]**2*low[2]*low[1]/(2*pi))) elif (bin.type in [0,3,4,5,10,13,14,15,16]): #Cartesian bins plotdata = plotdata/((high[0]-low[0])*(high[1]-low[1])*(high[1]-low[1])) x = linspace(bin.start[axisX]+bin.delta[axisX]/2,bin.stop[axisX]+bin.delta[axisX]/2, num=bin.num[axisX], endpoint=False)[slice(low[axisX],high[axisX])] y = linspace(bin.start[axisY]+bin.delta[axisY]/2,bin.stop[axisY]+bin.delta[axisY]/2, num=bin.num[axisY], endpoint=False)[slice(low[axisY],high[axisY])] mlab.figure(1, fgcolor=(0, 0, 0), bgcolor=(1, 1, 1)) z =plotdata # Visualize the points mlab.surf(x,y,z) mlab.show() | d785280b5a2acb60771b8b2db31c180e8e66ae71 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/509/d785280b5a2acb60771b8b2db31c180e8e66ae71/flukaplot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
7719,
74,
12,
2890,
16,
8238,
16,
4890,
60,
16,
4890,
61,
16,
1937,
33,
7036,
16,
5681,
33,
7036,
4672,
225,
4158,
273,
365,
18,
8238,
1229,
63,
8238,
65,
775,
30,
4158,
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,
3207,
7719,
74,
12,
2890,
16,
8238,
16,
4890,
60,
16,
4890,
61,
16,
1937,
33,
7036,
16,
5681,
33,
7036,
4672,
225,
4158,
273,
365,
18,
8238,
1229,
63,
8238,
65,
775,
30,
4158,
18,
... |
self.mox.VerifyAll() | def testNew(self): change_info = gcl.ChangeInfo('naame', 'iissue', 'deescription', ['aa', 'bb']) change_info.Save = self.mox.CreateMockAnything() args = ['--foo=bar'] change_info.Save() gcl.DoPresubmitChecks(change_info, committing=False).AndReturn(True) gcl.GetCodeReviewSetting('CODE_REVIEW_SERVER').AndReturn('my_server') gcl.os.getcwd().AndReturn('somewhere') gcl.os.chdir(gcl.GetRepositoryRoot().AndReturn(None)) gcl.GenerateDiff(change_info.FileList()) gcl.upload.RealMain(['upload.py', '-y', '--server=my_server', '--foo=bar', "--message=''", '--issue=iissue'], change_info.patch).AndReturn(("1", "2")) gcl.SendToRietveld("/lint/issue%s_%s" % ('1', '2'), timeout=0.5) gcl.GetCodeReviewSetting('TRY_ON_UPLOAD').AndReturn('True') gcl.TryChange(change_info, ['--issue', '1', '--patchset', '2'], swallow_exception=True) gcl.os.chdir('somewhere') self.mox.ReplayAll() gcl.UploadCL(change_info, args) self.mox.VerifyAll() | eb12bebc49c62a9d7b5359ea09518c40d497b197 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6076/eb12bebc49c62a9d7b5359ea09518c40d497b197/gcl_unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1908,
12,
2890,
4672,
2549,
67,
1376,
273,
314,
830,
18,
3043,
966,
2668,
6582,
339,
2187,
296,
77,
13882,
2187,
296,
323,
1389,
2187,
10228,
7598,
2187,
296,
9897,
19486,
2549,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1908,
12,
2890,
4672,
2549,
67,
1376,
273,
314,
830,
18,
3043,
966,
2668,
6582,
339,
2187,
296,
77,
13882,
2187,
296,
323,
1389,
2187,
10228,
7598,
2187,
296,
9897,
19486,
2549,
67... | |
def dispatchReply(self, reply): """Set KeyVars based on the supplied Reply reply is a parsed Reply object (opscore.protocols.messages.Reply) whose fields include: - header.program: name of the program that triggered the message (string) - header.commandId: command ID that triggered the message (int) - header.actor: the actor that generated the message (string) - header.code: the message type code (opscore.protocols.types.Enum) - string: the original unparsed message (string) - keywords: an ordered dictionary of message keywords (opscore.protocols.messages.Keywords) Refer to https://trac.sdss3.org/wiki/Ops/Protocols for details. """ keydispatcher.KeyVarDispatcher.dispatchReply(self, reply, doCallbacks=self._enableCallbacks) if reply.header.cmdrName == self.connection.cmdr: cmdVar = self.cmdDict.get(reply.header.commandId, None) if cmdVar != None: self._replyCmdVar(cmdVar, reply, doLog=False) def dispatchReplyStr(self, replyStr): """Read, parse and dispatch a message from the hub. """ try: reply = self.parser.parse(replyStr) except Exception, e: self.logMsg( msgStr = "CouldNotParse; Msg=%r; Text=%r" % (replyStr, RO.StringUtil.strFromException(e)), severity = RO.Constants.sevError, ) return self.logReply(reply) try: self.dispatchReply(reply) except Exception, e: sys.stderr.write("Could not dispatch: %r\nwhich was parsed as reply=%r\n" % (replyStr, reply)) traceback.print_exc(file=sys.stderr) def executeCmd(self, cmdVar): """Execute a command (of type opscore.actor.keyvar.CmdVar). Performs the following tasks: - Sets the command ID number - Sets the start time - Puts the command on the keyword dispatcher queue - Sends the command to the server Inputs: - cmdVar: the command, of class opscore.actor.keyvar.CmdVar Note: - Always increments cmdID because every command must have a unique command ID (even commands that go to different actors); this simplifies the dispatcher code and also makes the hub's life easier (since it can report certain kinds of failures using actor=hub). """ if not self._isConnected: errReply = self.makeReply( dataStr = "Failed; Actor=%r; Cmd=%r; Text=\"not connected\"" % (cmdVar.actor, cmdVar.cmdStr), ) self._replyCmdVar(cmdVar, errReply) return while True: if cmdVar.isRefresh: cmdID = self.refreshCmdIDGen.next() else: cmdID = self.userCmdIDGen.next() if not self.cmdDict.has_key(cmdID): break self.cmdDict[cmdID] = cmdVar cmdVar._setStartInfo(self, cmdID) try: if self.includeName: if cmdVar.forUserCmd: namePrefix = "%s.%s " % (cmdVar.forUserCmd.cmdr, self.name) else: namePrefix = "%s " % (self.name) else: namePrefix = "" fullCmdStr = "%s%d %s %s" % (namePrefix, cmdVar.cmdID, cmdVar.actor, cmdVar.cmdStr) self.connection.writeLine (fullCmdStr) self.logMsg ( msgStr = fullCmdStr, actor = cmdVar.actor, ) except Exception, e: errReply = self.makeReply( cmdID = cmdVar.cmdID, dataStr = "WriteFailed; Actor=%r; Cmd=%r; Text=%r" % ( cmdVar.actor, cmdVar.cmdStr, RO.StringUtil.strFromException(e)), ) self._replyCmdVar(cmdVar, errReply) def updConnState(self, conn): """If connection state changes, update refresh variables. """ wasConnected = self._isConnected self._isConnected = conn.isConnected() if wasConnected != self._isConnected: self.reactor.callLater(_ShortInterval, self.refreshAllVar) def logMsg(self, msgStr, severity = RO.Constants.sevNormal, actor = "TUI", cmdr = None, ): """Writes a message to the log. On error, prints message to stderr and returns normally. Inputs: - msgStr: message to display; a final \n is appended - severity: message severity (an RO.Constants.sevX constant) - actor: name of actor - cmdr: commander; defaults to self """ if not self.logFunc: return try: self.logFunc( msgStr, severity = severity, actor = actor, cmdr = cmdr, ) except Exception, e: sys.stderr.write("Could not log: %r; severity=%r; actor=%r; cmdr=%r\n" % \ (msgStr, severity, actor, cmdr)) traceback.print_exc(file=sys.stderr) def logReply(self, reply): """Log a reply (an opscore.protocols.messages.Reply) reply is a parsed Reply object (opscore.protocols.messages.Reply) whose fields include: - header.program: name of the program that triggered the message (string) - header.commandId: command ID that triggered the message (int) - header.actor: the actor that generated the message (string) - header.code: the message type code (opscore.protocols.types.Enum) - string: the original unparsed message (string) - keywords: an ordered dictionary of message keywords (opscore.protocols.messages.Keywords) Refer to https://trac.sdss3.org/wiki/Ops/Protocols for details. """ try: msgCode = reply.header.code severity = keyvar.MsgCodeSeverity[msgCode] self.logMsg( msgStr = reply.string, severity = severity, actor = reply.header.actor, cmdr = reply.header.cmdrName, ) except Exception, e: sys.stderr.write("Could not log Reply:\n%r\n" % (reply,)) traceback.print_exc(file=sys.stderr) def makeReply(self, cmdr = None, cmdID = 0, actor = None, msgCode = "F", dataStr = "", ): """Generate a Reply object (opscore.protocols.messages.Reply) based on the supplied data. Useful for reporting internal errors. """ if cmdr == None: cmdr = self.connection.cmdr or "me.me" if actor == None: actor = self.name headerStr = "%s %d %s %s" % (cmdr, cmdID, actor, msgCode) try: msgStr = " ".join((headerStr, dataStr)) reply = self.parser.parse(msgStr) except Exception, e: errStr = "Internal error; could not create message: error: %s" % (RO.StringUtil.strFromException(e),) self.logMsg(msgStr = errStr, severity = RO.Constants.sevError) sys.stderr.write(errStr + "\n") traceback.print_exc(file=sys.stderr) newDataStr = "Text=%s" % (RO.StringUtil.quoteStr(dataStr)) newMsgStr = " ".join((headerStr, newDataStr)) reply = self.parser.parse(newMsgStr) return reply def refreshAllVar(self): """Issues all keyVar refresh commands. """ cancelTimer(self._refreshAllTimer) cancelTimer(self._refreshNextTimer) self._enableCallbacks = not self.delayCallbacks self._runningRefreshCmdSet = set() self._allRefreshCmdsSent = False if not self._isConnected: for keyVarList in self.keyVarListDict.values(): for keyVar in keyVarList: keyVar.setNotCurrent() return self._sendNextRefreshCmd() def _sendNextRefreshCmd(self, refreshCmdItemIter=None): """Helper function for refreshAllVar. Plow through a keyVarList iterator until a refresh command is found that is wanted, issue it, then schedule a call for myself for ASAP (giving other events a chance to execute first). Inputs: - refreshCmdItemIter: iterator over items in refreshCmdDict; if None then set to self.refreshCmdDict.iteritems() """ if not self._isConnected: self._refreshAllTimer = self.reactor.callLater(_ShortInterval, self.refreshAllVar) return if refreshCmdItemIter == None: refreshCmdItemIter = self.refreshCmdDict.iteritems() try: refreshCmdInfo, keyVarSet = refreshCmdItemIter.next() | @staticmethod def _makeDictKey(actor, keyName): """Make a keyVarListDict key out of an actor and keyword name """ return (actor.lower(), keyName.lower()) def _nextKeyVarCallback(self, keyVarListIter, includeNotCurrent=True): """Issue next keyVar callback Input: - keyVarListIter: iterator over values in self.keyVarListDict """ try: keyVarList = keyVarListIter.next() | def _checkRemCmdTimeouts(self, cmdVarIter): """Helper function for checkCmdTimeouts. Check the remaining command variables in cmdVarIter. If a timeout is found, time out that one command and schedule myself to run again shortly (thereby giving other events a chance to run). | 36fa5bf2f08aa3f4e54d078ecac109d31a7dde95 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/425/36fa5bf2f08aa3f4e54d078ecac109d31a7dde95/cmdkeydispatcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
1933,
5931,
2694,
87,
12,
2890,
16,
1797,
1537,
2360,
4672,
3536,
2276,
445,
364,
866,
5931,
2694,
87,
18,
2073,
326,
4463,
1296,
3152,
316,
1797,
1537,
2360,
18,
971,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
1933,
5931,
2694,
87,
12,
2890,
16,
1797,
1537,
2360,
4672,
3536,
2276,
445,
364,
866,
5931,
2694,
87,
18,
2073,
326,
4463,
1296,
3152,
316,
1797,
1537,
2360,
18,
971,
279,
... |
self.logger.info("tuple: tuple_node = %s, id = %s, name = %s" % (tuple_node, id, name)) | self.logger.debug("tuple: tuple_node = %s, id = %s, name = %s" % (tuple_node, id, name)) | def _convert_tuple(self, tuple_node, id, name): list = [] self.logger.info("tuple: tuple_node = %s, id = %s, name = %s" % (tuple_node, id, name)) for item in tuple_node: if isinstance(item, dict): if "ref" in item: list.append(self._convert_ref(item["ref"], name + ".tuple")) elif "object" in item: list.append(self._convert_inner_object(item, id, "%s.tuple[%s]" % (name, len(list)))) elif len(set(["dict", "tuple", "set", "frozenset", "list"]) & set(item)) > 0: list.append(self._convert_value(item, id, "%s.tuple[%s]" % (name, len(list)))) else: self.logger.info("tuple: Don't know how to handle %s" % item) else: list.append(item) return TupleDef(name, tuple(list)) | f640b15368e4d3037d291c060bcc1380e557323f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7713/f640b15368e4d3037d291c060bcc1380e557323f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6283,
67,
8052,
12,
2890,
16,
3193,
67,
2159,
16,
612,
16,
508,
4672,
666,
273,
5378,
365,
18,
4901,
18,
4148,
2932,
8052,
30,
3193,
67,
2159,
273,
738,
87,
16,
612,
273,
738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6283,
67,
8052,
12,
2890,
16,
3193,
67,
2159,
16,
612,
16,
508,
4672,
666,
273,
5378,
365,
18,
4901,
18,
4148,
2932,
8052,
30,
3193,
67,
2159,
273,
738,
87,
16,
612,
273,
738,
... |
def get_files_from_data_dir(self): self.html_files = glob.glob("%s/*.html" % data_dir) print self.html_files self.golden_images = [re.sub("\.html$", "_inner_html.txt", filename) for filename in self.html_files] print self.golden_images def test_inner_html(self): self.failUnless(len(self.html_files) == len(self.golden_images)) failures = 0 for file, golden_image in zip(self.html_files, self.golden_images): local_url = "file:///" + file local_url = re.sub(r"\\", "/", local_url) print local_url inner_html = self.tester.get_innerHTML_from_URL(local_url) golden_inner_html = open(golden_image).read() if inner_html != golden_inner_html: failures += 1 self.failUnless(failures == 0) | def open(self,host,port=9997): self.tn.close() self.host = host self.port = port self.tn.open(host,port) self.init() | def get_files_from_data_dir(self): self.html_files = glob.glob("%s/*.html" % data_dir) print self.html_files self.golden_images = [re.sub("\.html$", "_inner_html.txt", filename) for filename in self.html_files] print self.golden_images | ad5bbcba6ad1b57a86576deb8484f3ddfa200b50 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13067/ad5bbcba6ad1b57a86576deb8484f3ddfa200b50/jssh_driver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2354,
67,
2080,
67,
892,
67,
1214,
12,
2890,
4672,
365,
18,
2620,
67,
2354,
273,
4715,
18,
10581,
27188,
87,
30987,
2620,
6,
738,
501,
67,
1214,
13,
1172,
365,
18,
2620,
67,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2354,
67,
2080,
67,
892,
67,
1214,
12,
2890,
4672,
365,
18,
2620,
67,
2354,
273,
4715,
18,
10581,
27188,
87,
30987,
2620,
6,
738,
501,
67,
1214,
13,
1172,
365,
18,
2620,
67,... |
box = self._get_container(controls) | box = self._get_container(panelcontrols.split(",")) | def add_panel(self, spec): "add_panel(panel_specification) -> error string, None if all is OK" offset = spec.find(",") if offset <= 0: return "invalid panel specification '%s'" % spec | e2755d9c123f1f059c154376f420fc6163a24844 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2811/e2755d9c123f1f059c154376f420fc6163a24844/hatariui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
13916,
12,
2890,
16,
857,
4672,
315,
1289,
67,
13916,
12,
13916,
67,
31543,
13,
317,
555,
533,
16,
599,
309,
777,
353,
7791,
6,
1384,
273,
857,
18,
4720,
2932,
16,
7923,
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
13916,
12,
2890,
16,
857,
4672,
315,
1289,
67,
13916,
12,
13916,
67,
31543,
13,
317,
555,
533,
16,
599,
309,
777,
353,
7791,
6,
1384,
273,
857,
18,
4720,
2932,
16,
7923,
309... |
def body(self): | def attachment_count( self ): count = 0 for item in self.attachments: if item['filename']: count += 1 return count @property def language( self ): return 'english' @property def word_count( self ): wc = {} for word in self.body.split(): word = word.lower() skip = False for letter in word: if letter not in string.ascii_lowercase: skip = True break if skip: continue if wc.has_key(word): wc[word] += 1 else: wc[word] = 1 return wc @property def body( self ): | def body(self): for item in self.attachments: if item['filename'] == '' and item['subtype'] != 'html': return unicode(item['payload'], self.encoding, 'ignore') return '' | f97944afc8b6a5e678fb900901f5227703e835c6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6274/f97944afc8b6a5e678fb900901f5227703e835c6/emailmessage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6042,
67,
1883,
12,
365,
262,
30,
1056,
273,
374,
364,
761,
316,
365,
18,
17828,
30,
309,
761,
3292,
3459,
3546,
30,
1056,
1011,
404,
225,
327,
1056,
225,
632,
4468,
1652,
2653,
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,
6042,
67,
1883,
12,
365,
262,
30,
1056,
273,
374,
364,
761,
316,
365,
18,
17828,
30,
309,
761,
3292,
3459,
3546,
30,
1056,
1011,
404,
225,
327,
1056,
225,
632,
4468,
1652,
2653,
12,
... |
@transform(fix_header, regex(r'^(.*)/prepped_bam/(.*).bam'), r'\1/prepped_bam/\2.bai') | @transform(fix_header, regex(r'^(.*)/prepped_bam/(.*).bam'), r'\1/prepped_bam/\2.bam.bai') | def fix_header(input_file, output_file): '''Fix header info''' cmd_dict = cdict.copy() cmd_dict['infile'] = input_file cmd_dict['outfile'] = output_file cmd_dict['read_group'] = os.path.split(output_file)[0] cmd_dict.update(read_group_re.match(cmd_dict['read_group']).groupdict()) open(cmd_dict['header_tmp'] % cmd_dict, 'w').write( open(cmd_dict['header_template'], 'r').read() % cmd_dict ) picard_cmd = '%(replace_header) INPUT=%(infile)s HEADER=%(header_tmp)s OUTPUT=%(outfile)s' call(picard_cmd % cmd_dict) os.remove(cmd_dict['header_tmp']) | 1dcbe90106e59b7068eea2a6827390a1e2282350 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14572/1dcbe90106e59b7068eea2a6827390a1e2282350/prep_sequence.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
3374,
12,
2630,
67,
768,
16,
876,
67,
768,
4672,
9163,
8585,
1446,
1123,
26418,
1797,
67,
1576,
273,
276,
1576,
18,
3530,
1435,
1797,
67,
1576,
3292,
267,
768,
3546,
273,
810... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
3374,
12,
2630,
67,
768,
16,
876,
67,
768,
4672,
9163,
8585,
1446,
1123,
26418,
1797,
67,
1576,
273,
276,
1576,
18,
3530,
1435,
1797,
67,
1576,
3292,
267,
768,
3546,
273,
810... |
return '' | if e[0]==2: return '' self.DEBUG('Socket error while receiving data','error') self._owner.disconnected() raise IOError("Disconnected from server") | def receive(self): """ Reads all pending incoming data. In case of disconnection calls owner's disconnected() method and then raises IOError exception.""" try: received = self._recv(BUFLEN) except socket.sslerror: self._seen_data=0 return '' except: received = '' | 6c79bb0472eaf9d55c397b6aad535708151a169d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7194/6c79bb0472eaf9d55c397b6aad535708151a169d/transports.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6798,
12,
2890,
4672,
3536,
29185,
777,
4634,
6935,
501,
18,
657,
648,
434,
1015,
4071,
4097,
3410,
1807,
17853,
1435,
707,
471,
1508,
14183,
8340,
1520,
12123,
775,
30,
5079,
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,
6798,
12,
2890,
4672,
3536,
29185,
777,
4634,
6935,
501,
18,
657,
648,
434,
1015,
4071,
4097,
3410,
1807,
17853,
1435,
707,
471,
1508,
14183,
8340,
1520,
12123,
775,
30,
5079,
273,
365,
... |
timeOut = 60 * 60 * 12 | def connectionLost(self, reason): """connection was lost""" pass | 6494592dfee619e3c115a8a4a1fb3a414b3e6ea1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6494592dfee619e3c115a8a4a1fb3a414b3e6ea1/http.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1459,
19024,
12,
2890,
16,
3971,
4672,
3536,
4071,
1703,
13557,
8395,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1459,
19024,
12,
2890,
16,
3971,
4672,
3536,
4071,
1703,
13557,
8395,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
def aStarSearch(problem, heuristic=nullHeuristic): "Search the node that has the lowest combined cost and heuristic first." return informedSearch(problem, heuristic) def greedySearch(problem, heuristic=nullHeuristic): "Search the node that has the lowest heuristic first." import copy closed = set([]) fringe = util.FasterPriorityQueue() startState = problem.getStartState() fringe.push((startState,'',None,0), heuristic(startState)) while 1: if (fringe.isEmpty()): return None currentPath = fringe.pop() currentNode = currentPath[0] if(problem.isGoalState(currentNode)==True): actions = [] while 1: if (currentPath == None or currentPath[1] == ''): actions.reverse() return actions actions.append(currentPath[1]) currentPath = currentPath[2] | def aStarSearch(problem, heuristic=nullHeuristic): "Search the node that has the lowest combined cost and heuristic first." return informedSearch(problem, heuristic) | ac7c6702486eaace4af150c79e8fd822458db8aa /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/840/ac7c6702486eaace4af150c79e8fd822458db8aa/search.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
279,
18379,
2979,
12,
18968,
16,
25833,
33,
2011,
5256,
18219,
4672,
315,
2979,
326,
756,
716,
711,
326,
11981,
8224,
6991,
471,
25833,
1122,
1199,
327,
316,
7312,
2979,
12,
18968,
16,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
279,
18379,
2979,
12,
18968,
16,
25833,
33,
2011,
5256,
18219,
4672,
315,
2979,
326,
756,
716,
711,
326,
11981,
8224,
6991,
471,
25833,
1122,
1199,
327,
316,
7312,
2979,
12,
18968,
16,
2... | |
doc = `doc` | doc = '"' + doc + '"' | def outputGetSetList(self): if self.getsetlist: for name, get, set, doc in self.getsetlist: if get: self.outputGetter(name, get) else: Output("#define %s_get_%s NULL", self.prefix, name) if set: self.outputSetter(name, set) else: Output("#define %s_set_%s NULL", self.prefix, name) Output("static PyGetSetDef %s_getsetlist[] = {", self.prefix) IndentLevel() for name, get, set, doc in self.getsetlist: if doc: doc = `doc` else: doc = "NULL" Output("{\"%s\", (getter)%s_get_%s, (setter)%s_set_%s, %s}", name, self.prefix, name, self.prefix, name, doc) DedentLevel() Output("};") else: Output("#define %s_getsetlist NULL", self.prefix) | 27a445023925a3abb14e08acbfcdd9134ca1a275 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/27a445023925a3abb14e08acbfcdd9134ca1a275/bgenObjectDefinition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
876,
967,
694,
682,
12,
2890,
4672,
309,
365,
18,
588,
542,
1098,
30,
364,
508,
16,
336,
16,
444,
16,
997,
316,
365,
18,
588,
542,
1098,
30,
309,
336,
30,
365,
18,
2844,
8461,
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,
876,
967,
694,
682,
12,
2890,
4672,
309,
365,
18,
588,
542,
1098,
30,
364,
508,
16,
336,
16,
444,
16,
997,
316,
365,
18,
588,
542,
1098,
30,
309,
336,
30,
365,
18,
2844,
8461,
12,
... |
@wrap_privileges | def get_cpu_times(self, pid): """return a tuple containing process user/kernel time.""" return _psutil_bsd.get_cpu_times(pid) | 1a06292cc1abe86c1d97dd948c0ba2744585ee8b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7296/1a06292cc1abe86c1d97dd948c0ba2744585ee8b/_psbsd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
11447,
67,
8293,
12,
2890,
16,
4231,
4672,
3536,
2463,
279,
3193,
4191,
1207,
729,
19,
8111,
813,
12123,
327,
389,
1121,
1367,
67,
2038,
72,
18,
588,
67,
11447,
67,
8293,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
11447,
67,
8293,
12,
2890,
16,
4231,
4672,
3536,
2463,
279,
3193,
4191,
1207,
729,
19,
8111,
813,
12123,
327,
389,
1121,
1367,
67,
2038,
72,
18,
588,
67,
11447,
67,
8293,
12,
... | |
print 'usage: aml.py source.txt' | print 'usage: yaml.py source.txt' | def getClassDoc(self, modulename, classname, pathname=None): """Documents the class and its public methods""" docco = codegrab.getObjectsDefinedIn(modulename, pathname) found = 0 for cls in docco.classes: if cls.name == classname: found = 1 self._results.append(('Preformatted','FunctionHeader', 'Class %s:' % cls.name)) self._results.append(('Preformatted','DocString', cls.doc)) for mth in cls.methods: if mth.status == 'official': self._results.append(('Preformatted','FunctionHeader', mth.proto)) self._results.append(('Preformatted','DocStringIndent', mth.doc)) break assert found, 'No Classes Defined in ' + modulename | dc9c14cfda60b11ba8d0938297e3307878d97a3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/dc9c14cfda60b11ba8d0938297e3307878d97a3b/yaml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2900,
1759,
12,
2890,
16,
31961,
16,
7479,
16,
9806,
33,
7036,
4672,
3536,
12922,
326,
667,
471,
2097,
1071,
2590,
8395,
997,
2894,
273,
981,
2752,
70,
18,
588,
4710,
8116,
382,
12,
17... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2900,
1759,
12,
2890,
16,
31961,
16,
7479,
16,
9806,
33,
7036,
4672,
3536,
12922,
326,
667,
471,
2097,
1071,
2590,
8395,
997,
2894,
273,
981,
2752,
70,
18,
588,
4710,
8116,
382,
12,
17... |
print 'selecting' | def select_file(self, filename): print 'selecting' self._filename = filename viz = config.get(options.VIZ_PLUGIN) self.xine.set_viz(viz) self.xine.select_file(filename) def expose_workaround(): try: _, _, width, height, _ = self.widget.window.get_geometry() self.xine.got_expose_event(0, 0, width, height) except (SystemExit, KeyboardInterrupt): raise except: return True return False | f0c5e7ba8412906f000dd573728523e492cdffa2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/f0c5e7ba8412906f000dd573728523e492cdffa2/xinerenderer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
67,
768,
12,
2890,
16,
1544,
4672,
365,
6315,
3459,
273,
1544,
26631,
273,
642,
18,
588,
12,
2116,
18,
4136,
62,
67,
19415,
13,
365,
18,
92,
558,
18,
542,
67,
23167,
12,
23167,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
67,
768,
12,
2890,
16,
1544,
4672,
365,
6315,
3459,
273,
1544,
26631,
273,
642,
18,
588,
12,
2116,
18,
4136,
62,
67,
19415,
13,
365,
18,
92,
558,
18,
542,
67,
23167,
12,
23167,... | |
_, errwrite = CreatePipe(None, 0) | _, errwrite = _subprocess.CreatePipe(None, 0) | def _get_handles(self, stdin, stdout, stderr): """Construct and return tuple with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ if stdin is None and stdout is None and stderr is None: return (None, None, None, None, None, None) | a2936cfa0989988f3e9f9ce6aec7d5657a2f73ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/a2936cfa0989988f3e9f9ce6aec7d5657a2f73ba/subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
24111,
12,
2890,
16,
8801,
16,
3909,
16,
4514,
4672,
3536,
7249,
471,
327,
3193,
598,
1665,
2184,
30,
293,
22,
71,
896,
16,
293,
22,
71,
2626,
16,
276,
22,
84,
896,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
24111,
12,
2890,
16,
8801,
16,
3909,
16,
4514,
4672,
3536,
7249,
471,
327,
3193,
598,
1665,
2184,
30,
293,
22,
71,
896,
16,
293,
22,
71,
2626,
16,
276,
22,
84,
896,
1... |
infos.append(CFG_WEBSESSION_INFO_MESSAGES["MEMBER_REJECTED"]) | infos.append(_(CFG_WEBSESSION_INFO_MESSAGES["MEMBER_REJECTED"])) | def perform_request_reject_member(uid, grpID, user_id, ln=cdslang): """Reject waiting member and delete it from the list @param uid: user ID @param grpID: ID of the group @param member_id: selected member ID @param ln: language @return a (body, errors[], warnings[]) formed tuple """ body = '' errors = [] warnings = [] infos = [] _ = gettext_set_language(ln) user_status = db.get_user_status(uid, grpID) if not len(user_status): errors.append('ERR_WEBSESSION_DB_ERROR') return (body, errors, warnings) if user_id == -1: warnings.append('WRN_WEBSESSION_NO_USER_SELECTED_DEL') (body, errors, warnings) = perform_request_manage_member(uid, grpID, warnings=warnings, ln=ln) else : """test if user is already member or pending""" status = db.get_user_status(user_id, grpID) if not status: warnings.append('WRN_WEBSESSION_ALREADY_MEMBER_REJECT') (body, errors, warnings) = perform_request_manage_member(uid, grpID, infos=infos, warnings=warnings, ln=ln) else: db.delete_member(grpID, user_id) group_infos = db.get_group_infos(grpID) group_name = group_infos[0][1] user = get_user_info(user_id, ln)[2] msg_subjet, msg_body = websession_templates.tmpl_member_msg(group_name=group_name, accepted=0, ln=ln) (body, errors, warnings, title, navtrail) = perform_request_send(uid, msg_to_user=user, msg_to_group="", msg_subject=msg_subjet, msg_body=msg_body, ln=ln) infos.append(CFG_WEBSESSION_INFO_MESSAGES["MEMBER_REJECTED"]) (body, errors, warnings) = perform_request_manage_member(uid, grpID, infos=infos, warnings=warnings, ln=ln) return (body, errors, warnings) | 5b6e928b4222c0527298f19150e237b65b55803a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3933/5b6e928b4222c0527298f19150e237b65b55803a/webgroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
24163,
67,
5990,
12,
1911,
16,
14295,
734,
16,
729,
67,
350,
16,
7211,
33,
4315,
2069,
539,
4672,
3536,
21705,
7336,
3140,
471,
1430,
518,
628,
326,
666,
632,
891,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
24163,
67,
5990,
12,
1911,
16,
14295,
734,
16,
729,
67,
350,
16,
7211,
33,
4315,
2069,
539,
4672,
3536,
21705,
7336,
3140,
471,
1430,
518,
628,
326,
666,
632,
891,
... |
set_affinity_warning(tid, new_affinity) | print "move_threads_to_cpu: could not change pid %d affinity to %s" % (pid, new_affinity) | def move_threads_to_cpu(new_affinity, pid_list): changed = False ps = procfs.pidstats() for pid in pid_list: try: curr_affinity = schedutils.get_affinity(pid) if set(curr_affinity) != set(new_affinity): schedutils.set_affinity(pid, new_affinity) curr_affinity = schedutils.get_affinity(pid) if set(curr_affinity) == set(new_affinity): changed = True else: set_affinity_warning(pid, new_affinity) # See if this is the thread group leader if not ps.has_key(pid): continue threads = procfs.pidstats("/proc/%d/task" % pid) for tid in threads.keys(): curr_affinity = schedutils.get_affinity(tid) if set(curr_affinity) != set(new_affinity): schedutils.set_affinity(tid, new_affinity) curr_affinity = schedutils.get_affinity(tid) if set(curr_affinity) == set(new_affinity): changed = True else: set_affinity_warning(tid, new_affinity) except SystemError: # process died continue return changed | 0beb1235163caea9f4a9755668bf6c271f4cccd9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3406/0beb1235163caea9f4a9755668bf6c271f4cccd9/tuna.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
67,
12495,
67,
869,
67,
11447,
12,
2704,
67,
1727,
7850,
16,
4231,
67,
1098,
4672,
3550,
273,
1083,
225,
4250,
273,
5418,
2556,
18,
6610,
5296,
1435,
364,
4231,
316,
4231,
67,
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,
3635,
67,
12495,
67,
869,
67,
11447,
12,
2704,
67,
1727,
7850,
16,
4231,
67,
1098,
4672,
3550,
273,
1083,
225,
4250,
273,
5418,
2556,
18,
6610,
5296,
1435,
364,
4231,
316,
4231,
67,
10... |
""" Return dictionary of all processes (which are dictionaries of each | """Return dictionary of all processes (which are dictionaries of each | def allprocs(self): """ Return dictionary of all processes (which are dictionaries of each process' details). """ | f4ace14ebc214d02926ffd35d8f2dda42dd35762 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3643/f4ace14ebc214d02926ffd35d8f2dda42dd35762/proc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
777,
27537,
12,
2890,
4672,
3536,
990,
3880,
434,
777,
8488,
261,
12784,
854,
16176,
434,
1517,
1207,
11,
3189,
2934,
3536,
2,
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,
777,
27537,
12,
2890,
4672,
3536,
990,
3880,
434,
777,
8488,
261,
12784,
854,
16176,
434,
1517,
1207,
11,
3189,
2934,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if selItems[cnt-1] > ( len(self.ctrlNames) - 2 ): return | if not selItems or selItems[cnt-1] > ( len(self.ctrlNames) - 2 ): return | def OnBbdownButton(self, event): selItems = self.lbObjects.GetSelections() cnt = len(selItems) if selItems[cnt-1] > ( len(self.ctrlNames) - 2 ): return for i in range( cnt ): item = selItems[cnt - i - 1] self.moveObject(item, item + 1) | 4abc71c7943938785082c0e6f42ce2efdc234cc7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/4abc71c7943938785082c0e6f42ce2efdc234cc7/CreationOrdDlg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
38,
70,
2378,
3616,
12,
2890,
16,
871,
4672,
357,
3126,
273,
365,
18,
20404,
4710,
18,
967,
29913,
1435,
7599,
273,
562,
12,
1786,
3126,
13,
309,
486,
357,
3126,
578,
357,
3126,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
38,
70,
2378,
3616,
12,
2890,
16,
871,
4672,
357,
3126,
273,
365,
18,
20404,
4710,
18,
967,
29913,
1435,
7599,
273,
562,
12,
1786,
3126,
13,
309,
486,
357,
3126,
578,
357,
3126,
... |
for typeid in field.allowed_types: info = tool.getTypeInfo(typeid) if info is None: log("Warning: in Archetypes.Widget.lookupDestinationsFor: portal type %s not found" % typeid ) continue | def lookupDestinationsFor(typeinfo, tool, purl): """ search where the user can add a typeid instance """ # first, discover who can contain the type searchFor = [] for regType in tool.listTypeInfo(): if typeinfo.globalAllow(): searchFor.append(regType.getId()) elif regType.filter_content_types and \ typeinfo.getId() in regType.allowed_content_types: searchFor.append(regType.getId()) # after, gimme the path/s containers = [] for wanted in searchFor: for brain in \ instance.portal_catalog(portal_type=wanted): obj = brain.getObject() if obj != None and \ hasattr(obj.aq_explicit,'isPrincipiaFolderish'): containers.append(purl.getRelativeUrl(obj)) # ok, go on... return containers | b8218e6ab5b17cabfbb6f2f9b33b853fcd8112d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/b8218e6ab5b17cabfbb6f2f9b33b853fcd8112d4/Widget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3689,
27992,
1290,
12,
723,
1376,
16,
5226,
16,
293,
718,
4672,
3536,
1623,
1625,
326,
729,
848,
527,
279,
618,
350,
791,
3536,
468,
1122,
16,
10372,
10354,
848,
912,
326,
618,
1623,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3689,
27992,
1290,
12,
723,
1376,
16,
5226,
16,
293,
718,
4672,
3536,
1623,
1625,
326,
729,
848,
527,
279,
618,
350,
791,
3536,
468,
1122,
16,
10372,
10354,
848,
912,
326,
618,
1623,
1... | |
print >>f, '\t\t\t<value><![CDATA[ %s ]]></value>' % (str(value.encode('utf-8'))) | print >>f, '\t\t\t<value><![CDATA[', if isinstance(value, unicode): value = value.encode('utf-8', 'replace') else: value = unicode(value, errors='replace').encode('utf-8', 'replace') f.write(value) print >>f, ']]></value>' | def to_xml(self, f=None): """Get this domain as an XML DOM Document :param f: Optional File to dump directly to :type f: File or Stream | 18ff75a04db1caf1f76121416feb3edef1da29ed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1098/18ff75a04db1caf1f76121416feb3edef1da29ed/domain.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
2902,
12,
2890,
16,
284,
33,
7036,
4672,
3536,
967,
333,
2461,
487,
392,
3167,
4703,
4319,
294,
891,
284,
30,
4055,
1387,
358,
4657,
5122,
358,
294,
723,
284,
30,
1387,
578,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
2902,
12,
2890,
16,
284,
33,
7036,
4672,
3536,
967,
333,
2461,
487,
392,
3167,
4703,
4319,
294,
891,
284,
30,
4055,
1387,
358,
4657,
5122,
358,
294,
723,
284,
30,
1387,
578,
... |
if type(value) != type([]): value = [value] | if typeof(value) != typeof([]): value = [value] | def _post_editnode(self, nid, changes=None): ''' do the linking and message sending part of the node creation ''' cn = self.classname cl = self.db.classes[cn] # link if necessary keys = self.form.keys() for key in keys: if key == ':multilink': value = self.form[key].value if type(value) != type([]): value = [value] for value in value: designator, property = value.split(':') link, nodeid = roundupdb.splitDesignator(designator) link = self.db.classes[link] value = link.get(nodeid, property) value.append(nid) link.set(nodeid, **{property: value}) elif key == ':link': value = self.form[key].value if type(value) != type([]): value = [value] for value in value: designator, property = value.split(':') link, nodeid = roundupdb.splitDesignator(designator) link = self.db.classes[link] link.set(nodeid, **{property: nid}) | beb755b8c11ec4f663d7d1b82dfe5ba34ad3a586 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/beb755b8c11ec4f663d7d1b82dfe5ba34ad3a586/cgi_client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2767,
67,
4619,
2159,
12,
2890,
16,
19416,
16,
3478,
33,
7036,
4672,
9163,
741,
326,
27651,
471,
883,
5431,
1087,
434,
326,
756,
6710,
9163,
6227,
273,
365,
18,
18340,
927,
273,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2767,
67,
4619,
2159,
12,
2890,
16,
19416,
16,
3478,
33,
7036,
4672,
9163,
741,
326,
27651,
471,
883,
5431,
1087,
434,
326,
756,
6710,
9163,
6227,
273,
365,
18,
18340,
927,
273,
3... |
self.cookedq = '' | self.cookedq = b'' | def __init__(self, host=None, port=0, timeout=socket._GLOBAL_DEFAULT_TIMEOUT): """Constructor. | 3de7fb86fc9e053955dae144b4fe6e080f5a4d81 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/3de7fb86fc9e053955dae144b4fe6e080f5a4d81/telnetlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
33,
7036,
16,
1756,
33,
20,
16,
2021,
33,
7814,
6315,
20402,
67,
5280,
67,
9503,
4672,
3536,
6293,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
33,
7036,
16,
1756,
33,
20,
16,
2021,
33,
7814,
6315,
20402,
67,
5280,
67,
9503,
4672,
3536,
6293,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
h, v = bb[zoom] bbx = [0, width, 2*width][h] bby = [0, height, 2*height][v] bbw = width bbh = height | h, v = bb[zoom] bbcx = ([1, 3, 5][h]) * width / 6 bbcy = ([1, 3, 5][v]) * height / 6 if 'OSD_SDL' in dir(config) and self.rotation % 180: scale_x = float(osd.width) / (height / 3) scale_y = float(osd.height) / (width / 3) scale = min(scale_x, scale_y) bbw = min(max((width / 3) * scale, osd.height), width) / scale bbh = min(max((height / 3) * scale, osd.width), height) / scale else: scale_x = float(osd.width) / (width / 3) scale_y = float(osd.height) / (height / 3) scale = min(scale_x, scale_y) bbw = min(max((width / 3) * scale, osd.width), width) / scale bbh = min(max((height / 3) * scale, osd.height), height) / scale bbx = max(0, bbcx - bbw/2) bby = max(0, bbcy - bbh/2) if bbx + bbw > width: bbx = width - bbw if bby + bbh > height: bby = height - bbh if 'OSD_SDL' in dir(config) and self.rotation % 180: new_h, new_w = bbw * scale, bbh * scale else: new_w, new_h = bbw * scale, bbh * scale else: if 'OSD_SDL' in dir(config) and self.rotation % 180: height, width = image.size | def view(self, filename, number, playlist, zoom=0): | 7ebb1fb4a137133876aea8497b61bb033fd846be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/7ebb1fb4a137133876aea8497b61bb033fd846be/iview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1476,
12,
2890,
16,
1544,
16,
1300,
16,
16428,
16,
7182,
33,
20,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1476,
12,
2890,
16,
1544,
16,
1300,
16,
16428,
16,
7182,
33,
20,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rev_id = handler.revision_id self.cache_mgr.revision_ids[cmd.ref] = rev_id if cmd.mark is not None: self.cache_mgr.revision_ids[":" + cmd.mark] = rev_id self.cache_mgr.last_revision_ids[self.active_branch] = rev_id | mark = ":" + cmd.mark self.cache_mgr.revision_ids[mark] = handler.revision_id for parent in cmd.parents: try: del self.heads[parent] except KeyError: warning("didn't find parent %s while tracking heads" % parent) self.heads[mark] = cmd.ref self.last_ref = cmd.ref | def commit_handler(self, cmd): """Process a CommitCommand.""" handler = GenericCommitHandler(cmd, self.repo, self.cache_mgr, self.active_branch, self.verbose) handler.process() rev_id = handler.revision_id self.cache_mgr.revision_ids[cmd.ref] = rev_id if cmd.mark is not None: self.cache_mgr.revision_ids[":" + cmd.mark] = rev_id self.cache_mgr.last_revision_ids[self.active_branch] = rev_id self._revision_count += 1 self.report_progress("(:%s)" % cmd.mark) if (self.max_commits is not None and self._revision_count >= self.max_commits): self.note("stopping after reaching requested count of commits") self.finished = True elif self._revision_count % self.checkpoint_every == 0: self.note("%d commits - automatic checkpoint triggered", self._revision_count) self.checkpoint_handler(None) | b6311beb8f53130d77a3056cfad661f459d2c4c6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8703/b6311beb8f53130d77a3056cfad661f459d2c4c6/generic_processor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3294,
67,
4176,
12,
2890,
16,
1797,
4672,
3536,
2227,
279,
10269,
2189,
12123,
1838,
273,
7928,
5580,
1503,
12,
4172,
16,
365,
18,
7422,
16,
365,
18,
2493,
67,
13552,
16,
365,
18,
3535... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3294,
67,
4176,
12,
2890,
16,
1797,
4672,
3536,
2227,
279,
10269,
2189,
12123,
1838,
273,
7928,
5580,
1503,
12,
4172,
16,
365,
18,
7422,
16,
365,
18,
2493,
67,
13552,
16,
365,
18,
3535... |
call(["dbus_uinput_bridge/build"]) call(["pot/gen_locale"]) | call(["./build_dbus_uinput_bridge"]) gen_locale() | def run(self): call(["dbus_uinput_bridge/build"]) call(["pot/gen_locale"]) build.run(self) | b822f067a518db72874bce4e6ce1b78e7a3d6eb0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2456/b822f067a518db72874bce4e6ce1b78e7a3d6eb0/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
745,
3816,
9654,
19,
3510,
67,
1966,
407,
67,
89,
2630,
67,
18337,
6,
5717,
3157,
67,
6339,
1435,
1361,
18,
2681,
12,
2890,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
745,
3816,
9654,
19,
3510,
67,
1966,
407,
67,
89,
2630,
67,
18337,
6,
5717,
3157,
67,
6339,
1435,
1361,
18,
2681,
12,
2890,
13,
2,
-100,
-100,
-100,
-100,
-100,
... |
xcolorname = color.replace(' | if color.startswith('rgb'): xcolorname = "c%02x%02x%02x" % (r,g,b) else: xcolorname = color.replace(' | def get_color(self, color): """Return a valid xcolor color name and store color""" | 758a72b461e78be485068bd5a939e84e92542519 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7584/758a72b461e78be485068bd5a939e84e92542519/tikz_export.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3266,
12,
2890,
16,
2036,
4672,
3536,
990,
279,
923,
619,
3266,
2036,
508,
471,
1707,
2036,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3266,
12,
2890,
16,
2036,
4672,
3536,
990,
279,
923,
619,
3266,
2036,
508,
471,
1707,
2036,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
files = ['$(OPT)', '$(LDFLAGS)', config_c, frozen_c] + \ | files = ['$(OPT)', '$(LDFLAGS)', base_config_c, base_frozen_c] + \ | def main(): # overridable context prefix = PREFIX # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: opts, args = getopt.getopt(sys.argv[1:], 'e:p:P:') except getopt.error, msg: usage('getopt error: ' + str(msg)) # proces option arguments for o, a in opts: if o == '-e': extensions.append(a) if o == '-p': prefix = a if o == '-P': exec_prefix = a # default exec_prefix if exec_prefix is None: exec_prefix = EXEC_PREFIX if exec_prefix is None: exec_prefix = prefix # locations derived from options binlib = os.path.join(exec_prefix, 'lib/python1.4/config') incldir = os.path.join(prefix, 'include/python1.4') config_c_in = os.path.join(binlib, 'config.c.in') frozenmain_c = os.path.join(binlib, 'frozenmain.c') getpath_c = os.path.join(binlib, 'getpath.c') supp_sources = [frozenmain_c, getpath_c] makefile_in = os.path.join(binlib, 'Makefile') defines = ['-DPYTHONPATH=\\"$(PYTHONPATH)\\"'] includes = ['-I' + incldir, '-I' + binlib] # sanity check of directories and files for dir in [prefix, exec_prefix, binlib, incldir] + extensions: if not os.path.exists(dir): usage('needed directory %s not found' % dir) if not os.path.isdir(dir): usage('%s: not a directory' % dir) for file in [config_c_in, makefile_in] + supp_sources: if not os.path.exists(file): usage('needed file %s not found' % file) if not os.path.isfile(file): usage('%s: not a plain file' % file) for dir in extensions: setup = os.path.join(dir, 'Setup') if not os.path.exists(setup): usage('needed file %s not found' % setup) if not os.path.isfile(setup): usage('%s: not a plain file' % setup) # check that enough arguments are passed if not args: usage('at least one filename argument required') # check that the script name ends in ".py" if args[0][-3:] != ".py": usage('the script name must have a .py suffix') # check that file arguments exist for arg in args: if not os.path.exists(arg): usage('argument %s not found' % arg) if not os.path.isfile(arg): usage('%s: not a plain file' % arg) # process non-option arguments scriptfile = args[0] modules = args[1:] # derive target name from script name base = os.path.basename(scriptfile) base, ext = os.path.splitext(base) if base: if base != scriptfile: target = base else: target = base + '.bin' # Actual work starts here... dict = findmodules.findmodules(scriptfile, modules, path) names = dict.keys() names.sort() print "Modules being frozen:" for name in names: print '\t', name backup = frozen_c + '~' try: os.rename(frozen_c, backup) except os.error: backup = None outfp = open(frozen_c, 'w') try: makefreeze.makefreeze(outfp, dict) finally: outfp.close() if backup: if cmp.cmp(backup, frozen_c): sys.stderr.write('%s not changed, not written\n' % frozen_c) os.rename(backup, frozen_c) builtins = [] unknown = [] mods = dict.keys() mods.sort() for mod in mods: if dict[mod] == '<builtin>': builtins.append(mod) elif dict[mod] == '<unknown>': unknown.append(mod) addfiles = [] if unknown: addfiles, addmods = \ checkextensions.checkextensions(unknown, extensions) for mod in addmods: unknown.remove(mod) builtins = builtins + addmods if unknown: sys.stderr.write('Warning: unknown modules remain: %s\n' % string.join(unknown)) builtins.sort() infp = open(config_c_in) backup = config_c + '~' try: os.rename(config_c, backup) except os.error: backup = None outfp = open(config_c, 'w') try: makeconfig.makeconfig(infp, outfp, builtins) finally: outfp.close() infp.close() if backup: if cmp.cmp(backup, config_c): sys.stderr.write('%s not changed, not written\n' % config_c) os.rename(backup, config_c) cflags = defines + includes + ['$(OPT)'] libs = [] for n in 'Modules', 'Python', 'Objects', 'Parser': n = 'lib%s.a' % n n = os.path.join(binlib, n) libs.append(n) makevars = parsesetup.getmakevars(makefile_in) somevars = {} for key in makevars.keys(): somevars[key] = makevars[key] somevars['CFLAGS'] = string.join(cflags) # override files = ['$(OPT)', '$(LDFLAGS)', config_c, frozen_c] + \ supp_sources + addfiles + libs + \ ['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)'] backup = makefile + '~' try: os.rename(makefile, backup) except os.error: backup = None outfp = open(makefile, 'w') try: makemakefile.makemakefile(outfp, somevars, files, target) finally: outfp.close() if backup: if not cmp.cmp(backup, makefile): print 'previous Makefile saved as', backup else: sys.stderr.write('%s not changed, not written\n' % makefile) os.rename(backup, makefile) # Done! print 'Now run make to build the target:', target | 1ef23af01200b5597684f183a54a806811b98f42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1ef23af01200b5597684f183a54a806811b98f42/freeze.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
5713,
27621,
819,
1633,
273,
17154,
1082,
202,
7,
444,
2121,
598,
300,
84,
1456,
1196,
67,
3239,
273,
599,
202,
202,
7,
444,
2121,
598,
300,
52,
1456,
4418,
273,
5378... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
468,
5713,
27621,
819,
1633,
273,
17154,
1082,
202,
7,
444,
2121,
598,
300,
84,
1456,
1196,
67,
3239,
273,
599,
202,
202,
7,
444,
2121,
598,
300,
52,
1456,
4418,
273,
5378... |
return str(arg) | s = str(arg) if self.debug: log.msg(s, debug=1) return s | def processResponse(self, arg, **kw): for h in self.handlers: arg = h.processResponse(arg, **kw) return str(arg) | 1a3409b7b54a829b47296eeadd726661a0e52eb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/1a3409b7b54a829b47296eeadd726661a0e52eb2/WSresource.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
1064,
12,
2890,
16,
1501,
16,
2826,
9987,
4672,
364,
366,
316,
365,
18,
11046,
30,
1501,
273,
366,
18,
2567,
1064,
12,
3175,
16,
2826,
9987,
13,
225,
327,
609,
12,
3175,
13,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
1064,
12,
2890,
16,
1501,
16,
2826,
9987,
4672,
364,
366,
316,
365,
18,
11046,
30,
1501,
273,
366,
18,
2567,
1064,
12,
3175,
16,
2826,
9987,
13,
225,
327,
609,
12,
3175,
13,
2,... |
params = decoders[0][1](params) return strPattern % params | return strPattern % MakeParameter(decoders[0], params) def MakeParameter( decoder, param ): newValue = decoder[1](param) if len(decoder) == 4 and len(newValue) < decoder[3]: newValue = decoder[0][0] * (decoder[3]-len(newValue)) + newValue return newValue | def dh( value, pattern, encf, decf, filter = None ): """This function helps in year parsing. Usually it will be used as a lambda call in a map: lambda v: dh( v, u'pattern string', encodingFunc, decodingFunc ) encodingFunc: Converts from an integer parameter to another integer or a tuple of integers. Depending on the pattern, each integer will be converted to a proper string representation, and will be passed as a format argument to the pattern: pattern % encodingFunc(value) This function is a complement of decodingFunc. decodingFunc: Converts a tuple/list of non-negative integers found in the original value string into a normalized value. The normalized value can be passed right back into dh() to produce the original string. This function is a complement of encodingFunc. dh() interprets %d as a decimal and %s as a roman numeral number. """ compPattern, strPattern, decoders = escapePattern2(pattern) if type(value) in _stringTypes: m = compPattern.match(value) if m: # decode each found value using provided decoder values = [ decoders[i][2](m.group(i+1)) for i in range(len(decoders))] decValue = decf( values ) if decValue in _stringTypes: raise AssertionError("Decoder must not return a string!") # recursive call to re-encode and see if we get the original (may through filter exception) if value == dh(decValue, pattern, encf, decf, filter): return decValue raise ValueError("reverse encoding didn't match") else: # Encode an integer value into a textual form. # This will be called from outside as well as recursivelly to verify parsed value if filter and not filter(value): raise ValueError("value %i is not allowed" % value) params = encf(value) if type(params) in _listTypes: if len(params) != len(decoders): raise AssertionError("parameter count (%d) does not match decoder count (%d)" % (len(params), len(decoders))) # convert integer parameters into their textual representation params = [ decoders[i][1](params[i]) for i in range(len(params)) ] return strPattern % tuple(params) else: if 1 != len(decoders): raise AssertionError("parameter count (%d) does not match decoder count (%d)" % (len(params), len(decoders))) # convert integer parameter into its textual representation params = decoders[0][1](params) return strPattern % params | 35e849e3733e60f2f60a2ad1815d333ced4b2c1b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/35e849e3733e60f2f60a2ad1815d333ced4b2c1b/date.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11007,
12,
460,
16,
1936,
16,
2446,
74,
16,
2109,
74,
16,
1034,
273,
599,
262,
30,
3536,
2503,
445,
21814,
316,
3286,
5811,
18,
29785,
518,
903,
506,
1399,
487,
279,
3195,
745,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11007,
12,
460,
16,
1936,
16,
2446,
74,
16,
2109,
74,
16,
1034,
273,
599,
262,
30,
3536,
2503,
445,
21814,
316,
3286,
5811,
18,
29785,
518,
903,
506,
1399,
487,
279,
3195,
745,
316,
... |
return curses.tparm(curses.tigetstr("setf"), 1) | return curses.tparm(SETF, 1) | def GetColor(color = None): if not HAVE_COLORS: return "" if color != None: color = color.lower() if (color == "blue"): return curses.tparm(curses.tigetstr("setf"), 1) elif (color == "green"): return curses.tparm(curses.tigetstr("setf"), 2) elif (color == "cyan"): return curses.tparm(curses.tigetstr("setf"), 3) elif (color == "red"): return curses.tparm(curses.tigetstr("setf"), 4) elif (color == "magenta"): return curses.tparm(curses.tigetstr("setf"), 5) elif (color == "yellow"): return curses.tparm(curses.tigetstr("setf"), 6) else: return curses.tparm(curses.tigetstr("sgr0")) | dc98a47cce179ee845b39ee597207fed290ca2b0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7242/dc98a47cce179ee845b39ee597207fed290ca2b0/makepandacore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2957,
12,
3266,
273,
599,
4672,
309,
486,
21926,
3412,
67,
10989,
55,
30,
327,
1408,
309,
2036,
480,
599,
30,
2036,
273,
2036,
18,
8167,
1435,
309,
261,
3266,
422,
315,
14081,
6,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2957,
12,
3266,
273,
599,
4672,
309,
486,
21926,
3412,
67,
10989,
55,
30,
327,
1408,
309,
2036,
480,
599,
30,
2036,
273,
2036,
18,
8167,
1435,
309,
261,
3266,
422,
315,
14081,
6,
... |
if isinstance(value, basestring): | if type(value) in STRING_TYPES: | def validate_vocabulary(self, instance, value, errors): """Make sure value is inside the allowed values for a given vocabulary""" error = None if value: # coerce value into a list called values values = value if isinstance(value, basestring): values = [value] elif isinstance(value, bool): values = [str(value)] elif not isinstance(value, (tuple, list)): raise TypeError("Field value type error: %s" % type(value)) vocab = self.Vocabulary(instance) # filter empty values = [instance.unicodeEncode(v) for v in values if v.strip()] # extract valid values from vocabulary valids = [] for v in vocab: if isinstance(v, (tuple, list)): v = v[0] if not isinstance(v, basestring): v = str(v) valids.append(instance.unicodeEncode(v)) # check field values for val in values: error = True for v in valids: if val == v: error = None break | 4e613e1c65e9c8de2fd94b5998dd4c5732279a60 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12165/4e613e1c65e9c8de2fd94b5998dd4c5732279a60/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
15913,
13631,
12,
2890,
16,
791,
16,
460,
16,
1334,
4672,
3536,
6464,
3071,
460,
353,
4832,
326,
2935,
924,
364,
279,
864,
20906,
8395,
555,
273,
599,
309,
460,
30,
468,
1227... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
15913,
13631,
12,
2890,
16,
791,
16,
460,
16,
1334,
4672,
3536,
6464,
3071,
460,
353,
4832,
326,
2935,
924,
364,
279,
864,
20906,
8395,
555,
273,
599,
309,
460,
30,
468,
1227... |
if node.__class__ == Table and node.numcols == 1: | if node.__class__ == Table and node.numcols == 1 and not 'box' in node.attributes.get('class', ''): | def transformSingleColTables(self, node): | b15c6f898277d59dd3338437ebddcf4380491bf0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/b15c6f898277d59dd3338437ebddcf4380491bf0/treecleaner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2510,
5281,
914,
6905,
12,
2890,
16,
756,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2510,
5281,
914,
6905,
12,
2890,
16,
756,
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,... |
gobject.type_register(HPaned) self.register_signals(HPaned) | def __init__(self): """Class initialiser""" self.terminator = Terminator() self.cnxids = {} self.signals.append({'name': 'resize-term', 'flags': gobject.SIGNAL_RUN_LAST, 'return_type': gobject.TYPE_NONE, 'param_types': (gobject.TYPE_STRING,)}) | 3059682fb74ce2172033f2f8372cf89edf2db310 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6502/3059682fb74ce2172033f2f8372cf89edf2db310/paned.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
3536,
797,
2172,
15914,
8395,
365,
18,
9505,
639,
273,
6820,
4240,
1435,
365,
18,
10305,
92,
2232,
273,
2618,
365,
18,
29659,
18,
6923,
12590,
11,
529,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
3536,
797,
2172,
15914,
8395,
365,
18,
9505,
639,
273,
6820,
4240,
1435,
365,
18,
10305,
92,
2232,
273,
2618,
365,
18,
29659,
18,
6923,
12590,
11,
529,
... | |
0 1 1 1 1 2 1 1 2 4 1 1 3 8 1 1 4 16 1 1 5 32 1 1 6 64 1 1 7 128 1 1 8 256 1 1 9 512 1 1 | 0 1 True True 1 2 True True 2 4 True True 3 8 True True 4 16 True True 5 32 True True 6 64 True True 7 128 True True 8 256 True True 9 512 True True | >>> def gencopy(iterator): | e45d59841e57ddcd31a7a0fb570f345b80c8796f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6753/e45d59841e57ddcd31a7a0fb570f345b80c8796f/test_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
314,
1331,
1101,
12,
9838,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
314,
1331,
1101,
12,
9838,
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,
-1... |
self.Spacer = wx.Panel(id=ID_MAPVARIABLEDIALOGSPACER, | self.Spacer = wx.Panel(id=ID_CREATENODEDIALOGSPACER, | def _init_ctrls(self, prnt): wx.Dialog.__init__(self, id=ID_CREATENODEDIALOG, name='CreateNodeDialog', parent=prnt, pos=wx.Point(376, 223), size=wx.Size(450, 350), style=wx.DEFAULT_DIALOG_STYLE, title='Create a new Node') self.SetClientSize(wx.Size(450, 350)) | 0573abd62e11a23398c1fc33fc728b45c987c7aa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/116/0573abd62e11a23398c1fc33fc728b45c987c7aa/commondialogs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
7075,
18,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
33,
734,
67,
5458,
789,
1157,
1212,
2056,
6365,
13369,
16,
508,
2218,
1684,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
7075,
18,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
33,
734,
67,
5458,
789,
1157,
1212,
2056,
6365,
13369,
16,
508,
2218,
1684,... |
log.info("ERROR: Missing URL for feed %s" % section) | log.info("ERROR: Missing URL for feed %s" % name) | def parse_feed(self, section): log.debug("Found feed: %s" % section) try: URL = self.get("", section, "URL", "", 1) except: log.info("ERROR: Missing URL for feed %s" % section) return | ebd32b858c287344c0216a2e6aba5eceabfbedcb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12359/ebd32b858c287344c0216a2e6aba5eceabfbedcb/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
7848,
12,
2890,
16,
2442,
4672,
613,
18,
4148,
2932,
2043,
4746,
30,
738,
87,
6,
738,
2442,
13,
775,
30,
1976,
273,
365,
18,
588,
2932,
3113,
2442,
16,
315,
1785,
3113,
234... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
7848,
12,
2890,
16,
2442,
4672,
613,
18,
4148,
2932,
2043,
4746,
30,
738,
87,
6,
738,
2442,
13,
775,
30,
1976,
273,
365,
18,
588,
2932,
3113,
2442,
16,
315,
1785,
3113,
234... |
width = fm.size(QtCore.Qt.AlignTop, 'A'*(len (self.values))).width() | width = self.col_width * len(self.values) | def update_pixmap(self): ''' to refresh? ''' | 01b02f62739e368f025e3daa5f7a9557de7876cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14016/01b02f62739e368f025e3daa5f7a9557de7876cd/histface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
14861,
1458,
12,
2890,
4672,
9163,
358,
4460,
35,
9163,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
14861,
1458,
12,
2890,
4672,
9163,
358,
4460,
35,
9163,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if kw.pop('document_only', False): self.__namespaceSupport.reset(**kw) | self.__namespaceSupport.reset(**kw) | def reset (self, **kw): """Reset this instance to the state it was when created. | 92c1937ca0956f393b34dc36c44b058bef23c9d2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7171/92c1937ca0956f393b34dc36c44b058bef23c9d2/domutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
261,
2890,
16,
2826,
9987,
4672,
3536,
7013,
333,
791,
358,
326,
919,
518,
1703,
1347,
2522,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
261,
2890,
16,
2826,
9987,
4672,
3536,
7013,
333,
791,
358,
326,
919,
518,
1703,
1347,
2522,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
styleIdNames = eval(cfg.Read('styleidnames')) | styleIdNames = readPyValFromConfig(cfg, 'styleidnames') | def initFromConfig(configFile, lang): cfg = wxFileConfig(localFilename=configFile, style=wxCONFIG_USE_LOCAL_FILE) cfg.SetExpandEnvVars(false) # read in all group names for this language groupPrefix = 'style.%s'%lang gpLen = len(groupPrefix) predefStyleGroupNames, otherLangStyleGroupNames = [], [] cont, val, idx = cfg.GetFirstGroup() while cont: if val != groupPrefix and len(val) >= 5 and val[:5] == 'style': if len(val) > gpLen and val[:gpLen] == groupPrefix: predefStyleGroupNames.append(val) else: otherLangStyleGroupNames.append(val) cont, val, idx = cfg.GetNextGroup(idx) # read in common elements commonDefs = eval(cfg.Read(commonDefsFile)) assert type(commonDefs) is type({}), \ 'Common definitions (%s) not a valid dict'%commonDefsFile commonStyleIdNames = eval(cfg.Read('common.styleidnames')) assert type(commonStyleIdNames) is type({}), \ 'Common definitions (%s) not a valid dict'%'common.styleidnames' # Lang spesific settings cfg.SetPath(lang) styleIdNames = eval(cfg.Read('styleidnames')) assert type(commonStyleIdNames) is type({}), \ 'Not a valid dict [%s] styleidnames)'%lang styleIdNames.update(commonStyleIdNames) braceInfo = eval(cfg.Read('braces')) assert type(commonStyleIdNames) is type({}), \ 'Not a valid dict [%s] braces)'%lang displaySrc = cfg.Read('displaysrc') lexer = eval(cfg.Read('lexer')) keywords = cfg.Read('keywords') cfg.SetPath('') # read in current styles styles = readStylesFromConfig(cfg, groupPrefix) # read in predefined styles predefStyleGroups = {} for group in predefStyleGroupNames: predefStyleGroups[group] = readStylesFromConfig(cfg, group) # read in all other style sections otherLangStyleGroups = {} for group in otherLangStyleGroupNames: otherLangStyleGroups[group] = readStylesFromConfig(cfg, group) return (cfg, commonDefs, styleIdNames, styles, predefStyleGroupNames, predefStyleGroups, otherLangStyleGroupNames, otherLangStyleGroups, displaySrc, lexer, keywords, braceInfo) | 44b2e06aa783edb8e94a97a152c4949f8c1b0b78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/44b2e06aa783edb8e94a97a152c4949f8c1b0b78/STCStyleEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
22102,
12,
1425,
812,
16,
3303,
4672,
2776,
273,
7075,
812,
809,
12,
3729,
5359,
33,
1425,
812,
16,
2154,
33,
27226,
7203,
67,
8001,
67,
14922,
67,
3776,
13,
2776,
18,
694,
12271... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
22102,
12,
1425,
812,
16,
3303,
4672,
2776,
273,
7075,
812,
809,
12,
3729,
5359,
33,
1425,
812,
16,
2154,
33,
27226,
7203,
67,
8001,
67,
14922,
67,
3776,
13,
2776,
18,
694,
12271... |
self.sio.seek(0) msg = p.parse(self.sio) | msg = p.parsestr(data) | def send(self, node, count): '''send message.''' | 94b3f5e163e807d2f1445d9c722b0d601f409d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/94b3f5e163e807d2f1445d9c722b0d601f409d57/notify.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
12,
2890,
16,
756,
16,
1056,
4672,
9163,
4661,
883,
1093,
6309,
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,
1366,
12,
2890,
16,
756,
16,
1056,
4672,
9163,
4661,
883,
1093,
6309,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print "queue woke up, queue size is %d"%len(self.queue) | def run(self): while 1: self.event.wait() print "queue woke up, queue size is %d"%len(self.queue) while self.queue: msg,target = self.queue.pop(0) self.connection.privmsg(target, msg) time.sleep(1) self.event.clear() | bfaaafd52d80254f77b5c05ff22ebc0e964dfe0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3953/bfaaafd52d80254f77b5c05ff22ebc0e964dfe0b/wolfbot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
1323,
404,
30,
365,
18,
2575,
18,
7048,
1435,
1323,
365,
18,
4000,
30,
1234,
16,
3299,
273,
365,
18,
4000,
18,
5120,
12,
20,
13,
365,
18,
4071,
18,
11365,
3576,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1086,
12,
2890,
4672,
1323,
404,
30,
365,
18,
2575,
18,
7048,
1435,
1323,
365,
18,
4000,
30,
1234,
16,
3299,
273,
365,
18,
4000,
18,
5120,
12,
20,
13,
365,
18,
4071,
18,
11365,
3576,... | |
print file | def write(self, s): pass | 1952ef9e499f9b381b678b0023c211179fdf514c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9834/1952ef9e499f9b381b678b0023c211179fdf514c/talgettext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
272,
4672,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
272,
4672,
1342,
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... | |
for proc in [ "I386", "AMD64", "PPC32", "PPC64", "SPARC32", "SPARC64" ]: | for proc in [ "MIPS64", "I386", "AMD64", "PPC32", "PPC64", "SPARC32", "SPARC64" ]: | def _GetAllTargets(): # legacy naming Targets = [ "NT386", "NT386GNU", "NT386MINGNU", "LINUXLIBC6", "SOLsun", "SOLgnu" ] for proc in [ "PPC", ]: for os in [ "OPENBSD", "NETBSD", "FREEBSD", "DARWIN", "LINUX", "NT" ]: Targets += [proc + "_" + os] # systematic naming for proc in [ "I386", "AMD64", "PPC32", "PPC64" ]: for os in [ "DARWIN" ]: Targets += [proc + "_" + os] for proc in [ "I386", "AMD64", "PPC32", "PPC64", "SPARC32", "SPARC64" ]: for os in [ "OPENBSD", "NETBSD", "FREEBSD" ]: Targets += [proc + "_" + os] for proc in [ "I386", "AMD64", "PPC32", "PPC64", "SPARC32", "SPARC64" ]: for os in [ "LINUX" ]: Targets += [proc + "_" + os] for proc in [ "I386", "AMD64", "IA64", "PPC32", "MIPS", "ALPHA32" ]: for os in [ "NT", "CYGWIN" ]: Targets += [proc + "_" + os] for proc in [ "I386", "AMD64", "SPARC32", "SPARC64" ]: for os in [ "SOLARIS" ]: Targets += [proc + "_" + os] return Targets | e5dd2e590d47712e5f74eb2b94a7ba475d779485 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9328/e5dd2e590d47712e5f74eb2b94a7ba475d779485/pylib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
21413,
9432,
13332,
225,
468,
8866,
14634,
225,
31683,
273,
306,
315,
1784,
23,
5292,
3113,
315,
1784,
23,
5292,
8318,
57,
3113,
315,
1784,
23,
5292,
49,
1360,
50,
57,
3113,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
21413,
9432,
13332,
225,
468,
8866,
14634,
225,
31683,
273,
306,
315,
1784,
23,
5292,
3113,
315,
1784,
23,
5292,
8318,
57,
3113,
315,
1784,
23,
5292,
49,
1360,
50,
57,
3113,
315,
... |
times.append(secs/count) flops.append(size) | times_gpu.append(secs/count) flops_gpu.append(size) | def main(): drv.init() assert drv.Device.count() >= 1 ctx = drv.Device(0).make_context() import pycuda.gpuarray as gpuarray # make sure all the kernels are compiled gpuarray.GPUArray.compile_kernels() print "done compiling" sizes = [] times = [] flops = [] flopsCPU = [] timesCPU = [] for power in range(10, 25): # 24 size = 1<<power print size sizes.append(size) a = gpuarray.zeros((size,), dtype=numpy.float32) b = gpuarray.zeros((size,), dtype=numpy.float32) b.fill(1) if power > 20: count = 100 else: count = 1000 #start timer start = drv.Event() end = drv.Event() start.record() #cuda operation which adds two arrays over count time to get an average for i in range(count): a+b #stop timer end.record() end.synchronize() #calculate used time secs = start.time_till(end)*1e-3 times.append(secs/count) flops.append(size) #cpu operations which adds two arrays aCpu = numpy.random.randn(size).astype(numpy.float32) bCpu = numpy.random.randn(size).astype(numpy.float32) #start timer start = drv.Event() end = drv.Event() start.record() #cpu operation which adds two arrays over count time to get an average for i in range(count): aCpu + bCpu #stop timer end.record() end.synchronize() #calculate used time secs = start.time_till(end)*1e-3 #add results to variable timesCPU.append(secs/count) flopsCPU.append(size) #calculate pseudo flops flops = [f/t for f, t in zip(flops,times)] flopsCPU = [f/t for f, t in zip(flopsCPU,timesCPU)] #print the data out from pytools import Table tbl = Table() tbl.add_row(("Size", "Time GPU", "Size/Time GPU", "Time CPU","Size/Time CPU","GPU vs CPU speedup")) for s, t, f,tCpu,fCpu in zip(sizes, times, flops,timesCPU,flopsCPU): tbl.add_row((s,t,f,tCpu,fCpu,f/fCpu)) print tbl | 055a09257e2bd88ee7af05b640f4da2d43cfda2f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12870/055a09257e2bd88ee7af05b640f4da2d43cfda2f/test_gpuarray_speed.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
302,
4962,
18,
2738,
1435,
1815,
302,
4962,
18,
3654,
18,
1883,
1435,
1545,
404,
1103,
273,
302,
4962,
18,
3654,
12,
20,
2934,
6540,
67,
2472,
1435,
225,
1930,
2395,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
302,
4962,
18,
2738,
1435,
1815,
302,
4962,
18,
3654,
18,
1883,
1435,
1545,
404,
1103,
273,
302,
4962,
18,
3654,
12,
20,
2934,
6540,
67,
2472,
1435,
225,
1930,
2395,
71,
1... |
raise ValueError, "name is too long (>%d)" \ % (LENGTH_NAME) | raise ValueError("name is too long (>%d)" % (LENGTH_NAME)) | def addfile(self, tarinfo, fileobj=None): """Add the TarInfo object `tarinfo' to the archive. If `fileobj' is given, tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects using gettarinfo(). On Windows platforms, `fileobj' should always be opened with mode 'rb' to avoid irritation about the file size. """ self._check("aw") | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
768,
12,
2890,
16,
8232,
1376,
16,
17041,
33,
7036,
4672,
3536,
986,
326,
20334,
966,
733,
1375,
11718,
1376,
11,
358,
326,
5052,
18,
971,
1375,
768,
2603,
11,
353,
864,
16,
8232,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
768,
12,
2890,
16,
8232,
1376,
16,
17041,
33,
7036,
4672,
3536,
986,
326,
20334,
966,
733,
1375,
11718,
1376,
11,
358,
326,
5052,
18,
971,
1375,
768,
2603,
11,
353,
864,
16,
8232,... |
``character_table_values(G)``\*`[v_1, ..., v_n] = [c_1, ..., c_n]`, where `[v_1, ...,v_n]` = ``character_table_values(G)`` `^{-1}[c_1, ...,c_n]`. | ``character_table_values(G)``\* [v_1, ..., v_n] = [c_1, ..., c_n], where [v_1, ..., v_n] = ``character_table_values(G)`` ^(-1)[c_1, ..., c_n]. | def character_table(self): r""" Returns the matrix of values of the irreducible characters of a permutation group `G` at the conjugacy classes of `G`. The columns represent the the conjugacy classes of `G` and the rows represent the different irreducible characters in the ordering given by GAP. EXAMPLES:: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) sage: G.order() 12 sage: G.character_table() [ 1 1 1 1] [ 1 1 -zeta3 - 1 zeta3] [ 1 1 zeta3 -zeta3 - 1] [ 3 -1 0 0] sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) sage: CT = gap(G).CharacterTable() Type ``print gap.eval("Display(%s)"%CT.name())`` to display this nicely. :: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3,4)]]) sage: G.order() 8 sage: G.character_table() [ 1 1 1 1 1] [ 1 -1 -1 1 1] [ 1 -1 1 -1 1] [ 1 1 -1 -1 1] [ 2 0 0 0 -2] sage: CT = gap(G).CharacterTable() Again, type ``print gap.eval("Display(%s)"%CT.name())`` to display this nicely. :: sage: SymmetricGroup(2).character_table() [ 1 -1] [ 1 1] sage: SymmetricGroup(3).character_table() [ 1 -1 1] [ 2 0 -1] [ 1 1 1] sage: SymmetricGroup(5).character_table() [ 1 -1 1 1 -1 -1 1] [ 4 -2 0 1 1 0 -1] [ 5 -1 1 -1 -1 1 0] [ 6 0 -2 0 0 0 1] [ 5 1 1 -1 1 -1 0] [ 4 2 0 1 -1 0 -1] [ 1 1 1 1 1 1 1] sage: list(AlternatingGroup(6).character_table()) [(1, 1, 1, 1, 1, 1, 1), (5, 1, 2, -1, -1, 0, 0), (5, 1, -1, 2, -1, 0, 0), (8, 0, -1, -1, 0, zeta5^3 + zeta5^2 + 1, -zeta5^3 - zeta5^2), (8, 0, -1, -1, 0, -zeta5^3 - zeta5^2, zeta5^3 + zeta5^2 + 1), (9, 1, 0, 0, 1, -1, -1), (10, -2, 1, 1, 0, 0, 0)] Suppose that you have a class function `f(g)` on `G` and you know the values `v_1, ..., v_n` on the conjugacy class elements in ``conjugacy_classes_representatives(G)`` = `[g_1, \ldots, g_n]`. Since the irreducible characters `\rho_1, \ldots, \rho_n` of `G` form an `E`-basis of the space of all class functions (`E` a "sufficiently large" cyclotomic field), such a class function is a linear combination of these basis elements, `f = c_1\rho_1 + \cdots + c_n\rho_n`. To find the coefficients `c_i`, you simply solve the linear system ``character_table_values(G)``\*`[v_1, ..., v_n] = [c_1, ..., c_n]`, where `[v_1, ...,v_n]` = ``character_table_values(G)`` `^{-1}[c_1, ...,c_n]`. AUTHORS: - David Joyner and William Stein (2006-01-04) | f5f8be9435d58a2a709e6aa602d3c0e6ac097c6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/f5f8be9435d58a2a709e6aa602d3c0e6ac097c6a/permgroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3351,
67,
2121,
12,
2890,
4672,
436,
8395,
2860,
326,
3148,
434,
924,
434,
326,
9482,
1118,
5286,
1523,
3949,
434,
279,
17440,
1041,
1375,
43,
68,
622,
326,
10550,
637,
3505,
3318,
434,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3351,
67,
2121,
12,
2890,
4672,
436,
8395,
2860,
326,
3148,
434,
924,
434,
326,
9482,
1118,
5286,
1523,
3949,
434,
279,
17440,
1041,
1375,
43,
68,
622,
326,
10550,
637,
3505,
3318,
434,
... |
elif key in ('iband', 'nbmod', 'kpuse'): | elif key in ('iband', 'kpuse'): | def write_incar(self, atoms, **kwargs): """Writes the INCAR file.""" p = self.incar_parameters incar = open('INCAR', 'w') incar.write('INCAR created by Atomic Simulation Environment\n') for key, val in p.items(): if val is not None: incar.write(' '+key.upper()+' = ') # special cases: if key in ('dipol', 'eint'): [incar.write('%.4f ' % x) for x in val] elif key in ('iband', 'nbmod', 'kpuse'): [incar.write('%i ' % x) for x in val] elif key == 'rwigs': [incar.write('%.4f ' % rwigs) for rwigs in val] if len(val) != self.natoms: raise RuntimeError('Incorrect number of magnetic moments') else: if type(val)==type(bool()): if val: incar.write('.TRUE.') else: incar.write('.FALSE.') else: incar.write('%s' % p[key]) incar.write('\n') if self.spinpol and not p['ispin']: incar.write(' ispin = 2\n'.upper()) # Write out initial magnetic moments magmom = atoms.get_initial_magnetic_moments()[self.sort] list = [[1, magmom[0]]] for n in range(1, len(magmom)): if magmom[n] == magmom[n-1]: list[-1][0] += 1 else: list.append([1, magmom[n]]) incar.write(' magmom = '.upper()) [incar.write('%i*%.4f ' % (mom[0], mom[1])) for mom in list] incar.write('\n') incar.close() | fd2f269ceb96ee9588e9ab0d4d0b4ab41343a533 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5735/fd2f269ceb96ee9588e9ab0d4d0b4ab41343a533/vasp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
9523,
297,
12,
2890,
16,
9006,
16,
2826,
4333,
4672,
3536,
8368,
326,
2120,
39,
985,
585,
12123,
293,
273,
365,
18,
9523,
297,
67,
3977,
7290,
297,
273,
1696,
2668,
23213,
98... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
9523,
297,
12,
2890,
16,
9006,
16,
2826,
4333,
4672,
3536,
8368,
326,
2120,
39,
985,
585,
12123,
293,
273,
365,
18,
9523,
297,
67,
3977,
7290,
297,
273,
1696,
2668,
23213,
98... |
[Ideal (e + d + c + b + a, 275*d^2 + 825*d*a + 550*b^6*a + 1650*b^5*a^2 + 275*b^4*a^3 - 550*b^3*a^4 + 275*b^2 - 566*b*a^11 - 69003*b*a^6 + 69019*b*a - 1467*a^12 - 178981*a^7 + 179073*a^2, 275*c^3 + 550*c^2*a - 550*c*a^2 + 275*b^6*a^2 + 550*b^5*a^3 - 550*b^4*a^4 + 550*b^2*a - 232*b*a^12 - 28336*b*a^7 + 28018*b*a^2 - 568*a^13 - 69289*a^8 + 69307*a^3, 55*b^7 + 165*b^6*a + 55*b^5*a^2 - 55*b^2 - 398*b*a^11 - 48554*b*a^6 + 48787*b*a - 1042*a^12 - 127116*a^7 + 128103*a^2, a - 1) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (e + d + c + b + a, 275*d^2 + 825*d*a + 550*b^6*a + 1650*b^5*a^2 + 275*b^4*a^3 - 550*b^3*a^4 + 275*b^2 - 566*b*a^11 - 69003*b*a^6 + 69019*b*a - 1467*a^12 - 178981*a^7 + 179073*a^2, 275*c^3 + 550*c^2*a - 550*c*a^2 + 275*b^6*a^2 + 550*b^5*a^3 - 550*b^4*a^4 + 550*b^2*a - 232*b*a^12 - 28336*b*a^7 + 28018*b*a^2 - 568*a^13 - 69289*a^8 + 69307*a^3, 55*b^7 + 165*b^6*a + 55*b^5*a^2 - 55*b^2 - 398*b*a^11 - 48554*b*a^6 + 48787*b*a - 1042*a^12 - 127116*a^7 + 128103*a^2, a^2 + 3*a + 1) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (e + d + c + b + a, 275*d^2 + 825*d*a + 550*b^6*a + 1650*b^5*a^2 + 275*b^4*a^3 - 550*b^3*a^4 + 275*b^2 - 566*b*a^11 - 69003*b*a^6 + 69019*b*a - 1467*a^12 - 178981*a^7 + 179073*a^2, 275*c^3 + 550*c^2*a - 550*c*a^2 + 275*b^6*a^2 + 550*b^5*a^3 - 550*b^4*a^4 + 550*b^2*a - 232*b*a^12 - 28336*b*a^7 + 28018*b*a^2 - 568*a^13 - 69289*a^8 + 69307*a^3, 55*b^7 + 165*b^6*a + 55*b^5*a^2 - 55*b^2 - 398*b*a^11 - 48554*b*a^6 + 48787*b*a - 1042*a^12 - 127116*a^7 + 128103*a^2, a^4 - 4*a^3 + 6*a^2 + a + 1) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (e + d + c + b + a, 275*d^2 + 825*d*a + 550*b^6*a + 1650*b^5*a^2 + 275*b^4*a^3 - 550*b^3*a^4 + 275*b^2 - 566*b*a^11 - 69003*b*a^6 + 69019*b*a - 1467*a^12 - 178981*a^7 + 179073*a^2, 275*c^3 + 550*c^2*a - 550*c*a^2 + 275*b^6*a^2 + 550*b^5*a^3 - 550*b^4*a^4 + 550*b^2*a - 232*b*a^12 - 28336*b*a^7 + 28018*b*a^2 - 568*a^13 - 69289*a^8 + 69307*a^3, 55*b^7 + 165*b^6*a + 55*b^5*a^2 - 55*b^2 - 398*b*a^11 - 48554*b*a^6 + 48787*b*a - 1042*a^12 - 127116*a^7 + 128103*a^2, a^4 + a^3 + a^2 + a + 1) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (e + d + c + b + a, 275*d^2 + 825*d*a + 550*b^6*a + 1650*b^5*a^2 + 275*b^4*a^3 - 550*b^3*a^4 + 275*b^2 - 566*b*a^11 - 69003*b*a^6 + 69019*b*a - 1467*a^12 - 178981*a^7 + 179073*a^2, 275*c^3 + 550*c^2*a - 550*c*a^2 + 275*b^6*a^2 + 550*b^5*a^3 - 550*b^4*a^4 + 550*b^2*a - 232*b*a^12 - 28336*b*a^7 + 28018*b*a^2 - 568*a^13 - 69289*a^8 + 69307*a^3, 55*b^7 + 165*b^6*a + 55*b^5*a^2 - 55*b^2 - 398*b*a^11 - 48554*b*a^6 + 48787*b*a - 1042*a^12 - 127116*a^7 + 128103*a^2, a^4 + a^3 + 6*a^2 - 4*a + 1) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field] | [Ideal (a - 1, b - 1, c - 1, d^2 + 3*d + 1, e + d + 3) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a - 1, b - 1, c^2 + 3*c + 1, d + c + 3, e - 1) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a - 1, b^2 + 3*b + 1, c + b + 3, d - 1, e - 1) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a - 1, b^4 + b^3 + b^2 + b + 1, c - b^2, d - b^3, e + b^3 + b^2 + b + 1) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a^2 + 3*a + 1, b - 1, c - 1, d - 1, e + a + 3) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a^2 + 3*a + 1, b + a + 3, c - 1, d - 1, e - 1) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a^4 - 4*a^3 + 6*a^2 + a + 1, 11*b^2 - 6*b*a^3 + 26*b*a^2 - 41*b*a + 4*b + 8*a^3 - 31*a^2 + 40*a + 24, 11*c + 3*a^3 - 13*a^2 + 26*a - 2, 11*d + 3*a^3 - 13*a^2 + 26*a - 2, 11*e + 11*b - 6*a^3 + 26*a^2 - 41*a + 4) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a^4 + a^3 + a^2 + a + 1, b - 1, c + a^3 + a^2 + a + 1, d - a^3, e - a^2) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a^4 + a^3 + a^2 + a + 1, b - a, c - a, d^2 + 3*d*a + a^2, e + d + 3*a) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a^4 + a^3 + a^2 + a + 1, b - a, c^2 + 3*c*a + a^2, d + c + 3*a, e - a) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a^4 + a^3 + a^2 + a + 1, b^2 + 3*b*a + a^2, c + b + 3*a, d - a, e - a) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a^4 + a^3 + a^2 + a + 1, b^3 + b^2*a + b^2 + b*a^2 + b*a + b + a^3 + a^2 + a + 1, c + b^2*a^3 + b^2*a^2 + b^2*a + b^2, d - b^2*a^2 - b^2*a - b^2 - b*a^2 - b*a - a^2, e - b^2*a^3 + b*a^2 + b*a + b + a^2 + a) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field, Ideal (a^4 + a^3 + 6*a^2 - 4*a + 1, 11*b^2 - 6*b*a^3 - 10*b*a^2 - 39*b*a - 2*b - 16*a^3 - 23*a^2 - 104*a + 24, 11*c + 3*a^3 + 5*a^2 + 25*a + 1, 11*d + 3*a^3 + 5*a^2 + 25*a + 1, 11*e + 11*b - 6*a^3 - 10*a^2 - 39*a - 2) of Multivariate Polynomial Ring in e, d, c, b, a over Rational Field] | def triangular_decomposition(self, algorithm=None, singular=singular_default): r""" Decompose zero-dimensional ideal ``self`` into triangular sets. | 2e77da7bd3536d7d46d876604202e92fd26e21c9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/2e77da7bd3536d7d46d876604202e92fd26e21c9/multi_polynomial_ideal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6882,
13077,
67,
323,
24388,
12,
2890,
16,
4886,
33,
7036,
16,
10048,
33,
17835,
67,
1886,
4672,
436,
8395,
26824,
4150,
3634,
17,
31236,
23349,
12176,
2890,
10335,
1368,
6882,
13077,
1678... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6882,
13077,
67,
323,
24388,
12,
2890,
16,
4886,
33,
7036,
16,
10048,
33,
17835,
67,
1886,
4672,
436,
8395,
26824,
4150,
3634,
17,
31236,
23349,
12176,
2890,
10335,
1368,
6882,
13077,
1678... |
if hasattr(os, "symlink"): os.symlink( | os.remove(test_support.TESTFN + "2") f = open(test_support.TESTFN + "2", "wb") f.write("bar") f.close() self.assertIs( posixpath.samefile( | def test_samefile(self): f = open(test_support.TESTFN + "1", "wb") try: f.write("foo") f.close() self.assertIs( posixpath.samefile( test_support.TESTFN + "1", test_support.TESTFN + "1" ), True ) # If we don't have links, assume that os.stat doesn't return resonable # inode information and thus, that samefile() doesn't work if hasattr(os, "symlink"): os.symlink( test_support.TESTFN + "1", test_support.TESTFN + "2" ) self.assertIs( posixpath.samefile( test_support.TESTFN + "1", test_support.TESTFN + "2" ), True ) os.remove(test_support.TESTFN + "2") f = open(test_support.TESTFN + "2", "wb") f.write("bar") f.close() self.assertIs( posixpath.samefile( test_support.TESTFN + "1", test_support.TESTFN + "2" ), False ) finally: if not f.close(): f.close() try: os.remove(test_support.TESTFN + "1") except os.error: pass try: os.remove(test_support.TESTFN + "2") except os.error: pass | f8e88622cc87194c85117fc67584a2741a22071e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/f8e88622cc87194c85117fc67584a2741a22071e/test_posixpath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
14307,
768,
12,
2890,
4672,
284,
273,
1696,
12,
3813,
67,
13261,
18,
16961,
19793,
397,
315,
21,
3113,
315,
9464,
7923,
775,
30,
284,
18,
2626,
2932,
11351,
7923,
284,
18,
44... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14307,
768,
12,
2890,
4672,
284,
273,
1696,
12,
3813,
67,
13261,
18,
16961,
19793,
397,
315,
21,
3113,
315,
9464,
7923,
775,
30,
284,
18,
2626,
2932,
11351,
7923,
284,
18,
44... |
if milestone.has_key('due'): | if milestone.due: | def write_utctime(name, value, params={}): write_prop(name, strftime('%Y%m%dT%H%M%SZ', value), params) | 0a94dd46f24513b32b4a1644fbadca92beb35398 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9317/0a94dd46f24513b32b4a1644fbadca92beb35398/roadmap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
322,
21261,
12,
529,
16,
460,
16,
859,
12938,
4672,
1045,
67,
5986,
12,
529,
16,
10405,
29909,
61,
9,
81,
9,
23148,
9,
44,
9,
49,
9,
28830,
2187,
460,
3631,
859,
13,
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,
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,
1045,
67,
322,
21261,
12,
529,
16,
460,
16,
859,
12938,
4672,
1045,
67,
5986,
12,
529,
16,
10405,
29909,
61,
9,
81,
9,
23148,
9,
44,
9,
49,
9,
28830,
2187,
460,
3631,
859,
13,
2,
... |
vals = value.split() | if isinstance(value, types.TupleType): vals = list(value) else: vals = value.split() | def convert(self, value): '''Convert value from a string to the appropriate type.''' svt = type(self.value) if svt == type(value): # already the correct type return value if type(self.allowed_values) == types.TupleType and \ value in self.allowed_values: # already correct type return value if self.is_boolean(): if str(value) == "True" or value == 1: return True elif str(value) == "False" or value == 0: return False raise TypeError, self.name + " must be True or False" if self.multiple_values_allowed(): # This will fall apart if the allowed_value is a tuple, # but not a homogenous one... if type(self.allowed_values) in types.StringTypes: vals = list(self._split_values(value)) else: vals = value.split() if len(self.default_value) > 0: to_type = type(self.default_value[0]) else: to_type = types.StringType for i in range(0, len(vals)): vals[i] = self._convert(vals[i], to_type) return tuple(vals) else: return self._convert(value, svt) raise TypeError, self.name + " has an invalid type." | d0a33b43dcbb21c5167f949d90badedcdceb89b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/d0a33b43dcbb21c5167f949d90badedcdceb89b5/OptionsClass.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
12,
2890,
16,
460,
4672,
9163,
2723,
460,
628,
279,
533,
358,
326,
5505,
618,
1093,
6309,
5893,
88,
273,
618,
12,
2890,
18,
1132,
13,
309,
5893,
88,
422,
618,
12,
1132,
4672,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
12,
2890,
16,
460,
4672,
9163,
2723,
460,
628,
279,
533,
358,
326,
5505,
618,
1093,
6309,
5893,
88,
273,
618,
12,
2890,
18,
1132,
13,
309,
5893,
88,
422,
618,
12,
1132,
4672,
4... |
print(' WARNING: failed to listen on port %d, trying another' % (port, file=sys.__stderr__)) | print(' WARNING: failed to listen on port %d, ' % port + 'trying another', file=sys.__stderr__) | def bind_port(sock, host='', preferred_port=54321): """Try to bind the sock to a port. If we are running multiple tests and we don't try multiple ports, the test can fails. This makes the test more robust.""" # Find some random ports that hopefully no one is listening on. # Ideally each test would clean up after itself and not continue listening # on any ports. However, this isn't the case. The last port (0) is # a stop-gap that asks the O/S to assign a port. Whenever the warning # message below is printed, the test that is listening on the port should # be fixed to close the socket at the end of the test. # Another reason why we can't use a port is another process (possibly # another instance of the test suite) is using the same port. for port in [preferred_port, 9907, 10243, 32999, 0]: try: sock.bind((host, port)) if port == 0: port = sock.getsockname()[1] return port except socket.error as e: (err, msg) = e.args if err != errno.EADDRINUSE: raise print(' WARNING: failed to listen on port %d, trying another' % (port, file=sys.__stderr__)) raise TestFailed('unable to find port to listen on') | f01fe6915b329c1511548e99e0e4d34ac423f9b3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/f01fe6915b329c1511548e99e0e4d34ac423f9b3/test_support.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1993,
67,
655,
12,
15031,
16,
1479,
2218,
2187,
9119,
67,
655,
33,
6564,
1578,
21,
4672,
3536,
7833,
358,
1993,
326,
7313,
358,
279,
1756,
18,
225,
971,
732,
854,
3549,
3229,
7434,
471... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1993,
67,
655,
12,
15031,
16,
1479,
2218,
2187,
9119,
67,
655,
33,
6564,
1578,
21,
4672,
3536,
7833,
358,
1993,
326,
7313,
358,
279,
1756,
18,
225,
971,
732,
854,
3549,
3229,
7434,
471... |
if sample and type(sample[0]) not in (TupleType, ListType): | if sample and not isinstance((sample[0]), (list, tuple)): | def Vocabulary(self, content_instance=None): """ Returns a DisplayList. | 6bf0b4d803f7a6c42f16af81053d806d99f67096 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12165/6bf0b4d803f7a6c42f16af81053d806d99f67096/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
776,
23348,
12,
2890,
16,
913,
67,
1336,
33,
7036,
4672,
3536,
2860,
279,
9311,
682,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
776,
23348,
12,
2890,
16,
913,
67,
1336,
33,
7036,
4672,
3536,
2860,
279,
9311,
682,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cmd = "%s %s > %s 2>&1" % (editor, rcfile, devnull) | cmd = "%s %s > %s 2>&1" % (editor, RCFILE, devnull) | def edit(e): '''Edit the rc file and reload''' editor = CONFIG["editor"] if platform == "win32": devnull = "nul" else: devnull = "/dev/null" if not editor: showerror("No Editor", "No editor is configured. Try setting " "BCD_EDITOR environment variable") return try: cmd = "%s %s > %s 2>&1" % (editor, rcfile, devnull) system(cmd) except OSError: showerror("Editor Problem", "Error running editor") return reload(e.widget) | 31b832cbb68db6c0fd68701c1d3c7b8e7b6ec9b4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2657/31b832cbb68db6c0fd68701c1d3c7b8e7b6ec9b4/bcd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
12,
73,
4672,
9163,
4666,
326,
4519,
585,
471,
7749,
26418,
4858,
273,
9128,
9614,
9177,
11929,
309,
4072,
422,
315,
8082,
1578,
6877,
4461,
2011,
273,
315,
82,
332,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
12,
73,
4672,
9163,
4666,
326,
4519,
585,
471,
7749,
26418,
4858,
273,
9128,
9614,
9177,
11929,
309,
4072,
422,
315,
8082,
1578,
6877,
4461,
2011,
273,
315,
82,
332,
6,
469,
30,
... |
c.ConnectNode(node) | self._ConnectNode(c, node) | def call_instance_run_rename(self, node, inst, old_name): """Run the OS rename script for an instance. | 253482126e14ec90848550d2d2005740e45f62a8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/253482126e14ec90848550d2d2005740e45f62a8/rpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
67,
1336,
67,
2681,
67,
18539,
12,
2890,
16,
756,
16,
1804,
16,
1592,
67,
529,
4672,
3536,
1997,
326,
5932,
6472,
2728,
364,
392,
791,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
67,
1336,
67,
2681,
67,
18539,
12,
2890,
16,
756,
16,
1804,
16,
1592,
67,
529,
4672,
3536,
1997,
326,
5932,
6472,
2728,
364,
392,
791,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
- The pari special structure \emph{bid}. | - The pari special structure ``bid``. | def _pari_bid_(self, flag=1): """ Returns the pari structure \emph{bid} associated to the ideal self. | ef0819690a4fd01b3d6fba60378c1b5b3e6c0cda /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/ef0819690a4fd01b3d6fba60378c1b5b3e6c0cda/number_field_ideal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1065,
77,
67,
19773,
67,
12,
2890,
16,
2982,
33,
21,
4672,
3536,
2860,
326,
779,
77,
3695,
521,
351,
844,
95,
19773,
97,
3627,
358,
326,
23349,
365,
18,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1065,
77,
67,
19773,
67,
12,
2890,
16,
2982,
33,
21,
4672,
3536,
2860,
326,
779,
77,
3695,
521,
351,
844,
95,
19773,
97,
3627,
358,
326,
23349,
365,
18,
2,
-100,
-100,
-100,
-10... |
def GetMemberName(id, member_offset): | def GetMemberNames(sid, member_offset): | def GetMemberName(id, member_offset): """ Get name of a member of a structure @param id: structure type ID @param member_offset: member offset. The offset can be any offset in the member. For example, is a member is 4 bytes long and starts at offset 2, then 2,3,4,5 denote the same structure member. @return: None if bad structure type ID is passed or no such member in the structure otherwise returns name of the specified member. """ s = idaapi.get_struc(id) if not s: return None m = idaapi.get_member(s, member_offset) if not m: return None return idaapi.get_member_name(m.id) | 244a3cd02a580c0095170004ec30e922f0d1a8a6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6984/244a3cd02a580c0095170004ec30e922f0d1a8a6/idc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
4419,
1557,
12,
7453,
16,
3140,
67,
3348,
4672,
3536,
968,
508,
434,
279,
3140,
434,
279,
3695,
225,
632,
891,
612,
30,
3695,
618,
1599,
632,
891,
3140,
67,
3348,
30,
3140,
1384,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
4419,
1557,
12,
7453,
16,
3140,
67,
3348,
4672,
3536,
968,
508,
434,
279,
3140,
434,
279,
3695,
225,
632,
891,
612,
30,
3695,
618,
1599,
632,
891,
3140,
67,
3348,
30,
3140,
1384,
... |
remuster='\[\[.*?\]]' | remuster='\[\[.*?\]\]' | def sectionheader(text,level,beginmarkup): #output of headinglevels to console if checklevels: print text.rstrip('\n') levelstr='='*level remuster='%s.*?%s' %(levelstr,levelstr) such=re.compile(remuster,re.DOTALL) for treffer in such.findall(text): sectiontitle=treffer.replace(levelstr,'') sectiontitle=sectiontitle.strip(' ') sectionid=sectiontitle.replace("'",'') sectionid=sectionid.replace("?",'') sectionid=sectionid.replace(",",'') sectionid=sectionid.replace("/",'-') sectionid=sectionid.replace(' ','-') sectionid=sectionid.replace('<quote>','').replace('</quote>','') sectionid=sectionid.replace('"','') sectionid=sectionid.replace('nbsp;','') sectionid=sectionid.replace('&','') sectionid=sectionid.replace('(','').replace(')','') sectionid=sectionid.lower() text=text.replace(treffer, '%s id="%s"><title>%s</title>' %(beginmarkup,sectionid,sectiontitle)) return text | caa8bf8158cb2a3ab25a09d0ff4a91b0baf37239 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1692/caa8bf8158cb2a3ab25a09d0ff4a91b0baf37239/wiki2docbook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2442,
3374,
12,
955,
16,
2815,
16,
10086,
15056,
4672,
468,
2844,
434,
910,
1714,
941,
87,
358,
2983,
309,
866,
12095,
30,
1172,
977,
18,
86,
6406,
2668,
64,
82,
6134,
1801,
701,
2218,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2442,
3374,
12,
955,
16,
2815,
16,
10086,
15056,
4672,
468,
2844,
434,
910,
1714,
941,
87,
358,
2983,
309,
866,
12095,
30,
1172,
977,
18,
86,
6406,
2668,
64,
82,
6134,
1801,
701,
2218,... |
log_classes = [] | log_categories = [] log_priority = None log_priority_arg = None | def main(argv): global log_classes initDynamicLoading() setDefaultJoystick() action = None # process command line options program = argv[0] all_args = argv[1:] log_classes = [] other_args = [] pause = 0 simdata_loglevel = "ALERT" config = findConfig() for arg in all_args: if arg == '--compile-data': action = compileData elif arg == '--dump-data': action = dumpData elif arg.startswith('--dump-data='): action = dumpData other_args.append(arg) elif arg == '--client-node': action = runClientNode elif arg == '--echo-server-node': action = runEchoServerNode elif arg == '--pause': pause = 1 elif arg in ("--help", "-h", "-help"): if action == None: print printUsage() print sys.exit(1) else: other_args.append(arg) elif arg.startswith("--config="): config = arg[9:] elif arg.startswith("--log="): log_classes.extend(arg[6:].split(':')) elif arg.startswith("--slog="): simdata_loglevel = arg[7:] else: other_args.append(arg) if action is None: action = runCSPSim loadSimData() SimData.log().setLogCategory(SimData.LOG_ALL) SimData.log().setLogPriority(SimData.LOG_DEBUG) loadCSP() try: simdata_loglevel = eval("SimData.LOG_%s" % simdata_loglevel.upper()) except: print "Invalid SimData logging level, defaulting to 'ALERT'" simdata_loglevel = SimData.LOG_ALERT SimData.log().setLogPriority(simdata_loglevel) print "Loading configuration from '%s'." % config if not CSP.openConfig(config): print "Unable to open primary configuration file (%s)" % config sys.exit(0) if pause: print "Hit <ctrl-break> to temporarily exit and set breakpoints." print "When you are done, continue execution and hit <enter>." sys.stdin.readline() action(other_args) | 94661ef29cba181b6a9e410a25555e266eb0174d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14747/94661ef29cba181b6a9e410a25555e266eb0174d/CSPSim.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
2552,
613,
67,
4701,
225,
1208,
9791,
10515,
1435,
9277,
46,
83,
1094,
1200,
1435,
225,
1301,
273,
599,
225,
468,
1207,
1296,
980,
702,
5402,
273,
5261,
63,
20,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
2552,
613,
67,
4701,
225,
1208,
9791,
10515,
1435,
9277,
46,
83,
1094,
1200,
1435,
225,
1301,
273,
599,
225,
468,
1207,
1296,
980,
702,
5402,
273,
5261,
63,
20,
... |
break | return | def read_from_client(client_address,server_address): while (True): # if this client or server is not connected break try: this_client = client[client_address][server_address] this_server = server[server_address] except KeyError: print "stopping read thread for client: "+client_address+" to server: "+server_address break # read from the client the amount specified in server_buff_size buffer_avialable = this_client['server_buff_size'] data='' try: data = this_client['socket'].recv(buffer_avialable) except Exception, e: if "socket" not in str(type(e)) and "Socket" not in str(e): raise print "SocketError occured reading from client: "+client_address drop_client(client_address,server_address) print "Dropped client: "+client_address break #stops this thread # if data is non null send it to the to_server_buffer if (len(data) != 0): frame = NATFrame() frame.initAsDataFrame(client_address,data) if TRACE: print "recived "+data+" from client" # send the frame as a string to the outgoing buffer this_server['to_server_buff'].append(frame.toString()) #decrement server_buf_size by len(data) (make atomic) this_client['buff_size_lock'].acquire() this_client['server_buff_size'] -= len(data) this_client['buff_size_lock'].release() sleep(SAMPLE_TIME) | af7b0bcb583945cc32ce1e6ac1cd2acbd599a1e9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/af7b0bcb583945cc32ce1e6ac1cd2acbd599a1e9/forwarder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
2080,
67,
2625,
12,
2625,
67,
2867,
16,
3567,
67,
2867,
4672,
1323,
261,
5510,
4672,
225,
468,
309,
333,
1004,
578,
1438,
353,
486,
5840,
898,
775,
30,
333,
67,
2625,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
2080,
67,
2625,
12,
2625,
67,
2867,
16,
3567,
67,
2867,
4672,
1323,
261,
5510,
4672,
225,
468,
309,
333,
1004,
578,
1438,
353,
486,
5840,
898,
775,
30,
333,
67,
2625,
273,
1... |
def getThisNodesInfoAsText(executableNode, label): | return "" def getThisNodesInfoAsText(currentNode, label): | def getThisNodesInfoAsTextTableLine(executableNode, label): r""" Create a formatted text string suitable for inclusion in a MediaWiki table """ labelNodeList = executableNode.getElementsByTagName(label) if labelNodeList.length > 0: labelNode = labelNodeList[0] # Only get the first one line = "|Program {0} || {1}\n{2}".format(label, getTextValuesFromNode(labelNode.childNodes), "|-\n") return line | bb4c200dee1fedd27e9c4ea11af1fe11302490e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12580/bb4c200dee1fedd27e9c4ea11af1fe11302490e5/SEMToMediaWiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
2503,
3205,
966,
1463,
1528,
1388,
1670,
12,
17751,
907,
16,
1433,
4672,
436,
8395,
1788,
279,
4955,
977,
533,
10631,
364,
26485,
316,
279,
6128,
25438,
1014,
3536,
1433,
19914,
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,
336,
2503,
3205,
966,
1463,
1528,
1388,
1670,
12,
17751,
907,
16,
1433,
4672,
436,
8395,
1788,
279,
4955,
977,
533,
10631,
364,
26485,
316,
279,
6128,
25438,
1014,
3536,
1433,
19914,
273,
... |
if source_text: | if source_text and self.de_widgets["Active person:Show sources"].get_active(): | def save_data_edit(self, obj): if self._dirty: # Save the edits ---------------------------------- person = self._dirty_person # First, get the data: gender = self.de_widgets["APGender"].get_active() if "," in self.de_widgets["APName"].get_text(): surname, firstname = self.de_widgets["APName"].get_text().split(",", 1) else: surname, firstname = self.de_widgets["APName"].get_text(), "" surname = surname.strip() firstname = firstname.strip() name = person.get_primary_name() # Now, edit it: self.trans = self.dbstate.db.transaction_begin() name.set_surname(surname) name.set_first_name(firstname) person.set_gender(gender) birthdate, birthplace = self.process_dateplace(self.de_widgets["APBirth"].get_text().strip()) new, birthevent = self.get_or_create_event(person, gen.lib.EventType.BIRTH, birthdate, birthplace) # reference it, if need be: birthref = person.get_birth_ref() if birthevent: if birthref is None: # need new birthref = gen.lib.EventRef() birthref.set_reference_handle(birthevent.get_handle()) person.set_birth_ref(birthref) # Only add if there is an event: source_text = self.de_widgets["APBirthSource"].get_text().strip() if source_text: new, source = self.get_or_create_source(source_text) self.add_source(birthevent, source) self.dbstate.db.commit_event(birthevent, self.trans) deathdate, deathplace = self.process_dateplace(self.de_widgets["APDeath"].get_text().strip()) new, deathevent = self.get_or_create_event(person, gen.lib.EventType.DEATH, deathdate, deathplace) # reference it, if need be: deathref = person.get_death_ref() if deathevent: if deathref is None: # need new deathref = gen.lib.EventRef() deathref.set_reference_handle(deathevent.get_handle()) person.set_death_ref(deathref) # Only add if there is an event: source_text = self.de_widgets["APDeathSource"].get_text().strip() if source_text: new, source = self.get_or_create_source(source_text) self.add_source(deathevent, source) self.dbstate.db.commit_event(deathevent, self.trans) source_text = self.de_widgets["APSource"].get_text().strip() if source_text: new, source = self.get_or_create_source(source_text) self.add_source(person, source) self.dbstate.db.commit_person(person,self.trans) self.dbstate.db.transaction_commit(self.trans, (_("Gramplet Data Edit: %s") % name_displayer.display(person))) self._dirty = False self.update() | 861e586e662758397fc67efe6d3dd2d7c6559c1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1491/861e586e662758397fc67efe6d3dd2d7c6559c1a/DataEntryGramplet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
892,
67,
4619,
12,
2890,
16,
1081,
4672,
309,
365,
6315,
18013,
30,
468,
7074,
326,
24450,
19134,
17,
6175,
273,
365,
6315,
18013,
67,
12479,
468,
5783,
16,
336,
326,
501,
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,
1923,
67,
892,
67,
4619,
12,
2890,
16,
1081,
4672,
309,
365,
6315,
18013,
30,
468,
7074,
326,
24450,
19134,
17,
6175,
273,
365,
6315,
18013,
67,
12479,
468,
5783,
16,
336,
326,
501,
30... |
cr.execute('select id from res_users where login=%s and password=%s and active', (login.encode('utf-8'), password.encode('utf-8'))) | if password: cr.execute('select id from res_users where login=%s and password=%s and active', (login.encode('utf-8'), password.encode('utf-8'))) else: cr.execute('select id from res_users where login=%s and password is null and active', (login.encode('utf-8'),)) | def login(db, login, password): cr = pooler.get_db(db).cursor() cr.execute('select id from res_users where login=%s and password=%s and active', (login.encode('utf-8'), password.encode('utf-8'))) res = cr.fetchone() cr.close() if res: return res[0] else: return False | 11af323602d59e2fb4045cb16b17b894c9ca6e27 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/11af323602d59e2fb4045cb16b17b894c9ca6e27/security.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3925,
12,
1966,
16,
3925,
16,
2201,
4672,
4422,
273,
2845,
264,
18,
588,
67,
1966,
12,
1966,
2934,
9216,
1435,
309,
2201,
30,
4422,
18,
8837,
2668,
4025,
612,
628,
400,
67,
5577,
1625,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3925,
12,
1966,
16,
3925,
16,
2201,
4672,
4422,
273,
2845,
264,
18,
588,
67,
1966,
12,
1966,
2934,
9216,
1435,
309,
2201,
30,
4422,
18,
8837,
2668,
4025,
612,
628,
400,
67,
5577,
1625,... |
if cl.super: | if hasattr(cl, "super") and cl.super: | def listclasses(self): dir, file = os.path.split(self.file) name, ext = os.path.splitext(file) if os.path.normcase(ext) != ".py": return [] try: dict = pyclbr.readmodule_ex(name, [dir] + sys.path) except ImportError, msg: return [] items = [] self.classes = {} for key, cl in dict.items(): if cl.module == name: s = key if cl.super: supers = [] for sup in cl.super: if type(sup) is type(''): sname = sup else: sname = sup.name if sup.module != cl.module: sname = "%s.%s" % (sup.module, sname) supers.append(sname) s = s + "(%s)" % ", ".join(supers) items.append((cl.lineno, s)) self.classes[s] = cl items.sort() list = [] for item, s in items: list.append(s) return list | f91ab5233d643a2df6cc9f75bc7ff4726e18e32c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/f91ab5233d643a2df6cc9f75bc7ff4726e18e32c/ClassBrowser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
4701,
12,
2890,
4672,
1577,
16,
585,
273,
1140,
18,
803,
18,
4939,
12,
2890,
18,
768,
13,
508,
16,
1110,
273,
1140,
18,
803,
18,
4939,
408,
12,
768,
13,
309,
1140,
18,
803,
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,
666,
4701,
12,
2890,
4672,
1577,
16,
585,
273,
1140,
18,
803,
18,
4939,
12,
2890,
18,
768,
13,
508,
16,
1110,
273,
1140,
18,
803,
18,
4939,
408,
12,
768,
13,
309,
1140,
18,
803,
18... |
td = timedelta(hours=int(h), minutes=int(m), seconds=int(s), microseconds=int(modf(float(s))[0])*1000000) | td = timedelta(hours=int(h), minutes=int(m), seconds=int(float(s)), microseconds=int(modf(float(s))[0]*1000000)) | def TimeDelta_or_None(s): from math import modf try: h, m, s = s.split(':') td = timedelta(hours=int(h), minutes=int(m), seconds=int(s), microseconds=int(modf(float(s))[0])*1000000) if h < 0: return -td else: return td except: return None | e11b39a4f4b57a15fddcd83f308fa86eb6cf97b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10477/e11b39a4f4b57a15fddcd83f308fa86eb6cf97b1/pytimes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2647,
9242,
67,
280,
67,
7036,
12,
87,
4672,
628,
4233,
1930,
681,
74,
775,
30,
366,
16,
312,
16,
272,
273,
272,
18,
4939,
2668,
2497,
13,
6655,
273,
10661,
12,
16814,
33,
474,
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,
2647,
9242,
67,
280,
67,
7036,
12,
87,
4672,
628,
4233,
1930,
681,
74,
775,
30,
366,
16,
312,
16,
272,
273,
272,
18,
4939,
2668,
2497,
13,
6655,
273,
10661,
12,
16814,
33,
474,
12,
... |
return Polynomial_padic_capped_relative_dense(self.parent(), (self._poly[i:j], self._valbase, [infinity]*i + self._relprecs[i:j], False, None if self._valaddeds is None else [infinity]*i + self._valaddeds[i:j], None if self._list is None else [self.base_ring()(0)] * i + self._list[i:j]), construct = True) | elif j < 0: j = len(self._relprecs) + j if j < 0: raise IndexError, "list index out of range" if i >= j: return Polynomial_padic_capped_relative_dense(self.parent(), []) else: return Polynomial_padic_capped_relative_dense(self.parent(), (self._poly[i:j], self._valbase, [infinity]*i + self._relprecs[i:j], False, None if self._valaddeds is None else [infinity]*i + self._valaddeds[i:j], None if self._list is None else [self.base_ring()(0)] * i + self._list[i:j]), construct = True) | def __getslice__(self, i, j): """ EXAMPLES: sage: K = Qp(13,7) sage: R.<t> = K[] sage: a = 13^7*t^3 + K(169,4)*t - 13^4 sage: a[1:2] (13^2 + O(13^4))*t """ if j > len(self._relprecs): j = len(self._relprecs) return Polynomial_padic_capped_relative_dense(self.parent(), (self._poly[i:j], self._valbase, [infinity]*i + self._relprecs[i:j], False, None if self._valaddeds is None else [infinity]*i + self._valaddeds[i:j], None if self._list is None else [self.base_ring()(0)] * i + self._list[i:j]), construct = True) | 02cea86da6522b98405157179b93c14d172565ca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/02cea86da6522b98405157179b93c14d172565ca/polynomial_padic_capped_relative_dense.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
6665,
972,
12,
2890,
16,
277,
16,
525,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
1475,
273,
2238,
84,
12,
3437,
16,
27,
13,
272,
410,
30,
534,
22782,
88,
34,
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,
588,
6665,
972,
12,
2890,
16,
277,
16,
525,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
1475,
273,
2238,
84,
12,
3437,
16,
27,
13,
272,
410,
30,
534,
22782,
88,
34,
273,
... |
if self.config.getint('default', 'discs') >= 1 and not self.config.get('default', 'arch') == 'source': | if self.config.getint('default', 'discs') >= 1: | def doCreateIsos(self): """Create isos from the various split directories.""" | 0a0bbe6688667e626f27585aaaa35c4a59af17ac /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8489/0a0bbe6688667e626f27585aaaa35c4a59af17ac/pungi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
1684,
2520,
538,
12,
2890,
4672,
3536,
1684,
353,
538,
628,
326,
11191,
1416,
6402,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
1684,
2520,
538,
12,
2890,
4672,
3536,
1684,
353,
538,
628,
326,
11191,
1416,
6402,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self.text.append("\n") | self.text.append(self.new_line) | def process_preformatted_item(self, node): if node.hasAttribute("class"): class_ = node.getAttribute("class") else: class_ = None if class_ == "comment": # we currently use this for stuff like ## or #acl for i in node.childNodes: if i.nodeType == Node.TEXT_NODE: self.text.append(i.data) #print "'%s'" % i.data elif i.localName == 'br': self.text.append("\n") else: pass #print i.localName else: self.text.extend(["{{{", self.new_line]) for i in node.childNodes: if i.nodeType == Node.TEXT_NODE: self.text.append(i.data) #print "'%s'" % i.data elif i.localName == 'br': self.text.append("\n") else: pass #print i.localName self.text.append("}}}\n") | 4b03df1cf340caeb2a0e882fb5c853890be75c31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/4b03df1cf340caeb2a0e882fb5c853890be75c31/text_html_text_x_moin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
1484,
14897,
67,
1726,
12,
2890,
16,
756,
4672,
309,
756,
18,
5332,
1499,
2932,
1106,
6,
4672,
667,
67,
273,
756,
18,
588,
1499,
2932,
1106,
7923,
469,
30,
667,
67,
273,
59... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
1484,
14897,
67,
1726,
12,
2890,
16,
756,
4672,
309,
756,
18,
5332,
1499,
2932,
1106,
6,
4672,
667,
67,
273,
756,
18,
588,
1499,
2932,
1106,
7923,
469,
30,
667,
67,
273,
59... |
file = CWriter(filename) self.WriteHeader(file) file.Write("\n") | file = CHeaderWriter(filename) | def WriteServiceUtilsImplementation(self, filename): """Writes the gles2 auto generated utility implementation.""" file = CWriter(filename) self.WriteHeader(file) file.Write("\n") for enum in _ENUM_LISTS: file.Write("bool ValidateGLenum%s(GLenum value) {\n" % enum) file.Write(" switch (value) {\n") for value in _ENUM_LISTS[enum]: file.Write(" case %s:\n" % value) file.Write(" return true;\n") file.Write(" default:\n") file.Write(" return false;\n") file.Write(" }\n") file.Write("}\n") file.Write("\n") file.Close() | 8a837bb40249dfd9f0a2736abdab4f64592c99db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/8a837bb40249dfd9f0a2736abdab4f64592c99db/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
1179,
1989,
13621,
12,
2890,
16,
1544,
4672,
3536,
8368,
326,
314,
1040,
22,
3656,
4374,
12788,
4471,
12123,
585,
273,
385,
1864,
2289,
12,
3459,
13,
364,
2792,
316,
389,
16509,
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,
2598,
1179,
1989,
13621,
12,
2890,
16,
1544,
4672,
3536,
8368,
326,
314,
1040,
22,
3656,
4374,
12788,
4471,
12123,
585,
273,
385,
1864,
2289,
12,
3459,
13,
364,
2792,
316,
389,
16509,
67... |
except KeyError: nosmp = 0 | else: try: nosmp = os.environ['NPY_NOSMP'] nosmp = 1 except KeyError: nosmp = 0 | def generate_config_h(ext, build_dir): target = join(build_dir,'config.h') if newer(__file__,target): config_cmd = config.get_config_cmd() print 'Generating',target # tc = generate_testcode(target) from distutils import sysconfig python_include = sysconfig.get_python_inc() result = config_cmd.try_run(tc,include_dirs=[python_include], library_dirs = default_lib_dirs) if not result: raise "ERROR: Failed to test configuration" # Perhaps a fancier check is in order here. try: nosmp = os.environ['NPY_NOSMP'] nosmp = 1 except KeyError: nosmp = 0 if nosmp: moredefs = [('NPY_ALLOW_THREADS', '0')] else: moredefs = [] # mathlibs = [] tc = testcode_mathlib() mathlibs_choices = [[],['m'],['cpml']] mathlib = os.environ.get('MATHLIB') if mathlib: mathlibs_choices.insert(0,mathlib.split(',')) for libs in mathlibs_choices: if config_cmd.try_run(tc,libraries=libs): mathlibs = libs break else: raise "math library missing; rerun setup.py after setting the MATHLIB env variable" ext.libraries.extend(mathlibs) moredefs.append(('MATHLIB',','.join(mathlibs))) | 3faacbbc2b90a123440423ad6db109d7a6b978f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/3faacbbc2b90a123440423ad6db109d7a6b978f0/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
1425,
67,
76,
12,
408,
16,
1361,
67,
1214,
4672,
1018,
273,
1233,
12,
3510,
67,
1214,
11189,
1425,
18,
76,
6134,
309,
16069,
12,
972,
768,
972,
16,
3299,
4672,
642,
67,
417... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
1425,
67,
76,
12,
408,
16,
1361,
67,
1214,
4672,
1018,
273,
1233,
12,
3510,
67,
1214,
11189,
1425,
18,
76,
6134,
309,
16069,
12,
972,
768,
972,
16,
3299,
4672,
642,
67,
417... |
Result: The integer , 0, on success or a dictionary containing values for the keys, "faultcode" and "faultstring". | Result: The integer , 0, on success | def testrun_remove_tag(self, run_id, tag_name): """Remove a tag from the given TestRun. | 83012e559756373ef19add9ed3d26f1bf779a22c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/231/83012e559756373ef19add9ed3d26f1bf779a22c/testopia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
281,
313,
318,
67,
4479,
67,
2692,
12,
2890,
16,
1086,
67,
350,
16,
1047,
67,
529,
4672,
3536,
3288,
279,
1047,
628,
326,
864,
7766,
1997,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
281,
313,
318,
67,
4479,
67,
2692,
12,
2890,
16,
1086,
67,
350,
16,
1047,
67,
529,
4672,
3536,
3288,
279,
1047,
628,
326,
864,
7766,
1997,
18,
2,
-100,
-100,
-100,
-100,
-100,
-... |
records.sort(key=operator.itemgetter(sortItem),reverse=True) | records.sort( key = operator.itemgetter( sortItem ), reverse = True ) | def getUserSummaryWeb(self,selectDict, sortList, startItem, maxItems): """ Get the summary of user jobs in a standard form for the Web portal. Pagination and global sorting is supported. """ | 99c1bc850ba087890925b3180df206f65bb1d4b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/99c1bc850ba087890925b3180df206f65bb1d4b3/JobDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4735,
4733,
4079,
12,
2890,
16,
4025,
5014,
16,
1524,
682,
16,
787,
1180,
16,
943,
3126,
4672,
3536,
968,
326,
4916,
434,
729,
6550,
316,
279,
4529,
646,
364,
326,
2999,
11899,
18,
169... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4735,
4733,
4079,
12,
2890,
16,
4025,
5014,
16,
1524,
682,
16,
787,
1180,
16,
943,
3126,
4672,
3536,
968,
326,
4916,
434,
729,
6550,
316,
279,
4529,
646,
364,
326,
2999,
11899,
18,
169... |
server.log_error(context) context.status = 500 context.entity = root.internal_server_error(context) | cls.internal_server_error(server, context) | def handle_request(cls, server, context): # (1) Initialize 'context.commit' (true if the method is not safe) context.commit = (cls.is_safe is False) | c2b053496d5daff15ef8e1af3fd35ea8d5f3fb5c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/c2b053496d5daff15ef8e1af3fd35ea8d5f3fb5c/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
2293,
12,
6429,
16,
1438,
16,
819,
4672,
468,
261,
21,
13,
9190,
296,
2472,
18,
7371,
11,
261,
3767,
309,
326,
707,
353,
486,
4183,
13,
819,
18,
7371,
273,
261,
6429,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
2293,
12,
6429,
16,
1438,
16,
819,
4672,
468,
261,
21,
13,
9190,
296,
2472,
18,
7371,
11,
261,
3767,
309,
326,
707,
353,
486,
4183,
13,
819,
18,
7371,
273,
261,
6429,
18,
... |
open(path, 'w').close() self._info("Touched file '%s'" % path) | if os.path.exists(path): mtime = round(time.time()) os.utime(path, (mtime, mtime)) self._info("Touched existing file '%s'" % path) else: open(path, 'w').close() self._info("Touched new file '%s'" % path) | def touch(self, path): """Emulates the UNIX touch command. Creates a file, if it does not exist. Otherwise changes its access and modification times to the current time. Fails if used with the directories or the parent directory of the given file does not exist. """ if os.path.isdir(path): raise DataError("Cannot touch '%s' because it is a directory" % path) if not os.path.exists(os.path.dirname(path)): raise DataError("Cannot touch '%s' because its parent directory " "does not exist" % path) open(path, 'w').close() self._info("Touched file '%s'" % path) | 6f8bd1e5c5b0db8d92d174d89dc27677542321fb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7408/6f8bd1e5c5b0db8d92d174d89dc27677542321fb/OperatingSystem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6920,
12,
2890,
16,
589,
4672,
3536,
1514,
17099,
326,
23160,
6920,
1296,
18,
225,
10210,
279,
585,
16,
309,
518,
1552,
486,
1005,
18,
5272,
3478,
2097,
2006,
471,
11544,
4124,
358,
326,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6920,
12,
2890,
16,
589,
4672,
3536,
1514,
17099,
326,
23160,
6920,
1296,
18,
225,
10210,
279,
585,
16,
309,
518,
1552,
486,
1005,
18,
5272,
3478,
2097,
2006,
471,
11544,
4124,
358,
326,... |
max_key_length = int(value) | max_key_length = max(2, int(value)) | def to_js_regex(r): p = r.split(None, 1) if len(p) < 2: return r p[1] = back_ref.sub(ur'$\1', back_ref_g.sub(ur'$\1', p[1])) return u' '.join(p) | 9d399919310ee2905273a1f5452413fdf92e49c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5124/9d399919310ee2905273a1f5452413fdf92e49c2/make-json.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
2924,
67,
7584,
12,
86,
4672,
293,
273,
436,
18,
4939,
12,
7036,
16,
404,
13,
309,
562,
12,
84,
13,
411,
576,
30,
327,
436,
293,
63,
21,
65,
273,
1473,
67,
1734,
18,
171... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
2924,
67,
7584,
12,
86,
4672,
293,
273,
436,
18,
4939,
12,
7036,
16,
404,
13,
309,
562,
12,
84,
13,
411,
576,
30,
327,
436,
293,
63,
21,
65,
273,
1473,
67,
1734,
18,
171... |
self._write_class_summary(public, private, classes, doc.by_group(classes), 'Classes') self._write_class_summary(public, private, excepts, doc.by_group(excepts), 'Exceptions') self._write_func_summary(public, private, doc.functions(), None, doc.by_group(doc.functions()), | self._write_class_summary(public, private, doc, classes, 'Classes') self._write_class_summary(public, private, doc, excepts, 'Exceptions') self._write_func_summary(public, private, doc, doc.functions(), | def _write_module(self, public, private, uid, doc): # Write the header, navbar, & module name str = self._header(uid.name()) private.write(str) public.write(str) | dad6dd09c82d3878a78d977cc13da79d4420db2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/dad6dd09c82d3878a78d977cc13da79d4420db2b/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
67,
2978,
12,
2890,
16,
1071,
16,
3238,
16,
4555,
16,
997,
4672,
468,
2598,
326,
1446,
16,
8775,
3215,
16,
473,
1605,
508,
609,
273,
365,
6315,
3374,
12,
1911,
18,
529,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
67,
2978,
12,
2890,
16,
1071,
16,
3238,
16,
4555,
16,
997,
4672,
468,
2598,
326,
1446,
16,
8775,
3215,
16,
473,
1605,
508,
609,
273,
365,
6315,
3374,
12,
1911,
18,
529,
10... |
"H2": atom_info("H", 0, "H'"), "H3": atom_info("H", 0, "H'"), "H1": atom_info("H", 0, "H'"), "H4": atom_info("H", 0, "H'"), "H5": atom_info("H", 0, "H'"), "HO6": atom_info("H", 0, "H'"), "HO4": atom_info("H", 0, "H'"), "HO2": atom_info("H", 0, "H'"), "HO3": atom_info("H", 0, "H'"), "HO1": atom_info("H", 0, "H'"), "H61": atom_info("H", 0, "H'"), | "H2": atom_info("H", 0, "H"), "H3": atom_info("H", 0, "H"), "H1": atom_info("H", 0, "H"), "H4": atom_info("H", 0, "H"), "H5": atom_info("H", 0, "H"), "HO6": atom_info("H", 0, "H"), "HO4": atom_info("H", 0, "H"), "HO2": atom_info("H", 0, "H"), "HO3": atom_info("H", 0, "H"), "HO1": atom_info("H", 0, "H"), "H61": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") | 46b20303e8ed53745807da84c39cb29f25aa3911 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/46b20303e8ed53745807da84c39cb29f25aa3911/residue_info.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1311,
12,
2890,
4672,
327,
7566,
2956,
67,
7175,
3113,
315,
285,
335,
67,
2019,
3113,
315,
31320,
310,
67,
1925,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1311,
12,
2890,
4672,
327,
7566,
2956,
67,
7175,
3113,
315,
285,
335,
67,
2019,
3113,
315,
31320,
310,
67,
1925,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
def __init__(self, extension_elements=None, extension_attributes=None, text=None, value=None): | def __init__(self, extension_elements=None, value=None, extension_attributes=None, text=None): | def __init__(self, extension_elements=None, extension_attributes=None, text=None, value=None): self.value = value self.extension_elements = extension_elements or [] self.extension_attributes = extension_attributes or {} | 0ba6315ab8118b874d87e51c8f024bfc6f59e8a9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6580/0ba6315ab8118b874d87e51c8f024bfc6f59e8a9/gcalendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2710,
67,
6274,
33,
7036,
16,
460,
33,
7036,
16,
2710,
67,
4350,
33,
7036,
16,
977,
33,
7036,
4672,
365,
18,
1132,
273,
460,
365,
18,
6447,
67,
6274,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
2710,
67,
6274,
33,
7036,
16,
460,
33,
7036,
16,
2710,
67,
4350,
33,
7036,
16,
977,
33,
7036,
4672,
365,
18,
1132,
273,
460,
365,
18,
6447,
67,
6274,
... |
self.function_info[name] = ParseTreeInfo(cstmt and cstmt[-1] or None, name, self.file) self.function_info[name].prototype = self.extract_tokens("", cstmt[3]) | if name == "def": name = cstmt[3][1] self.function_info[name] = ParseTreeInfo(cstmt and cstmt[-1] or None, name, self.file) self.function_info[name].prototype = self.extract_tokens("", cstmt[4]) else: self.function_info[name] = ParseTreeInfo(cstmt and cstmt[-1] or None, name, self.file) self.function_info[name].prototype = self.extract_tokens("", cstmt[3]) | def extract_info(self, tree): # extract docstring found = 0 if len(tree) == 2: found, vars = self.match(DOCSTRING_STMT_PATTERN[1], tree[1]) elif len(tree) >= 4: found, vars = self.match(DOCSTRING_STMT_PATTERN, tree[3]) if found: self.docstring = eval(vars['docstring']) # discover inner definitions for node in tree[1:]: found, vars = self.match(ASSIGNMENT_STMT_PATTERN, node) if found: self.assign_info[vars['varname']] = 1 found, vars = self.match(COMPOUND_STMT_PATTERN, node) if found: cstmt = vars['compound'] if cstmt[0] == symbol.funcdef: name = cstmt[2][1] self.function_info[name] = ParseTreeInfo(cstmt and cstmt[-1] or None, name, self.file) self.function_info[name].prototype = self.extract_tokens("", cstmt[3]) elif cstmt[0] == symbol.classdef: name = cstmt[2][1] self.class_info[name] = ParseTreeInfo(cstmt and cstmt[-1] or None, name, self.file) self.extract_derivs(self.class_info[name], cstmt) | e47fdbe42407a99cef6b7537e6d8c9c841f7c7ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8543/e47fdbe42407a99cef6b7537e6d8c9c841f7c7ac/gendocs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
1376,
12,
2890,
16,
2151,
4672,
468,
2608,
14525,
1392,
273,
374,
309,
562,
12,
3413,
13,
422,
576,
30,
1392,
16,
4153,
273,
365,
18,
1916,
12,
19693,
5804,
67,
882,
6152,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
1376,
12,
2890,
16,
2151,
4672,
468,
2608,
14525,
1392,
273,
374,
309,
562,
12,
3413,
13,
422,
576,
30,
1392,
16,
4153,
273,
365,
18,
1916,
12,
19693,
5804,
67,
882,
6152,
... |
""" % (hostname, loopaddr, loopdest) | """ % (loopaddr, loopdest) | def _addvirtual(mlist, fp): listname = mlist.internal_name() fieldsz = len(listname) + len('-unsubscribe') hostname = mlist.host_name # Set up the mailman-loop address loopaddr = Utils.get_site_email(mlist.host_name, extra='loop') loopdest = Utils.ParseEmail(loopaddr)[0] # Seek to the end of the text file, but if it's empty write the standard # disclaimer, and the loop catch address. fp.seek(0, 2) if not fp.tell(): print >> fp, """\ | 175f917ad717dc31199735173c02bac87c8e39de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/175f917ad717dc31199735173c02bac87c8e39de/Postfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
12384,
12,
781,
376,
16,
4253,
4672,
666,
529,
273,
312,
1098,
18,
7236,
67,
529,
1435,
1466,
94,
273,
562,
12,
1098,
529,
13,
397,
562,
2668,
17,
318,
9174,
6134,
5199,
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,
389,
1289,
12384,
12,
781,
376,
16,
4253,
4672,
666,
529,
273,
312,
1098,
18,
7236,
67,
529,
1435,
1466,
94,
273,
562,
12,
1098,
529,
13,
397,
562,
2668,
17,
318,
9174,
6134,
5199,
2... |
ceConfigDict = getCEConfigDict(ceName) resourceDict = getResourceDict(ceName) ceConfigDict.update(resourceDict) | ceConfigDict = getCEConfigDict( ceName ) resourceDict = getResourceDict( ceName ) ceConfigDict.update( resourceDict ) | def getLocalCEConfigDict(ceName): """ Collect all the local settings relevant to the CE configuration """ ceConfigDict = getCEConfigDict(ceName) resourceDict = getResourceDict(ceName) ceConfigDict.update(resourceDict) return ceConfigDict | 3d103a1ec7530dcfac38e6ccc642be862e663b73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/3d103a1ec7530dcfac38e6ccc642be862e663b73/ComputingElement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6993,
1441,
809,
5014,
12,
311,
461,
4672,
3536,
9302,
777,
326,
1191,
1947,
9368,
358,
326,
29538,
1664,
3536,
5898,
809,
5014,
273,
336,
1441,
809,
5014,
12,
5898,
461,
262,
1058,
5014... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6993,
1441,
809,
5014,
12,
311,
461,
4672,
3536,
9302,
777,
326,
1191,
1947,
9368,
358,
326,
29538,
1664,
3536,
5898,
809,
5014,
273,
336,
1441,
809,
5014,
12,
5898,
461,
262,
1058,
5014... |
def setDIRACGroupInProxy(proxy,group): | def setDIRACGroupInProxy( proxyData, group ): | def setDIRACGroupInProxy(proxy,group): """ Add the DIRAC group string to the proxy. If the group value is None, strip the group from the proxy """ if group is None: if proxy.find( ":::diracgroup=" ) == 0: lines = proxy.split('\n') new_proxy = '\n'.join(lines[1:]) else: new_proxy = proxy if proxy.find( ":::diracgroup=" ) == 0: lines = proxy.split('\n') lines[0] = ":::diracgroup=%s\n" % group.strip() new_proxy = '\n'.join(lines) else: new_proxy = ":::diracgroup=%s\n" % group.strip() new_proxy = new_proxy + proxy return new_proxy | 7a80cfb8f9b1b4549e36aff6121746435be42eae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/7a80cfb8f9b1b4549e36aff6121746435be42eae/GridCredentials.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
4537,
2226,
1114,
382,
3886,
12,
2889,
751,
16,
1041,
262,
30,
3536,
1436,
326,
18544,
2226,
1041,
533,
358,
326,
2889,
18,
971,
326,
1041,
460,
353,
599,
16,
2569,
326,
1041,
628... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4537,
2226,
1114,
382,
3886,
12,
2889,
751,
16,
1041,
262,
30,
3536,
1436,
326,
18544,
2226,
1041,
533,
358,
326,
2889,
18,
971,
326,
1041,
460,
353,
599,
16,
2569,
326,
1041,
628... |
self._options.debug) | is_debug_mode) | def _GatherTestFiles(self, paths): """Generate a set of test files and place them in self._test_files, with appropriate subsets in self._ignored_failures, self._fixable_failures, and self._fixable_crashes. Args: paths: a list of command line paths relative to the webkit/tests directory. glob patterns are ok. """ paths_to_walk = set() for path in paths: # If there's an * in the name, assume it's a glob pattern. path = os.path.join(path_utils.LayoutDataDir(), path) if path.find('*') > -1: filenames = glob.glob(path) paths_to_walk.update(filenames) else: paths_to_walk.add(path) | ab8fa0c51059c27a8bd4200899a3688e50a1393c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9392/ab8fa0c51059c27a8bd4200899a3688e50a1393c/run_webkit_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
26092,
4709,
2697,
12,
2890,
16,
2953,
4672,
3536,
4625,
279,
444,
434,
1842,
1390,
471,
3166,
2182,
316,
365,
6315,
3813,
67,
2354,
16,
598,
5505,
30760,
316,
365,
6315,
24055,
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,
389,
26092,
4709,
2697,
12,
2890,
16,
2953,
4672,
3536,
4625,
279,
444,
434,
1842,
1390,
471,
3166,
2182,
316,
365,
6315,
3813,
67,
2354,
16,
598,
5505,
30760,
316,
365,
6315,
24055,
67,... |
print "DATA IS ", data color = gtk.gdk.color_parse(' | red, green, blue = (data&0xFF0000)>>16, (data&0xFF00)>>8, data&0xFF color = gtk.gdk.Color(*[c*256 for c in (red, green, blue)]) | def set_widget_data(self, data): print "DATA IS ", data color = gtk.gdk.color_parse('#%s' % hex(data)[2:]) self.widget.set_color(color) | a4f69106dfee83df4b0b8dbd1ba2cae4e0d66a1a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2510/a4f69106dfee83df4b0b8dbd1ba2cae4e0d66a1a/checkwidgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
6587,
67,
892,
12,
2890,
16,
501,
4672,
1172,
315,
4883,
4437,
3104,
501,
2036,
273,
22718,
18,
75,
2883,
18,
3266,
67,
2670,
2668,
7,
9,
87,
11,
738,
3827,
12,
892,
25146,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
444,
67,
6587,
67,
892,
12,
2890,
16,
501,
4672,
1172,
315,
4883,
4437,
3104,
501,
2036,
273,
22718,
18,
75,
2883,
18,
3266,
67,
2670,
2668,
7,
9,
87,
11,
738,
3827,
12,
892,
25146,
... |
(name, company_id)) | [code] + today_value + [company_id]) | def search_receivable_payable(self, cursor, user_id, name, args, context=None): if not len(args): return [] move_line_obj = self.pool.get('account.move.line') company_obj = self.pool.get('company.company') user_obj = self.pool.get('res.user') | c2fdd6e852f94ab4559f3c5ac982a6b50b203473 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9290/c2fdd6e852f94ab4559f3c5ac982a6b50b203473/move.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
8606,
427,
429,
67,
10239,
429,
12,
2890,
16,
3347,
16,
729,
67,
350,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
309,
486,
562,
12,
1968,
4672,
327,
5378,
3635,
67,
1369,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
8606,
427,
429,
67,
10239,
429,
12,
2890,
16,
3347,
16,
729,
67,
350,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
309,
486,
562,
12,
1968,
4672,
327,
5378,
3635,
67,
1369,
... |
@test_support.cpython_only | @support.cpython_only | def test_argumentcheck(self): self.assertRaises(TypeError, self.enum) # no arguments self.assertRaises(TypeError, self.enum, 1) # wrong type (not iterable) self.assertRaises(TypeError, self.enum, 'abc', 'a') # wrong type self.assertRaises(TypeError, self.enum, 'abc', 2, 3) # too many arguments | 3dfaabbb8ef872d23caabb19c3e448fe85a73c36 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/3dfaabbb8ef872d23caabb19c3e448fe85a73c36/test_enumerate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3446,
1893,
12,
2890,
4672,
365,
18,
11231,
12649,
6141,
12,
19030,
16,
365,
18,
7924,
13,
468,
1158,
1775,
365,
18,
11231,
12649,
6141,
12,
19030,
16,
365,
18,
7924,
16,
404... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3446,
1893,
12,
2890,
4672,
365,
18,
11231,
12649,
6141,
12,
19030,
16,
365,
18,
7924,
13,
468,
1158,
1775,
365,
18,
11231,
12649,
6141,
12,
19030,
16,
365,
18,
7924,
16,
404... |
def fl_replace_formbrowser(ob, num, form): """ fl_replace_formbrowser(ob, num, form) """ retval = _fl_replace_formbrowser(ob, num, form) | def fl_replace_formbrowser(pObject, num, pForm): """ fl_replace_formbrowser(pObject, num, pForm) """ retval = _fl_replace_formbrowser(pObject, num, pForm) | def fl_replace_formbrowser(ob, num, form): """ fl_replace_formbrowser(ob, num, form) """ retval = _fl_replace_formbrowser(ob, num, form) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
2079,
67,
687,
11213,
12,
84,
921,
16,
818,
16,
293,
1204,
4672,
3536,
1183,
67,
2079,
67,
687,
11213,
12,
84,
921,
16,
818,
16,
293,
1204,
13,
3536,
225,
5221,
273,
389,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2079,
67,
687,
11213,
12,
84,
921,
16,
818,
16,
293,
1204,
4672,
3536,
1183,
67,
2079,
67,
687,
11213,
12,
84,
921,
16,
818,
16,
293,
1204,
13,
3536,
225,
5221,
273,
389,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.