rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
sum(sub_total) as total_sub \ from cci_missions_dossier as d,cci_missions_dossier_type as t \ where d.type_id=t.id and t.section=\'legalization\' \ and (d.create_date::date BETWEEN '%s' AND '%s' )\
sum(l.total) as total_sub \ from cci_missions_dossier as d,cci_missions_dossier_type as t, cci_missions_legalization as l \ where l.dossier_id = d.id and d.type_id=t.id and t.section=\'legalization\' \ and (d.date::date BETWEEN '%s' AND '%s' )\
def _get_total_legalization(self, d1, d2): self.cr.execute("select t.section, count(t.id) as no_certi, sum(goods_value) as no_goods, \ sum(sub_total) as total_sub \ from cci_missions_dossier as d,cci_missions_dossier_type as t \ where d.type_id=t.id and t.section=\'legalization\' \ and (d.create_date::date BETWEEN '%s' AND '%s' )\ group by t.section" % (d1, d2)) res_ata = self.cr.dictfetchall() return res_ata
9f092a99a526fdd09f626e0c2a44007c857cb559 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/9f092a99a526fdd09f626e0c2a44007c857cb559/stats_mission_type.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 4963, 67, 2013, 1588, 12, 2890, 16, 302, 21, 16, 302, 22, 4672, 365, 18, 3353, 18, 8837, 2932, 4025, 268, 18, 3464, 16, 1056, 12, 88, 18, 350, 13, 487, 1158, 67, 7593...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4963, 67, 2013, 1588, 12, 2890, 16, 302, 21, 16, 302, 22, 4672, 365, 18, 3353, 18, 8837, 2932, 4025, 268, 18, 3464, 16, 1056, 12, 88, 18, 350, 13, 487, 1158, 67, 7593...
if hasattr(self.db, 'close'): self.db.close() self.db = None
if hasattr(self.dict, 'close'): self.dict.close() self.dict = None
def close(self): if hasattr(self.db, 'close'): self.db.close() self.db = None
845502b911d91a3218eca6094becdea4677a81b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/845502b911d91a3218eca6094becdea4677a81b5/shelve.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 4672, 309, 3859, 12, 2890, 18, 1966, 16, 296, 4412, 11, 4672, 365, 18, 1966, 18, 4412, 1435, 365, 18, 1966, 273, 599, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 4672, 309, 3859, 12, 2890, 18, 1966, 16, 296, 4412, 11, 4672, 365, 18, 1966, 18, 4412, 1435, 365, 18, 1966, 273, 599, 2, -100, -100, -100, -100, -100, -100, -100, -100,...
print entry.attrib['name'], self.states[entry]
print entry.get('name'), self.states[entry]
def VerifyEntry(self, entry, modlist = []): '''Dispatch call to Verify<tagname> and save state in self.states''' try: method = getattr(self, "Verify%s"%(entry.tag)) # verify state and stash value in state if entry.tag == 'Package': self.states[entry] = method(entry, modlist) else: self.states[entry] = method(entry)
7f96b6e6c21e510fb73ea66f3c3e52b21d089e3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/7f96b6e6c21e510fb73ea66f3c3e52b21d089e3e/Toolset.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8553, 1622, 12, 2890, 16, 1241, 16, 681, 1098, 273, 5378, 4672, 9163, 5325, 745, 358, 8553, 32, 2692, 529, 34, 471, 1923, 919, 316, 365, 18, 7992, 26418, 775, 30, 707, 273, 3869, 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, 8553, 1622, 12, 2890, 16, 1241, 16, 681, 1098, 273, 5378, 4672, 9163, 5325, 745, 358, 8553, 32, 2692, 529, 34, 471, 1923, 919, 316, 365, 18, 7992, 26418, 775, 30, 707, 273, 3869, 12, ...
f=makeFile(os.path.join(element.getRootPackage().getFilePath(),'skins',element.getRootPackage().getName(),action_name+'.pt'),0)
print 'rootf:',element.getRootPackage().getName() print 'rootfres:',self.getSkinPath(element)+action_name+'.pt' f=self.makeFile(os.path.join(self.getSkinPath(element),action_name+'.pt'),0)
def generateMethodActions(self,element): outfile=StringIO() print >> outfile for m in element.getMethodDefs(): if m.hasStereoType( ['action','view','form']): action_name=m.getTaggedValue(m.getStereoType(), m.getName()).strip() print 'generating ' + m.getStereoType()+':',action_name dict={}
8e4d9d9e796f5091a3eae12f371779fbf8c28ad2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11941/8e4d9d9e796f5091a3eae12f371779fbf8c28ad2/ArchGenXML.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 1305, 6100, 12, 2890, 16, 2956, 4672, 8756, 33, 780, 4294, 1435, 1172, 1671, 8756, 364, 312, 316, 930, 18, 588, 1305, 14554, 13332, 309, 312, 18, 5332, 55, 22854, 559, 12, 10228, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1305, 6100, 12, 2890, 16, 2956, 4672, 8756, 33, 780, 4294, 1435, 1172, 1671, 8756, 364, 312, 316, 930, 18, 588, 1305, 14554, 13332, 309, 312, 18, 5332, 55, 22854, 559, 12, 10228, ...
if sys.argv[idx+1][1] == '=':
opt = sys.argv[idx+1] if len(opt) > 3 and opt[2] == '=': val = _getParamValue(p, sys.argv[idx+1][3:]) else:
def _getParamShortArg(p, processedArgs): ''' try to get a param from short arg ''' if not p.has_key('arg'): return None if p['arg'] == 'c': raise exceptions.ValueError("-c option is reserved for config file.") if p['arg'][-1] == ':': # expecting an argument try: idx = map(lambda x:x[:2]=='-'+p['arg'][0], sys.argv[1:]).index(True) # has something like -a # case 1: -a file if sys.argv[idx+1] == '-'+p['arg'][0]: if idx+1 in processedArgs or idx+2 in processedArgs: raise exceptions.ValueError("Parameter " + sys.argv[idx+1] + " has been processed before.") try: val = _getParamValue(p, sys.argv[idx+2]) processedArgs.append(idx+1) processedArgs.append(idx+2) return val except: return None # case 2: -aopt or -a=opt else: if idx+1 in processedArgs: raise exceptions.ValueError("Parameter " + sys.argv[idx+1] + " has been processed before.") try: if sys.argv[idx+1][1] == '=': val = _getParamValue(p, sys.argv[idx+1][2:]) else: val = _getParamValue(p, sys.argv[idx+1][1:]) processedArgs.append(idx+1) return val except: return None except: # not available return None else: # true or false # handle -h option, as a special case if '-'+p['arg'] in sys.argv[1:]: idx = sys.argv[1:].index('-'+p['arg']) if idx+1 in processedArgs: raise exceptions.ValueError("Parameter " + sys.argv[idx+1] + " has been processed before.") processedArgs.append(idx+1) return True else: return None
a49a467d9ad416c7410a16df4f15da9161ace24a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/401/a49a467d9ad416c7410a16df4f15da9161ace24a/simuOpt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 786, 4897, 4117, 12, 84, 16, 5204, 2615, 4672, 9163, 775, 358, 336, 279, 579, 628, 3025, 1501, 9163, 309, 486, 293, 18, 5332, 67, 856, 2668, 3175, 11, 4672, 327, 599, 309, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 786, 4897, 4117, 12, 84, 16, 5204, 2615, 4672, 9163, 775, 358, 336, 279, 579, 628, 3025, 1501, 9163, 309, 486, 293, 18, 5332, 67, 856, 2668, 3175, 11, 4672, 327, 599, 309, ...
try: params = self._rf.root.results.params modelclass = params[0]["classname"] except tables.NoSuchNodeError: raise ModelError("File does not contain correct model data structure!") finally: rf.close()
params = self._rf.root.results.params modelclass = params[0]["classname"] except tables.NoSuchNodeError: raise ModelError("File does not contain correct model data structure!") finally: rf.close()
def make_wrapper_model(modelfile, *args, **kwargs): """Return a wrapper class that provides the given model class from a file.""" #Check file exists if not os.path.isfile(modelfile): raise IOError("File does not exist!") try: self._log.debug("Opening file " + modelfile + " to read class name.") rf = tables.openFile(modelfile, "r") try: try: params = self._rf.root.results.params modelclass = params[0]["classname"] except tables.NoSuchNodeError: raise ModelError("File does not contain correct model data structure!") finally: rf.close() except IOError: raise class ModelWrapper(modelclass): """Wraps first order model using HDF5 file of results.""" def __init__(self, filename, *args, **kwargs): """Get results from file and instantiate variables. Opens file with handle saved as self._rf. File is closed in __del__""" #Call super class __init__ method super(ModelWrapper, self).__init__(*args, **kwargs) #Check file exists if not os.path.isfile(filename): raise IOError("File does not exist!") try: self._log.debug("Opening file " + filename + " to read results.") try: self._rf = tables.openFile(filename, "r") self.yresult = self._rf.root.results.yresult self.tresult = self._rf.root.results.tresult self.fotstart = self._rf.root.results.fotstart self.foystart = self._rf.root.results.foystart self.k = self._rf.root.results.k[:] params = self._rf.root.results.parameters except tables.NoSuchNodeError: raise ModelError("File does not contain correct model data structure!") try: self.source = self._rf.root.results.sourceterm except tables.NoSuchNodeError: self._log.debug("First order file does not have a source term.") self.source = None #Put params in right slots for ix, val in enumerate(params[0]): self.__setattr__(params.colnames[ix], val) #set correct potential function (only works with cmpotentials currently) self.potentials = cmpotentials.__getattribute__(self.potential_func) except IOError: raise #Fix bgmodel to actual instance #Check ystart is in right form (1-d array of three values) if self.ystart.ndim == 1: ys = self.ystart[0:3] elif self.ystart.ndim == 2: ys = self.ystart[0:3,0] self.bgmodel = self.bgclass(ystart=ys, tstart=self.tstart, tend=self.tend, tstep_wanted=self.tstep_wanted, tstep_min=self.tstep_min, solver=self.solver, potential_func=self.potential_func, pot_params=self.pot_params) #Put in data try: self._log.debug("Trying to get background results...") self.bgmodel.tresult = self._rf.root.bgresults.tresult[:] self.bgmodel.yresult = self._rf.root.bgresults.yresult except tables.NoSuchNodeError: raise ModelError("File does not contain background results!") self.bgmodel.runcount = 1 #Get epsilon self._log.debug("Calculating self.bgepsilon...") self.bgepsilon = self.bgmodel.getepsilon() #Success self._log.info("Successfully imported data from file into model instance.") def __del__(self): """Close file when object destroyed.""" try: self._log.debug("Trying to close file...") self._rf.close() except IOError: raise return ModelWrapper(modelfile, *args, **kwargs)
96df048065ae79e65f8290c4e3b2e5a824a8cc53 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7283/96df048065ae79e65f8290c4e3b2e5a824a8cc53/cosmomodels.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 8376, 67, 2284, 12, 2284, 768, 16, 380, 1968, 16, 2826, 4333, 4672, 3536, 990, 279, 4053, 667, 716, 8121, 326, 864, 938, 667, 628, 279, 585, 12123, 468, 1564, 585, 1704, 309,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 8376, 67, 2284, 12, 2284, 768, 16, 380, 1968, 16, 2826, 4333, 4672, 3536, 990, 279, 4053, 667, 716, 8121, 326, 864, 938, 667, 628, 279, 585, 12123, 468, 1564, 585, 1704, 309,...
raise TypeError('%r is not a code object' % co)
raise TypeError('{!r} is not a code object'.format(co))
def getargs(co): """Get information about the arguments accepted by a code object. Three things are returned: (args, varargs, varkw), where 'args' is a list of argument names (possibly containing nested lists), and 'varargs' and 'varkw' are the names of the * and ** arguments or None.""" if not iscode(co): raise TypeError('%r is not a code object' % co) nargs = co.co_argcount names = co.co_varnames args = list(names[:nargs]) step = 0 # The following acrobatics are for anonymous (tuple) arguments. for i in range(nargs): if args[i][:1] in ('', '.'): stack, remain, count = [], [], [] while step < len(co.co_code): op = ord(co.co_code[step]) step = step + 1 if op >= dis.HAVE_ARGUMENT: opname = dis.opname[op] value = ord(co.co_code[step]) + ord(co.co_code[step+1])*256 step = step + 2 if opname in ('UNPACK_TUPLE', 'UNPACK_SEQUENCE'): remain.append(value) count.append(value) elif opname == 'STORE_FAST': stack.append(names[value]) # Special case for sublists of length 1: def foo((bar)) # doesn't generate the UNPACK_TUPLE bytecode, so if # `remain` is empty here, we have such a sublist. if not remain: stack[0] = [stack[0]] break else: remain[-1] = remain[-1] - 1 while remain[-1] == 0: remain.pop() size = count.pop() stack[-size:] = [stack[-size:]] if not remain: break remain[-1] = remain[-1] - 1 if not remain: break args[i] = stack[0] varargs = None if co.co_flags & CO_VARARGS: varargs = co.co_varnames[nargs] nargs = nargs + 1 varkw = None if co.co_flags & CO_VARKEYWORDS: varkw = co.co_varnames[nargs] return Arguments(args, varargs, varkw)
17e7dd35cf6285fc4ab802d08c9c1791f6e24e06 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/17e7dd35cf6285fc4ab802d08c9c1791f6e24e06/inspect.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 1968, 12, 2894, 4672, 3536, 967, 1779, 2973, 326, 1775, 8494, 635, 279, 981, 733, 18, 225, 935, 992, 9198, 854, 2106, 30, 261, 1968, 16, 19732, 16, 569, 9987, 3631, 1625, 296, 196...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1968, 12, 2894, 4672, 3536, 967, 1779, 2973, 326, 1775, 8494, 635, 279, 981, 733, 18, 225, 935, 992, 9198, 854, 2106, 30, 261, 1968, 16, 19732, 16, 569, 9987, 3631, 1625, 296, 196...
brief_xhtml.toxml('utf-8')
description_xhtml.toxml('utf-8')
def x_article(self,node): description_xhtml = self.new_node('div',klass='description') brief_xhtml = self.new_node('div', self.x(self.get_child(self.get_child(node,tag='articleinfo'), tag='articlepurpose' )), klass='brief' ) body_item = self.get_child(node,tag='title').nextSibling while body_item: item = self.x(body_item) if item: description_xhtml.appendChild(item) body_item = body_item.nextSibling return self.new_node( 'item', self.new_text('title',node.getAttribute('name')), self.new_text('pubDate',node.getAttribute('last-revision')), self.new_text('description', description_xhtml.toxml('utf-8')+\ '&lt;hr/&gr;'+\ brief_xhtml.toxml('utf-8') ) )
99ee14925d498fa6e47ac63d782d6aeeb8e5affd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9849/99ee14925d498fa6e47ac63d782d6aeeb8e5affd/bbook2rss.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 619, 67, 11480, 12, 2890, 16, 2159, 4672, 2477, 67, 26341, 273, 365, 18, 2704, 67, 2159, 2668, 2892, 2187, 22626, 2218, 3384, 6134, 324, 17802, 67, 26341, 273, 365, 18, 2704, 67, 2159, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 619, 67, 11480, 12, 2890, 16, 2159, 4672, 2477, 67, 26341, 273, 365, 18, 2704, 67, 2159, 2668, 2892, 2187, 22626, 2218, 3384, 6134, 324, 17802, 67, 26341, 273, 365, 18, 2704, 67, 2159, ...
StmtExpr(ExprAssn( ExprDeref(idvar), p.nextShmemIdExpr(self.side))), StmtDecl(ExprCall(
StmtExpr(ExprAssn(ExprDeref(idvar), _shmemId(shmemvar))), StmtExpr(ExprCall(
def implementManagerIface(self): p = self.protocol routedvar = ExprVar('aRouted') idvar = ExprVar('aId') sizevar = ExprVar('aSize') listenertype = Type('ChannelListener', ptr=1)
d9fcd325bb89a6dd20a5eefb536c3f9ee4bdf884 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11102/d9fcd325bb89a6dd20a5eefb536c3f9ee4bdf884/lower.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2348, 1318, 45, 865, 12, 2890, 4672, 293, 273, 365, 18, 8373, 3237, 329, 1401, 273, 8074, 1537, 2668, 69, 4583, 329, 6134, 612, 1401, 273, 8074, 1537, 2668, 69, 548, 6134, 963, 1401, 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2348, 1318, 45, 865, 12, 2890, 4672, 293, 273, 365, 18, 8373, 3237, 329, 1401, 273, 8074, 1537, 2668, 69, 4583, 329, 6134, 612, 1401, 273, 8074, 1537, 2668, 69, 548, 6134, 963, 1401, 2...
else: return self.title[0:31]
else: return self.title[0:44]
def __unicode__(self): if self.abbrev <> '': return self.abbrev else: return self.title[0:31] # truncation ...
bbd2faac6e5e79a92a53ff2abf759ee26ffca539 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7019/bbd2faac6e5e79a92a53ff2abf759ee26ffca539/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9124, 972, 12, 2890, 4672, 309, 365, 18, 378, 27216, 2813, 875, 30, 327, 365, 18, 378, 27216, 469, 30, 327, 365, 18, 2649, 63, 20, 30, 6334, 65, 225, 468, 31507, 1372, 2, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9124, 972, 12, 2890, 4672, 309, 365, 18, 378, 27216, 2813, 875, 30, 327, 365, 18, 378, 27216, 469, 30, 327, 365, 18, 2649, 63, 20, 30, 6334, 65, 225, 468, 31507, 1372, 2, -100,...
if ja() == True:
if ja():
def cancelrest(): "Rest period is interrupted by event." if game.resting: skip(1) proutn(_("Mr. Spock- \"Captain, shall we cancel the rest period?\"")) if ja() == True: game.resting = False game.optime = 0.0 return True return False
eafdd35f1af1e4e93d3609a0adbe768b562907e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3176/eafdd35f1af1e4e93d3609a0adbe768b562907e0/sst.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3755, 8792, 13332, 315, 5188, 3879, 353, 15711, 635, 871, 1199, 309, 7920, 18, 8792, 310, 30, 2488, 12, 21, 13, 450, 322, 82, 24899, 2932, 49, 86, 18, 5878, 975, 17, 225, 1239, 26294, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3755, 8792, 13332, 315, 5188, 3879, 353, 15711, 635, 871, 1199, 309, 7920, 18, 8792, 310, 30, 2488, 12, 21, 13, 450, 322, 82, 24899, 2932, 49, 86, 18, 5878, 975, 17, 225, 1239, 26294, ...
print "SPEED", self, type(self), getattr(self, 'speed', '???') speed = self.speed speedConfiguration = SpeedConfigurations[speed] message['speed'] = speed
return elif variable == 'delay': virtualSpeed = self.virtualSpeed speedConfiguration = SpeedConfigurations[virtualSpeed]
def calcScale(maxVal): if maxVal < 128: maxVal = 0 if maxVal > 0: return 128.0 / float(maxVal) else: return 1.0
14b2acc074530e8a6710261615202e97b1b8b23b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12485/14b2acc074530e8a6710261615202e97b1b8b23b/micropolisturbogearsengine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7029, 5587, 12, 1896, 3053, 4672, 309, 943, 3053, 411, 8038, 30, 943, 3053, 273, 374, 309, 943, 3053, 405, 374, 30, 327, 8038, 18, 20, 342, 1431, 12, 1896, 3053, 13, 469, 30, 327, 40...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7029, 5587, 12, 1896, 3053, 4672, 309, 943, 3053, 411, 8038, 30, 943, 3053, 273, 374, 309, 943, 3053, 405, 374, 30, 327, 8038, 18, 20, 342, 1431, 12, 1896, 3053, 13, 469, 30, 327, 40...
if command_template is not None, then program_string == program name and argv is given by command_template with %s replaced by the full path to the program. Else, program_string is interpreted as a shell command with first name being the program name.
Return the program name and argv of the process that would be executed by run_program(program_string, command_template).
def run_program(program_string, command_template=None): """ if command_template is not None, then program_string == program name and argv is given by command_template with %s replaced by the full path to the program. Else, program_string is interpreted as a shell command with first name being the program name. """ env = Params.g_build.env_of_name('default') if command_template in (None, '%s'): argv = shlex.split(program_string) program_name = argv[0] try: program_obj = find_program(program_name, env) except ValueError, ex: Params.fatal(str(ex)) try: program_node = program_obj.path.find_build(ccroot.get_target_name(program_obj)) except AttributeError: Params.fatal("%s does not appear to be a program" % (program_name,)) execvec = [program_node.abspath(env)] + argv[1:] else: program_name = program_string try: program_obj = find_program(program_name, env) except ValueError, ex: Params.fatal(str(ex)) try: program_node = program_obj.path.find_build(ccroot.get_target_name(program_obj)) except AttributeError: Params.fatal("%s does not appear to be a program" % (program_name,)) execvec = shlex.split(command_template % (program_node.abspath(env),)) former_cwd = os.getcwd() if (Params.g_options.cwd_launch): os.chdir(Params.g_options.cwd_launch) else: os.chdir(Params.g_cwd_launch) try: retval = run_argv(execvec) finally: os.chdir(former_cwd) return retval
9313b9abd5a589966f66045fb19c198fc8f63241 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11087/9313b9abd5a589966f66045fb19c198fc8f63241/wutils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 12890, 12, 12890, 67, 1080, 16, 1296, 67, 3202, 33, 7036, 4672, 3536, 2000, 326, 5402, 508, 471, 5261, 434, 326, 1207, 716, 4102, 506, 7120, 635, 1086, 67, 12890, 12, 12890, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 12890, 12, 12890, 67, 1080, 16, 1296, 67, 3202, 33, 7036, 4672, 3536, 2000, 326, 5402, 508, 471, 5261, 434, 326, 1207, 716, 4102, 506, 7120, 635, 1086, 67, 12890, 12, 12890, ...
return resultArchive
return (resultArchive, uploadFileServer)
def renameDataFiles(directory):
9da3d5ab7a9dc600d1e4835cda86f34679789f07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/9da3d5ab7a9dc600d1e4835cda86f34679789f07/feedback_report.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6472, 751, 2697, 12, 5149, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6472, 751, 2697, 12, 5149, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
if not review.review_request.public:
review_request = review.review_request if not review_request.public:
def mail_review(user, review): """Sends an e-mail representing the supplied review.""" if not review.review_request.public: return review.ordered_comments = \ review.comments.order_by('filediff', 'first_line') review.email_message_id = \ send_review_mail(user, review.review_request, u"Re: Review Request: %s" % review.review_request.summary, review.review_request.email_message_id, None, 'reviews/review_email.txt', {'review': review}) review.time_emailed = datetime.now() review.save()
abc32ae4339bcfd19962ad7ab9f4a882ffc53635 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1600/abc32ae4339bcfd19962ad7ab9f4a882ffc53635/email.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4791, 67, 16041, 12, 1355, 16, 10725, 4672, 3536, 10501, 392, 425, 17, 4408, 5123, 326, 4580, 10725, 12123, 10725, 67, 2293, 273, 10725, 18, 16041, 67, 2293, 225, 309, 486, 10725, 67, 22...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4791, 67, 16041, 12, 1355, 16, 10725, 4672, 3536, 10501, 392, 425, 17, 4408, 5123, 326, 4580, 10725, 12123, 10725, 67, 2293, 273, 10725, 18, 16041, 67, 2293, 225, 309, 486, 10725, 67, 22...
unlink("/tmp/test.swf") error = system(COMPARE[1]+ " -Q 300 -p%d '%s' -o /tmp/test.swf" % (page, filename)) if error: raise ConversionError(error) unlink(file1) error = system(SWFRENDER + " /tmp/test.swf -o %s" % file1) if error: raise ConversionError(error) unlink("/tmp/test.swf")
def runtools(self, filename, page, file1, file2, file12): badness = 0.0 self.runtool(COMPARE[0], filename, page, file2) self.runtool(COMPARE[1], filename, page, file1)
def runtools(self, filename, page, file1, file2, file12):
a822c33ef7e2df2abe7cf982020aac1c739f8445 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5722/a822c33ef7e2df2abe7cf982020aac1c739f8445/testpdfs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 6642, 12, 2890, 16, 1544, 16, 1363, 16, 585, 21, 16, 585, 22, 16, 585, 2138, 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,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 6642, 12, 2890, 16, 1544, 16, 1363, 16, 585, 21, 16, 585, 22, 16, 585, 2138, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
env = AppEnv(tenv, LIBS)
env = LibEnv(tenv, INCLUDE) env = AppEnv(env, LIBS)
def App(tenv, name, SOURCES = [], LIBS = ['nova'], LINKSCRIPT = None): env = AppEnv(tenv, LIBS) if not LINKSCRIPT: LINKSCRIPT = "%s.ld" % name return env.Link(output + '/apps/%s.nova' % name, SOURCES, linkscript = LINKSCRIPT)
c381b4811ced369038d79b3936cecda559aa99ae /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6150/c381b4811ced369038d79b3936cecda559aa99ae/nul.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4677, 12, 14835, 16, 508, 16, 16088, 55, 273, 5378, 16, 8961, 12692, 273, 10228, 82, 16739, 17337, 22926, 10885, 273, 599, 4672, 1550, 273, 10560, 3491, 12, 14835, 16, 28062, 13, 1550, 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, 4677, 12, 14835, 16, 508, 16, 16088, 55, 273, 5378, 16, 8961, 12692, 273, 10228, 82, 16739, 17337, 22926, 10885, 273, 599, 4672, 1550, 273, 10560, 3491, 12, 14835, 16, 28062, 13, 1550, 2...
if line.startswith("
import re comment = re.compile( "^\s* if comment.match(line): continue
def read_cmake_list(name): """ Read a cmake files list and return a dictionary with each cmake variable matched to a list of filenames. This makes it easy to add/remove files, as only the cmake list needs to be modified and scons will automatically pick up the changes. """ lists = {} for line in open(name): if line.startswith("#"): continue if line.startswith("set"): current = [] name = line[4:].strip() lists[name] = current else: w = line.strip("( )\t\r\n") if w: current.append(w) return lists
13b5165ab2a0d17fb16d397714ea9c73aa1910ef /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14418/13b5165ab2a0d17fb16d397714ea9c73aa1910ef/helpers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 71, 6540, 67, 1098, 12, 529, 4672, 3536, 2720, 279, 5003, 911, 1390, 666, 471, 327, 279, 3880, 598, 1517, 5003, 911, 2190, 4847, 358, 279, 666, 434, 9066, 18, 225, 1220, 7297,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 71, 6540, 67, 1098, 12, 529, 4672, 3536, 2720, 279, 5003, 911, 1390, 666, 471, 327, 279, 3880, 598, 1517, 5003, 911, 2190, 4847, 358, 279, 666, 434, 9066, 18, 225, 1220, 7297,...
sage: xi = Matrix(R, 8, 1, sr.vars('x',1)) sage: wi = Matrix(R, 8, 1, sr.vars('w',1))
sage: xi = Matrix(R, 8, 1, sr.vars('x', 1)) sage: wi = Matrix(R, 8, 1, sr.vars('w', 1))
def inversion_polynomials(self, xi, wi, length): """ Return polynomials to represent the inversion in the AES S-Box.
62424369e932ac59629cb4d40b7e47ae2a712293 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/62424369e932ac59629cb4d40b7e47ae2a712293/sr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 316, 1589, 67, 3915, 13602, 87, 12, 2890, 16, 14087, 16, 16138, 16, 769, 4672, 3536, 2000, 16991, 87, 358, 2406, 326, 316, 1589, 316, 326, 15986, 348, 17, 3514, 18, 2, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 316, 1589, 67, 3915, 13602, 87, 12, 2890, 16, 14087, 16, 16138, 16, 769, 4672, 3536, 2000, 16991, 87, 358, 2406, 326, 316, 1589, 316, 326, 15986, 348, 17, 3514, 18, 2, -100, -100, -100...
Changed data is returned by each function in the chain until the last function returns data--then that data is returned to the executor.
Each function of the chain takes the input, applies some transformation to it, and then returns the newly changed input as output. This output is then passed to the next function in the chain as input and we proceed until all registered functions have had a chance to operate on the data. We then return the data to the caller.
def executeChain(self, data): """ Executes a callback chain on a given piece of data. This data could be a string or an object. Consult the documentation for the specific callback chain you're executing.
db90d771c89073b96c5c12345e0a44ebff216485 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11836/db90d771c89073b96c5c12345e0a44ebff216485/api.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 3893, 12, 2890, 16, 501, 4672, 3536, 3889, 993, 279, 1348, 2687, 603, 279, 864, 11151, 434, 501, 18, 225, 1220, 501, 3377, 506, 279, 533, 578, 392, 733, 18, 225, 11020, 406, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 3893, 12, 2890, 16, 501, 4672, 3536, 3889, 993, 279, 1348, 2687, 603, 279, 864, 11151, 434, 501, 18, 225, 1220, 501, 3377, 506, 279, 533, 578, 392, 733, 18, 225, 11020, 406, 326,...
2) Static vocabulary * is already a DisplayList * is a list of 2-tuples with strings (see above) * is a list of strings (in this case a DisplayList with key=value will be created)
def Vocabulary(self, content_instance=None): """ returns a DisplayList
1a6f51fe1ae01e90811456e45ef7420fb6ebdbcf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/1a6f51fe1ae01e90811456e45ef7420fb6ebdbcf/Field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 776, 23348, 12, 2890, 16, 913, 67, 1336, 33, 7036, 4672, 3536, 1135, 279, 9311, 682, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 776, 23348, 12, 2890, 16, 913, 67, 1336, 33, 7036, 4672, 3536, 1135, 279, 9311, 682, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
params=work_params)
params=work_params, log=log)
def get_home_dihedral_proxies(self, work_params, geometry, pdb_hierarchy, geometry_ref, sites_cart_ref, pdb_hierarchy_ref, log=sys.stdout): ss_selection = None residue_match_hash = {} reference_dihedral_proxies = cctbx.geometry_restraints.shared_dihedral_proxy() sigma = work_params.sigma limit = work_params.limit i_seq_name_hash = self.build_name_hash(pdb_hierarchy=pdb_hierarchy) i_seq_name_hash_ref = self.build_name_hash(pdb_hierarchy=pdb_hierarchy_ref) reference_dihedral_hash = self.build_dihedral_hash( geometry=geometry_ref, sites_cart=sites_cart_ref, pdb_hierarchy=pdb_hierarchy_ref, include_hydrogens=work_params.hydrogens, include_main_chain=work_params.main_chain, include_side_chain=work_params.side_chain) match_map = self.process_reference_groups( pdb_hierarchy=pdb_hierarchy, pdb_hierarchy_ref=pdb_hierarchy_ref, params=work_params) if work_params.secondary_structure_only: if (not libtbx.env.has_module(name="ksdssp")): raise RuntimeError( "ksdssp module is not configured, cannot generate secondary structure reference") ref_ss_m = secondary_structure.manager( pdb_hierarchy=pdb_hierarchy_ref, xray_structure=pdb_hierarchy_ref.extract_xray_structure(), sec_str_from_pdb_file=None) ref_ss_m.find_automatically() pdb_str = pdb_hierarchy_ref.as_pdb_string() (records, stderr) = secondary_structure.run_ksdssp_direct(pdb_str) sec_str_from_pdb_file = iotbx.pdb.secondary_structure.process_records( records=records, allow_none=True) if sec_str_from_pdb_file != None: overall_helix_selection = sec_str_from_pdb_file.overall_helix_selection() overall_sheet_selection = sec_str_from_pdb_file.overall_sheet_selection() overall_selection = overall_helix_selection +' or ' + overall_sheet_selection sel_cache_ref = pdb_hierarchy_ref.atom_selection_cache() ss_selection = (self.phil_atom_selections_as_i_seqs_multiple( cache=sel_cache_ref, string_list=[overall_selection])) for dp in geometry.dihedral_proxies: key = "" key_work = "" for i_seq in dp.i_seqs: key_work = key_work + i_seq_name_hash[i_seq] try: key = key+i_seq_name_hash_ref[match_map[i_seq]] except: continue try: reference_angle = reference_dihedral_hash[key] if key[5:14] == key[20:29] and \ key[5:14] == key[35:44] and \ key[5:14] == key[50:59] and \ key_work[5:14] == key_work[20:29] and \ key_work[5:14] == key_work[35:44] and \ key_work[5:14] == key_work[50:59]: residue_match_hash[key_work[5:14]] = key[5:14] except: continue if work_params.secondary_structure_only and ss_selection != None: if match_map[dp.i_seqs[0]] in ss_selection and \ match_map[dp.i_seqs[1]] in ss_selection and \ match_map[dp.i_seqs[2]] in ss_selection and \ match_map[dp.i_seqs[3]] in ss_selection: dp_add = cctbx.geometry_restraints.dihedral_proxy( i_seqs=dp.i_seqs, angle_ideal=reference_angle, weight=1/(1.0**2), limit=30.0) reference_dihedral_proxies.append(dp_add) else: dp_add = cctbx.geometry_restraints.dihedral_proxy( i_seqs=dp.i_seqs, angle_ideal=reference_angle, weight=1/(5.0**2), limit=15.0) reference_dihedral_proxies.append(dp_add) else: dp_add = cctbx.geometry_restraints.dihedral_proxy( i_seqs=dp.i_seqs, angle_ideal=reference_angle, weight=1/sigma**2, limit=limit) reference_dihedral_proxies.append(dp_add)
907e426fd41ff5a0c9492ce2a493a7074b2e48aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/907e426fd41ff5a0c9492ce2a493a7074b2e48aa/reference_model.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 8712, 67, 3211, 28351, 67, 20314, 606, 12, 2890, 16, 1440, 67, 2010, 16, 5316, 16, 10892, 67, 17937, 16, 5316, 67, 1734, 16, 9180, 67, 11848, 67, 1734, 16, 10892, 67, 17937, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8712, 67, 3211, 28351, 67, 20314, 606, 12, 2890, 16, 1440, 67, 2010, 16, 5316, 16, 10892, 67, 17937, 16, 5316, 67, 1734, 16, 9180, 67, 11848, 67, 1734, 16, 10892, 67, 17937, ...
raise exc[0](exc[1]).with_traceback(exc[2])
raise exc[1]
def nested(*managers): """Support multiple context managers in a single with-statement. Code like this: with nested(A, B, C) as (X, Y, Z): <body> is equivalent to this: with A as X: with B as Y: with C as Z: <body> """ exits = [] vars = [] exc = (None, None, None) try: for mgr in managers: exit = mgr.__exit__ enter = mgr.__enter__ vars.append(enter()) exits.append(exit) yield vars except: exc = sys.exc_info() finally: while exits: exit = exits.pop() try: if exit(*exc): exc = (None, None, None) except: exc = sys.exc_info() if exc != (None, None, None): # Don't rely on sys.exc_info() still containing # the right information. Another exception may # have been raised and caught by an exit method raise exc[0](exc[1]).with_traceback(exc[2])
6010d80bacb84dbfba4aa9a7f919c7cdfc060ecd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/6010d80bacb84dbfba4aa9a7f919c7cdfc060ecd/contextlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4764, 30857, 29757, 4672, 3536, 6289, 3229, 819, 21103, 316, 279, 2202, 598, 17, 11516, 18, 225, 3356, 3007, 333, 30, 225, 598, 4764, 12, 37, 16, 605, 16, 385, 13, 487, 261, 60, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4764, 30857, 29757, 4672, 3536, 6289, 3229, 819, 21103, 316, 279, 2202, 598, 17, 11516, 18, 225, 3356, 3007, 333, 30, 225, 598, 4764, 12, 37, 16, 605, 16, 385, 13, 487, 261, 60, 16, ...
bugs = Bug.objects.all() for word in query_words: bugs = bugs.filter( Q(project__language=word) | Q(title__contains=word) | Q(description__contains=word) | Q(project__name__iexact=word)) bugs = bugs.order_by('-last_touched')
bugs = get_bugs_by_query_words(query_words)
def fetch_bugs(request): # {{{ # FIXME: Give bugs some date field if request.user.is_authenticated(): suggestion_keys = request.user.get_profile().\ get_recommended_search_terms() else: suggestion_keys = [] suggestions = [(i, k, False) for i, k in enumerate(suggestion_keys)] query = request.GET.get('language', '') query_words = split_query_words(query) format = request.GET.get('format', None) start = int(request.GET.get('start', 1)) end = int(request.GET.get('end', 10)) total_bug_count = 0 if query: bugs = Bug.objects.all() for word in query_words: bugs = bugs.filter( Q(project__language=word) | Q(title__contains=word) | Q(description__contains=word) | Q(project__name__iexact=word)) bugs = bugs.order_by('-last_touched') # Minus sign = reverse order. total_bug_count = bugs.count() bugs = bugs[start-1:end] for b in bugs: b.project.icon_url = "/static/images/icons/projects/%s.png" % \ b.project.name.lower() bugs = list(bugs) else: bugs = [] # Make some changes to how bug data is displayed. for bug in bugs: if bug.last_touched: try: bug.last_touched = timesince(bug.last_touched) + " ago" bug.last_touched.split(",")[0] except AtrributeError: pass if bug.last_polled: try: bug.last_polled = timesince(bug.last_polled) + " ago" bug.last_polled.split(",")[0] except AtrributeError: pass data = {} data['language'] = query data['query_words'] = query_words prev_page_query_str = QueryDict('') prev_page_query_str = prev_page_query_str.copy() next_page_query_str = QueryDict('') next_page_query_str = next_page_query_str.copy() if query: prev_page_query_str['language'] = query next_page_query_str['language'] = query if format: prev_page_query_str['format'] = format next_page_query_str['format'] = format diff = end - start prev_page_query_str['start'] = start - diff - 1 prev_page_query_str['end'] = start - 1 next_page_query_str['start'] = end + 1 next_page_query_str['end'] = end + diff + 1 data['start'] = start data['end'] = end data['prev_page_url'] = '/search/?' + prev_page_query_str.urlencode() data['next_page_url'] = '/search/?' + next_page_query_str.urlencode() if format == 'json': # FIXME: Why `alert`? return bugs_to_json_response(data, bugs, request.GET.get( 'jsoncallback', 'alert')) else: data['the_user'] = request.user data['suggestions'] = suggestions data['bunch_of_bugs'] = bugs data['developer_name'] = "Orrin Hatch" data['url'] = 'http://launchpad.net/' data['total_bug_count'] = total_bug_count data['show_prev_page_link'] = start > 1 data['show_next_page_link'] = end < (total_bug_count - 1) return render_to_response('search/search.html', data) # }}}
943b62fd1832a84e09d5e9af9cac5f302f146215 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11976/943b62fd1832a84e09d5e9af9cac5f302f146215/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2158, 67, 19381, 12, 2293, 4672, 468, 10179, 95, 225, 468, 9852, 30, 22374, 22398, 2690, 1509, 652, 225, 309, 590, 18, 1355, 18, 291, 67, 14454, 13332, 19715, 67, 2452, 273, 590, 18, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2158, 67, 19381, 12, 2293, 4672, 468, 10179, 95, 225, 468, 9852, 30, 22374, 22398, 2690, 1509, 652, 225, 309, 590, 18, 1355, 18, 291, 67, 14454, 13332, 19715, 67, 2452, 273, 590, 18, 1...
return self.exceptions == other.exceptions
if isinstance(other, CatchAllCondition): return self.exceptions == other.exceptions return False
def __eq__(self, other): return self.exceptions == other.exceptions
802f3046ddd058f401c0c66c10c5486e83541382 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5703/802f3046ddd058f401c0c66c10c5486e83541382/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 11253, 972, 12, 2890, 16, 1308, 4672, 327, 365, 18, 11855, 422, 1308, 18, 11855, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 11253, 972, 12, 2890, 16, 1308, 4672, 327, 365, 18, 11855, 422, 1308, 18, 11855, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.emit('ROT_TWO') self.visit(k)
self.emit('ROT_THREE')
def visitDict(self, node): lineno = getattr(node, 'lineno', None) if lineno: self.emit('SET_LINENO', lineno) self.emit('BUILD_MAP', 0) for k, v in node.items: lineno2 = getattr(node, 'lineno', None) if lineno2 is not None and lineno != lineno2: self.emit('SET_LINENO', lineno2) lineno = lineno2 self.emit('DUP_TOP') self.visit(v) self.emit('ROT_TWO') self.visit(k) self.emit('STORE_SUBSCR')
37179f7e610e1e65bc811075c36beabc9a27f704 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/37179f7e610e1e65bc811075c36beabc9a27f704/pycodegen.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 5014, 12, 2890, 16, 756, 4672, 7586, 273, 3869, 12, 2159, 16, 296, 17782, 2187, 599, 13, 309, 7586, 30, 365, 18, 18356, 2668, 4043, 67, 20663, 1157, 51, 2187, 7586, 13, 365, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 5014, 12, 2890, 16, 756, 4672, 7586, 273, 3869, 12, 2159, 16, 296, 17782, 2187, 599, 13, 309, 7586, 30, 365, 18, 18356, 2668, 4043, 67, 20663, 1157, 51, 2187, 7586, 13, 365, 18, ...
print 'start scan'
def _wireless_autoconnect(self, fresh=True): """ Attempts to autoconnect to a wireless network. """ print "No wired connection present, attempting to autoconnect " + \ "to wireless network" if self.wifi.wireless_interface is None: print 'Autoconnect failed because wireless interface returned None' return if fresh: print 'start scan' self.Scan(sync=True) print 'end scan' for x, network in enumerate(self.LastScan): if bool(network["has_profile"]): if self.debug_mode: print network["essid"] + ' has profile' if bool(network.get('automatic')): print 'trying to automatically connect to...' + \ network["essid"] self.ConnectWireless(x) time.sleep(1) return print "Unable to autoconnect, you'll have to manually connect"
77717a31c0fdae2852f3433dca48e0744ed43b85 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/353/77717a31c0fdae2852f3433dca48e0744ed43b85/wicd-daemon.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 14538, 2656, 67, 5854, 16550, 2517, 12, 2890, 16, 12186, 33, 5510, 4672, 3536, 6020, 9585, 358, 2059, 16550, 2517, 358, 279, 6636, 2656, 2483, 18, 3536, 1172, 315, 2279, 341, 2921, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 14538, 2656, 67, 5854, 16550, 2517, 12, 2890, 16, 12186, 33, 5510, 4672, 3536, 6020, 9585, 358, 2059, 16550, 2517, 358, 279, 6636, 2656, 2483, 18, 3536, 1172, 315, 2279, 341, 2921, ...
if f_pg_type != f_obj_type: logger.notifyChannel('orm', netsvc.LOG_INFO, "column '%s' in table '%s' changed type to %s." % (k, self._table, c[1]))
field_size_change = False if f.digits: field_size = (65535 * f.digits[0]) + f.digits[0] + f.digits[1] if field_size != f_pg_size: field_size_change = True if f_pg_type != f_obj_type or field_size_change: if f_pg_type != f_obj_type: logger.notifyChannel('orm', netsvc.LOG_INFO, "column '%s' in table '%s' changed type to %s." % (k, self._table, c[1])) if field_size_change: logger.notifyChannel('orm', netsvc.LOG_INFO, "column '%s' in table '%s' changed in the size." % (k, self._table))
f_pg_def = res[0]
4dc22b73e5629a109cb6b0227806db11d3b60e79 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/4dc22b73e5629a109cb6b0227806db11d3b60e79/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 284, 67, 8365, 67, 536, 273, 400, 63, 20, 65, 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, ...
[ 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, 284, 67, 8365, 67, 536, 273, 400, 63, 20, 65, 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,...
variance = x/(len(numbers))
variance = x/(len(numbers))
def getVariance(numbers,posMean='Empty'): """Determine the measure of the spread of the data set about the mean. Sample variance is determined by default; population variance can be determined by setting population attribute to True. """ x = 0 # Summation variable. if posMean == 'Empty': mean = getMean(numbers) else: mean = posMean # Subtract the mean from each data item and square the difference. # Sum all the squared deviations. for item in numbers: x += (float(item) - mean)**2.0 try: # Divide sum of squares by N-1 (sample variance). variance = x/(len(numbers)) except: variance = 0 return variance
1bb09fe3b908f6c5347a3270ef7d577fd4e504d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/1bb09fe3b908f6c5347a3270ef7d577fd4e504d8/Statistics.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 25987, 12, 13851, 16, 917, 15312, 2218, 1921, 11, 4672, 3536, 8519, 326, 6649, 434, 326, 15103, 434, 326, 501, 444, 2973, 326, 3722, 18, 11474, 12380, 353, 11383, 635, 805, 31, 1120...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 25987, 12, 13851, 16, 917, 15312, 2218, 1921, 11, 4672, 3536, 8519, 326, 6649, 434, 326, 15103, 434, 326, 501, 444, 2973, 326, 3722, 18, 11474, 12380, 353, 11383, 635, 805, 31, 1120...
'''
"""
def now(self, str_interval=None): ''' Return the current time.
16a3ebf380b95607b344181655488d818a27791f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1906/16a3ebf380b95607b344181655488d818a27791f/templating.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2037, 12, 2890, 16, 609, 67, 6624, 33, 7036, 4672, 3536, 2000, 326, 783, 813, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2037, 12, 2890, 16, 609, 67, 6624, 33, 7036, 4672, 3536, 2000, 326, 783, 813, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
if len(selected) >=1: path = (len(selected)-1,) elif len(model) > 0: path = (0,)
if len(selected) >= 1: path = selected[0]
def on_browse_row(self, widget, path, column=0): if path is None: # Default to last item in selection: model, selected = self.browser_selection.get_selected_rows() if len(selected) >=1: path = (len(selected)-1,) elif len(model) > 0: path = (0,) else: return value = self.browserdata.get_value(self.browserdata.get_iter(path), 1) icon = self.browserdata.get_value(self.browserdata.get_iter(path), 0) if value == "..": self.browse_parent_dir(None) else: if self.lib_view == self.VIEW_ARTIST or self.lib_view == self.VIEW_GENRE: if value == "/": if self.lib_view == self.VIEW_ARTIST: self.lib_level = 1 elif self.lib_view == self.VIEW_GENRE: self.lib_level = 0 elif icon != self.sonatapb: self.lib_level = self.lib_level + 1 self.browse(None, value)
40f84a0630c85f9486fc2c80c1ace7769604dba7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2312/40f84a0630c85f9486fc2c80c1ace7769604dba7/main.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 25731, 67, 492, 12, 2890, 16, 3604, 16, 589, 16, 1057, 33, 20, 4672, 309, 589, 353, 599, 30, 468, 2989, 358, 1142, 761, 316, 4421, 30, 938, 16, 3170, 273, 365, 18, 11213, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 25731, 67, 492, 12, 2890, 16, 3604, 16, 589, 16, 1057, 33, 20, 4672, 309, 589, 353, 599, 30, 468, 2989, 358, 1142, 761, 316, 4421, 30, 938, 16, 3170, 273, 365, 18, 11213, ...
for key in other.keys():
for key in other:
def __radd__(self, other): # First check if argument is a scalar if isscalar(other) or (isdense(other) and rank(other)==0): new = dok_matrix() # Add this scalar to every element. M, N = self.shape for i in range(M): for j in range(N): aij = self.get((i, j), 0) + other if aij != 0: new[i, j] = aij #new.dtype.char = self.dtype.char elif isinstance(other, dok_matrix): new = dok_matrix() new.update(self) new.shape = self.shape for key in other.keys(): new[key] += other[key] elif isspmatrix(other): csc = self.tocsc() new = csc + other else: # Perhaps it's a dense matrix? new = other + self.todense() return new
cc9a850083c66543ac7901fd68022fbe73610704 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/cc9a850083c66543ac7901fd68022fbe73610704/sparse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 354, 449, 972, 12, 2890, 16, 1308, 4672, 468, 5783, 866, 309, 1237, 353, 279, 4981, 309, 3385, 3473, 12, 3011, 13, 578, 261, 291, 25942, 12, 3011, 13, 471, 6171, 12, 3011, 13, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 354, 449, 972, 12, 2890, 16, 1308, 4672, 468, 5783, 866, 309, 1237, 353, 279, 4981, 309, 3385, 3473, 12, 3011, 13, 578, 261, 291, 25942, 12, 3011, 13, 471, 6171, 12, 3011, 13, ...
filter = self.distance_array()[R + max] < self.couplingradius
filter = self.distance_array()[R + max] < self.couplingradius
def get_hamiltonian_kpoint(self, kpt_c, calc): """Get Hamiltonian at some new arbitrary k-vector
7f2224f22010d99136433ed21c756a803140a7f6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1380/7f2224f22010d99136433ed21c756a803140a7f6/wannier.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 76, 11580, 1917, 2779, 67, 79, 1153, 12, 2890, 16, 417, 337, 67, 71, 16, 7029, 4672, 3536, 967, 670, 11580, 1917, 2779, 622, 2690, 394, 11078, 417, 17, 7737, 2, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 76, 11580, 1917, 2779, 67, 79, 1153, 12, 2890, 16, 417, 337, 67, 71, 16, 7029, 4672, 3536, 967, 670, 11580, 1917, 2779, 622, 2690, 394, 11078, 417, 17, 7737, 2, -100, -100, ...
elif c == "\"":
elif s == 1 and c == "\"": s = 0 elif s == 2 and c == "'":
def colon_find(l): mob = re.compile("\s*(\w+)").match(l) if mob and not mob.group(1) in ["for", "if", "while", "else", "elif"]: return None colon = None s = 0 e = 0 for i in range(len(l)): c = l[i] if e: e = 0 elif s: if c == "\\": e = 1 elif c == "\"": s = 0 elif c == "\"": s = 1 elif c == ":": colon = i return colon
c16d79d226d18328044fa3e96014aac49c7ed00d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1366/c16d79d226d18328044fa3e96014aac49c7ed00d/scramble.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13336, 67, 4720, 12, 80, 4672, 312, 947, 273, 283, 18, 11100, 31458, 87, 27220, 91, 15, 2225, 2934, 1916, 12, 80, 13, 309, 312, 947, 471, 486, 312, 947, 18, 1655, 12, 21, 13, 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, 13336, 67, 4720, 12, 80, 4672, 312, 947, 273, 283, 18, 11100, 31458, 87, 27220, 91, 15, 2225, 2934, 1916, 12, 80, 13, 309, 312, 947, 471, 486, 312, 947, 18, 1655, 12, 21, 13, 316, ...
import gobject
def start(self): """Create the subprocess. Calls pre_fork() and forks. The parent then calls parent_post_fork() and returns, while the child calls child_post_fork() and then child_run().""" assert self.child is None
91e4645ec4e456ebe3caa82853d3638c9102eff7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4591/91e4645ec4e456ebe3caa82853d3638c9102eff7/processes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 12, 2890, 4672, 3536, 1684, 326, 6652, 18, 23665, 675, 67, 23335, 1435, 471, 364, 7904, 18, 1021, 982, 1508, 4097, 982, 67, 2767, 67, 23335, 1435, 471, 1135, 16, 1323, 326, 1151, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 12, 2890, 4672, 3536, 1684, 326, 6652, 18, 23665, 675, 67, 23335, 1435, 471, 364, 7904, 18, 1021, 982, 1508, 4097, 982, 67, 2767, 67, 23335, 1435, 471, 1135, 16, 1323, 326, 1151, ...
help='Port where zope is running at')
help='Port where zope is running at.')
def init_argparser(self, parser): """Add our arguments to a parser """
1cbea72a4cc6134ec543b7e66641f74522ba3a07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14549/1cbea72a4cc6134ec543b7e66641f74522ba3a07/reload.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 67, 3175, 4288, 12, 2890, 16, 2082, 4672, 3536, 986, 3134, 1775, 358, 279, 2082, 3536, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 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, 1208, 67, 3175, 4288, 12, 2890, 16, 2082, 4672, 3536, 986, 3134, 1775, 358, 279, 2082, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous')
m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0)
def matrix(arg0=None, arg1=None, arg2=None, arg3=None, sparse=None): """ Create a matrix. INPUT: Supported formats 1. matrix([sparse=True]): the 0x0 matrix over ZZ 2. matrix(list_of_rows, [sparse=True]): matrix with each row constructed from the list_of_rows 3. matrix(nrows, entries, [sparse=True]): matrix with given number of rows and flat list of entries 4. matrix(nrows, ncols, entries, [sparse=True]): matrix with given number of rows and columns with flat list of entries 5. matrix(ring, list_of_row, [sparse=True]): matrix over ring with rows the elements of the list_of_rows 6. matrix(ring, nrows, entries, [sparse=True]): matrix over ring with given number of rows and entries from the flat list 7. matrix(ring, nrows, ncols, entries, [sparse=True]): matrix over the given ring with given number of rows and columns and entries. 8. matrix(numpy_array) The sparse option is optional, must be explicitly named (i.e., sparse=True), and may be either True or False. The entries can instead be a dictionary of key:value pairs of the form (i,j):x, where i,j are integers instead of a list. If sparse is not specified and the entries are a dictionary, it default to True. OUTPUT: a matrix EXAMPLES: 1. The degenerate matrix input format: sage: m = matrix(); m [] sage: parent(m) Full MatrixSpace of 0 by 0 dense matrices over Integer Ring sage: m = matrix(sparse=True); m [] sage: parent(m) Full MatrixSpace of 0 by 0 sparse matrices over Integer Ring 2. The "matrix(list_of_rows, [sparse])" input format. Notice that SAGE is careful to find a sensible common ring for all the entries (using the Sequence object): sage: x = polygen(QQ) sage: m = matrix([[1/3,2+x],[3,4]]); m [ 1/3 x + 2] [ 3 4] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in x over Rational Field sage: m = matrix([[1,2],[3,4/7]]); m [ 1 2] [ 3 4/7] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: m = matrix([[1,2,3], [RDF(2), CDF(1,2), 3]]); m [ 1.0 2.0 3.0] [ 2.0 1.0 + 2.0*I 3.0] sage: parent(m) Full MatrixSpace of 2 by 3 dense matrices over Complex Double Field sage: V = GF(7)^2 sage: m = matrix([V.0, V.0+2*V.1], sparse=True); m [1 0] [1 2] sage: parent(m) Full MatrixSpace of 2 by 2 sparse matrices over Finite Field of size 7 3. matrix(nrows, entries, [sparse]): sage: matrix(2,[1,2,3, 4,5,6]) [1 2 3] [4 5 6] sage: matrix(3, [1,2, 3/4, 5/6, 7*x, 8*x]) [ 1 2] [3/4 5/6] [7*x 8*x] The number of rows must divide the number of entries. sage: matrix(5,[1,2,3, 4,5,6]) Traceback (most recent call last): ... TypeError: entries has the wrong length 4. matrix(nrows, ncols, entries, [sparse]): sage: matrix(2,3, [1,2,3, 4,5,6]) [1 2 3] [4 5 6] sage: matrix(3,2, [1,2, 3/4, 5/6, 7*x, 8*x]) [ 1 2] [3/4 5/6] [7*x 8*x] The length of the entry list must be the same as the number of rows times columns. sage: matrix(3,3, [1,2, 3/4, 5/6, 7*x, 8*x]) Traceback (most recent call last): ... TypeError: entries has the wrong length 5. matrix(ring, list_of_row, [sparse]): sage: m = matrix(QQ, [[1,2], [3,4]]); m [1 2] [3 4] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: m = matrix(GF(7), [[1/3,2/3,1/2], [3/4,4/5,7]]); m [5 3 4] [6 5 0] sage: parent(m) Full MatrixSpace of 2 by 3 dense matrices over Finite Field of size 7 6. matrix(ring, nrows, entries, [sparse]): sage: M = ZZ^4 sage: m = matrix(QQ, [M([1,2,3,4]), M([-1,0,3,4])]); m [ 1 2 3 4] [-1 0 3 4] sage: parent(m) Full MatrixSpace of 2 by 4 dense matrices over Rational Field 7. matrix(ring, nrows, ncols, entries, [sparse]) sage: matrix(QQ, 2, 2, [1,2,3,4]) [1 2] [3 4] sage: matrix(GF(5), 2, 3, range(6)) [0 1 2] [3 4 0] sage: matrix(ZZ, 10, 10, range(100)).parent() Full MatrixSpace of 10 by 10 dense matrices over Integer Ring sage: matrix(ZZ, 10, 10, range(100), sparse=True).parent() Full MatrixSpace of 10 by 10 sparse matrices over Integer Ring sage: R = PolynomialRing(QQ, 9, 'x') sage: A = matrix(R, 3, 3, R.gens()); A [x0 x1 x2] [x3 x4 x5] [x6 x7 x8] sage: det(A) -x2*x4*x6 + x1*x5*x6 + x2*x3*x7 - x0*x5*x7 - x1*x3*x8 + x0*x4*x8 CREATING SPARSE MATRICES FROM DICTS: sage: a = matrix({(1,2):10, (2,3):5/1}) sage: print a, a.parent() [ 0 0 0 0] [ 0 0 10 0] [ 0 0 0 5] Full MatrixSpace of 3 by 4 sparse matrices over Rational Field sage: a = matrix({(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] True sage: a = matrix(3,{(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(3,5,{(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0 0 0] [ 0 0 10 0 0] [ 0 0 0 0 0] True sage: a = matrix(QQ, 3, {(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(QQ, 3, {(1,2):10}, sparse=True) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(QQ, 3, 5, {(1,2):10}, sparse=True) sage: print a, a.is_sparse() [ 0 0 0 0 0] [ 0 0 10 0 0] [ 0 0 0 0 0] True 8. Creating a matrix from a numpy array Any numpy array with a datatype of float or complex may be passed to matrix If the data type is float the result will be a matrix over the real double field. complex numpy arrays will give matrices over the complex double field. The data of the numpy array must be contiguous, so slices of other matrices will raise an exception. sage: import numpy sage: n=numpy.array([[1,2],[3,4]],float) sage: m=matrix(n) sage: n=numpy.array([[numpy.complex(0,1),numpy.complex(0,2)],[3,4]],complex) sage: m=matrix(n) TESTS: sage: import numpy sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'float32') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'float64') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'complex64') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'complex128') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = matrix([[1,2],[3,4]]) sage: b = matrix(a.numpy()); b [1 2] [3 4] sage: a == b True sage: c = matrix(a.numpy('float32')); c [1.0 2.0] [3.0 4.0] """ if hasattr(arg0, '_matrix_'): if arg1 is None: arg1 = rings.ZZ return arg0._matrix_(arg1) if hasattr(arg1, '_matrix_'): return arg1._matrix_(arg0) if arg0 is None: # 1. matrix([sparse]): # the 0x0 matrix over ZZ # the degenerate matrix ring = rings.ZZ nrows = 0 ncols = 0 entries = [] elif isinstance(arg0, (list, tuple)): # 2. matrix(list_of_rows, [sparse]): # matrix with each row constructed from the list_of_rows # list of rows if not (arg1 is None and arg2 is None and arg3 is None): raise TypeError, "invalid input" nrows = len(arg0) if nrows == 0: ncols = 0 else: ncols = len(arg0[0]) w = sum([list(v) for v in arg0], []) entries, ring = prepare(w) elif isinstance(arg0, dict): # 2. matrix(dict_of_rows, sparse=True): if sparse is None: sparse = True entries, ring = prepare_dict(arg0) nrows = nrows_from_dict(entries) ncols = ncols_from_dict(entries) elif not rings.is_Ring(arg0) and isinstance(arg1, (list, tuple)) and arg2 is None and arg3 is None: # 3. matrix(nrows, entries, [sparse]): # matrix with given number of rows and flat list of entries nrows = int(arg0) entries, ring = prepare(arg1) ncols = len(entries) // nrows elif not rings.is_Ring(arg0) and isinstance(arg1, dict) and arg2 is None and arg3 is None: # 3. matrix(nrows, entries, sparse=True): # matrix with given number of rows and sparse dict of entries if sparse is None: sparse = True nrows = int(arg0) entries, ring = prepare_dict(arg1) ncols = ncols_from_dict(entries) elif not rings.is_Ring(arg0) and isinstance(arg2, (list, tuple)) and arg3 is None: # 4. matrix(nrows, ncols, entries, [sparse]): # matrix with given number of rows and columns with flat list of entries nrows = int(arg0) ncols = int(arg1) entries, ring = prepare(arg2) elif not rings.is_Ring(arg0) and isinstance(arg2, dict) and arg3 is None: # 4. matrix(nrows, ncols, entries, sparse=True): # matrix with given number of rows and columns with flat list of entries if sparse is None: sparse = True nrows = int(arg0) ncols = int(arg1) entries, ring = prepare_dict(arg2) elif rings.is_Ring(arg0) and isinstance(arg1, (list, tuple)) and arg2 is None and arg3 is None: # 5. matrix(ring, list_of_row, [sparse]): # matrix over ring with rows the elements of the list_of_rows ring = arg0 nrows = len(arg1) if nrows == 0: ncols = 0 else: try: ncols = len(arg1[0]) except TypeError: raise TypeError, "If making a matrix with the matrix(ring, list_of_row, [sparse]) constructor, the second input must be a list of rows." entries = sum([list(v) for v in arg1], []) elif rings.is_Ring(arg0) and isinstance(arg1, dict) and arg2 is None and arg3 is None: # 5. matrix(ring, dict, sparse=True): # matrix over ring with rows the elements the dict if sparse is None: sparse = True ring = arg0 entries = arg1 nrows = nrows_from_dict(entries) elif rings.is_Ring(arg0) and isinstance(arg2, (list, tuple)) and arg3 is None: # 6. matrix(ring, nrows, entries, [sparse]): # matrix over ring with given number of rows and entries from the flat list ring = arg0 nrows = int(arg1) entries = arg2 if nrows == 0: ncols = 0 else: ncols = len(entries) // nrows elif rings.is_Ring(arg0) and isinstance(arg2, dict) and arg3 is None: # 6. matrix(ring, nrows, entries, sparse=True) # matrix over ring with given number of rows and entries from the dict if sparse is None: sparse = True ring = arg0 nrows = int(arg1) entries = arg2 if nrows == 0: ncols = 0 else: ncols = ncols_from_dict(entries) elif rings.is_Ring(arg0): # 7. matrix(ring, nrows, ncols, entries, [sparse]): # matrix over the given ring with given number of rows and columns and entries. ring = arg0 nrows = int(arg1) if arg2 is None: ncols = nrows else: ncols = int(arg2) entries = arg3 if isinstance(entries, dict): if sparse is None: sparse = True else: import numpy if isinstance(arg0,numpy.ndarray): str_dtype = str(arg0.dtype) if str_dtype.count('float32')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy32(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('float64')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('complex64')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(CDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy32(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('complex128')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(CDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('object') == 1: #Get the raw nested list from the numpy array #and feed it back into matrix try: return matrix( map(list, list(arg0)) ) except TypeError: raise TypeError("cannot convert numpy matrix to SAGE matrix") else: raise TypeError("cannot convert numpy matrix to SAGE matrix") else: raise TypeError, "unknown matrix constructor format. Type matrix? for help" if sparse is None: sparse = False return matrix_space.MatrixSpace(ring, nrows, ncols, sparse=sparse)(entries)
afaca1e12ee60ebc48a960e19c48135538784f50 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/afaca1e12ee60ebc48a960e19c48135538784f50/constructor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3148, 12, 3175, 20, 33, 7036, 16, 1501, 21, 33, 7036, 16, 1501, 22, 33, 7036, 16, 1501, 23, 33, 7036, 16, 9387, 33, 7036, 4672, 3536, 1788, 279, 3148, 18, 225, 12943, 30, 19503, 6449...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3148, 12, 3175, 20, 33, 7036, 16, 1501, 21, 33, 7036, 16, 1501, 22, 33, 7036, 16, 1501, 23, 33, 7036, 16, 9387, 33, 7036, 4672, 3536, 1788, 279, 3148, 18, 225, 12943, 30, 19503, 6449...
def decrypt(passphrase, data):
def _decrypt(passphrase, data):
def decrypt(passphrase, data): from Crypto.Cipher import AES return AES.new(md5.new(passphrase).digest()[:16]).decrypt(data)
e64ed19422041a89f53fb01cf7eeb17a2fc1e6f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e64ed19422041a89f53fb01cf7eeb17a2fc1e6f1/persist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 19790, 12, 5466, 9429, 16, 501, 4672, 628, 15629, 18, 13896, 1930, 15986, 327, 15986, 18, 2704, 12, 1264, 25, 18, 2704, 12, 5466, 9429, 2934, 10171, 1435, 10531, 2313, 65, 2934, 197...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 19790, 12, 5466, 9429, 16, 501, 4672, 628, 15629, 18, 13896, 1930, 15986, 327, 15986, 18, 2704, 12, 1264, 25, 18, 2704, 12, 5466, 9429, 2934, 10171, 1435, 10531, 2313, 65, 2934, 197...
if not inick.startswith(cfg.dc_to_irc_prefix):
if not matches_dc_to_irc_prefix(inick):
def dc_from_irc(inick): # Decode an IRC-encoded DC nick, for use in Dtella. # Verify prefix if not inick.startswith(cfg.dc_to_irc_prefix): raise NickError("Bad prefix") dnick = inick[len(cfg.dc_to_irc_prefix):] if not dnick: raise NickError("Nothing after prefix") n_escapes = 0 for c in dnick: if c == '`': n_escapes += 1 if n_escapes: head, tail = dnick.rsplit('-', 1) escapes = base_convert(tail, base36_chars, escape_chars, n_escapes) if len(escapes) != n_escapes: raise NickError("Unknown escape sequence") dnick = '' n_escapes = 0 for c in head: if c == '`': dnick += escapes[n_escapes] n_escapes += 1 else: dnick += c return dnick
02004ebca46b9ef4a32bdaf0d17150117eae70d8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11503/02004ebca46b9ef4a32bdaf0d17150117eae70d8/bridge_server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6744, 67, 2080, 67, 481, 71, 12, 267, 1200, 4672, 468, 6209, 392, 467, 11529, 17, 10787, 21533, 10909, 16, 364, 999, 316, 463, 88, 1165, 69, 18, 225, 468, 8553, 1633, 309, 486, 1885, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6744, 67, 2080, 67, 481, 71, 12, 267, 1200, 4672, 468, 6209, 392, 467, 11529, 17, 10787, 21533, 10909, 16, 364, 999, 316, 463, 88, 1165, 69, 18, 225, 468, 8553, 1633, 309, 486, 1885, ...
if not quiet: print l
ui.status("%s\n" % l)
def import_(ui, repo, patch1, *patches, **opts): """import an ordered set of patches""" try: import psyco psyco.full() except: pass patches = (patch1,) + patches d = opts["base"] strip = opts["strip"] for patch in patches: ui.status("applying %s\n" % patch) pf = os.path.join(d, patch) text = "" for l in file(pf): if l[:4] == "--- ": break text += l # make sure text isn't empty if not text: text = "imported patch %s\n" % patch f = os.popen("patch -p%d < %s" % (strip, pf)) files = [] for l in f.read().splitlines(): l.rstrip('\r\n'); if not quiet: print l if l[:14] == 'patching file ': pf = l[14:] if pf not in files: files.append(pf) patcherr = f.close() if patcherr: sys.stderr.write("patch failed") sys.exit(1) if len(files) > 0: addremove(ui, repo, *files) repo.commit(files, text)
776d10e65815436b813384e1f32dab731173d23d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/776d10e65815436b813384e1f32dab731173d23d/commands.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1930, 67, 12, 4881, 16, 3538, 16, 4729, 21, 16, 380, 30278, 16, 2826, 4952, 4672, 3536, 5666, 392, 5901, 444, 434, 16482, 8395, 775, 30, 1930, 4250, 93, 2894, 4250, 93, 2894, 18, 2854,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1930, 67, 12, 4881, 16, 3538, 16, 4729, 21, 16, 380, 30278, 16, 2826, 4952, 4672, 3536, 5666, 392, 5901, 444, 434, 16482, 8395, 775, 30, 1930, 4250, 93, 2894, 4250, 93, 2894, 18, 2854,...
file.write(data)
script.write(data)
def read(fd): data = os.read(fd, 1024) file.write(data) return data
14b1b833000321d3158fb79440d95ba284b63860 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/14b1b833000321d3158fb79440d95ba284b63860/script.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 12, 8313, 4672, 501, 273, 1140, 18, 896, 12, 8313, 16, 6250, 13, 2728, 18, 2626, 12, 892, 13, 327, 501, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 12, 8313, 4672, 501, 273, 1140, 18, 896, 12, 8313, 16, 6250, 13, 2728, 18, 2626, 12, 892, 13, 327, 501, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
_orig.write(f, txt)
return _orig.write(f, txt)
def _hook(f, txt): if f == 1: sys.stdout.write(txt) else: _orig.write(f, txt)
269e908e6f31947fe8fb3cfc21c8672c3ba3a4da /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11468/269e908e6f31947fe8fb3cfc21c8672c3ba3a4da/console.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4476, 12, 74, 16, 6463, 4672, 309, 284, 422, 404, 30, 2589, 18, 10283, 18, 2626, 12, 5830, 13, 469, 30, 327, 389, 4949, 18, 2626, 12, 74, 16, 6463, 13, 225, 2, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4476, 12, 74, 16, 6463, 4672, 309, 284, 422, 404, 30, 2589, 18, 10283, 18, 2626, 12, 5830, 13, 469, 30, 327, 389, 4949, 18, 2626, 12, 74, 16, 6463, 13, 225, 2, -100, -100, -10...
initialize_record = {u'subtitle': u'', u'director': u'Unknown', u'rating': u'NR', u'inetref': u'00000000', u'year': 1895, u'userrating': 0.0, u'length': 0, u'showlevel': 1, u'coverfile': u'No Cover', u'host': u'',}
initialize_record = {u'title': u'', u'subtitle': u'', u'director': u'Unknown', u'rating': u'NR', u'inetref': u'00000000', u'year': 1895, u'userrating': 0.0, u'length': 0, u'showlevel': 1, u'coverfile': u'No Cover', u'host': u'',}
def __init__(self, configuration): """Retrieve the configuration options """ super(MythTvMetaData, self).__init__(configuration)
6089d4d60f2dab84c6af9981c242684b162de38e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/6089d4d60f2dab84c6af9981c242684b162de38e/jamu.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1664, 4672, 3536, 5767, 326, 1664, 702, 3536, 2240, 12, 12062, 451, 56, 90, 6998, 16, 365, 2934, 972, 2738, 972, 12, 7025, 13, 2, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1664, 4672, 3536, 5767, 326, 1664, 702, 3536, 2240, 12, 12062, 451, 56, 90, 6998, 16, 365, 2934, 972, 2738, 972, 12, 7025, 13, 2, -100, -100, -100, -100,...
del self.barStyle
self.barStyle = None
def destroy(self): del self.barStyle DirectFrame.destroy(self)
654b8a53ee556fb991d81a40fe7da8ec6e28266f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7242/654b8a53ee556fb991d81a40fe7da8ec6e28266f/DirectWaitBar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5546, 12, 2890, 4672, 365, 18, 3215, 2885, 273, 599, 9908, 3219, 18, 11662, 12, 2890, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 5546, 12, 2890, 4672, 365, 18, 3215, 2885, 273, 599, 9908, 3219, 18, 11662, 12, 2890, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
i = find_token(document.body, '\\begin_inset Flex ' + name, position)
i = find_token(document.body, '\\begin_inset Flex ' + name, i)
def revert_flex_inset(document, name, LaTeXname, position): " Convert flex insets to TeX code " i = 0 z = 0 while True: i = find_token(document.body, '\\begin_inset Flex ' + name, position) if i == -1: return z = find_end_of_inset(document.body, i) if z == -1: document.warning("Malformed LyX document: Can't find end of Flex " + name + " inset.") return # remove the \end_inset document.body[z - 2:z + 1] = put_cmd_in_ert("}") # we need to reset character layouts if necessary j = find_token(document.body, '\\emph on', i) k = find_token(document.body, '\\noun on', i) l = find_token(document.body, '\\series', i) m = find_token(document.body, '\\family', i) n = find_token(document.body, '\\shape', i) o = find_token(document.body, '\\color', i) p = find_token(document.body, '\\size', i) q = find_token(document.body, '\\bar under', i) r = find_token(document.body, '\\uuline on', i) s = find_token(document.body, '\\uwave on', i) t = find_token(document.body, '\\strikeout on', i) if j != -1 and j < z: document.body.insert(z-2, "\\emph default") if k != -1 and k < z: document.body.insert(z-2, "\\noun default") if l != -1 and l < z: document.body.insert(z-2, "\\series default") if m != -1 and m < z: document.body.insert(z-2, "\\family default") if n != -1 and n < z: document.body.insert(z-2, "\\shape default") if o != -1 and o < z: document.body.insert(z-2, "\\color inherit") if p != -1 and p < z: document.body.insert(z-2, "\\size default") if q != -1 and q < z: document.body.insert(z-2, "\\bar default") if r != -1 and r < z: document.body.insert(z-2, "\\uuline default") if s != -1 and s < z: document.body.insert(z-2, "\\uwave default") if t != -1 and t < z: document.body.insert(z-2, "\\strikeout default") document.body[i:i+4] = put_cmd_in_ert(LaTeXname + "{") i += 1
6fd3bfd0925f2d122b3356384366dc5bf43b11de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7514/6fd3bfd0925f2d122b3356384366dc5bf43b11de/lyx_2_0.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15226, 67, 27592, 67, 267, 542, 12, 5457, 16, 508, 16, 21072, 21575, 60, 529, 16, 1754, 4672, 315, 4037, 16600, 23576, 358, 28602, 60, 981, 315, 277, 273, 374, 998, 273, 374, 1323, 105...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15226, 67, 27592, 67, 267, 542, 12, 5457, 16, 508, 16, 21072, 21575, 60, 529, 16, 1754, 4672, 315, 4037, 16600, 23576, 358, 28602, 60, 981, 315, 277, 273, 374, 998, 273, 374, 1323, 105...
get_transaction().begin()
transaction.begin()
def start_transaction(self): get_transaction().begin()
dea1e680d7bf4c85345756b9e5eca00c04483554 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/dea1e680d7bf4c85345756b9e5eca00c04483554/zope2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 67, 7958, 12, 2890, 4672, 336, 67, 7958, 7675, 10086, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 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, 787, 67, 7958, 12, 2890, 4672, 336, 67, 7958, 7675, 10086, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
new_code = str(ref_acc_bank.code.ljust(dig,'0') + str(current_num))
try: new_code = str(int(ref_acc_bank.code.ljust(dig,'0')) + current_num) except Exception,e: new_code = str(ref_acc_bank.code.ljust(dig-len(str(current_num)),'0')) + str(current_num)
def action_create(self, cr, uid, ids, context=None): obj_multi = self.browse(cr,uid,ids[0]) obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_position_template = self.pool.get('account.fiscal.position.template') obj_fiscal_position = self.pool.get('account.fiscal.position')
c92cfc7659ca54865ca47cf87f589a084536a040 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/c92cfc7659ca54865ca47cf87f589a084536a040/account.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1301, 67, 2640, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 1081, 67, 7027, 273, 365, 18, 25731, 12, 3353, 16, 1911, 16, 2232, 63, 20, 5717, 1081, 67, 8981, 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, 1301, 67, 2640, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 1081, 67, 7027, 273, 365, 18, 25731, 12, 3353, 16, 1911, 16, 2232, 63, 20, 5717, 1081, 67, 8981, 273,...
self.versionMapping = versionUri
self.versionMapping = UriValueMapping(versionUri)
def __init__(self, versionUri=commonns.relrdf.version, stmtUri=commonns.relrdf.stmt, metaInfoVersion=1): super(AllVersionsMapper, self).__init__()
d029536455356ed4980b2c2d7780a46200da9be3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5223/d029536455356ed4980b2c2d7780a46200da9be3/basicquery.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1177, 3006, 33, 6054, 2387, 18, 2878, 19299, 18, 1589, 16, 3480, 3006, 33, 6054, 2387, 18, 2878, 19299, 18, 10589, 16, 2191, 966, 1444, 33, 21, 4672, 224...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1177, 3006, 33, 6054, 2387, 18, 2878, 19299, 18, 1589, 16, 3480, 3006, 33, 6054, 2387, 18, 2878, 19299, 18, 10589, 16, 2191, 966, 1444, 33, 21, 4672, 224...
The end user should never see this task, and this code should move to C++ once a comfortable region selection as been agreed upon.
The end user should never see this task, and this code should move to C++ once a comfortable region selection as been agreed upon.
def imregion(imagename='', spectral='', stokes='', box='', poly='', circ='', dropExtra=False): """Helper task for seleting regions in images The end user should never see this task, and this code should move to C++ once a comfortable region selection as been agreed upon. """ a=inspect.stack() stacklevel=0 for k in range(len(a)): if (string.find(a[k][1], 'ipython console') > 0): stacklevel=k myf=sys._getframe(stacklevel).f_globals ####local params ia=myf['ia'] cs=myf['cs'] rg=myf['rg'] casalog=myf['casalog'] ### #Add type/menu/range error checking here arg_names=['imagename','spectral','stokes','box','poly','circ'] arg_values=[imagename,spectral,stokes,box,poly,circ] arg_types=[str,(list,str),str,str,str,str,str] #parameter_printvalues(arg_names,arg_values,arg_types) try: parameter_checktype(arg_names,arg_values,arg_types) except TypeError, e: print "imregion -- TypeError: ", e return None except ValueError, e: print "imregion -- OptionError: ", e return None # Now we get to the heart of the script!!! retValue={} try: # Find where the directional, stokes, and spectral # axies are. axes=getimaxes(imagename) # Initialize the coordinate system for the region # we are about to create csys = None ia.open( imagename ) csys=ia.coordsys() # Find where the directional and channel axies are # Save the internal placement of the axies in a list # (which will be in the following order: # direction1: RA, Longitude # direction2: DEC, Lattitude # spectral: chan~chan;>chan;<chan;chan,chan,chan # stokes: I or V axisTypes=csys.axiscoordinatetypes() axisNames=csys.names() stokesValues=[] if ( len(axes[3][1] ) > 0 ): stokesValues=csys.stokes() # Warn user if they've given a selection for an axis # that doesn't exist. if ( len(stokes) > 0 and axes[3][0]=='' ): casalog.post( 'Image file '+imagename+" doesn't have a stokes axis, but stokes values given.", 'WARN' ) if ( len(spectral) > 0 and axes[2][0]=='' ): casalog.post( 'Image file '+imagename+" doesn't have a spectral axis, but spectral values given.", 'WARN' ) #TODO HANDLE a SINGLE DIRECTIONAL AXIS # Get the min/max values for each axis, in pixels # This will be used as the default value if the user # doesn't supply one. # TODO use world coordiates values, when wbox and wpolygon # work. The min/max values will be in blcf, and trcf fullSize=ia.boundingbox(ia.setboxregion()) mins=fullSize['blc'] maxs=fullSize['trc'] # When extracting the coordinates from the user input # that if no units were given that values given are # pixel values. Also note that a ! at the end of a # region indicates that the region is to be not selected. # Initialize our list of regions to start. regions={} # Loop through the list of boxes selecting the region # as specified by the user. ';' separates box specifiations # ',' separtes the coordinate positions. Boxes are # specified in blc, trc coordinats. boxes=[];pols=[];spects=[]; if ( len(box) > 0 ): boxes=box.split(';') pols=[] if ( len(stokes) > 0 ): if ( stokes.count(',') > 0 ): pols=stokes.split(','); else: # We have a string of values that we want toe # make into a list. pols=_make_pol_list( stokes, stokesValues ) pols=_sort_pol_list( pols, stokesValues ) tmpSpects=[] spects=[] if ( len(spectral) > 0 ): if ( spectral.count( ';' ) < 1 ): tmpSpects=spectral.split(',') else: tmpSpects=spectral.split(';') for i in range( len(tmpSpects) ): chanSet=tmpSpects[i].split(',') if ( len( chanSet ) == 1 ): spects.append( chanSet[0] ) else: for j in range( len( chanSet ) ): spects.append( chanSet[j] ) numNewRegions=1 if ( len(boxes) > 0 ): numNewRegions*=len(boxes) if ( len(pols) > 0 and axes[3][0]!='' ): numNewRegions*=len(pols) if ( len(spects) > 0 and axes[2][0]!='' ) : numNewRegions*=len(spects) for regIndex in range( numNewRegions ): # Initialze the bottom-left and top-right coordinates and indexes blc=[] trc=[] for j in range( len( axes ) ): if axes[j][0]=='': # This axes was not found so keep don't add it continue; blc.append('') trc.append('') if ( len(boxes) > 0 ): boxIndex = regIndex % len(boxes) else: boxIndex = -1; if ( len(spects) > 0 and axes[2][0]!=''): specIndex = regIndex % len(spects) else: specIndex = -1; if ( len(pols) > 0 and axes[3][0]!='' ): polIndex = regIndex % len(pols) else: polIndex = -1; if ( boxIndex >= 0 ): # Strip of any leading/trailing square braces. theBox = boxes[boxIndex]; if ( theBox[0]=='[' ): theBox=theBox[1:] if ( theBox[len(theBox)-1]==']' ): theBox=theBox[0:-1] coords = theBox.split(',') if ( len( coords ) != 4 ) : raise Exception, "Illegal box coordinates: "+box+". Expected four values representing the\n\tbottom-left corner and the top-right corner" continue # If the coord. is an int type then its a pixel value. # and we need to add the units. # TODO add a check that they are all the same units # CURRENTLY ONLY SUPPORT PIXEL VALUES! if ( not _imregion_units_given(coords) ): #for coordIndex in range( len( coords ) ): # coords[coordIndex]+='pix' no_op='noop' else: raise Exception, "Sorry! Coordinates are accepted in pixel values only" if ( int(coords[0]) >= mins[axes[0][0]] and int(coords[0]) <= maxs[axes[0][0]] ) : blc[axes[0][0]]=int(coords[0]) elif( int(coords[0]) == -1 ): blc[axes[0][0]] = mins[axes[0][0]] else: raise Exception, "Out of range box pixel coordinate: " \ + coords[0] + ".\nExpected values in the range " \ + str(mins[axes[0][0]]) + " to " \ + str(maxs[axes[0][0]]) if ( int(coords[1]) >= mins[axes[1][0]] and int(coords[1]) <= maxs[axes[1][0]] ): blc[axes[1][0]]=int(coords[1]) elif( int(coords[1]) == -1 ): blc[axes[1][0]] = mins[axes[1][0]] else: raise Exception, "Out of range box pixel coordinate: " \ + coords[1] + ".\nExpected values in the range " \ + str(mins[axes[1][0]]) + " to " \ + str(maxs[axes[1][0]]) if ( int(coords[2]) >= mins[axes[0][0]] and int(coords[2]) <= maxs[axes[0][0]] ): trc[axes[0][0]]=int(coords[2]) elif( int(coords[2]) == -1 ): trc[axes[0][0]] = maxs[axes[0][0]] else: raise Exception, "Out of range box pixel coordinate: " \ + coords[2] + ".\nExpected values in the range " \ + str(mins[axes[0][0]]) + " to "\ + str(maxs[axes[0][0]]) if ( len(stokesValues) > 0 ): if ( int(coords[3]) >= mins[axes[1][0]] and int(coords[3]) <= maxs[axes[1][0]] ): trc[axes[1][0]]=int(coords[3]) elif( int(coords[2]) == -1 ): trc[axes[1][0]] = maxs[axes[1][0]] else: raise Exception, "Out of range box pixel coordinate: " \ + coords[3] + ".\nExpected values in the range " \ + str(mins[axes[1][0]]) + " to "\ + str(maxs[axes[1][0]]) elif ( not dropExtra ): blc[axes[0][0]]=mins[axes[0][0]] blc[axes[1][0]]=mins[axes[1][0]] trc[axes[0][0]]=maxs[axes[0][0]] trc[axes[1][0]]=maxs[axes[1][0]] else: # We don't want to keep this axis so don't add it. noop='noop' if ( ( specIndex < 0 or axes[2][0]=='' ) and dropExtra): # We don't want to keep this axis so don't add it. noop='noop' elif ( specIndex >= 0 and axes[2][0]!=''): #Parse the spectral values, we are # expecting to get a min and max value. values=__parse_spectral(spects[specIndex],str(mins[axes[2][0]]),str(maxs[axes[2][0]]) ) #print "SPECTRAL VALS: ", values if ( values[0] == -1 ): blc[axes[2][0]]=mins[axes[2][0]] else: blc[axes[2][0]]=values[0] if ( values[1] == -1 ): trc[axes[2][0]]=maxs[axes[2][0]] else: trc[axes[2][0]]=values[1] elif ( axes[2][0]!='' ): blc[axes[2][0]]=mins[axes[2][0]] trc[axes[2][0]]=maxs[axes[2][0]] if ( ( polIndex < 0 or axes[3][0]=='' ) and dropExtra ): # We don't want to keep this axis so don't add it. noop='noop' elif ( polIndex >= 0 and axes[2][0]!='' ): # Parse to get this into a pixel value. # Note that we could do this more efficiently, # we could make a region that inlcudes a range of # polarization/stokes values rather then a single value. polVals=_parse_stokes( stokesValues, pols[polIndex],mins[axes[3][0]],maxs[axes[3][0]] ) if ( len(stokesValues) > 0 and polVals[0] == -1 ): blc[axes[3][0]]=mins[axes[3][0]] else: blc[axes[3][0]]=polVals[0] if ( polVals[1] == -1 ): trc[axes[3][0]]=maxs[axes[3][0]] else: trc[axes[3][0]]=polVals[1] elif ( len(stokesValues) > 0 and axes[3][0]!='' ): blc[axes[3][0]]=mins[axes[3][0]] trc[axes[3][0]]=maxs[axes[3][0]] # Create a strings for the wbox command. # For now we assume they are all pixel values, because # this is all we allow. blcStr='' for i in range( len(blc) ): if ( i > 0 ): blcStr+=',' if ( isinstance( blc[i], str ) ): blcStr+=blc[i]+"pix" else: blcStr+=str(blc[i])+"pix" trcStr='' for i in range( len(trc) ): if ( i > 0 ): trcStr+=',' if ( isinstance( trc[i], str ) ): trcStr+=trc[i]+"pix" else: trcStr+=str(trc[i])+"pix" #print "BLC STR: ", blcStr #print "TRC STR: ", trcStr #tmpRegion=rg.box( blc=blc, trc=trc ) tmpRegion=rg.wbox( blc=blcStr, trc=trcStr, csys=csys.torecord() ) regions["region"+str(len(regions))]=tmpRegion casalog.post( "Created Box at: "+str(blc)+" "+str(trc),'DEBUGGING','imregion') # Loop through the list of boxes selecting the region # as specified by the user. ';' separates box specifiations # ',' separtes the coordinate positions. Boxes are # specified in blc, trc coordinates. polys=[]; if ( len(poly) > 0 ): polys=poly.split(';') if ( len(polys)>0 and (len(pols)>0 or len(spects)>0 ) ): casalog.post( 'Sorry! Polygon region supports selection on the directional axes only', 'WARNING', 'imregion') for regIndex in range( len(polys) ): # Loop through the list of values, breaking them into # a list of x and a list of y values. current=polys[regIndex] xVals='' yVals='' for coord in range( 1, len(current), 2 ): if ( coord > 1 ): xVals+=',' yVals+=',' if ( not current[coord].isdigit() ): xVals+=current[coord]+"pix" else: xVals+=current[coord] if ( not current[coord+1].isdigit() ): yVals+=current[coord+1]+"pix" else: yVals+=current[coord+1] tmpRegion=rg.wpolygon( xVals, yVals, csys=csys.torecord() ) regions["region"+str(len(rgs))]=tmpRegion casalog.post("Created polygon region with: "+xVals+"\n\t"+YVals, 'DEBUGGING', 'imregion' ); # Loop through the list of circles selecting the region # as specified by the user. ';' separates box specifiations # ',' separtes the coordinate positions. Boxes are # specified in blc, trc coordinates. if ( len(circ) > 0 ): casalog.post( "Sorry, circle selection is not supported yet!", "WARNING", 'imregion' ) # Cleanup time if ( csys != None ): del csys if ( ia.isopen() ): ia.close() if ( len(regions) > 1 ): retValue = rg.makeunion( regions ) else: retValue=regions['region0'] return retValue except Exception, instance: print '*** Error ***',instance return
a69d01757f03ee69e74cf5758fa605dd04201481 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2098/a69d01757f03ee69e74cf5758fa605dd04201481/imregion.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 709, 6858, 12, 15374, 1069, 2218, 2187, 30066, 2218, 2187, 384, 601, 281, 2218, 2187, 3919, 2218, 2187, 7573, 2218, 2187, 18956, 2218, 2187, 3640, 7800, 33, 8381, 4672, 3536, 2276, 1562, 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, 709, 6858, 12, 15374, 1069, 2218, 2187, 30066, 2218, 2187, 384, 601, 281, 2218, 2187, 3919, 2218, 2187, 7573, 2218, 2187, 18956, 2218, 2187, 3640, 7800, 33, 8381, 4672, 3536, 2276, 1562, 3...
'Naaya News': ('resourceurl', ), 'Naaya Story': ('resourceurl', ),
'Naaya News': ('resourceurl',), 'Naaya Story': ('resourceurl',),
def __init__(self, id): NaayaContentUpdater.__init__(self, id) self.title = 'Update Naaya LinkChecker properties' self.description = '''Adds the islink setting and sets it to False. Use the Properties tab to specify for which properties the islink setting should be set to True. ''' self.update_meta_type = 'Naaya LinkChecker' self.manage_changeProperties(**{'Naaya URL': ('locator',), 'Naaya Pointer': ('pointer',) 'Naaya Event': ('location_url', 'agenda_url', 'event_url'), 'Naaya News': ('resourceurl', ), 'Naaya Story': ('resourceurl', ), })
1c85c6feff08fdf557b57eda81587529e6702842 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3287/1c85c6feff08fdf557b57eda81587529e6702842/update_link_checker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 612, 4672, 16350, 528, 69, 1350, 15305, 16186, 2738, 972, 12, 2890, 16, 612, 13, 365, 18, 2649, 273, 296, 1891, 16350, 528, 69, 4048, 8847, 1790, 11, 365...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 612, 4672, 16350, 528, 69, 1350, 15305, 16186, 2738, 972, 12, 2890, 16, 612, 13, 365, 18, 2649, 273, 296, 1891, 16350, 528, 69, 4048, 8847, 1790, 11, 365...
self.type = 1
self.type = 'n'
def read_package( self, package): b = ['no', 'yes'] type = package.getAttribute( 'type') if type: self.type = type[0] self.order = int( type[1]) else: self.type = 1 self.order = 1 # implied if package.getAttribute( 'distance'): self.bond_width = float( package.getAttribute( 'distance')) * self.paper.real_to_screen_ratio() else: self.bond_width = None if package.getAttribute( 'width'): self.line_width = float( package.getAttribute( 'width')) if package.getAttribute( 'center'): self.center = b.index( package.getAttribute( 'center')) else: self.center = None if package.getAttribute( 'color'): self.line_color = package.getAttribute( 'color') if package.getAttribute( 'double_ratio'): self.double_length_ratio = float( package.getAttribute( 'double_ratio')) # end of implied self.atom1 = self.molecule.get_atom_with_cdml_id( package.getAttribute( 'start')) self.atom2 = self.molecule.get_atom_with_cdml_id( package.getAttribute( 'end'))
fe04687b10f8eea9de476ff3f401d009efb5d0b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4298/fe04687b10f8eea9de476ff3f401d009efb5d0b4/classes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 5610, 12, 365, 16, 2181, 4672, 324, 273, 10228, 2135, 2187, 296, 9707, 3546, 618, 273, 2181, 18, 588, 1499, 12, 296, 723, 6134, 309, 618, 30, 365, 18, 723, 273, 618, 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, 855, 67, 5610, 12, 365, 16, 2181, 4672, 324, 273, 10228, 2135, 2187, 296, 9707, 3546, 618, 273, 2181, 18, 588, 1499, 12, 296, 723, 6134, 309, 618, 30, 365, 18, 723, 273, 618, 63, 20,...
else: addFile(f)
addFile(f)
def addModule(f, recursive=True): if OSNAME != 'posix': return if os.path.isdir(f): for i in glob.glob(f): if os.path.isdir(f + os.sep + i) and recursive: addModule(f + os.sep + i) elif i[-3:] == '.py': addModule(f + os.sep + i) elif f[-3:] == '.py': try: py_compile.compile(f) if os.path.exists(f+'o'): addFile(f+'o') addFile(f) elif os.path.exists(f+'c'): addFile(f+'c') addFile(f) else: addFile(f) except: print >> sys.stderr, 'Error while compyling', f addFile(f)
a2dbe49821a3445804104a60e1d9d3e41981ac44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11142/a2dbe49821a3445804104a60e1d9d3e41981ac44/build-required-files.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 3120, 12, 74, 16, 5904, 33, 5510, 4672, 309, 5932, 1985, 480, 296, 24463, 4278, 327, 309, 1140, 18, 803, 18, 291, 1214, 12, 74, 4672, 364, 277, 316, 4715, 18, 10581, 12, 74, 467...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 3120, 12, 74, 16, 5904, 33, 5510, 4672, 309, 5932, 1985, 480, 296, 24463, 4278, 327, 309, 1140, 18, 803, 18, 291, 1214, 12, 74, 4672, 364, 277, 316, 4715, 18, 10581, 12, 74, 467...
seen.add(childTup)
def findAllWeakTrovesToRemove(group, primaryErases, cache): # we only remove weak troves if either a) they are primary # removes or b) they are referenced only by troves being removed primaryErases = list(primaryErases) toErase = set(primaryErases) seen = set() parents = {} troveQueue = util.IterableQueue() # create temporary parents info for all troves. Unfortunately # we don't have this anywhere helpful like we do in the erase # on the system in conaryclient.update for troveTup in chain(group.iterTroveList(strongRefs=True), troveQueue): for childTup in cache.iterTroveList(troveTup, strongRefs=True): parents.setdefault(childTup, []).append(troveTup) if trove.troveIsCollection(childTup[0]): troveQueue.add(childTup) for troveTup in chain(primaryErases, troveQueue): for childTup in cache.iterTroveList(troveTup, strongRefs=True): if childTup in seen: continue seen.add(childTup) keepTrove = False for parentTup in parents[childTup]: if parentTup == troveTup: continue if parentTup not in toErase: keepTrove = True break if not keepTrove: toErase.add(childTup) return toErase
3505c4e8ba4f904bd18e7c444ecaa0e59edf33e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/3505c4e8ba4f904bd18e7c444ecaa0e59edf33e2/grouprecipe.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11135, 3218, 581, 56, 303, 3324, 12765, 12, 1655, 16, 3354, 41, 17415, 16, 1247, 4672, 468, 732, 1338, 1206, 16046, 23432, 3324, 309, 3344, 279, 13, 2898, 854, 3354, 468, 7157, 578, 324,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11135, 3218, 581, 56, 303, 3324, 12765, 12, 1655, 16, 3354, 41, 17415, 16, 1247, 4672, 468, 732, 1338, 1206, 16046, 23432, 3324, 309, 3344, 279, 13, 2898, 854, 3354, 468, 7157, 578, 324,...
actual mutators set, result in two calls: ``instance.setId(123)`` and
actual mutators set, result in two calls: ``instance.setId('123')`` and
def updateAll(self, instance, **kwargs): """This method mutates fields in the given instance.
57f07172fb783f0b18729c2dd8c0117cb745b1db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/57f07172fb783f0b18729c2dd8c0117cb745b1db/Schema.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 1595, 12, 2890, 16, 791, 16, 2826, 4333, 4672, 3536, 2503, 707, 4318, 815, 1466, 316, 326, 864, 791, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1595, 12, 2890, 16, 791, 16, 2826, 4333, 4672, 3536, 2503, 707, 4318, 815, 1466, 316, 326, 864, 791, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.journal_name
self.journal_name = journal_name
def __init__(self, language, journal_name): """ Initialisation. """ self.language = language self.journal_name
d627e6c45c40d98e4cb9a9b7103e950684051bf8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/d627e6c45c40d98e4cb9a9b7103e950684051bf8/webjournal_config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2653, 16, 13001, 67, 529, 4672, 3536, 10188, 10742, 18, 3536, 365, 18, 4923, 273, 2653, 365, 18, 22644, 67, 529, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2653, 16, 13001, 67, 529, 4672, 3536, 10188, 10742, 18, 3536, 365, 18, 4923, 273, 2653, 365, 18, 22644, 67, 529, 2, -100, -100, -100, -100, -100, -100, -...
if startline is None: s += ' %s\n' % warning
if startline == '??': log.warn(' %s' % warning)
def report_errors(self, api_doc, parse_errors, field_warnings): if not parse_errors and not field_warnings: return
4a2361b347ff4cb39ca22c09d1559c349cc1e0d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/4a2361b347ff4cb39ca22c09d1559c349cc1e0d1/docstringparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2605, 67, 4324, 12, 2890, 16, 1536, 67, 2434, 16, 1109, 67, 4324, 16, 652, 67, 12103, 4672, 309, 486, 1109, 67, 4324, 471, 486, 652, 67, 12103, 30, 327, 2, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2605, 67, 4324, 12, 2890, 16, 1536, 67, 2434, 16, 1109, 67, 4324, 16, 652, 67, 12103, 4672, 309, 486, 1109, 67, 4324, 471, 486, 652, 67, 12103, 30, 327, 2, -100, -100, -100, -100, -1...
libs = [ os.path.join("$OPT_PREFIX","lib",p) for
libs = [ os.path.join("$XERCESC_PREFIX","lib",p) for
def __init__(self): headers = [ os.path.join("$OPT_PREFIX","include","xercesc",p) for p in xerces_headers ] libs = [ os.path.join("$OPT_PREFIX","lib",p) for p in xerces_libs ] Package.__init__(self, "XERCESC", "src/xercesc/runConfigure", actions, libs + headers, default_package_file = "xerces-c-src_2_7_0.tar.gz")
fc17103723e7b449fc5a798ec3a82fa5290857e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1466/fc17103723e7b449fc5a798ec3a82fa5290857e6/xercesc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 225, 1607, 273, 306, 1140, 18, 803, 18, 5701, 2932, 8, 15620, 67, 6307, 15937, 6702, 15937, 92, 12610, 742, 3113, 84, 13, 364, 293, 316, 619, 264, 764,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 225, 1607, 273, 306, 1140, 18, 803, 18, 5701, 2932, 8, 15620, 67, 6307, 15937, 6702, 15937, 92, 12610, 742, 3113, 84, 13, 364, 293, 316, 619, 264, 764,...
try: return str(hash(obj)) except: return crc32(repr(obj))
try: return str(hash(obj)) except: try: return crc32(repr(obj)) except: return crc32(unicode(obj))
def make_tag(obj): """ Collisisons here don't matter much. """ try: return str(hash(obj)) except: return crc32(repr(obj))
09053e78d0dad7c9a5bc8b525da602750b58d994 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10360/09053e78d0dad7c9a5bc8b525da602750b58d994/util.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 2692, 12, 2603, 4672, 3536, 17596, 291, 4530, 87, 2674, 2727, 1404, 15177, 9816, 18, 3536, 775, 30, 327, 609, 12, 2816, 12, 2603, 3719, 1335, 30, 775, 30, 327, 10619, 1578, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1221, 67, 2692, 12, 2603, 4672, 3536, 17596, 291, 4530, 87, 2674, 2727, 1404, 15177, 9816, 18, 3536, 775, 30, 327, 609, 12, 2816, 12, 2603, 3719, 1335, 30, 775, 30, 327, 10619, 1578, 1...
labelSaveTitle.pack(side=TOP,anchor=W,padx=5,pady=5)
def CreatePageGeneral(self): #tkVars self.winWidth=StringVar(self) self.winHeight=StringVar(self) self.paraWidth=StringVar(self) self.startupEdit=IntVar(self) self.autoSave=IntVar(self) self.encoding=StringVar(self) self.userHelpBrowser=BooleanVar(self) self.helpBrowser=StringVar(self) #widget creation #body frame=self.tabPages.pages['General']['page'] #body section frames frameRun=Frame(frame,borderwidth=2,relief=GROOVE) frameSave=Frame(frame,borderwidth=2,relief=GROOVE) frameWinSize=Frame(frame,borderwidth=2,relief=GROOVE) frameParaSize=Frame(frame,borderwidth=2,relief=GROOVE) frameEncoding=Frame(frame,borderwidth=2,relief=GROOVE) frameHelp=Frame(frame,borderwidth=2,relief=GROOVE) #frameRun labelRunTitle=Label(frameRun,text='Startup Preferences') labelRunChoiceTitle=Label(frameRun,text='At Startup') radioStartupEdit=Radiobutton(frameRun,variable=self.startupEdit, value=1,command=self.SetKeysType,text="Open Edit Window") radioStartupShell=Radiobutton(frameRun,variable=self.startupEdit, value=0,command=self.SetKeysType,text='Open Shell Window') #frameSave labelSaveTitle=Label(frameSave,text='Autosave Preference') labelRunSaveTitle=Label(frameSave,text='At Start of Run (F5) ') radioSaveAsk=Radiobutton(frameSave,variable=self.autoSave, value=0,command=self.SetKeysType,text="Prompt to Save") radioSaveAuto=Radiobutton(frameSave,variable=self.autoSave, value=1,command=self.SetKeysType,text='No Prompt') #frameWinSize labelWinSizeTitle=Label(frameWinSize,text='Initial Window Size'+ ' (in characters)') labelWinWidthTitle=Label(frameWinSize,text='Width') entryWinWidth=Entry(frameWinSize,textvariable=self.winWidth, width=3) labelWinHeightTitle=Label(frameWinSize,text='Height') entryWinHeight=Entry(frameWinSize,textvariable=self.winHeight, width=3) #paragraphFormatWidth labelParaWidthTitle=Label(frameParaSize,text='Paragraph reformat'+ ' width (in characters)') entryParaWidth=Entry(frameParaSize,textvariable=self.paraWidth, width=3) #frameEncoding labelEncodingTitle=Label(frameEncoding,text="Default Source Encoding") radioEncLocale=Radiobutton(frameEncoding,variable=self.encoding, value="locale",text="Locale-defined") radioEncUTF8=Radiobutton(frameEncoding,variable=self.encoding, value="utf-8",text="UTF-8") radioEncNone=Radiobutton(frameEncoding,variable=self.encoding, value="none",text="None") #frameHelp frameHelpList=Frame(frameHelp) frameHelpListButtons=Frame(frameHelpList) labelHelpListTitle=Label(frameHelpList,text='Additional Help Sources:') scrollHelpList=Scrollbar(frameHelpList) self.listHelp=Listbox(frameHelpList,height=5,takefocus=FALSE, exportselection=FALSE) scrollHelpList.config(command=self.listHelp.yview) self.listHelp.config(yscrollcommand=scrollHelpList.set) self.listHelp.bind('<ButtonRelease-1>',self.HelpSourceSelected) self.buttonHelpListEdit=Button(frameHelpListButtons,text='Edit', state=DISABLED,width=8,command=self.HelpListItemEdit) self.buttonHelpListAdd=Button(frameHelpListButtons,text='Add', width=8,command=self.HelpListItemAdd) self.buttonHelpListRemove=Button(frameHelpListButtons,text='Remove', state=DISABLED,width=8,command=self.HelpListItemRemove) #widget packing #body frameRun.pack(side=TOP,padx=5,pady=5,fill=X) frameSave.pack(side=TOP,padx=5,pady=5,fill=X) frameWinSize.pack(side=TOP,padx=5,pady=5,fill=X) frameParaSize.pack(side=TOP,padx=5,pady=5,fill=X) frameEncoding.pack(side=TOP,padx=5,pady=5,fill=X) frameHelp.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH) #frameRun labelRunTitle.pack(side=TOP,anchor=W,padx=5,pady=5) labelRunChoiceTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) radioStartupShell.pack(side=RIGHT,anchor=W,padx=5,pady=5) radioStartupEdit.pack(side=RIGHT,anchor=W,padx=5,pady=5) #frameSave labelSaveTitle.pack(side=TOP,anchor=W,padx=5,pady=5) labelRunSaveTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) radioSaveAuto.pack(side=RIGHT,anchor=W,padx=5,pady=5) radioSaveAsk.pack(side=RIGHT,anchor=W,padx=5,pady=5) #frameWinSize labelWinSizeTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) entryWinHeight.pack(side=RIGHT,anchor=E,padx=10,pady=5) labelWinHeightTitle.pack(side=RIGHT,anchor=E,pady=5) entryWinWidth.pack(side=RIGHT,anchor=E,padx=10,pady=5) labelWinWidthTitle.pack(side=RIGHT,anchor=E,pady=5) #paragraphFormatWidth labelParaWidthTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) entryParaWidth.pack(side=RIGHT,anchor=E,padx=10,pady=5) #frameEncoding labelEncodingTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) radioEncNone.pack(side=RIGHT,anchor=E,pady=5) radioEncUTF8.pack(side=RIGHT,anchor=E,pady=5) radioEncLocale.pack(side=RIGHT,anchor=E,pady=5) #frameHelp frameHelpListButtons.pack(side=RIGHT,padx=5,pady=5,fill=Y) frameHelpList.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH) labelHelpListTitle.pack(side=TOP,anchor=W) scrollHelpList.pack(side=RIGHT,anchor=W,fill=Y) self.listHelp.pack(side=LEFT,anchor=E,expand=TRUE,fill=BOTH) self.buttonHelpListEdit.pack(side=TOP,anchor=W,pady=5) self.buttonHelpListAdd.pack(side=TOP,anchor=W) self.buttonHelpListRemove.pack(side=TOP,anchor=W,pady=5) return frame
cb3fac2e967e9ef77ede3f9945cfed8702f7e0a5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/cb3fac2e967e9ef77ede3f9945cfed8702f7e0a5/configDialog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1788, 1964, 12580, 12, 2890, 4672, 468, 16099, 5555, 365, 18, 8082, 2384, 33, 780, 1537, 12, 2890, 13, 365, 18, 8082, 2686, 33, 780, 1537, 12, 2890, 13, 365, 18, 25072, 2384, 33, 780, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1964, 12580, 12, 2890, 4672, 468, 16099, 5555, 365, 18, 8082, 2384, 33, 780, 1537, 12, 2890, 13, 365, 18, 8082, 2686, 33, 780, 1537, 12, 2890, 13, 365, 18, 25072, 2384, 33, 780, ...
value = params["prop%s_value" % property_num][0]
vName = "prop%s_value" % property_num if params.has_key(vName): value = params[vName][0] else: value = ''
def deleteProperty(self, params): property_num = params["processor"][0][4:] subject = params["uri"][0] property = params["prop%s_name" % property_num][0] value = params["prop%s_value" % property_num][0] if self.qstore.get(property, self.qstore.RANGE, None)[0][2]==self.qstore.LITERAL: value = "^" + value self.qstore.getStore().remove(subject, property, value)
fde83ade30529ea05460d00eff740235812dde7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7049/fde83ade30529ea05460d00eff740235812dde7b/editor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1430, 1396, 12, 2890, 16, 859, 4672, 1272, 67, 2107, 273, 859, 9614, 8700, 6, 6362, 20, 6362, 24, 26894, 3221, 273, 859, 9614, 1650, 6, 6362, 20, 65, 1272, 273, 859, 9614, 5986, 9, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1430, 1396, 12, 2890, 16, 859, 4672, 1272, 67, 2107, 273, 859, 9614, 8700, 6, 6362, 20, 6362, 24, 26894, 3221, 273, 859, 9614, 1650, 6, 6362, 20, 65, 1272, 273, 859, 9614, 5986, 9, 8...
directory= getDefaultWorkingDirectory()
directory = self.currentWorkingDirectory if directory == '': directory= getDefaultWorkingDirectory()
def loadFavorite(self): """ Prompts the user to choose a "favorite file" (i.e. *.txt) from disk to be added to the personal favorites list. """ # If the file already exists in the favorites folder then the user is # given the option of overwriting it or renaming it env.history.message(greenmsg("Load Favorite File:")) formats = \ "Favorite (*.txt);;"\ "All Files (*.*)" directory= getDefaultWorkingDirectory() fname = QFileDialog.getOpenFileName(self, "Choose a file to load", directory, formats) if not fname: env.history.message("User cancelled loading file.") return
82ed4dd06ff34b616433cbcc7ebbbd928fc50087 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/82ed4dd06ff34b616433cbcc7ebbbd928fc50087/DnaDisplayStyle_PropertyManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 31745, 1137, 12, 2890, 4672, 3536, 17552, 1092, 326, 729, 358, 9876, 279, 315, 19731, 280, 1137, 585, 6, 261, 77, 18, 73, 18, 380, 18, 5830, 13, 628, 4234, 358, 506, 3096, 358, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 31745, 1137, 12, 2890, 4672, 3536, 17552, 1092, 326, 729, 358, 9876, 279, 315, 19731, 280, 1137, 585, 6, 261, 77, 18, 73, 18, 380, 18, 5830, 13, 628, 4234, 358, 506, 3096, 358, ...
file.write(_escape_cdata(node.text, encoding))
file.write(_encode(_escape_cdata(node.text), encoding))
def _write(self, file, node, encoding, namespaces): # write XML to file tag = node.tag if tag is Comment: file.write("<!-- %s -->" % _escape_cdata(node.text, encoding)) elif tag is ProcessingInstruction: file.write("<?%s?>" % _escape_cdata(node.text, encoding)) else: items = list(node.items()) xmlns_items = [] # new namespaces in this scope try: if isinstance(tag, QName) or tag[:1] == "{": tag, xmlns = fixtag(tag, namespaces) if xmlns: xmlns_items.append(xmlns) except TypeError: _raise_serialization_error(tag) file.write("<" + _encode(tag, encoding)) if items or xmlns_items: items.sort() # lexical order for k, v in items: try: if isinstance(k, QName) or k[:1] == "{": k, xmlns = fixtag(k, namespaces) if xmlns: xmlns_items.append(xmlns) except TypeError: _raise_serialization_error(k) try: if isinstance(v, QName): v, xmlns = fixtag(v, namespaces) if xmlns: xmlns_items.append(xmlns) except TypeError: _raise_serialization_error(v) file.write(" %s=\"%s\"" % (_encode(k, encoding), _escape_attrib(v, encoding))) for k, v in xmlns_items: file.write(" %s=\"%s\"" % (_encode(k, encoding), _escape_attrib(v, encoding))) if node.text or len(node): file.write(">") if node.text: file.write(_escape_cdata(node.text, encoding)) for n in node: self._write(file, n, encoding, namespaces) file.write("</" + _encode(tag, encoding) + ">") else: file.write(" />") for k, v in xmlns_items: del namespaces[v] if node.tail: file.write(_escape_cdata(node.tail, encoding))
e4cfaf8f7bb5d21848fb232e3757979401720c1d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/e4cfaf8f7bb5d21848fb232e3757979401720c1d/ElementTree.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 12, 2890, 16, 585, 16, 756, 16, 2688, 16, 7728, 4672, 468, 1045, 3167, 358, 585, 1047, 273, 756, 18, 2692, 309, 1047, 353, 9821, 30, 585, 18, 2626, 2932, 5586, 413, 738, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2626, 12, 2890, 16, 585, 16, 756, 16, 2688, 16, 7728, 4672, 468, 1045, 3167, 358, 585, 1047, 273, 756, 18, 2692, 309, 1047, 353, 9821, 30, 585, 18, 2626, 2932, 5586, 413, 738, 8...
self.TC = TrueCrypt("ME182BT")
self.TC = TrueCrypt()
def table(self): self.liststore = gtk.ListStore(str, str, str, 'gboolean') self.treeview = gtk.TreeView(self.liststore) self.container = gtk.TreeViewColumn('Container') self.target = gtk.TreeViewColumn('Mountpoint') self.state = gtk.TreeViewColumn('State') self.TC = TrueCrypt("ME182BT") container = self.TC.getList() for c in container: container_list = [c[1][0], c[1][1], c[1][2], "True"] self.liststore.append(container_list) self.treeview.append_column(self.container) self.treeview.append_column(self.target) self.treeview.append_column(self.state) self.cellpb = gtk.CellRendererText() self.cell = gtk.CellRendererText() self.cell1 = gtk.CellRendererText() self.cellpb.set_property('cell-background', 'white') self.cell.set_property('cell-background', 'white') self.cell1.set_property('cell-background', 'white') self.container.pack_start(self.cellpb, False) self.state.pack_start(self.cell, True) self.target.pack_start(self.cell1, True) #if gtk.gtk_version[1] < 2: # self.container.set_cell_data_func(self.cellpb, self.make_pb) #else: # self.container.set_attributes(self.cellpb, stock_id=1) self.button = gtk.Button("action")#Has to be renamed automaticly on changing cont.-state (,ount/eject/details) self.button.show() self.container.set_attributes(self.cellpb, text=0) self.target.set_attributes(self.cell1, text=1) self.state.set_attributes(self.cell, text=2) self.scrolledwindow = gtk.ScrolledWindow() self.scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.scrolledwindow.add(self.treeview) self.vbox = gtk.VBox() self.button.connect('clicked', self.action) self.vbox.show() self.vbox.pack_start(self.scrolledwindow, True) self.vbox.pack_start(self.button, False) self.window.add(self.vbox) self.window.show_all()
cff5d0dc6667625121bff6ab36b3b3f437675ef6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3000/cff5d0dc6667625121bff6ab36b3b3f437675ef6/gTrueCrypt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1014, 12, 2890, 4672, 365, 18, 1098, 2233, 273, 22718, 18, 682, 2257, 12, 701, 16, 609, 16, 609, 16, 296, 75, 6494, 6134, 365, 18, 3413, 1945, 273, 22718, 18, 2471, 1767, 12, 2890, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1014, 12, 2890, 4672, 365, 18, 1098, 2233, 273, 22718, 18, 682, 2257, 12, 701, 16, 609, 16, 609, 16, 296, 75, 6494, 6134, 365, 18, 3413, 1945, 273, 22718, 18, 2471, 1767, 12, 2890, 1...
volumeBasis = map(mayaVectors.MayaVector, api.getObjectBases(volume))
volumeBasis = [ Vector( (v.x, v.y, v.z) ) for v in api.getObjectBases( volume ) ]
def __init__( self, x, y, z, vertIdx=None ): vectors.Vector.__init__(self, [x, y, z]) self.id = vertIdx
52564d4a95cbac131256446089e9d6a4b90b66d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1810/52564d4a95cbac131256446089e9d6a4b90b66d9/meshUtils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 365, 16, 619, 16, 677, 16, 998, 16, 3173, 4223, 33, 7036, 262, 30, 10046, 18, 5018, 16186, 2738, 972, 12, 2890, 16, 306, 92, 16, 677, 16, 998, 5717, 365, 18, 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, 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, 365, 16, 619, 16, 677, 16, 998, 16, 3173, 4223, 33, 7036, 262, 30, 10046, 18, 5018, 16186, 2738, 972, 12, 2890, 16, 306, 92, 16, 677, 16, 998, 5717, 365, 18, 3...
stext = string.split(text)
stext = text.split()
def splitspace(text): # split on spacing but include spaces at element ends stext = string.split(text) result = [] for e in stext: result.append(e+" ") return result
041e2d265f4d145658b08edc02ff501d425029d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/041e2d265f4d145658b08edc02ff501d425029d6/para.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1416, 2981, 12, 955, 4672, 468, 1416, 603, 13259, 1496, 2341, 7292, 622, 930, 3930, 384, 408, 273, 977, 18, 4939, 1435, 563, 273, 5378, 364, 425, 316, 384, 408, 30, 563, 18, 6923, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1416, 2981, 12, 955, 4672, 468, 1416, 603, 13259, 1496, 2341, 7292, 622, 930, 3930, 384, 408, 273, 977, 18, 4939, 1435, 563, 273, 5378, 364, 425, 316, 384, 408, 30, 563, 18, 6923, 12, ...
fromRepo = UnicodeCol(alternateID=True, length=32) toRepo = UnicodeCol(default=None, length=32)
fromRepo = UnicodeCol(alternateID=True, length=UnicodeColKeyLength) toRepo = UnicodeCol(default=None)
def ageFileDetails(): for d in Directory.select(): d.age_file_details()
1914e98105bad444213144f8ad795c2e01bf6f73 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13031/1914e98105bad444213144f8ad795c2e01bf6f73/model.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9388, 812, 3790, 13332, 364, 302, 316, 8930, 18, 4025, 13332, 302, 18, 410, 67, 768, 67, 6395, 1435, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9388, 812, 3790, 13332, 364, 302, 316, 8930, 18, 4025, 13332, 302, 18, 410, 67, 768, 67, 6395, 1435, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
pid = readpidfile('syslog-ng.pid')
def readpidfile(pidfile): f = open(pidfile, 'r') pid = f.read() f.close() return int(pid.strip())
9fd942cf8f8dc81756b293cca46fe1e5462c724f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1177/9fd942cf8f8dc81756b293cca46fe1e5462c724f/func_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 6610, 768, 12, 6610, 768, 4672, 284, 273, 1696, 12, 6610, 768, 16, 296, 86, 6134, 4231, 273, 284, 18, 896, 1435, 284, 18, 4412, 1435, 327, 509, 12, 6610, 18, 6406, 10756, 225, 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, 855, 6610, 768, 12, 6610, 768, 4672, 284, 273, 1696, 12, 6610, 768, 16, 296, 86, 6134, 4231, 273, 284, 18, 896, 1435, 284, 18, 4412, 1435, 327, 509, 12, 6610, 18, 6406, 10756, 225, 2...
for line in Node.printTree(self, -1)[2:].split('\n'): print line
tree = str(self) for child in self.childNodes: tree += child.printTree(2) return tree
def printTree(self): for line in Node.printTree(self, -1)[2:].split('\n'): print line
3f6081e8cdf476677cbd0ea3842a280aa8d91840 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4487/3f6081e8cdf476677cbd0ea3842a280aa8d91840/parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 2471, 12, 2890, 4672, 364, 980, 316, 2029, 18, 1188, 2471, 12, 2890, 16, 300, 21, 25146, 22, 30, 8009, 4939, 2668, 64, 82, 11, 4672, 1172, 980, 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, 1172, 2471, 12, 2890, 4672, 364, 980, 316, 2029, 18, 1188, 2471, 12, 2890, 16, 300, 21, 25146, 22, 30, 8009, 4939, 2668, 64, 82, 11, 4672, 1172, 980, 2, -100, -100, -100, -100, -100, ...
print doc
self.stdout.write("%s\n"%str(doc))
def do_help(self, arg): if arg: # XXX check arg syntax try: func = getattr(self, 'help_' + arg) except AttributeError: try: doc=getattr(self, 'do_' + arg).__doc__ if doc: print doc return except AttributeError: pass print self.nohelp % (arg,) return func() else: names = self.get_names() cmds_doc = [] cmds_undoc = [] help = {} for name in names: if name[:5] == 'help_': help[name[5:]]=1 names.sort() # There can be duplicates if routines overridden prevname = '' for name in names: if name[:3] == 'do_': if name == prevname: continue prevname = name cmd=name[3:] if cmd in help: cmds_doc.append(cmd) del help[cmd] elif getattr(self, name).__doc__: cmds_doc.append(cmd) else: cmds_undoc.append(cmd) print self.doc_leader self.print_topics(self.doc_header, cmds_doc, 15,80) self.print_topics(self.misc_header, help.keys(),15,80) self.print_topics(self.undoc_header, cmds_undoc, 15,80)
90e52fb339295b9beb2c32ed803b2fefd10dad3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/90e52fb339295b9beb2c32ed803b2fefd10dad3b/cmd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 5201, 12, 2890, 16, 1501, 4672, 309, 1501, 30, 468, 11329, 866, 1501, 6279, 775, 30, 1326, 273, 3869, 12, 2890, 16, 296, 5201, 4623, 397, 1501, 13, 1335, 6394, 30, 775, 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, 741, 67, 5201, 12, 2890, 16, 1501, 4672, 309, 1501, 30, 468, 11329, 866, 1501, 6279, 775, 30, 1326, 273, 3869, 12, 2890, 16, 296, 5201, 4623, 397, 1501, 13, 1335, 6394, 30, 775, 30, ...
"ORDER BY config,rev_time DESC,slave"
"ORDER BY rev_time,config DESC,slave"
def select(cls, env, config=None, rev=None, platform=None, slave=None, status=None, db=None): """Retrieve existing builds from the database that match the specified criteria. """ if not db: db = env.get_db_cnx()
362da6c51a58e6ceceef17151f1debacf70a6aaf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4547/362da6c51a58e6ceceef17151f1debacf70a6aaf/model.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2027, 12, 6429, 16, 1550, 16, 642, 33, 7036, 16, 5588, 33, 7036, 16, 4072, 33, 7036, 16, 11735, 33, 7036, 16, 1267, 33, 7036, 16, 1319, 33, 7036, 4672, 3536, 5767, 2062, 10736, 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, 2027, 12, 6429, 16, 1550, 16, 642, 33, 7036, 16, 5588, 33, 7036, 16, 4072, 33, 7036, 16, 11735, 33, 7036, 16, 1267, 33, 7036, 16, 1319, 33, 7036, 4672, 3536, 5767, 2062, 10736, 628, ...
env.prefs[proteinStyleAuxCustomColors_prefs_key] = color
env.prefs[proteinStyleAuxCustomColor_prefs_key] = color
def chooseAuxilliaryColor(self): color = self.auxColorComboBox.getColor() env.prefs[proteinStyleAuxCustomColors_prefs_key] = color return
2b37f3e0e74266cca89b9427b6521df1c4a4dcca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/2b37f3e0e74266cca89b9427b6521df1c4a4dcca/ProteinDisplayStyle_PropertyManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9876, 21981, 16607, 814, 2957, 12, 2890, 4672, 2036, 273, 365, 18, 18196, 2957, 22199, 18, 588, 2957, 1435, 1550, 18, 1484, 2556, 63, 24807, 2885, 21981, 3802, 2957, 67, 1484, 2556, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9876, 21981, 16607, 814, 2957, 12, 2890, 4672, 2036, 273, 365, 18, 18196, 2957, 22199, 18, 588, 2957, 1435, 1550, 18, 1484, 2556, 63, 24807, 2885, 21981, 3802, 2957, 67, 1484, 2556, 67, ...
return -1
return None
def _find_timer_PES_(self, buffer): """ Return position of timer in buffer or -1 if not found. This function is valid for PES files """ pos = buffer.find('\x00\x00\x01') offset = 0 if pos == -1 or offset + 1000 >= len(buffer): return -1
42acd927733011cf8240a16b5447261ed338ea48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11721/42acd927733011cf8240a16b5447261ed338ea48/mpeginfo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4720, 67, 12542, 67, 1423, 55, 67, 12, 2890, 16, 1613, 4672, 3536, 2000, 1754, 434, 5441, 316, 1613, 578, 300, 21, 309, 486, 1392, 18, 1220, 445, 353, 923, 364, 453, 3991, 1390, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4720, 67, 12542, 67, 1423, 55, 67, 12, 2890, 16, 1613, 4672, 3536, 2000, 1754, 434, 5441, 316, 1613, 578, 300, 21, 309, 486, 1392, 18, 1220, 445, 353, 923, 364, 453, 3991, 1390, ...
n.append((mask, start, asn)) f.close() except: pass for l in n: ip = OrderedIP("%s/%s" % (l[1], l[0]), asn=l[2]) if ip.version() == 4: netblocks_v4.append(ip) elif ip.version() == 6: netblocks_v6.append(ip) else: return (netblocks_v4, netblocks_v6)
ip = IP(s[0]) if ip.version() == 4: netblocks_v4.append((ip.int(), mask, 4, asn)) elif ip.version() == 6: netblocks_v6.append((ip.int(), mask, 6, asn)) except: pass f.close() print "Found %d IPv4 netblocks, %d IPv6 netblocks in %s" % (len(netblocks_v4), len(netblocks_v6), netblocks_file) netblocks_v4.sort() netblocks_v6.sort()
def setup_netblocks(netblocks_file): """returns 2 lists, with IPv4 and IPv6 entries respectively""" netblocks_v4 = OrderedNetblocks([]) netblocks_v6 = OrderedNetblocks([]) n = [] if netblocks_file is not None: try: f = open(netblocks_file, 'r') for l in f.readline(): s = l.split() start, mask = s[0].split('/') mask = int(mask) if mask == 0: continue asn = int(s[1]) n.append((mask, start, asn)) f.close() except: pass for l in n: ip = OrderedIP("%s/%s" % (l[1], l[0]), asn=l[2]) if ip.version() == 4: netblocks_v4.append(ip) elif ip.version() == 6: netblocks_v6.append(ip) else: return (netblocks_v4, netblocks_v6) return (netblocks_v4, netblocks_v6)
94d86ab638d1d9026b0d03f1b0222c99a1bc4484 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13031/94d86ab638d1d9026b0d03f1b0222c99a1bc4484/mirrorlist_server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 67, 2758, 7996, 12, 2758, 7996, 67, 768, 4672, 3536, 6154, 576, 6035, 16, 598, 7853, 24, 471, 7853, 26, 3222, 19629, 8395, 2901, 7996, 67, 90, 24, 273, 8524, 7308, 7996, 3816, 57...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 67, 2758, 7996, 12, 2758, 7996, 67, 768, 4672, 3536, 6154, 576, 6035, 16, 598, 7853, 24, 471, 7853, 26, 3222, 19629, 8395, 2901, 7996, 67, 90, 24, 273, 8524, 7308, 7996, 3816, 57...
upper_char = unichr(0x1ea0) lower_char = unichr(0x1ea1)
upper_char = chr(0x1ea0) lower_char = chr(0x1ea1)
def test_inline_flags(self): # Bug #1700 upper_char = unichr(0x1ea0) # Latin Capital Letter A with Dot Bellow lower_char = unichr(0x1ea1) # Latin Small Letter A with Dot Bellow
aa7f6aa681f2264ed8aeacae1d835ff84d427f10 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/aa7f6aa681f2264ed8aeacae1d835ff84d427f10/test_re.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 10047, 67, 7133, 12, 2890, 4672, 468, 16907, 468, 4033, 713, 3854, 67, 3001, 273, 640, 1354, 86, 12, 20, 92, 21, 24852, 20, 13, 468, 11134, 267, 11200, 7053, 10559, 387, 432,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10047, 67, 7133, 12, 2890, 4672, 468, 16907, 468, 4033, 713, 3854, 67, 3001, 273, 640, 1354, 86, 12, 20, 92, 21, 24852, 20, 13, 468, 11134, 267, 11200, 7053, 10559, 387, 432,...
conn = psycopg2.connect()
conn = psycopg2.connect(dsn)
def fetch(num, secs): conn = psycopg2.connect() cur = conn.cursor() for i in range(num): cur.execute("select pg_sleep(%s)", (secs,))
10c8cd1bdc4b02ad6411fbb9ba9deb1e6c4d38e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10078/10c8cd1bdc4b02ad6411fbb9ba9deb1e6c4d38e4/patcher_psycopg_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2158, 12, 2107, 16, 18043, 4672, 1487, 273, 4250, 93, 22295, 75, 22, 18, 3612, 12, 26055, 13, 662, 273, 1487, 18, 9216, 1435, 364, 277, 316, 1048, 12, 2107, 4672, 662, 18, 8837, 2932, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2158, 12, 2107, 16, 18043, 4672, 1487, 273, 4250, 93, 22295, 75, 22, 18, 3612, 12, 26055, 13, 662, 273, 1487, 18, 9216, 1435, 364, 277, 316, 1048, 12, 2107, 4672, 662, 18, 8837, 2932, ...
import sys
def makefile(self, mode, bufsize=None): if mode != 'r' and mode != 'rb': raise httplib.UnimplementedFileMode() return StringIO.StringIO(self.text)
121d34af198b2d051eec158fd1be7aa19a224c28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/121d34af198b2d051eec158fd1be7aa19a224c28/test_httplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 768, 12, 2890, 16, 1965, 16, 1681, 1467, 33, 7036, 4672, 309, 1965, 480, 296, 86, 11, 471, 1965, 480, 296, 6731, 4278, 1002, 15851, 6673, 18, 984, 21099, 812, 2309, 1435, 327, 15...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1221, 768, 12, 2890, 16, 1965, 16, 1681, 1467, 33, 7036, 4672, 309, 1965, 480, 296, 86, 11, 471, 1965, 480, 296, 6731, 4278, 1002, 15851, 6673, 18, 984, 21099, 812, 2309, 1435, 327, 15...
self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfp -mfloat-abi=softfp" class arch_armv7r(generic_arm): "Builder class for armv7r target" def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv7r-unknown-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv7-r -mfpu=vfp -mfloat-abi=softfp" class arch_armv7m(generic_arm): "Builder class for armv7m target" def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv7m-unknown-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv7-m -mfpu=vfp -mfloat-abi=softfp"
self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv7a-unknown-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfp -mfloat-abi=softfp"
4964b99515155b7f4f78a9d8c353886629f0bf25 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7327/4964b99515155b7f4f78a9d8c353886629f0bf25/arm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 81, 1900, 705, 4672, 5210, 67, 4610, 16186, 2738, 972, 12, 2890, 16, 81, 1900, 705, 13, 365, 18, 4272, 9614, 1792, 4005, 11929, 1546, 4610, 90, 27, 69, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 81, 1900, 705, 4672, 5210, 67, 4610, 16186, 2738, 972, 12, 2890, 16, 81, 1900, 705, 13, 365, 18, 4272, 9614, 1792, 4005, 11929, 1546, 4610, 90, 27, 69, ...
a = cls.qname(NS.xsins, 'type')
xta = ':'.join((NS.xsins[0], 'type'))
def manual(cls, node, tval, ns=None): """ Set the node's xsi:type attribute based on either I{value}'s class or the class of the node's text. Then adds the referenced prefix(s) to the node's prefix mapping. @param node: An XML node @type node: L{sax.element.Element} @param tval: The name of the schema type. @type tval: str @param ns: The XML namespace of I{tval}. @type ns: (prefix, uri) @return: The specified node. @rtype: L{sax.element.Element} """ a = cls.qname(NS.xsins, 'type') node.addPrefix(NS.xsins[0], NS.xsins[1]) if ns is None: node.set(a, tval) else: node.set(a, cls.qname(ns, tval)) node.addPrefix(ns[0], ns[1]) return node
268a03f80e6f7419375b57cc3a660cd82a9f4084 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1242/268a03f80e6f7419375b57cc3a660cd82a9f4084/marshaller.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11297, 12, 6429, 16, 756, 16, 268, 1125, 16, 3153, 33, 7036, 4672, 3536, 1000, 326, 756, 1807, 619, 7722, 30, 723, 1566, 2511, 603, 3344, 467, 95, 1132, 1713, 87, 667, 578, 326, 667, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11297, 12, 6429, 16, 756, 16, 268, 1125, 16, 3153, 33, 7036, 4672, 3536, 1000, 326, 756, 1807, 619, 7722, 30, 723, 1566, 2511, 603, 3344, 467, 95, 1132, 1713, 87, 667, 578, 326, 667, ...
drawline(ll,ur,blue) drawline(lr,ul,red)
drawline(blue,ll,ur) drawline(red,lr,ul)
def draw(self): if self._delegate.transient_state.in_drag: # (requires mouse click!) # other tests here say glpane.in_drag ll, lr, ur, ul = self.screenrect() # these points should be valid in the HL's coords == self's coords from drawer import drawline drawline(ll,ur,blue) drawline(lr,ul,red) self.drawkid(self._delegate) ##### Q or BUG: why does some other code get away with passing self.delegate to drawkid??? #e could it be instantiating kid every time it draws it? or drawing a non-Instance and not noticing??? ####@@@@
8e5f11424b743ae815bb035e312c572e7f227ec8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/8e5f11424b743ae815bb035e312c572e7f227ec8/test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 12, 2890, 4672, 309, 365, 6315, 22216, 18, 22670, 67, 2019, 18, 267, 67, 15997, 30, 468, 261, 18942, 7644, 4682, 24949, 468, 1308, 7434, 2674, 12532, 5118, 29009, 18, 267, 67, 1599...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 12, 2890, 4672, 309, 365, 6315, 22216, 18, 22670, 67, 2019, 18, 267, 67, 15997, 30, 468, 261, 18942, 7644, 4682, 24949, 468, 1308, 7434, 2674, 12532, 5118, 29009, 18, 267, 67, 1599...
if ampm and ampm == 'PM':
if ampm and ampm == 'PM' and hour != '12':
def process_form(self, instance, field, form, empty_marker=None, emptyReturnsMarker=False, validating=True): """Basic impl for form processing in a widget"""
ba1db9a91bb3303dc64988784c90329f4505f723 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12165/ba1db9a91bb3303dc64988784c90329f4505f723/Widget.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 687, 12, 2890, 16, 791, 16, 652, 16, 646, 16, 1008, 67, 11145, 33, 7036, 16, 1008, 1356, 7078, 33, 8381, 16, 18075, 33, 5510, 4672, 3536, 8252, 9380, 364, 646, 4929, 316, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 687, 12, 2890, 16, 791, 16, 652, 16, 646, 16, 1008, 67, 11145, 33, 7036, 16, 1008, 1356, 7078, 33, 8381, 16, 18075, 33, 5510, 4672, 3536, 8252, 9380, 364, 646, 4929, 316, 2...
"""
"""
def flimage_freemem(pImage): """ flimage_freemem(pImage) """ _flimage_freemem(pImage)
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, 2730, 67, 74, 266, 351, 351, 12, 84, 2040, 4672, 3536, 1183, 2730, 67, 74, 266, 351, 351, 12, 84, 2040, 13, 3536, 225, 389, 2242, 2730, 67, 74, 266, 351, 351, 12, 84, 2040, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 2730, 67, 74, 266, 351, 351, 12, 84, 2040, 4672, 3536, 1183, 2730, 67, 74, 266, 351, 351, 12, 84, 2040, 13, 3536, 225, 389, 2242, 2730, 67, 74, 266, 351, 351, 12, 84, 2040, 1...
et = ETriangle0()
et = RTriangle0()
def demo(self): D = shapes.Drawing(200, 100) et = ETriangle0() et.x=50 et.y=0 et.draw() D.add(et) labelFontSize = 10 D.add(shapes.String(et.x+(et.size/2),(et.y-(1.2*labelFontSize)), self.__class__.__name__, fillColor=colors.black, textAnchor='middle', fontSize=labelFontSize)) return D
9e1ac96d5b69772a6c97fc0c1be0dbddf9cdc82c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/9e1ac96d5b69772a6c97fc0c1be0dbddf9cdc82c/signsandsymbols.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21477, 12, 2890, 4672, 463, 273, 14736, 18, 26885, 12, 6976, 16, 2130, 13, 3393, 273, 534, 31506, 20, 1435, 3393, 18, 92, 33, 3361, 3393, 18, 93, 33, 20, 3393, 18, 9446, 1435, 463, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21477, 12, 2890, 4672, 463, 273, 14736, 18, 26885, 12, 6976, 16, 2130, 13, 3393, 273, 534, 31506, 20, 1435, 3393, 18, 92, 33, 3361, 3393, 18, 93, 33, 20, 3393, 18, 9446, 1435, 463, 1...
self.__speed=(forward and self.avatarControlForwardSpeed or reverse and -self.avatarControlReverseSpeed) avatarSlideSpeed=self.avatarControlForwardSpeed*0.5
self.__speed=(forward and self.ship.acceleration or reverse and -self.ship.reverseAcceleration) avatarSlideSpeed=self.ship.acceleration*0.5
def handleAvatarControls(self, task): """ Check on the arrow keys and update the avatar. """ if __debug__: if self.wantAvatarPhysicsIndicator: onScreenDebug.append("localAvatar pos = %s\n"%(base.localAvatar.getPos().pPrintValues(),)) onScreenDebug.append("localAvatar h = % 10.4f\n"%(base.localAvatar.getH(),)) onScreenDebug.append("localAvatar anim = %s\n"%(base.localAvatar.animFSM.getCurrentState().getName(),)) #assert(self.debugPrint("handleAvatarControls(task=%s)"%(task,))) physObject=self.actorNode.getPhysicsObject() #rotAvatarToPhys=Mat3.rotateMatNormaxis(-self.avatarNodePath.getH(), Vec3.up()) #rotPhysToAvatar=Mat3.rotateMatNormaxis(self.avatarNodePath.getH(), Vec3.up()) contact=self.actorNode.getContactVector() # hack fix for falling through the floor: if contact==Vec3.zero() and self.avatarNodePath.getZ()<-50.0: # DCR: don't reset X and Y; allow player to move self.reset() self.avatarNodePath.setZ(50.0) messenger.send("walkerIsOutOfWorld", [self.avatarNodePath])
6bf0ce7b64dbc472e517058dc6c231bb0d06d617 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/6bf0ce7b64dbc472e517058dc6c231bb0d06d617/ShipPilot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 23999, 16795, 12, 2890, 16, 1562, 4672, 3536, 2073, 603, 326, 12274, 1311, 471, 1089, 326, 16910, 18, 3536, 309, 1001, 4148, 972, 30, 309, 365, 18, 17369, 23999, 3731, 1900, 2102, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 23999, 16795, 12, 2890, 16, 1562, 4672, 3536, 2073, 603, 326, 12274, 1311, 471, 1089, 326, 16910, 18, 3536, 309, 1001, 4148, 972, 30, 309, 365, 18, 17369, 23999, 3731, 1900, 2102, ...
return _getElementsByTagNameNSHelper(self, namespaceURI, localName, [])
return _getElementsByTagNameNSHelper(self, namespaceURI, localName, NodeList())
def getElementsByTagNameNS(self, namespaceURI, localName): return _getElementsByTagNameNSHelper(self, namespaceURI, localName, [])
95700f7cde5c0efa1ae7bc956f4ba54ec8508b51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95700f7cde5c0efa1ae7bc956f4ba54ec8508b51/minidom.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11034, 3156, 12, 2890, 16, 19421, 16, 11927, 4672, 327, 389, 588, 3471, 10401, 3156, 2276, 12, 2890, 16, 19421, 16, 11927, 16, 5378, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 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, 11034, 3156, 12, 2890, 16, 19421, 16, 11927, 4672, 327, 389, 588, 3471, 10401, 3156, 2276, 12, 2890, 16, 19421, 16, 11927, 16, 5378, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100...
print "* som :",weighted_average(som1) print "* som [0,2]:",weighted_average(som1,start=0,end=2) print "* so :",weighted_average(som1[0]) print "* so [1,3]:",weighted_average(som1[0],start=1,end=3)
print "* som :", weighted_average(som1) print "* som [0,2]:", weighted_average(som1, start=0, end=2) print "* so :", weighted_average(som1[0]) print "* so [1,3]:", weighted_average(som1[0], start=1, end=3)
def weighted_average(obj,**kwargs): """ This function takes a SOM or SO and calculates the weighted average for the primary axis. Parameters: ---------- -> obj is a SOM or SO that will have the weighted average calculated from it -> kwargs is a list of key word arguments that the function accepts: start=<index of starting bin> end=<index of ending bin> Return: ------ <- A tuple (for a SO) or a list of tuples (for a SOM) containing the weighted average and the uncertainty squared associated with the weighted average Exceptions: ---------- <- TypeError is raised if a tuple or another construct (besides a SOM or SO) is passed to the function """ # import the helper functions import hlr_utils # set up for working through data # This time highest object in the hierarchy is NOT what we need result = [] if(hlr_utils.get_length(obj) > 1): res_descr = "list" else: res_descr = "number" (o_descr,d_descr)=hlr_utils.get_descr(obj) if(kwargs.has_key("start")): start=int(kwargs["start"]) else: start=0 if(kwargs.has_key("end")): end=int(kwargs["end"]) else: end=hlr_utils.get_length(obj)-1 result=hlr_utils.copy_som_attr(result,res_descr,obj,o_descr) # iterate through the values import utils for i in range(hlr_utils.get_length(obj)): val = hlr_utils.get_value(obj,i,o_descr,"y") err2 = hlr_utils.get_err2(obj,i,o_descr,"y") value=utils.weighted_average(val, err2, start, end) hlr_utils.result_insert(result,res_descr,value,None,"all") import copy return copy.deepcopy(result)
ab79edf433672f6155274e6964e46e97c3dbeb1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/ab79edf433672f6155274e6964e46e97c3dbeb1c/hlr_weighted_average.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13747, 67, 15621, 12, 2603, 16, 636, 4333, 4672, 3536, 1220, 445, 5530, 279, 348, 1872, 578, 7460, 471, 17264, 326, 13747, 8164, 364, 326, 3354, 2654, 18, 225, 7012, 30, 12181, 317, 1081...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13747, 67, 15621, 12, 2603, 16, 636, 4333, 4672, 3536, 1220, 445, 5530, 279, 348, 1872, 578, 7460, 471, 17264, 326, 13747, 8164, 364, 326, 3354, 2654, 18, 225, 7012, 30, 12181, 317, 1081...
if Root.find(":\\") == 1: Root = Root[2:] Root = Root.replace("\\\\", "/") Root = Root.replace("\\", "/")
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 [ "MIPS64", "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
c43ef54950822dbbb1ec2aa03ba322a18a268fdc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9328/c43ef54950822dbbb1ec2aa03ba322a18a268fdc/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, ...
hsb = Tkinter.Scrollbar(self.scrollFrame, orient="horizontal") hsb.grid(row=1, column=0, sticky="ew") self._hscrollbar = hsb vsb = Tkinter.Scrollbar(self.scrollFrame, orient="vertical") vsb.grid(row=0, column=1, sticky="ns")
self.hsb = Tkinter.Scrollbar(self.scrollFrame, orient="horizontal") self.hsb.grid(row=1, column=0, sticky="ew") self._hscrollbar = self.hsb self.vsb = Tkinter.Scrollbar(self.scrollFrame, orient="vertical") self.vsb.grid(row=0, column=1, sticky="ns")
def __init__(self, master, width = 300, height = 300,
3b63dc846cb26ec6865a5e27e054da2580ea0742 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6354/3b63dc846cb26ec6865a5e27e054da2580ea0742/GrayImageDispWdg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4171, 16, 1835, 273, 11631, 16, 2072, 273, 11631, 16, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4171, 16, 1835, 273, 11631, 16, 2072, 273, 11631, 16, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
print 'Cannot open file "%s"' % list
print 'Cannot open file "%s"' % plsname
def read_m3u(self, plsname): """ This is the (m3u) playlist reading function.
046617f8c755dfbb51a0126b61a1ff7287a857e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/046617f8c755dfbb51a0126b61a1ff7287a857e6/playlist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 81, 23, 89, 12, 2890, 16, 886, 87, 529, 4672, 3536, 1220, 353, 326, 261, 81, 23, 89, 13, 16428, 6453, 445, 18, 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, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 81, 23, 89, 12, 2890, 16, 886, 87, 529, 4672, 3536, 1220, 353, 326, 261, 81, 23, 89, 13, 16428, 6453, 445, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
output += self.dump_text(item.data.find(XHTML('body')), stylizer, item)
output += ''.join(self.dump_text(item.data.find(XHTML('body')), stylizer, item))
def get_cover_page(self): output = u'' if 'titlepage' in self.oeb_book.guide: self.log.debug('Generating cover page...') href = self.oeb_book.guide['titlepage'].href item = self.oeb_book.manifest.hrefs[href] if item.spine_position is None: stylizer = Stylizer(item.data, item.href, self.oeb_book, self.opts.output_profile) output += self.dump_text(item.data.find(XHTML('body')), stylizer, item) return output
62317ca8cfa72d773c092cd5bbedd9b76ee09520 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/62317ca8cfa72d773c092cd5bbedd9b76ee09520/fb2ml.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 3165, 67, 2433, 12, 2890, 4672, 876, 273, 582, 6309, 309, 296, 2649, 2433, 11, 316, 365, 18, 15548, 70, 67, 3618, 18, 12118, 30, 365, 18, 1330, 18, 4148, 2668, 21755, 5590, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3165, 67, 2433, 12, 2890, 4672, 876, 273, 582, 6309, 309, 296, 2649, 2433, 11, 316, 365, 18, 15548, 70, 67, 3618, 18, 12118, 30, 365, 18, 1330, 18, 4148, 2668, 21755, 5590, ...
nodelist[i] += 8
nodeload[i] += 8
def find_relaxed_node(node_list): import sys nr_nodes = info['nr_nodes'] if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = dom.getVCPUInfo() for vcpu in sxp.children(cpuinfo, 'vcpu'): if sxp.child_value(vcpu, 'online') == 0: continue cpumap = list(sxp.child_value(vcpu,'cpumap')) for i in range(0, nr_nodes): node_cpumask = info['node_to_cpu'][i] for j in node_cpumask: if j in cpumap: nodeload[i] += 1 break for i in range(0, nr_nodes): nodeload[i] = int(nodeload[i] * 16 / len(info['node_to_cpu'][i])) if len(info['node_to_cpu'][i]) == 0 or i not in node_list: nodelist[i] += 8 return map(lambda x: x[0], sorted(enumerate(nodeload), key=lambda x:x[1]))
a98b7ebe3e4f397eca62d0831ab69d13e9971694 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6195/a98b7ebe3e4f397eca62d0831ab69d13e9971694/XendDomainInfo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 2878, 651, 329, 67, 2159, 12, 2159, 67, 1098, 4672, 1930, 2589, 9884, 67, 4690, 273, 1123, 3292, 11611, 67, 4690, 3546, 309, 756, 67, 1098, 353, 599, 30, 756, 67, 1098, 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, 1104, 67, 2878, 651, 329, 67, 2159, 12, 2159, 67, 1098, 4672, 1930, 2589, 9884, 67, 4690, 273, 1123, 3292, 11611, 67, 4690, 3546, 309, 756, 67, 1098, 353, 599, 30, 756, 67, 1098, 273, ...
def initialize_config_module(module_name): get_manager().projects().initialize(module_name)
def initialize_config_module(module_name, location=None): get_manager().projects().initialize(module_name, location)
def initialize_config_module(module_name): get_manager().projects().initialize(module_name)
fd8f8b0ffe84c5c09590d2e4eed2b39fba5f206f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9981/fd8f8b0ffe84c5c09590d2e4eed2b39fba5f206f/build_system.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4046, 67, 1425, 67, 2978, 12, 2978, 67, 529, 16, 2117, 33, 7036, 4672, 225, 336, 67, 4181, 7675, 13582, 7675, 11160, 12, 2978, 67, 529, 16, 2117, 13, 225, 2, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4046, 67, 1425, 67, 2978, 12, 2978, 67, 529, 16, 2117, 33, 7036, 4672, 225, 336, 67, 4181, 7675, 13582, 7675, 11160, 12, 2978, 67, 529, 16, 2117, 13, 225, 2, -100, -100, -100, -100, ...
CopyFile(GetOutputDir()+'/lib/panda3d.py', 'direct/src/ffi/panda3d.py')
if (sys.platform.startswith("win")): CopyFile(GetOutputDir()+'/bin/panda3d.py', 'direct/src/ffi/panda3d.py') else: CopyFile(GetOutputDir()+'/lib/panda3d.py', 'direct/src/ffi/panda3d.py')
pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
bbcf2e4267fe9b3cc6bcc77ae196ea4bf601f812 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8543/bbcf2e4267fe9b3cc6bcc77ae196ea4bf601f812/makepanda.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 293, 464, 842, 722, 67, 76, 1011, 1548, 82, 7, 318, 536, 225, 453, 4307, 37, 67, 3932, 1653, 39, 6365, 67, 5757, 64, 82, 6, 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, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 293, 464, 842, 722, 67, 76, 1011, 1548, 82, 7, 318, 536, 225, 453, 4307, 37, 67, 3932, 1653, 39, 6365, 67, 5757, 64, 82, 6, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
label = match.group(self.groups.initial.footnotelabel)
label = match.group('footnotelabel')
def footnote_reference(self, match, lineno): """ Handles `nodes.footnote_reference` and `nodes.citation_reference` elements. """ label = match.group(self.groups.initial.footnotelabel) refname = normalize_name(label) if match.group(self.groups.initial.citationlabel): refnode = nodes.citation_reference('[%s]_' % label, refname=refname) refnode += nodes.Text(label) self.document.note_citation_ref(refnode) else: refnode = nodes.footnote_reference('[%s]_' % label) if refname[0] == '#': refname = refname[1:] refnode['auto'] = 1 self.document.note_autofootnote_ref(refnode) elif refname == '*': refname = '' refnode['auto'] = '*' self.document.note_symbol_footnote_ref( refnode) else: refnode += nodes.Text(label) if refname: refnode['refname'] = refname self.document.note_footnote_ref(refnode) string = match.string matchstart = match.start(self.groups.initial.whole) matchend = match.end(self.groups.initial.whole) return (string[:matchstart], [refnode], string[matchend:], [])
039645ec5706bfe06b64e66663e62db9bc1abf30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/039645ec5706bfe06b64e66663e62db9bc1abf30/states.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14200, 7652, 67, 6180, 12, 2890, 16, 845, 16, 7586, 4672, 3536, 27020, 1375, 4690, 18, 10923, 7652, 67, 6180, 68, 471, 1375, 4690, 18, 71, 8773, 67, 6180, 68, 2186, 18, 3536, 1433, 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, 14200, 7652, 67, 6180, 12, 2890, 16, 845, 16, 7586, 4672, 3536, 27020, 1375, 4690, 18, 10923, 7652, 67, 6180, 68, 471, 1375, 4690, 18, 71, 8773, 67, 6180, 68, 2186, 18, 3536, 1433, 273...
os.rename(tmp_file.name, dest)
try: if hasattr(os, 'link'): os.link(tmp_file.name, dest) os.remove(tmp_file.name) else: os.rename(tmp_file.name, dest) except OSError, e: os.remove(tmp_file.name) if e.errno == errno.EEXIST: raise ExternalClashError('Name clash with existing message: %s' % dest) else: raise
def add(self, message): """Add message and return assigned key.""" tmp_file = self._create_tmp() try: self._dump_message(message, tmp_file) finally: _sync_close(tmp_file) if isinstance(message, MaildirMessage): subdir = message.get_subdir() suffix = self.colon + message.get_info() if suffix == self.colon: suffix = '' else: subdir = 'new' suffix = '' uniq = os.path.basename(tmp_file.name).split(self.colon)[0] dest = os.path.join(self._path, subdir, uniq + suffix) os.rename(tmp_file.name, dest) if isinstance(message, MaildirMessage): os.utime(dest, (os.path.getatime(dest), message.get_date())) return uniq
cd66a9f704f854092ad45c02e745e2ce78359afa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/cd66a9f704f854092ad45c02e745e2ce78359afa/mailbox.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 12, 2890, 16, 883, 4672, 3536, 986, 883, 471, 327, 6958, 498, 12123, 1853, 67, 768, 273, 365, 6315, 2640, 67, 5645, 1435, 775, 30, 365, 6315, 8481, 67, 2150, 12, 2150, 16, 1853, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2890, 16, 883, 4672, 3536, 986, 883, 471, 327, 6958, 498, 12123, 1853, 67, 768, 273, 365, 6315, 2640, 67, 5645, 1435, 775, 30, 365, 6315, 8481, 67, 2150, 12, 2150, 16, 1853, ...
pathIDs = pathIDs[:-1] pathString = ','.join([ str(x) for x in pathIDs ])
pathIDs = pathIDs[:-1] pathString = ','.join( [ str( x ) for x in pathIDs ] )
def getDirectoryMetadata(self,path,credDict,inherited=True,owndata=True): """ Get metadata for the given directory aggregating metadata for the directory itself and for all the parent directories if inherited flag is True. Get also the non-indexed metadata parameters. """ result = self.dtree.getPathIDs(path) if not result['OK']: return result pathIDs = result['Value'] result = self.getMetadataFields(credDict) if not result['OK']: return result metaFields = result['Value'] metaDict = {} metaOwnerDict = {} metaTypeDict = {} dirID = pathIDs[-1] if not inherited: pathIDs = pathIDs[-1:] if not owndata: pathIDs = pathIDs[:-1] pathString = ','.join([ str(x) for x in pathIDs ]) for meta in metaFields: req = "SELECT Value,DirID FROM FC_Meta_%s WHERE DirID in (%s)" % (meta,pathString) result = self._query(req) if not result['OK']: return result if len(result['Value']) > 1: return S_ERROR('Metadata conflict for directory %s' % path) if result['Value']: metaDict[meta] = result['Value'][0][0] if int(result['Value'][0][1]) == dirID: metaOwnerDict[meta] = 'OwnMetadata' else: metaOwnerDict[meta] = 'ParentMetadata' metaTypeDict[meta] = metaFields[meta] # Get also non-searchable data result = self.getDirectoryMetaParameters(path,credDict,inherited,owndata) if result['OK']: metaDict.update(result['Value']) for meta in result['Value']: metaOwnerDict[meta] = 'OwnParameter' result = S_OK(metaDict) result['MetadataOwner'] = metaOwnerDict result['MetadataType'] = metaTypeDict return result
127f98379e5064d0a5d5df2ba7ce74c780770faa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/127f98379e5064d0a5d5df2ba7ce74c780770faa/DirectoryMetadata.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19831, 2277, 12, 2890, 16, 803, 16, 20610, 5014, 16, 6018, 329, 33, 5510, 16, 995, 892, 33, 5510, 4672, 3536, 968, 1982, 364, 326, 864, 1867, 4377, 1776, 1982, 364, 326, 1867, 6174, 47...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19831, 2277, 12, 2890, 16, 803, 16, 20610, 5014, 16, 6018, 329, 33, 5510, 16, 995, 892, 33, 5510, 4672, 3536, 968, 1982, 364, 326, 864, 1867, 4377, 1776, 1982, 364, 326, 1867, 6174, 47...
ans -= xpow/n xpow *= x return pAdic(self.__parent, ans, prec)
ans = ans - R(xpow.lift()/n) xpow = xpow * x return pAdic(self.__parent, ans.lift(), prec)
def log(self): r""" Compute the p-adic logarithm of any nonzero element of $\Q_p$. (See below for normalization.) The usual power series for log with values in the additive group of $\Q_p$ only converges for 1-units (units congruent to 1 modulo p). However, there is a unique extension of log to a homomorphism defined on all the units. If u = a*v is a unit with v = 1 (mod p), then we define log(u) = log(v). This is the correct extension because the units U of Z_p splits as a product U = V x <w>, where V is the subgroup of 1-units and w is a (p-1)st root of unity. The <w> factor is torsion, so must go to 0 under any homomorphism to the torsion free group $(\Q_p, +)$.
5ed8252fff46facbcdc931e7e9488023fa081dab /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/5ed8252fff46facbcdc931e7e9488023fa081dab/padic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 613, 12, 2890, 4672, 436, 8395, 8155, 326, 293, 17, 20333, 613, 31249, 434, 1281, 16966, 930, 434, 271, 64, 53, 67, 84, 8, 18, 261, 9704, 5712, 364, 13728, 12998, 225, 1021, 25669, 721...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 613, 12, 2890, 4672, 436, 8395, 8155, 326, 293, 17, 20333, 613, 31249, 434, 1281, 16966, 930, 434, 271, 64, 53, 67, 84, 8, 18, 261, 9704, 5712, 364, 13728, 12998, 225, 1021, 25669, 721...
default_track = self.get_enabled_subtitle_track() if default_track is None:
enabled_tracks = self.get_all_enabled_subtitle_tracks() if len(enabled_tracks) == 0:
def setup_subtitles(self, force_subtitles): if config.get(prefs.ENABLE_SUBTITLES) or force_subtitles: default_track = self.get_enabled_subtitle_track() if default_track is None: tracks = self.get_subtitle_tracks() if len(tracks) > 0: self.enable_subtitle_track(tracks[0]) else: self.disable_subtitles()
02fbedc48eb3966b0b338fea6f2a796fbfbeaefb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/02fbedc48eb3966b0b338fea6f2a796fbfbeaefb/quicktime.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 67, 1717, 17643, 12, 2890, 16, 2944, 67, 1717, 17643, 4672, 309, 642, 18, 588, 12, 1484, 2556, 18, 29377, 67, 8362, 56, 1285, 11386, 13, 578, 2944, 67, 1717, 17643, 30, 3696, 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, 3875, 67, 1717, 17643, 12, 2890, 16, 2944, 67, 1717, 17643, 4672, 309, 642, 18, 588, 12, 1484, 2556, 18, 29377, 67, 8362, 56, 1285, 11386, 13, 578, 2944, 67, 1717, 17643, 30, 3696, 67,...
raise DocImportError(path, sys.exc_type, sys.exc_value)
raise DocImportError(path, sys.exc_info())
def importfile(path): """Import a Python source file or compiled file given its path.""" magic = imp.get_magic() file = open(path, 'r') if file.read(len(magic)) == magic: kind = imp.PY_COMPILED else: kind = imp.PY_SOURCE file.close() filename = os.path.basename(path) name, ext = os.path.splitext(filename) file = open(path, 'r') try: module = imp.load_module(name, file, path, (ext, 'r', kind)) except: raise DocImportError(path, sys.exc_type, sys.exc_value) file.close() return module
a8b37d1a3238fb85be760a30db03672525e8f591 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/a8b37d1a3238fb85be760a30db03672525e8f591/pydoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1930, 768, 12, 803, 4672, 3536, 5010, 279, 6600, 1084, 585, 578, 7743, 585, 864, 2097, 589, 12123, 8146, 273, 1646, 18, 588, 67, 11179, 1435, 585, 273, 1696, 12, 803, 16, 296, 86, 6134...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1930, 768, 12, 803, 4672, 3536, 5010, 279, 6600, 1084, 585, 578, 7743, 585, 864, 2097, 589, 12123, 8146, 273, 1646, 18, 588, 67, 11179, 1435, 585, 273, 1696, 12, 803, 16, 296, 86, 6134...
video = (int(node.attributes["streamindex"].value), node.attributes["codec"].value, int(node.attributes["id"].value))
video = (int(node.attributes["ffmpegindex"].value), node.attributes["codec"].value, int(node.attributes["id"].value))
def selectStreams(folder): """Choose the streams we want from the source file""" video = (-1, 'N/A', -1) # index, codec, ID audio1 = (-1, 'N/A', -1, 'N/A') # index, codec, ID, lang audio2 = (-1, 'N/A', -1, 'N/A') #open the XML containing information about this file infoDOM = xml.dom.minidom.parse(os.path.join(folder, 'streaminfo.xml')) #error out if its the wrong XML if infoDOM.documentElement.tagName != "file": fatalError("This does not look like a stream info file (%s)" % os.path.join(folder, 'streaminfo.xml')) #get video ID, CODEC nodes = infoDOM.getElementsByTagName("video") if nodes.length == 0: write("Didn't find any video elements in stream info file.!!!") write(""); os.exit(1) if nodes.length > 1: write("Found more than one video element in stream info file.!!!") node = nodes[0] video = (int(node.attributes["streamindex"].value), node.attributes["codec"].value, int(node.attributes["id"].value)) #get audioID's - we choose the best 2 audio streams using this algorithm # 1. if there is one or more stream(s) using the 1st preferred language we use that # 2. if there is one or more stream(s) using the 2nd preferred language we use that # 3. if we still haven't found a stream we use the stream with the lowest PID # 4. we prefer ac3 over mp2 # 5. if there are more that one stream with the chosen language we use the one with the lowest PID write("Preferred audio languages %s and %s" % (preferredlang1, preferredlang2)) nodes = infoDOM.getElementsByTagName("audio") if nodes.length == 0: write("Didn't find any audio elements in stream info file.!!!") write(""); os.exit(1) found = False # first try to find a stream with ac3 and preferred language 1 for node in nodes: index = int(node.attributes["streamindex"].value) lang = node.attributes["language"].value format = string.upper(node.attributes["codec"].value) pid = int(node.attributes["id"].value) if lang == preferredlang1 and format == "AC3": if found: if pid < audio1[AUDIO_ID]: audio1 = (index, format, pid, lang) else: audio1 = (index, format, pid, lang) found = True # second try to find a stream with mp2 and preferred language 1 if not found: for node in nodes: index = int(node.attributes["streamindex"].value) lang = node.attributes["language"].value format = string.upper(node.attributes["codec"].value) pid = int(node.attributes["id"].value) if lang == preferredlang1 and format == "MP2": if found: if pid < audio1[AUDIO_ID]: audio1 = (index, format, pid, lang) else: audio1 = (index, format, pid, lang) found = True # finally use the stream with the lowest pid, prefer ac3 over mp2 if not found: for node in nodes: int(node.attributes["streamindex"].value) format = string.upper(node.attributes["codec"].value) pid = int(node.attributes["id"].value) if not found: audio1 = (index, format, pid, lang) else: if format == "AC3" and audio1[1] == "MP2": audio1 = (index, format, pid, lang) else: if pid < audio1[AUDIO_ID]: audio1 = (index, format, pid, lang) found = True # do we need to find a second audio stream? if preferredlang1 != preferredlang2 and nodes.length > 1: found = False # first try to find a stream with ac3 and preferred language 2 for node in nodes: index = int(node.attributes["streamindex"].value) lang = node.attributes["language"].value format = string.upper(node.attributes["codec"].value) pid = int(node.attributes["id"].value) if lang == preferredlang2 and format == "AC3": if found: if pid < audio2[AUDIO_ID]: audio2 = (index, format, pid, lang) else: audio2 = (index, format, pid, lang) found = True # second try to find a stream with mp2 and preferred language 2 if not found: for node in nodes: index = int(node.attributes["streamindex"].value) lang = node.attributes["language"].value format = string.upper(node.attributes["codec"].value) pid = int(node.attributes["id"].value) if lang == preferredlang2 and format == "MP2": if found: if pid < audio2[AUDIO_ID]: audio2 = (index, format, pid, lang) else: audio2 = (index, format, pid, lang) found = True # finally use the stream with the lowest pid, prefer ac3 over mp2 if not found: for node in nodes: index = int(node.attributes["streamindex"].value) format = string.upper(node.attributes["codec"].value) pid = int(node.attributes["id"].value) if not found: # make sure we don't choose the same stream as audio1 if pid != audio1[AUDIO_ID]: audio2 = (index, format, pid, lang) found = True else: if format == "AC3" and audio2[AUDIO_CODEC] == "MP2" and pid != audio1[AUDIO_ID]: audio2 = (index, format, pid, lang) else: if pid < audio2[AUDIO_ID] and pid != audio1[AUDIO_ID]: audio2 = (index, format, pid, lang) write("Video id: %x, Audio1: %x (%s, %s), Audio2: %x (%s, %s)" % \ (video[VIDEO_ID], audio1[AUDIO_ID], audio1[AUDIO_CODEC], audio1[AUDIO_LANG], \ audio2[AUDIO_ID], audio2[AUDIO_CODEC], audio2[AUDIO_LANG])) return (video, audio1, audio2)
a510479602c638a947005930d0187f913bc7678d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13713/a510479602c638a947005930d0187f913bc7678d/mythburn.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2027, 10301, 12, 5609, 4672, 3536, 24529, 326, 8205, 732, 2545, 628, 326, 1084, 585, 8395, 225, 6191, 565, 273, 24927, 21, 16, 296, 50, 19, 37, 2187, 300, 21, 13, 540, 468, 770, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2027, 10301, 12, 5609, 4672, 3536, 24529, 326, 8205, 732, 2545, 628, 326, 1084, 585, 8395, 225, 6191, 565, 273, 24927, 21, 16, 296, 50, 19, 37, 2187, 300, 21, 13, 540, 468, 770, 16, ...
</datafield>\n""" % { 'df-tag-ref-stats' : CFG_REFEXTRACT_TAG_ID_EXTRACTION_STATS, 'df-ind1-ref-stats' : CFG_REFEXTRACT_IND1_EXTRACTION_STATS, 'df-ind2-ref-stats' : CFG_REFEXTRACT_IND2_EXTRACTION_STATS, 'sf-code-ref-stats' : CFG_REFEXTRACT_SUBFIELD_EXTRACTION_STATS, 'version' : CFG_REFEXTRACT_VERSION, 'timestamp' : str(int(mktime(localtime()))), 'status' : status_code, 'reportnum' : count_reportnum, 'title' : count_title, 'url' : count_url, 'misc' : count_misc, }
</datafield>\n""" \ % { 'df-tag-ref-stats' : CFG_REFEXTRACT_TAG_ID_EXTRACTION_STATS, 'df-ind1-ref-stats' : CFG_REFEXTRACT_IND1_EXTRACTION_STATS, 'df-ind2-ref-stats' : CFG_REFEXTRACT_IND2_EXTRACTION_STATS, 'sf-code-ref-stats' : CFG_REFEXTRACT_SUBFIELD_EXTRACTION_STATS, 'version' : CFG_REFEXTRACT_VERSION, 'timestamp' : str(int(mktime(localtime()))), 'status' : status_code, 'reportnum' : count_reportnum, 'title' : count_title, 'url' : count_url, 'misc' : count_misc, }
def display_xml_record(status_code, count_reportnum, count_title, count_url, count_misc, recid, xml_lines): """Given a series of MARC XML-ized reference lines and a record-id, write a MARC XML record to the stdout stream. Include in the record some stats for the extraction job. The printed MARC XML record will essentially take the following structure: <record> <controlfield tag="001">1</controlfield> <datafield tag="999" ind1="C" ind2="5"> [...] </datafield> [...] <datafield tag="999" ind1="C" ind2="6"> <subfield code="a"> CDS Invenio/X.XX.X refextract/X.XX.X-timestamp-err-repnum-title-URL-misc </subfield> </datafield> </record> Timestamp, error(code), reportnum, title, URL, and misc will are of course take the relevant values. @param status_code: (integer)the status of reference-extraction for the given record: was there an error or not? 0 = no error; 1 = error. @param count_reportnum: (integer) - the number of institutional report-number citations found in the document's reference lines. @param count_title: (integer) - the number of journal title citations found in the document's reference lines. @param count_url: (integer) - the number of URL citations found in the document's reference lines. @param count_misc: (integer) - the number of sections of miscellaneous text (i.e. 999C5$m) from the document's reference lines. @param recid: (string) - the record-id of the given document. (put into 001 field.) @param xml_lines: (list) of strings. Each string in the list contains a group of MARC XML 999C5 datafields, making up a single reference line. These reference lines will make up the document body. @return: None """ ## Start with the opening record tag: out = u"%(record-open)s\n" % { 'record-open' : CFG_REFEXTRACT_XML_RECORD_OPEN, } ## Display the record-id controlfield: out += u""" <controlfield tag="%(cf-tag-recid)s">%(recid)s</controlfield>\n""" \ % { 'cf-tag-recid' : CFG_REFEXTRACT_CTRL_FIELD_RECID, 'recid' : encode_for_xml(recid), } ## Loop through all xml lines and add them to the output string: for line in xml_lines: out += line ## add the 999C6 status subfields: out += u""" <datafield tag="%(df-tag-ref-stats)s" ind1="%(df-ind1-ref-stats)s" ind2="%(df-ind2-ref-stats)s"> <subfield code="%(sf-code-ref-stats)s">%(version)s-%(timestamp)s-%(status)s-%(reportnum)s-%(title)s-%(url)s-%(misc)s</subfield> </datafield>\n""" % { 'df-tag-ref-stats' : CFG_REFEXTRACT_TAG_ID_EXTRACTION_STATS, 'df-ind1-ref-stats' : CFG_REFEXTRACT_IND1_EXTRACTION_STATS, 'df-ind2-ref-stats' : CFG_REFEXTRACT_IND2_EXTRACTION_STATS, 'sf-code-ref-stats' : CFG_REFEXTRACT_SUBFIELD_EXTRACTION_STATS, 'version' : CFG_REFEXTRACT_VERSION, 'timestamp' : str(int(mktime(localtime()))), 'status' : status_code, 'reportnum' : count_reportnum, 'title' : count_title, 'url' : count_url, 'misc' : count_misc, } ## Now add the closing tag to the record: out += u"%(record-close)s\n" % { 'record-close' : CFG_REFEXTRACT_XML_RECORD_CLOSE, } return out
afd852f45332d11ac027b8d47ce1a922ce7f2cc6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/afd852f45332d11ac027b8d47ce1a922ce7f2cc6/refextract.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2562, 67, 2902, 67, 3366, 12, 2327, 67, 710, 16, 1056, 67, 6006, 2107, 16, 1056, 67, 2649, 16, 1056, 67, 718, 16, 1056, 67, 23667, 16, 1950, 350, 16, 2025, 67, 3548, 4672, 3536, 6083...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2562, 67, 2902, 67, 3366, 12, 2327, 67, 710, 16, 1056, 67, 6006, 2107, 16, 1056, 67, 2649, 16, 1056, 67, 718, 16, 1056, 67, 23667, 16, 1950, 350, 16, 2025, 67, 3548, 4672, 3536, 6083...