rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
targetIP = socket.gethostbyname(realhost) hostIP = socket.gethostbyname(socket.gethostname()) localIP = '127.0.0.1' if targetIP in (hostIP, localIP):
if realhost == 'localhost':
def request(self, host, handler, body, verbose=0):
a067f822565309d3f0f669e80606ead7a5886b92 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/a067f822565309d3f0f669e80606ead7a5886b92/transport.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 590, 12, 2890, 16, 1479, 16, 1838, 16, 1417, 16, 3988, 33, 20, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 590, 12, 2890, 16, 1479, 16, 1838, 16, 1417, 16, 3988, 33, 20, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
import struct, zlib
import struct
def create_exe (self, arcname, fullname): import struct, zlib
018cbb15c04aa544708430bb5b91aebe3e808923 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/018cbb15c04aa544708430bb5b91aebe3e808923/bdist_wininst.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 14880, 261, 2890, 16, 8028, 529, 16, 13321, 4672, 1930, 1958, 16, 24220, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 14880, 261, 2890, 16, 8028, 529, 16, 13321, 4672, 1930, 1958, 16, 24220, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
a1 = abs (npy.vdot(atoms.f, atoms.f_old)) a2 = npy.vdot(atoms.f_old, atoms.f_old) print 'a1,a2 created',a1,a2
a1 = abs (npy.vdot(self.f, self.f_old)) a2 = npy.vdot(self.f_old, self.f_old)
def step(self, f): atoms = self.atoms self.ni = atoms.nimages-2 # try: atoms.imax # except: atoms.imax=0 # if(not self.ni):atoms.imax=1 g = open('out','w') atoms.r = npy.zeros((self.ni, atoms.natoms, self.dim), 'd') for i in range(1, atoms.nimages-1): atoms.r[i-1] = atoms.images[i].get_positions() print >> g,'atoms.r',atoms.r atoms.f = npy.zeros((self.ni, atoms.natoms, self.dim), 'd') for i in range(1, atoms.nimages-1): atoms.f[i-1] = atoms.images[i].get_forces() print >> g,'atoms.f',atoms.f try: atoms.start except:atoms.start=0 if(not atoms.start): atoms.start = 1 atoms.a = npy.zeros(self.memory+1, 'd') self.ptmp = atoms self.maxstep = npy.sqrt(self.maxstep * self.ni) atoms.lbfgsinit = 0 try: atoms.lbfgsinit except:atoms.lbfgsinit=0 if(not atoms.lbfgsinit): atoms.lbfgsinit = 1 atoms.Ho = npy.ones((self.ni, atoms.natoms, self.dim), 'd') if (not self.min=='line'):atoms.Ho = atoms.Ho * self.alpha atoms.ITR = 1 atoms.s = [1.] atoms.y = [1.] atoms.rho = [1.] else: a1 = abs (npy.vdot(atoms.f, atoms.f_old)) a2 = npy.vdot(atoms.f_old, atoms.f_old) print 'a1,a2 created',a1,a2 if(self.min=='line'): if(a1<=0.5* a2 and a2!=0): reset_flag = 0 else: reset_flag = 1 else: reset_flag = 0 if(reset_flag==0): g1 = open('out1','w') g2 = open('out2','w') print >> g1,'atoms.r',atoms.r print >> g2,'atoms.r_old',atoms.r_old ITR = atoms.ITR#correctly generated if(ITR > self.memory): atoms.s.pop(1) atoms.y.pop(1) atoms.rho.pop(1) ITR=self.memory atoms.s.append(atoms.r - atoms.r_old)#!!atoms.r is not updating # boundry cond # for i in range(atoms.ni): # if(method=='min'):i=0 # try: # DBC(atoms.s[ITR][i],atoms.p[i].Box) #need to make matrix for box # except: # print "Box not found." # if(method=='min'):break atoms.y.append(-(atoms.f-atoms.f_old)) atoms.rho.append(1/npy.vdot(atoms.y[ITR],atoms.s[ITR])) atoms.ITR += 1 else:
f1d52cfd851a7584be9609c1169d9c87bae506fb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5735/f1d52cfd851a7584be9609c1169d9c87bae506fb/glbfgs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2235, 12, 2890, 16, 284, 4672, 9006, 273, 365, 18, 14937, 365, 18, 15834, 273, 9006, 18, 82, 7369, 17, 22, 468, 775, 30, 9006, 18, 381, 651, 468, 1335, 30, 9006, 18, 381, 651, 33, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2235, 12, 2890, 16, 284, 4672, 9006, 273, 365, 18, 14937, 365, 18, 15834, 273, 9006, 18, 82, 7369, 17, 22, 468, 775, 30, 9006, 18, 381, 651, 468, 1335, 30, 9006, 18, 381, 651, 33, ...
def upgrade_token(self, token=None, url=atom.http_core.Uri.parse_uri):
def upgrade_token(self, token=None, url=atom.http_core.Uri.parse_uri( 'https://www.google.com/accounts/AuthSubSessionToken')):
def upgrade_token(self, token=None, url=atom.http_core.Uri.parse_uri): """Asks the Google auth server for a multi-use AuthSub token.
b0588a713f6e1a474fc30fd8cde56a76fbf5e58b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10620/b0588a713f6e1a474fc30fd8cde56a76fbf5e58b/client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8400, 67, 2316, 12, 2890, 16, 1147, 33, 7036, 16, 880, 33, 7466, 18, 2505, 67, 3644, 18, 3006, 18, 2670, 67, 1650, 12, 296, 4528, 2207, 5591, 18, 9536, 18, 832, 19, 13739, 19, 1730, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8400, 67, 2316, 12, 2890, 16, 1147, 33, 7036, 16, 880, 33, 7466, 18, 2505, 67, 3644, 18, 3006, 18, 2670, 67, 1650, 12, 296, 4528, 2207, 5591, 18, 9536, 18, 832, 19, 13739, 19, 1730, ...
parts.insert(-1, '')
parts.insert(len(parts) - 1, '')
def inet_ntop(af, addr): if af == socket.AF_INET: return socket.inet_ntoa(addr) elif af == socket.AF_INET6: if len(addr) != 16: raise ValueError("address length incorrect") parts = struct.unpack('!8H', addr) curBase = bestBase = None for i in range(8): if not parts[i]: if curBase is None: curBase = i curLen = 0 curLen += 1 else: if curBase is not None: if bestBase is None or curLen > bestLen: bestBase = curBase bestLen = curLen curBase = None if curBase is not None and (bestBase is None or curLen > bestLen): bestBase = curBase bestLen = curLen parts = [hex(x)[2:] for x in parts] print parts if bestBase is not None: parts[bestBase:bestBase + bestLen] = [''] if parts[0] == '': parts.insert(0, '') if parts[-1] == '': parts.insert(-1, '') return ':'.join(parts) else: raise socket.error(97, 'Address family not supported by protocol')
d546f4019f2d13afbe35855646ad2c5948e00f8e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d546f4019f2d13afbe35855646ad2c5948e00f8e/compat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17661, 67, 496, 556, 12, 1727, 16, 3091, 4672, 309, 10073, 422, 2987, 18, 6799, 67, 18819, 30, 327, 2987, 18, 23864, 67, 496, 11867, 12, 4793, 13, 1327, 10073, 422, 2987, 18, 6799, 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, 17661, 67, 496, 556, 12, 1727, 16, 3091, 4672, 309, 10073, 422, 2987, 18, 6799, 67, 18819, 30, 327, 2987, 18, 23864, 67, 496, 11867, 12, 4793, 13, 1327, 10073, 422, 2987, 18, 6799, 67,...
return
return created_dirs
def mkpath (name, mode=0777, verbose=0, dry_run=0): """Create a directory and any missing ancestor directories. If the directory already exists, return silently. Raise DistutilsFileError if unable to create some directory along the way (eg. some sub-path exists, but is a file rather than a directory). If 'verbose' is true, print a one-line summary of each mkdir to stdout.""" global PATH_CREATED # XXX what's the better way to handle verbosity? print as we create # each directory in the path (the current behaviour), or only announce # the creation of the whole path? (quite easy to do the latter since # we're not using a recursive algorithm) name = os.path.normpath (name) if os.path.isdir (name) or name == '': return if PATH_CREATED.get (name): return (head, tail) = os.path.split (name) tails = [tail] # stack of lone dirs to create while head and tail and not os.path.isdir (head): #print "splitting '%s': " % head, (head, tail) = os.path.split (head) #print "to ('%s','%s')" % (head, tail) tails.insert (0, tail) # push next higher dir onto stack #print "stack of tails:", tails # now 'head' contains the deepest directory that already exists # (that is, the child of 'head' in 'name' is the highest directory # that does *not* exist) for d in tails: #print "head = %s, d = %s: " % (head, d), head = os.path.join (head, d) if PATH_CREATED.get (head): continue if verbose: print "creating", head if not dry_run: try: os.mkdir (head) except os.error, (errno, errstr): raise DistutilsFileError, \ "could not create '%s': %s" % (head, errstr) PATH_CREATED[head] = 1
da4d1aef4e8f9589956ea7a1e8cf2bbb249cb0eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/da4d1aef4e8f9589956ea7a1e8cf2bbb249cb0eb/util.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5028, 803, 261, 529, 16, 1965, 33, 20, 14509, 16, 3988, 33, 20, 16, 10299, 67, 2681, 33, 20, 4672, 3536, 1684, 279, 1867, 471, 1281, 3315, 9731, 6402, 18, 225, 971, 326, 1867, 1818, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5028, 803, 261, 529, 16, 1965, 33, 20, 14509, 16, 3988, 33, 20, 16, 10299, 67, 2681, 33, 20, 4672, 3536, 1684, 279, 1867, 471, 1281, 3315, 9731, 6402, 18, 225, 971, 326, 1867, 1818, ...
parent = readmodule(package, path, inpackage) child = readmodule(submodule, parent['__path__'], 1)
parent = readmodule_ex(package, path, inpackage) child = readmodule_ex(submodule, parent['__path__'], 1)
def readmodule_ex(module, path=[], inpackage=0): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module.''' dict = {} i = module.rfind('.') if i >= 0: # Dotted module name package = module[:i].strip() submodule = module[i+1:].strip() parent = readmodule(package, path, inpackage) child = readmodule(submodule, parent['__path__'], 1) return child if _modules.has_key(module): # we've seen this module before... return _modules[module] if module in sys.builtin_module_names: # this is a built-in module _modules[module] = dict return dict # search the path for the module f = None if inpackage: try: f, file, (suff, mode, type) = \ imp.find_module(module, path) except ImportError: f = None if f is None: fullpath = list(path) + sys.path f, file, (suff, mode, type) = imp.find_module(module, fullpath) if type == imp.PKG_DIRECTORY: dict['__path__'] = [file] _modules[module] = dict path = [file] + path f, file, (suff, mode, type) = \ imp.find_module('__init__', [file]) if type != imp.PY_SOURCE: # not Python source, can't do anything with this module f.close() _modules[module] = dict return dict _modules[module] = dict classstack = [] # stack of (class, indent) pairs src = f.read() f.close() # To avoid having to stop the regexp at each newline, instead # when we need a line number we simply string.count the number of # newlines in the string since the last time we did this; i.e., # lineno = lineno + \ # string.count(src, '\n', last_lineno_pos, here) # last_lineno_pos = here countnl = string.count lineno, last_lineno_pos = 1, 0 i = 0 while 1: m = _getnext(src, i) if not m: break start, i = m.span() if m.start("Method") >= 0: # found a method definition or function thisindent = _indent(m.group("MethodIndent")) meth_name = m.group("MethodName") lineno = lineno + \ countnl(src, '\n', last_lineno_pos, start) last_lineno_pos = start # close all classes indented at least as much while classstack and \ classstack[-1][1] >= thisindent: del classstack[-1] if classstack: # it's a class method cur_class = classstack[-1][0] cur_class._addmethod(meth_name, lineno) else: # it's a function f = Function(module, meth_name, file, lineno) dict[meth_name] = f elif m.start("String") >= 0: pass elif m.start("Class") >= 0: # we found a class definition thisindent = _indent(m.group("ClassIndent")) # close all classes indented at least as much while classstack and \ classstack[-1][1] >= thisindent: del classstack[-1] lineno = lineno + \ countnl(src, '\n', last_lineno_pos, start) last_lineno_pos = start class_name = m.group("ClassName") inherit = m.group("ClassSupers") if inherit: # the class inherits from other classes inherit = inherit[1:-1].strip() names = [] for n in inherit.split(','): n = n.strip() if dict.has_key(n): # we know this super class n = dict[n] else: c = n.split('.') if len(c) > 1: # super class # is of the # form module.class: # look in # module for class m = c[-2] c = c[-1] if _modules.has_key(m): d = _modules[m] if d.has_key(c): n = d[c] names.append(n) inherit = names # remember this class cur_class = Class(module, class_name, inherit, file, lineno) dict[class_name] = cur_class classstack.append((cur_class, thisindent)) elif m.start("Import") >= 0: # import module for n in m.group("ImportList").split(','): n = n.strip() try: # recursively read the imported module d = readmodule(n, path, inpackage) except: ##print 'module', n, 'not found' pass elif m.start("ImportFrom") >= 0: # from module import stuff mod = m.group("ImportFromPath") names = m.group("ImportFromList").split(',') try: # recursively read the imported module d = readmodule(mod, path, inpackage) except: ##print 'module', mod, 'not found' continue # add any classes that were defined in the # imported module to our name space if they # were mentioned in the list for n in names: n = n.strip() if d.has_key(n): dict[n] = d[n] elif n == '*': # only add a name if not # already there (to mimic what # Python does internally) # also don't add names that # start with _ for n in d.keys(): if n[0] != '_' and \ not dict.has_key(n): dict[n] = d[n] else: assert 0, "regexp _getnext found something unexpected" return dict
cb5da4b4d7bf5db97d84f27e38144505c7ff2458 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/cb5da4b4d7bf5db97d84f27e38144505c7ff2458/pyclbr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 2978, 67, 338, 12, 2978, 16, 589, 22850, 6487, 316, 5610, 33, 20, 4672, 9163, 1994, 279, 1605, 585, 471, 327, 279, 3880, 434, 3318, 18, 225, 5167, 364, 14057, 316, 7767, 471, 2589...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2978, 67, 338, 12, 2978, 16, 589, 22850, 6487, 316, 5610, 33, 20, 4672, 9163, 1994, 279, 1605, 585, 471, 327, 279, 3880, 434, 3318, 18, 225, 5167, 364, 14057, 316, 7767, 471, 2589...
sage: homchain(C2, generators=True, base_ring=GF(2))[2]
sage: homchain(C2, generators=True, base_ring=GF(2))[2]
def homchain(complex=None, **kwds): r""" Compute the homology of a chain complex using the CHomP program ``homchain``. :param complex: a chain complex :param generators: if True, also return list of generators :type generators: boolean; optional, default False :param verbose: if True, print helpful messages as the computation progresses :type verbose: boolean; optional, default False :param help: if True, just print a help message and exit :type help: boolean; optional, default False :param extra_opts: options passed directly to ``homchain`` :type extra_opts: string :return: homology groups as a dictionary indexed by dimension EXAMPLES:: sage: from sage.interfaces.chomp import homchain sage: C = cubical_complexes.Sphere(3).chain_complex() sage: homchain(C)[3] # optional: need CHomP Z Generators: these are given as a list after the homology group. Each generator is specified as a cycle, an element in the appropriate free module over the base ring:: sage: C2 = delta_complexes.Sphere(2).chain_complex() sage: homchain(C2, generators=True)[2] # optional: need CHomP (Z, [(1, -1)]) sage: homchain(C2, generators=True, base_ring=GF(2))[2] (Vector space of dimension 1 over Finite Field of size 2, [(1, 1)]) TESTS: Chain complexes concentrated in negative dimensions, cochain complexes, etc.:: sage: C = ChainComplex({-5: 4 * identity_matrix(ZZ, 2)}, degree=-1) sage: homchain(C) # optional: need CHomP {-6: C4 x C4} sage: C = ChainComplex({-5: 4 * identity_matrix(ZZ, 2)}, degree=1) sage: homchain(C, generators=True) # optional: need CHomP {-4: (C4 x C4, [(1, 0), (0, 1)])} """ from sage.homology.all import ChainComplex help = kwds.get('help', False) if help: return CHomP().help('homchain') # Type-checking just in case. if isinstance(complex, ChainComplex): return CHomP()('homchain', complex, **kwds) else: raise TypeError, "Complex is not a chain complex."
cd9d7c463f8a8ab4997abebb4301aa7f1769d062 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cd9d7c463f8a8ab4997abebb4301aa7f1769d062/chomp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13995, 5639, 12, 14259, 33, 7036, 16, 2826, 25577, 4672, 436, 8395, 8155, 326, 13995, 4676, 434, 279, 2687, 7233, 1450, 326, 6469, 362, 52, 5402, 12176, 17125, 5639, 68, 8338, 225, 294, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13995, 5639, 12, 14259, 33, 7036, 16, 2826, 25577, 4672, 436, 8395, 8155, 326, 13995, 4676, 434, 279, 2687, 7233, 1450, 326, 6469, 362, 52, 5402, 12176, 17125, 5639, 68, 8338, 225, 294, ...
"""The method for element drawing """
""" The method for element drawing. """
def drawModel(self): """The method for element drawing """ if self.model: if isinstance(self.model, molecule) or \ isinstance(self.model, Group): self.model.draw(self, None) else: ## assembly self.model.draw(self)
7828cbef13f84d50298938f6ae339289db2ec006 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/7828cbef13f84d50298938f6ae339289db2ec006/ThumbView.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 1488, 12, 2890, 4672, 3536, 1021, 707, 364, 930, 16327, 18, 3536, 225, 309, 365, 18, 2284, 30, 309, 1549, 12, 2890, 18, 2284, 16, 13661, 13, 578, 521, 1549, 12, 2890, 18, 2284, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1488, 12, 2890, 4672, 3536, 1021, 707, 364, 930, 16327, 18, 3536, 225, 309, 365, 18, 2284, 30, 309, 1549, 12, 2890, 18, 2284, 16, 13661, 13, 578, 521, 1549, 12, 2890, 18, 2284, ...
"hachoir-core>=1.0",
"hachoir-core>=1.0.1",
def main(): # Check Python version! if sys.hexversion < 0x2040000: print "Sorry, you need Python 2.4 or greater to run (install) hachoir-subfile!" sys.exit(1) if "--setuptools" in sys.argv: sys.argv.remove("--setuptools") from setuptools import setup use_setuptools = True else: from distutils.core import setup use_setuptools = False hachoir_subfile = load_source("version", path.join("hachoir_subfile", "version.py")) install_options = { "name": hachoir_subfile.PACKAGE, "version": hachoir_subfile.VERSION, "url": hachoir_subfile.WEBSITE, "download_url": hachoir_subfile.WEBSITE, "license": hachoir_subfile.LICENSE, "author": AUTHORS, "description": DESCRIPTION, "classifiers": CLASSIFIERS, "packages": PACKAGES.keys(), "package_dir": PACKAGES, "long_description": open('README').read(), } if use_setuptools: install_options["zip_safe"] = True install_options["install_requires"] = ( "hachoir-core>=1.0", "hachoir-parser>=1.0", "hachoir-regex>=1.0") # Call main() setup function setup(**install_options)
fd6b0496f6a4ef4772527eb87da35532eef3233e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/fd6b0496f6a4ef4772527eb87da35532eef3233e/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 468, 2073, 6600, 1177, 5, 309, 2589, 18, 7118, 1589, 411, 374, 92, 21573, 2787, 30, 1172, 315, 28898, 16, 1846, 1608, 6600, 576, 18, 24, 578, 6802, 358, 1086, 261, 5425, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 468, 2073, 6600, 1177, 5, 309, 2589, 18, 7118, 1589, 411, 374, 92, 21573, 2787, 30, 1172, 315, 28898, 16, 1846, 1608, 6600, 576, 18, 24, 578, 6802, 358, 1086, 261, 5425, 1...
self.__animControlDict[lName][partName]
self.__animControlDict[lodNames[0]][partName]
def loadAnims(self, anims, partName="modelRoot", lodName="lodRoot"): """loadAnims(self, string:string{}, string='modelRoot', string='lodRoot') Actor anim loader. Takes an optional partName (defaults to 'modelRoot' for non-multipart actors) and lodName (defaults to 'lodRoot' for non-LOD actors) and dict of corresponding anims in the form animName:animPath{} """ if (lodName == 'all'): lodNames = self.switches.keys() lodNames.sort() for i in range(0,len(lodNames)): lodNames[i] = str(lodNames[i]) else: lodNames = [lodName] assert Actor.notify.debug("in loadAnims: %s, part: %s, lod: %s" % (anims, partName, lodNames[0]))
b4f7896e0c0b8f561ad2a99f07a0c0014a35d495 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8543/b4f7896e0c0b8f561ad2a99f07a0c0014a35d495/Actor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 979, 12097, 12, 2890, 16, 10536, 87, 16, 1087, 461, 1546, 2284, 2375, 3113, 328, 369, 461, 1546, 80, 369, 2375, 6, 4672, 3536, 945, 979, 12097, 12, 2890, 16, 533, 30, 1080, 2916,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 979, 12097, 12, 2890, 16, 10536, 87, 16, 1087, 461, 1546, 2284, 2375, 3113, 328, 369, 461, 1546, 80, 369, 2375, 6, 4672, 3536, 945, 979, 12097, 12, 2890, 16, 533, 30, 1080, 2916,...
for prq in src.cache[1][entry[0]][entry[1]]: if prq not in prereqs:
for prq in matching[0].cache[1][entry[0]][entry[1]]: if prq not in prereqs and prq not in entries: toexamine.append(prq)
def GeneratePrereqs(self, structures, metadata): entries = [] prereqs = [] for structure in structures: for entry in structure.getchildren(): if (entry.tag, entry.get('name')) not in entries: entries.append((entry.tag, entry.get('name'))) entries.sort() entries = tuple(entries) gdata = metadata.groups[:] gdata.sort() gdata = tuple(gdata) if self.cache.has_key((entries, gdata)): prereqs = self.cache[(entries, gdata)] else: [src.Cache(metadata) for src in self.entries.values()] for entry in entries: matching = [src for src in self.entries.values() if src.cache and src.cache[1].has_key(entry[0]) and src.cache[1][entry[0]].has_key(entry[1])] if len(matching) > 1: prio = [int(src.priority) for src in matching] if prio.count(max(prio)) > 1: self.logger.error("Found conflicting %s sources with same priority for %s, pkg %s" % (entry[0].lower(), metadata.hostname, entry[1])) raise PluginExecutionError index = prio.index(max(prio)) matching = [matching[index]]
cd89c695f97789e9f04a9eb849e83609249e9ee3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/cd89c695f97789e9f04a9eb849e83609249e9ee3/Deps.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 2050, 822, 12926, 12, 2890, 16, 12597, 16, 1982, 4672, 3222, 273, 5378, 30328, 12926, 273, 5378, 364, 3695, 316, 12597, 30, 364, 1241, 316, 3695, 18, 588, 5906, 13332, 309, 261, 40...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 2050, 822, 12926, 12, 2890, 16, 12597, 16, 1982, 4672, 3222, 273, 5378, 30328, 12926, 273, 5378, 364, 3695, 316, 12597, 30, 364, 1241, 316, 3695, 18, 588, 5906, 13332, 309, 261, 40...
return None
bt_class = None yield bt_class return
def generate_bugzilla_tracker_classes(tracker_name=None): # If a tracker name was passed in then return the # specific sub-class for that tracker. if tracker_name: try: bt = customs.models.BugzillaTracker.all_trackers.get(project_name=tracker_name) return bugzilla_tracker_factory(bt) except mysite.customs.models.BugzillaTracker.DoesNotExist: return None else: # Create a generator that yields all sub-classes. for bt in mysite.customs.models.BugzillaTracker.all_trackers.all(): yield bugzilla_tracker_factory(bt)
a7e2fae6ce60e13d5d4367208cf844134c441806 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11976/a7e2fae6ce60e13d5d4367208cf844134c441806/bugzilla.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 67, 925, 15990, 67, 16543, 67, 4701, 12, 16543, 67, 529, 33, 7036, 4672, 468, 971, 279, 9745, 508, 1703, 2275, 316, 1508, 327, 326, 468, 2923, 720, 17, 1106, 364, 716, 9745, 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, 2103, 67, 925, 15990, 67, 16543, 67, 4701, 12, 16543, 67, 529, 33, 7036, 4672, 468, 971, 279, 9745, 508, 1703, 2275, 316, 1508, 327, 326, 468, 2923, 720, 17, 1106, 364, 716, 9745, 18, ...
if max_mem != -1: max_mem = max_mem // PAGE_SIZE if hard_limit != -1: hard_limit = hard_limit // PAGE_SIZE
def setMemoryLimit(max_mem, hard_limit=None): if max_mem is None: max_mem = -1 # getTotalMem() * 2 hard_limit = -1 if hard_limit is None: hard_limit = -1 if max_mem != -1: max_mem = max_mem // PAGE_SIZE if hard_limit != -1: hard_limit = hard_limit // PAGE_SIZE try: setrlimit(RLIMIT_AS, (max_mem, hard_limit)) return True except ValueError: return False
4e97748f3cf979e46600f6e84cd48b57f4af7480 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/4e97748f3cf979e46600f6e84cd48b57f4af7480/memory.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 6031, 3039, 12, 1896, 67, 3917, 16, 7877, 67, 3595, 33, 7036, 4672, 309, 943, 67, 3917, 353, 599, 30, 943, 67, 3917, 273, 300, 21, 468, 12831, 3545, 1435, 380, 576, 7877, 67, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 6031, 3039, 12, 1896, 67, 3917, 16, 7877, 67, 3595, 33, 7036, 4672, 309, 943, 67, 3917, 353, 599, 30, 943, 67, 3917, 273, 300, 21, 468, 12831, 3545, 1435, 380, 576, 7877, 67, 35...
ok_path = tuple(sys.path)
ok_path = tuple(sys.path)
def reload(self, module, path=None): if path is None and hasattr(module, '__filename__'): head, tail = os.path.split(module.__filename__) path = [os.path.join(head, '')] return ihooks.ModuleImporter.reload(self, module, path)
3ec38f0ee48b31c80510c60b3df0e6bc4dfb89f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3ec38f0ee48b31c80510c60b3df0e6bc4dfb89f9/rexec.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7749, 12, 2890, 16, 1605, 16, 589, 33, 7036, 4672, 309, 589, 353, 599, 471, 3859, 12, 2978, 16, 4940, 3459, 7250, 4672, 910, 16, 5798, 273, 1140, 18, 803, 18, 4939, 12, 2978, 16186, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7749, 12, 2890, 16, 1605, 16, 589, 33, 7036, 4672, 309, 589, 353, 599, 471, 3859, 12, 2978, 16, 4940, 3459, 7250, 4672, 910, 16, 5798, 273, 1140, 18, 803, 18, 4939, 12, 2978, 16186, ...
self.returnCursor (pkt.dataout, sx, sy, frame, 1, key, '')
self.returnCursor (pkt, sx, sy, frame, 1, key, '')
def handleImcursor (self, pkt): if (pkt.tid & IIS_READ): self.server.controller.updateProgressInfo ('Cursor mode ON', 2) if (pkt.tid & IMC_SAMPLE): # return the cursor position # wcs = int (pkt.z) # (sx, sy, key, frame) = self.server.controller.imageView.getCursor () # frame -= 1 # # self.returnCursor (pkt.dataout, sx, sy, frame, wcs, '0', '') print ('To be implemented.') else: # wait until the user presses a key self.server.controller.imageView.setReqHandler (self) while (not self.gotKey): # Wait for the PyImageView instance to wake us up time.sleep (0.3) # If we are here, it means that # 1. the user pressed a key whilst the cursor was # inside PyImageView # 2. PyImageView intercepted the keyDown event and # notified us by setting our self.gotKey to True sx = self.x sy = self.y frame = self.frameNo key = self.key # Return the appropriate cursor values to the client self.returnCursor (pkt.dataout, sx, sy, frame, 1, key, '') else: self.server.controller.updateProgressInfo ('Reading cursor from client...', -1) # read the cursor position in logical coordinates sx = int (pkt.x) sy = int (pkt.y) wx = float (pkt.x) wy = float (pkt.y) wcs = int (pkt.z) if (wcs): # decode thw WCS info for the current frame try: fb = self.server.controller.getFrame (self.frameNo) except: # the selected frame does not exist, create it fb = self.server.controller.initFrame (self.frameNo) fb.ct = self.wcsUpdate (fb.wcs) if (fb.ct.valid): if (abs (fb.ct.a) > 0.001): sx = int ((wx - fb.ct.tx) / fb.ct.a) if (abs (fb.ct.d) > 0.001): sy = int ((wy - xt.ty) / fb.ct.d) cursorX = sx cursorY = sy return
eb163fa149dbd928a3fa7b9842edc6170373d658 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2360/eb163fa149dbd928a3fa7b9842edc6170373d658/RequestHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 1170, 9216, 261, 2890, 16, 11536, 4672, 309, 261, 5465, 88, 18, 18081, 473, 467, 5127, 67, 6949, 4672, 365, 18, 3567, 18, 5723, 18, 2725, 5491, 966, 7707, 6688, 1965, 6229, 2187, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 1170, 9216, 261, 2890, 16, 11536, 4672, 309, 261, 5465, 88, 18, 18081, 473, 467, 5127, 67, 6949, 4672, 365, 18, 3567, 18, 5723, 18, 2725, 5491, 966, 7707, 6688, 1965, 6229, 2187, ...
node = self.search_client(client_name, root)
node = self.search_client(client_name, tree)
def add_client(self, client_name, attribs): '''add client to clients.xml''' tree = lxml.etree.parse(self.data + "/clients.xml") root = tree.getroot() element = lxml.etree.Element("Client", name=client_name) for key, val in attribs.iteritems(): element.set(key, val) node = self.search_client(client_name, root) if node != None: self.logger.error("Client \"%s\" already exists" % (client_name)) raise MetadataConsistencyError root.append(element) client_tree = open(self.data + "/clients.xml","w") fd = client_tree.fileno() while True: try: fcntl.lockf(fd, fcntl.LOCK_EX | fcntl.LOCK_NB) except IOError: continue else: break tree.write(client_tree) fcntl.lockf(fd, fcntl.LOCK_UN) client_tree.close()
b1b6a1e1fe10bbd2fda6bebefdb10eaeef339967 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11867/b1b6a1e1fe10bbd2fda6bebefdb10eaeef339967/Metadata.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 2625, 12, 2890, 16, 1004, 67, 529, 16, 11460, 4672, 9163, 1289, 1004, 358, 7712, 18, 2902, 26418, 2151, 273, 328, 2902, 18, 31303, 18, 2670, 12, 2890, 18, 892, 397, 2206, 1693...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 2625, 12, 2890, 16, 1004, 67, 529, 16, 11460, 4672, 9163, 1289, 1004, 358, 7712, 18, 2902, 26418, 2151, 273, 328, 2902, 18, 31303, 18, 2670, 12, 2890, 18, 892, 397, 2206, 1693...
return self.question + self.nugget_list[random.randint(0, len(self.nugget_list))]
return self.question + self.nugget_list[random.randint(0, len(self.nugget_list) - 1)]
def getSentence(self): return self.question + self.nugget_list[random.randint(0, len(self.nugget_list))]
54ad0d407555c5733db7f137d934e31fa6becd68 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14781/54ad0d407555c5733db7f137d934e31fa6becd68/module_nugget.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1322, 319, 802, 12, 2890, 4672, 327, 365, 18, 4173, 397, 365, 18, 82, 637, 588, 67, 1098, 63, 9188, 18, 7884, 474, 12, 20, 16, 562, 12, 2890, 18, 82, 637, 588, 67, 1098, 3719, 65, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1322, 319, 802, 12, 2890, 4672, 327, 365, 18, 4173, 397, 365, 18, 82, 637, 588, 67, 1098, 63, 9188, 18, 7884, 474, 12, 20, 16, 562, 12, 2890, 18, 82, 637, 588, 67, 1098, 3719, 65, ...
'coefficients', 'effects', 'fitted.values', 'residuals', 'summary', 'drop1', 'add1'.
Chambers, J. M. and Hastie, T. J. (1992) _Statistical Models in S_, Wadsworth & Brooks/Cole. ...
def help(self, command): """ Returns help string for a given command.
4eb1c0c3778c054f72536ca2e33b33ace272f300 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/4eb1c0c3778c054f72536ca2e33b33ace272f300/r.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2809, 12, 2890, 16, 1296, 4672, 3536, 2860, 2809, 533, 364, 279, 864, 1296, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2809, 12, 2890, 16, 1296, 4672, 3536, 2860, 2809, 533, 364, 279, 864, 1296, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
result = CS.getUsernameForDN(fileDict['OwnerDN'])
result = CS.getUsernameForDN('/'+fileDict['OwnerDN'])
def addFile(self,name,fileDict,numericid): """ Pretty print of the file ls output """ perm = fileDict['Permissions'] date = fileDict['ModificationTime'] nlinks = fileDict['NumberOfLinks'] size = fileDict['Size'] if fileDict.has_key('Owner'): uname = fileDict['Owner'] elif fileDict.has_key('OwnerDN'): result = CS.getUsernameForDN(fileDict['OwnerDN']) if result['OK']: uname = result['Value'] else: uname = 'unknown' else: uname = 'unknown' if numericid: uname = str(fileDict['UID']) if fileDict.has_key('OwnerGroup'): gname = fileDict['OwnerGroup'] elif fileDict.has_key('OwnerRole'): groups = CS.getGroupsWithVOMSAttribute(fileDict['OwnerRole']) if groups: gname = groups[0] else: gname = 'unknown' if numericid: gname = str(fileDict['GID']) self.entries.append( ('-'+self.__getModeString(perm),nlinks,uname,gname,size,date,name) )
b292f386ccc38ef505e52c1ce4f308a22650b89e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/b292f386ccc38ef505e52c1ce4f308a22650b89e/FileCatalogClientCLI.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18671, 12, 2890, 16, 529, 16, 768, 5014, 16, 5246, 350, 4672, 3536, 22328, 1172, 434, 326, 585, 7180, 876, 3536, 4641, 273, 585, 5014, 3292, 6521, 3546, 1509, 273, 585, 5014, 3292, 13467...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18671, 12, 2890, 16, 529, 16, 768, 5014, 16, 5246, 350, 4672, 3536, 22328, 1172, 434, 326, 585, 7180, 876, 3536, 4641, 273, 585, 5014, 3292, 6521, 3546, 1509, 273, 585, 5014, 3292, 13467...
PythonUtil.uniqueElements(vzl)
uniqueElements(vzl)
def _sendAddInterest(self, contextId, scopeId, parentId, zoneIdList): """ Part of the new otp-server code.
523171de17434070d4dafb1c1e2d56893396a5af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/523171de17434070d4dafb1c1e2d56893396a5af/DoInterestManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4661, 986, 29281, 12, 2890, 16, 819, 548, 16, 2146, 548, 16, 11582, 16, 4157, 22117, 4672, 3536, 6393, 434, 326, 394, 28625, 17, 3567, 981, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4661, 986, 29281, 12, 2890, 16, 819, 548, 16, 2146, 548, 16, 11582, 16, 4157, 22117, 4672, 3536, 6393, 434, 326, 394, 28625, 17, 3567, 981, 18, 2, -100, -100, -100, -100, -100, -1...
r.recv = r.read fp = socket._fileobject(r, close=True)
r.readable = lambda: True r.writable = r.seekable = lambda: False fp = io.BufferedReader(r)
def do_open(self, http_class, req): """Return an addinfourl object for the request, using http_class.
d4840f24f7028481f3a4dcaa7278158fdba038af /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/d4840f24f7028481f3a4dcaa7278158fdba038af/urllib2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 3190, 12, 2890, 16, 1062, 67, 1106, 16, 1111, 4672, 3536, 990, 392, 527, 10625, 477, 80, 733, 364, 326, 590, 16, 1450, 1062, 67, 1106, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 3190, 12, 2890, 16, 1062, 67, 1106, 16, 1111, 4672, 3536, 990, 392, 527, 10625, 477, 80, 733, 364, 326, 590, 16, 1450, 1062, 67, 1106, 18, 2, -100, -100, -100, -100, -100, -...
undo['virtual'][j + "/" + arch] = self.binaries['testing'][arch][1][j][:] self.binaries['testing'][arch][1][j].append(binary) for j in self.binaries['testing'][arch][0][binary]['rdepends']:
undo['virtual'][j + "/" + arch] = binaries[arch][1][j][:] binaries[arch][1][j].append(binary) for j in binaries[arch][0][binary]['rdepends']:
def doop_source(self, pkg):
1f9ba4410c75a5f4cafac19e8033b8218b3b49ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2784/1f9ba4410c75a5f4cafac19e8033b8218b3b49ba/britney.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 556, 67, 3168, 12, 2890, 16, 3475, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 556, 67, 3168, 12, 2890, 16, 3475, 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, ...
def __init__(data = None)
def __init__(data = None):
def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 777) else quickfix.StringField.__init__(self, 777, data)
484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 780, 974, 16186, 2738, 972, 12, 2890, 16, 2371, 4700, 13, 469, 9549, 904, 18, 780, 974, 16186, 2738, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 780, 974, 16186, 2738, 972, 12, 2890, 16, 2371, 4700, 13, 469, 9549, 904, 18, 780, 974, 16186, 2738, ...
return "-".join(process)
process = copy.copy(process) process.sort() return "[%s]" % ("-".join(process))
def generateProcessCombinationId(process): return "-".join(process)
e5490009f0355d69f3a9b008c528e0170ce913cb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/e5490009f0355d69f3a9b008c528e0170ce913cb/generator2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 2227, 26062, 548, 12, 2567, 4672, 1207, 273, 1610, 18, 3530, 12, 2567, 13, 1207, 18, 3804, 1435, 225, 327, 30048, 87, 4279, 738, 7566, 17, 9654, 5701, 12, 2567, 3719, 282, 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, 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, 2103, 2227, 26062, 548, 12, 2567, 4672, 1207, 273, 1610, 18, 3530, 12, 2567, 13, 1207, 18, 3804, 1435, 225, 327, 30048, 87, 4279, 738, 7566, 17, 9654, 5701, 12, 2567, 3719, 282, 2, -10...
if sys.platform == 'sunos5':
platform = self.get_platform() if platform == 'sunos5':
def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. # # The command for _tkinter is long and site specific. Please # uncomment and/or edit those parts as indicated. If you don't have a # specific extension (e.g. Tix or BLT), leave the corresponding line # commented out. (Leave the trailing backslashes in! If you # experience strange errors, you may want to join all uncommented # lines and remove the backslashes -- the backslash interpretation is # done by the shell's "read" command and it may not be implemented on # every system.
1fc6b0d7db91d541a72639988978bef873a18f5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1fc6b0d7db91d541a72639988978bef873a18f5f/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5966, 67, 16099, 2761, 12, 2890, 16, 7290, 67, 8291, 16, 2561, 67, 8291, 4672, 468, 1021, 389, 16099, 2761, 1605, 18, 468, 468, 1021, 1296, 364, 389, 16099, 2761, 353, 1525, 471, 2834, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5966, 67, 16099, 2761, 12, 2890, 16, 7290, 67, 8291, 16, 2561, 67, 8291, 4672, 468, 1021, 389, 16099, 2761, 1605, 18, 468, 468, 1021, 1296, 364, 389, 16099, 2761, 353, 1525, 471, 2834, ...
raise ValueError("n must be > 0: %s" % `n`)
raise ValueError("n must be > 0: " + `n`)
def get_close_matches(word, possibilities, n=3, cutoff=0.6): """Use SequenceMatcher to return list of the best "good enough" matches. word is a sequence for which close matches are desired (typically a string). possibilities is a list of sequences against which to match word (typically a list of strings). Optional arg n (default 3) is the maximum number of close matches to return. n must be > 0. Optional arg cutoff (default 0.6) is a float in [0, 1]. Possibilities that don't score at least that similar to word are ignored. The best (no more than n) matches among the possibilities are returned in a list, sorted by similarity score, most similar first. >>> get_close_matches("appel", ["ape", "apple", "peach", "puppy"]) ['apple', 'ape'] >>> import keyword >>> get_close_matches("wheel", keyword.kwlist) ['while'] >>> get_close_matches("apple", keyword.kwlist) [] >>> get_close_matches("accept", keyword.kwlist) ['except'] """ if not n > 0: raise ValueError("n must be > 0: %s" % `n`) if not 0.0 <= cutoff <= 1.0: raise ValueError("cutoff must be in [0.0, 1.0]: %s" % `cutoff`) result = [] s = SequenceMatcher() s.set_seq2(word) for x in possibilities: s.set_seq1(x) if s.real_quick_ratio() >= cutoff and \ s.quick_ratio() >= cutoff and \ s.ratio() >= cutoff: result.append((s.ratio(), x)) # Sort by score. result.sort() # Retain only the best n. result = result[-n:] # Move best-scorer to head of list. result.reverse() # Strip scores. return [x for score, x in result]
f1da6287fc90a068da8487dc5564b35f194d74b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f1da6287fc90a068da8487dc5564b35f194d74b9/difflib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 4412, 67, 8436, 12, 1095, 16, 28550, 16, 290, 33, 23, 16, 13383, 33, 20, 18, 26, 4672, 3536, 3727, 8370, 6286, 358, 327, 666, 434, 326, 3796, 315, 19747, 7304, 6, 1885, 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, 336, 67, 4412, 67, 8436, 12, 1095, 16, 28550, 16, 290, 33, 23, 16, 13383, 33, 20, 18, 26, 4672, 3536, 3727, 8370, 6286, 358, 327, 666, 434, 326, 3796, 315, 19747, 7304, 6, 1885, 18, ...
print 'from root %r: %d cycles' % (root, len(cycles))
def break_cycles_v(vertices, edges): """Enumerates a reasonably minimal set of vertices that must be removed to make the graph acyclic.""" # Consider where each cycle should be broken -- we go for the idea # that it is often better to break it as far as possible from the # cycle's entry point, so that the stack check occurs as late as # possible. For the distance we use a global "depth" computed as # the distance from the roots. The algo below is: # - get a list of cycles # - let maxdepth(cycle) = max(depth(vertex) for vertex in cycle) # - sort the list of cycles by their maxdepth, nearest first # - for each cycle in the list, if the cycle is not broken yet, # remove the vertex with the largest depth # - repeat the whole procedure until no more cycles are found. # Ordering the cycles themselves nearest first maximizes the chances # that when breaking a nearby cycle - which must be broken in any # case - we remove a vertex and break some further cycles by chance. v_depths = vertices progress = True roots_finished = set() while progress: roots = list(find_roots(v_depths, edges)) if v_depths is vertices: # first time only v_depths = compute_depths(roots, vertices, edges) assert len(v_depths) == len(vertices) # ...so far. We remove # from v_depths the vertices at which we choose to break cycles print '%d inital roots' % (len(roots,)) progress = False for root in roots: if root in roots_finished: continue cycles = all_cycles(root, v_depths, edges) if not cycles: roots_finished.add(root) continue print 'from root %r: %d cycles' % (root, len(cycles)) # compute the "depth" of each cycles: how far it goes from any root allcycles = [] for cycle in cycles: cycledepth = max([v_depths[edge.source] for edge in cycle]) allcycles.append((cycledepth, cycle)) allcycles.sort() # consider all cycles starting from the ones with smallest depth for _, cycle in allcycles: try: choices = [(v_depths[edge.source], edge.source) for edge in cycle] except KeyError: pass # this cycle was already broken else: # break this cycle by removing the furthest vertex max_depth, max_vertex = max(choices) del v_depths[max_vertex] yield max_vertex progress = True assert is_acyclic(v_depths, edges)
3b9e304397035cf75499f71ef59e986dbc5df1bb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6934/3b9e304397035cf75499f71ef59e986dbc5df1bb/graphlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 898, 67, 23976, 67, 90, 12, 17476, 16, 5231, 4672, 3536, 3572, 264, 815, 279, 3971, 6906, 16745, 444, 434, 6928, 716, 1297, 506, 3723, 358, 1221, 326, 2667, 1721, 93, 18964, 12123, 225, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 898, 67, 23976, 67, 90, 12, 17476, 16, 5231, 4672, 3536, 3572, 264, 815, 279, 3971, 6906, 16745, 444, 434, 6928, 716, 1297, 506, 3723, 358, 1221, 326, 2667, 1721, 93, 18964, 12123, 225, ...
v -- vector
a -- vector
def lcm(a, b=None, integer=False): """ The least common multiple of a and b, or if a is a list and b is omitted the least common multiple of all elements of v. NOTE: Use integer=True to make this vastly faster if you are working with lists of integers. INPUT: a -- number b -- number (optional) integer -- (default: False); if True, do an integer LCM or v -- vector integer -- (default: False); if True, do an integer LCM NOTE -- this is *vastly* faster than doing the generic LCM EXAMPLES: sage: LCM(97,100) 9700 sage: LCM(0,2) 0 sage: LCM(-3,-5) 15 sage: LCM([1,2,3,4,5/3]) 60 sage: v = LCM(range(1,10000),integer=True) # *very* fast! sage: len(str(v)) 4349 """ if integer: if isinstance(a,(list,tuple)): return sage.rings.integer.LCM_list(a) else: return integer_ring.ZZ(a).lcm(\ integer_ring.ZZ(b)) if isinstance(a, (list,tuple)): return __LCM_list(a) if not isinstance(a, RingElement): a = integer_ring.ZZ(a) return a.lcm(b)
b39fcd223318e01de46d50e04daffecb4f920367 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/b39fcd223318e01de46d50e04daffecb4f920367/arith.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 328, 7670, 12, 69, 16, 324, 33, 7036, 16, 3571, 33, 8381, 4672, 3536, 1021, 4520, 2975, 3229, 434, 279, 471, 324, 16, 578, 309, 279, 353, 279, 666, 471, 324, 353, 16195, 326, 4520, 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, 328, 7670, 12, 69, 16, 324, 33, 7036, 16, 3571, 33, 8381, 4672, 3536, 1021, 4520, 2975, 3229, 434, 279, 471, 324, 16, 578, 309, 279, 353, 279, 666, 471, 324, 353, 16195, 326, 4520, 2...
if modobj:
if modobj and perform_checks:
def load_module_graph(cr, graph, status=None, check_access_rules=True, **kwargs): # **kwargs is passed directly to convert_xml_import if not status: status={} status = status.copy() package_todo = [] statusi = 0 pool = pooler.get_pool(cr.dbname) # update the graph with values from the database (if exist) ## First, we set the default values for each package in graph additional_data = dict.fromkeys([p.name for p in graph], {'id': 0, 'state': 'uninstalled', 'dbdemo': False, 'installed_version': None}) ## Then we get the values from the database cr.execute('SELECT name, id, state, demo AS dbdemo, latest_version AS installed_version' ' FROM ir_module_module' ' WHERE name in (%s)' % (','.join(['%s'] * len(graph))), additional_data.keys() ) ## and we update the default values with values from the database additional_data.update(dict([(x.pop('name'), x) for x in cr.dictfetchall()])) for package in graph: for k, v in additional_data[package.name].items(): setattr(package, k, v) migrations = MigrationManager(cr, graph) check_rules = False modobj = None for package in graph: status['progress'] = (float(statusi)+0.1)/len(graph) m = package.name mid = package.id migrations.migrate_module(package, 'pre') register_class(m) logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s loading objects' % m) modules = pool.instanciate(m, cr) if modobj is None: modobj = pool.get('ir.module.module') if modobj: modobj.check(cr, 1, [mid]) idref = {} status['progress'] = (float(statusi)+0.4)/len(graph) if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'): check_rules = True init_module_objects(cr, m, modules) for kind in ('init', 'update'): for filename in package.data.get('%s_xml' % kind, []): mode = 'update' if hasattr(package, 'init') or package.state=='to install': mode = 'init' logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: loading %s' % (m, filename)) name, ext = os.path.splitext(filename) fp = tools.file_open(opj(m, filename)) if ext == '.csv': tools.convert_csv_import(cr, m, os.path.basename(filename), fp.read(), idref, mode=mode) elif ext == '.sql': queries = fp.read().split(';') for query in queries: new_query = ' '.join(query.split()) if new_query: cr.execute(new_query) else: tools.convert_xml_import(cr, m, fp, idref, mode=mode, **kwargs) fp.close() if hasattr(package, 'demo') or (package.dbdemo and package.state != 'installed'): status['progress'] = (float(statusi)+0.75)/len(graph) for xml in package.data.get('demo_xml', []): name, ext = os.path.splitext(xml) logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: loading %s' % (m, xml)) fp = tools.file_open(opj(m, xml)) if ext == '.csv': tools.convert_csv_import(cr, m, os.path.basename(xml), fp.read(), idref, noupdate=True) else: tools.convert_xml_import(cr, m, fp, idref, noupdate=True, **kwargs) fp.close() cr.execute('update ir_module_module set demo=%s where id=%s', (True, mid)) package_todo.append(package.name) ver = release.major_version + '.' + package.data.get('version', '1.0') # update the installed version in database... #cr.execute("update ir_module_module set state='installed', latest_version=%s where id=%s", (ver, mid,)) # Set new modules and dependencies modobj.write(cr, 1, [mid], {'state':'installed', 'latest_version':ver}) cr.commit() # Update translations for all installed languages if modobj: modobj.update_translations(cr, 1, [mid], None) cr.commit() migrations.migrate_module(package, 'post') statusi+=1 if check_access_rules and check_rules: cr.execute("""select model,name from ir_model where id not in (select model_id from ir_model_access)""") for (model,name) in cr.fetchall(): logger.notifyChannel('init', netsvc.LOG_WARNING, 'object %s (%s) has no access rules!' % (model,name)) cr.execute('select model from ir_model where state=%s', ('manual',)) for model in cr.dictfetchall(): pool.get('ir.model').instanciate(cr, 1, model['model'], {}) pool.get('ir.model.data')._process_end(cr, 1, package_todo) cr.commit()
cf7c1e96ebf98c6484d7c3795f7788e91f6773e1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/cf7c1e96ebf98c6484d7c3795f7788e91f6773e1/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 2978, 67, 4660, 12, 3353, 16, 2667, 16, 1267, 33, 7036, 16, 866, 67, 3860, 67, 7482, 33, 5510, 16, 2826, 4333, 4672, 468, 2826, 4333, 353, 2275, 5122, 358, 1765, 67, 2902, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 2978, 67, 4660, 12, 3353, 16, 2667, 16, 1267, 33, 7036, 16, 866, 67, 3860, 67, 7482, 33, 5510, 16, 2826, 4333, 4672, 468, 2826, 4333, 353, 2275, 5122, 358, 1765, 67, 2902, ...
self.assertEqual(search_for_configuration_file(), config_file)
found = search_for_configuration_file() if found.startswith('/private'): found = found[8:] self.assertEqual(found, config_file)
def test_current_working_directory(self): fake_cwd = '/home/alex/mailman/hacking' fake_testdir = self._make_fake(fake_cwd) config_file = os.path.join(fake_testdir, 'mailman.cfg') with fakedirs(fake_testdir): # Write a mostly empty configuration file. with open(os.path.join(fake_testdir, 'mailman.cfg'), 'w') as fp: print >> fp, '# Fake mailman.cfg file' with chdir(fake_testdir): self.assertEqual(search_for_configuration_file(), config_file)
6ebd29504f204913a1c57f64d802151fc97bfb41 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2120/6ebd29504f204913a1c57f64d802151fc97bfb41/test_configfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2972, 67, 20478, 67, 5149, 12, 2890, 4672, 10517, 67, 11089, 273, 1173, 8712, 19, 287, 338, 19, 4408, 4728, 19, 76, 484, 310, 11, 10517, 67, 3813, 1214, 273, 365, 6315, 6540,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2972, 67, 20478, 67, 5149, 12, 2890, 4672, 10517, 67, 11089, 273, 1173, 8712, 19, 287, 338, 19, 4408, 4728, 19, 76, 484, 310, 11, 10517, 67, 3813, 1214, 273, 365, 6315, 6540,...
Uses Denis Simon's GP/PARI scripts from \url{http://www.math.unicaen.fr/~simon/}.
Uses Denis Simon's GP/PARI scripts from http://www.math.unicaen.fr/~simon/.
def simon_two_descent(self, verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Computes lower and upper bounds on the rank of the Mordell-Weil group, and a list of independent points. INPUT:
16c5d6f4b590776892987400ecee6a836886ccbb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/16c5d6f4b590776892987400ecee6a836886ccbb/ell_number_field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3142, 265, 67, 15415, 67, 5569, 319, 12, 2890, 16, 3988, 33, 20, 16, 20167, 21, 33, 25, 16, 20167, 23, 33, 3361, 16, 20167, 313, 427, 33, 2163, 16, 943, 7748, 33, 3462, 16, 20167, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3142, 265, 67, 15415, 67, 5569, 319, 12, 2890, 16, 3988, 33, 20, 16, 20167, 21, 33, 25, 16, 20167, 23, 33, 3361, 16, 20167, 313, 427, 33, 2163, 16, 943, 7748, 33, 3462, 16, 20167, ...
if p_action == 'ef':
if f_action == 'ef':
def updateLayoutForms(self, portal, locator, skin_id, f_action, file_id): """ reload Naaya portal layout files""" report = {} portal_path = portal.absolute_url(1) portal_meta = portal.meta_type file_custom = [] for fid in file_id.split(','): file_custom.append(fid.strip())
2429ac708b8941cd1ccd196b463833c8dd1abad4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3287/2429ac708b8941cd1ccd196b463833c8dd1abad4/NaayaUpdater.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 3744, 18529, 12, 2890, 16, 11899, 16, 8871, 16, 18705, 67, 350, 16, 284, 67, 1128, 16, 585, 67, 350, 4672, 3536, 7749, 16350, 528, 69, 11899, 3511, 1390, 8395, 2605, 273, 2618, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 3744, 18529, 12, 2890, 16, 11899, 16, 8871, 16, 18705, 67, 350, 16, 284, 67, 1128, 16, 585, 67, 350, 4672, 3536, 7749, 16350, 528, 69, 11899, 3511, 1390, 8395, 2605, 273, 2618, 1...
for w_key,cell in
for w_key,hash,cell in
def dict_copy__Dict(space, w_self): return W_DictObject(space, [(w_key,cell.get()) for w_key,cell in w_self.non_empties()])
a9a72cafc2a01ecab085d2980211916bd9911e63 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/a9a72cafc2a01ecab085d2980211916bd9911e63/dictobject.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2065, 67, 3530, 972, 5014, 12, 2981, 16, 341, 67, 2890, 4672, 327, 678, 67, 5014, 921, 12, 2981, 16, 306, 12, 91, 67, 856, 16, 3855, 18, 588, 10756, 364, 341, 67, 856, 16, 2816, 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, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2065, 67, 3530, 972, 5014, 12, 2981, 16, 341, 67, 2890, 4672, 327, 678, 67, 5014, 921, 12, 2981, 16, 306, 12, 91, 67, 856, 16, 3855, 18, 588, 10756, 364, 341, 67, 856, 16, 2816, 16...
@return: RecipeLoader object used to load the recipe
@return: recipe class loaded
def loadSuperClass(self, troveSpec, label=None): """ Load a recipe so that its class/data can be used as a super class for this recipe.
c20efd7cc70237d71e760db28b9e111741f221d7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8747/c20efd7cc70237d71e760db28b9e111741f221d7/loadrecipe.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 8051, 797, 12, 2890, 16, 23432, 537, 1990, 16, 1433, 33, 7036, 4672, 3536, 4444, 279, 16100, 1427, 716, 2097, 667, 19, 892, 848, 506, 1399, 487, 279, 2240, 667, 364, 333, 16100, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1262, 8051, 797, 12, 2890, 16, 23432, 537, 1990, 16, 1433, 33, 7036, 4672, 3536, 4444, 279, 16100, 1427, 716, 2097, 667, 19, 892, 848, 506, 1399, 487, 279, 2240, 667, 364, 333, 16100, ...
except TypeError: argspec = '(...)' if object.__name__ == '<lambda>': decl = '<lambda> ' + argspec[1:-1] else: decl = self.bold(object.__name__) + argspec
if object.__name__ == '<lambda>': decl = '<lambda> ' + argspec[1:-1] else: decl = self.bold(object.__name__) + argspec
def docfunction(self, object): """Produce text documentation for a function object.""" try: args, varargs, varkw, defaults = inspect.getargspec(object) argspec = inspect.formatargspec( args, varargs, varkw, defaults, formatvalue=self.formatvalue) except TypeError: argspec = '(...)'
c59006cf0425a2636c8284ef2601f7f489fad815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/c59006cf0425a2636c8284ef2601f7f489fad815/pydoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 997, 915, 12, 2890, 16, 733, 4672, 3536, 25884, 977, 7323, 364, 279, 445, 733, 12123, 775, 30, 833, 16, 19732, 16, 569, 9987, 16, 3467, 273, 5334, 18, 588, 23172, 12, 1612, 13, 23837, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 997, 915, 12, 2890, 16, 733, 4672, 3536, 25884, 977, 7323, 364, 279, 445, 733, 12123, 775, 30, 833, 16, 19732, 16, 569, 9987, 16, 3467, 273, 5334, 18, 588, 23172, 12, 1612, 13, 23837, ...
self.devices = devices or []
if devices is None: devices = [] self.devices = devices
def __init__(self, devices=None): self.devices = devices or []
5058b2d242c89e5f5a72d6db71d43c9f8f027228 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7382/5058b2d242c89e5f5a72d6db71d43c9f8f027228/hw_context.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 7166, 33, 7036, 4672, 365, 18, 12506, 273, 7166, 578, 5378, 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, 1001, 2738, 972, 12, 2890, 16, 7166, 33, 7036, 4672, 365, 18, 12506, 273, 7166, 578, 5378, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
response = xmlrpclib.dumps(response, methodresponse=1, allow_none=self.allow_none, encoding=self.encoding)
response = self.dumps(response, methodresponse=1)
def _marshaled_dispatch(self, request): try: params, method = xmlrpclib.loads(request.raw_post_data)
7cc12f61df06e90c09b706dc34007bce099a9350 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7754/7cc12f61df06e90c09b706dc34007bce099a9350/xmlrpc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3108, 329, 67, 10739, 12, 2890, 16, 590, 4672, 775, 30, 859, 16, 707, 273, 2025, 13832, 830, 495, 18, 17135, 12, 2293, 18, 1899, 67, 2767, 67, 892, 13, 2, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3108, 329, 67, 10739, 12, 2890, 16, 590, 4672, 775, 30, 859, 16, 707, 273, 2025, 13832, 830, 495, 18, 17135, 12, 2293, 18, 1899, 67, 2767, 67, 892, 13, 2, -100, -100, -100, -100...
def search_geo_clusters(self, meta_types=None, lat_min=None, lat_max=None, lon_min=None, lon_max=None, zoom_level=None, path='', geo_types=None, query='', approved=True, lat_center=None, lon_center=None,
def search_geo_clusters(self, meta_types=None, lat_min=None, lat_max=None, lon_min=None, lon_max=None, path='', geo_types=None, query='', approved=True,
def search_geo_clusters(self, meta_types=None, lat_min=None, lat_max=None, lon_min=None, lon_max=None, zoom_level=None, path='', geo_types=None, query='', approved=True, lat_center=None, lon_center=None, landscape_type=[], administrative_level=[], languages=None): """ Returns all the clusters that match the specified criteria. """ if zoom_level is None: zoom_level = 0 if lat_min is None or lat_min == '': lat_min = -90. if lat_max is None or lat_max == '': lat_max = 90. if lon_min is None or lon_min == '': lon_min = -180. if lon_max is None or lon_max == '': lon_max = 180. if lat_center is None or lat_center == '': lat_center = 0. if lon_center is None or lon_center == '': lon_center = 0. zoom_level = int(zoom_level) lat_min, lat_max = float(lat_min), float(lat_max) lon_min, lon_max = float(lon_min), float(lon_max) lat_center, lon_center = float(lat_center), float(lon_center)
02aa5efb4054ae6ee0d7425f004d619f77e60f16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/02aa5efb4054ae6ee0d7425f004d619f77e60f16/GeoMapTool.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 67, 12376, 67, 16806, 12, 2890, 16, 2191, 67, 2352, 33, 7036, 16, 2516, 67, 1154, 33, 7036, 16, 2516, 67, 1896, 33, 7036, 16, 4281, 67, 1154, 33, 7036, 16, 4281, 67, 1896, 33, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 67, 12376, 67, 16806, 12, 2890, 16, 2191, 67, 2352, 33, 7036, 16, 2516, 67, 1154, 33, 7036, 16, 2516, 67, 1896, 33, 7036, 16, 4281, 67, 1154, 33, 7036, 16, 4281, 67, 1896, 33, ...
for project in user_profile.projects.all(): if self.potree.hasproject(language.code, project.code): projecttitle = self.potree.getprojectname(project.code) project = self.potree.getproject(language.code, project.code)
for project_model in user_profile.projects.all(): if self.potree.hasproject(language.code, project_model.code): projecttitle = self.potree.getprojectname(project_model.code) project = self.potree.getproject(language.code, project_model.code)
def getquicklinks(self): """gets a set of quick links to user's project-languages""" quicklinks = [] user_profile = self.request.user.get_profile() for language in user_profile.languages.all(): if not self.potree.haslanguage(language.code): continue langlinks = [] for project in user_profile.projects.all(): if self.potree.hasproject(language.code, project.code): projecttitle = self.potree.getprojectname(project.code) project = self.potree.getproject(language.code, project.code) isprojectadmin = "admin" in project.getrights(request=self.request) langlinks.append({ "code": project.code, "name": project.title, "isprojectadmin": isprojectadmin, "sep": "<br />"}) if langlinks: langlinks[-1]["sep"] = "" quicklinks.append({"code": languagecode, "name": self.tr_lang(language.name), "projects": langlinks}) # rewritten for compatibility with Python 2.3 # quicklinks.sort(cmp=locale.strcoll, key=lambda dict: dict["name"]) quicklinks.sort(lambda x,y: locale.strcoll(x["name"], y["name"])) return quicklinks
175d382fc31e690fc531a50d19fa85a14987aa15 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11388/175d382fc31e690fc531a50d19fa85a14987aa15/indexpage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 19525, 7135, 12, 2890, 4672, 3536, 14665, 279, 444, 434, 9549, 4716, 358, 729, 1807, 1984, 17, 14045, 8395, 9549, 7135, 273, 5378, 729, 67, 5040, 273, 365, 18, 2293, 18, 1355, 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, 336, 19525, 7135, 12, 2890, 4672, 3536, 14665, 279, 444, 434, 9549, 4716, 358, 729, 1807, 1984, 17, 14045, 8395, 9549, 7135, 273, 5378, 729, 67, 5040, 273, 365, 18, 2293, 18, 1355, 18, ...
def __init__(data = None)
def __init__(data = None):
def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 10) else quickfix.StringField.__init__(self, 10, data)
484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 780, 974, 16186, 2738, 972, 12, 2890, 16, 1728, 13, 469, 9549, 904, 18, 780, 974, 16186, 2738, 972, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 780, 974, 16186, 2738, 972, 12, 2890, 16, 1728, 13, 469, 9549, 904, 18, 780, 974, 16186, 2738, 972, 1...
for node in graph.vertices(): if node != extra: part.append(graph.neighbors(node))
for vertex in graph.vertices(): if vertex != extra: part.append(graph.neighbors(vertex))
def is_circular_planar(self, ordered=True): """ Returns True if a graph with boundary is circular planar, and False otherwise. A graph (with nonempty boundary) is circular planar if it has a planar embedding in which all boundary nodes can be drawn in order on a disc boundary, with all the interior nodes drawn inside the disc. Note -- This function assumes that the graph has nonempty boundary. (Circular Planarity has no definition for graphs without boundary). -- The current version relies on computing the genus of a slightly modified graph so it is time-expensive and not reasonable to use for graphs with > 12 vertices. -- Also since the current version relies on computing the genus, it is necessary that the graph be connected in order to use Euler's formula. INPUT: ordered -- whether or not to consider the order of the boundary (set ordered=False to see if there is any possible boundary order that will satisfy circular planarity) EXAMPLES: sage: g439 = Graph({1:[5,7], 2:[5,6], 3:[6,7], 4:[5,6,7]}) sage: g439.set_boundary([1,2,3,4]) sage.: g439.show(figsize=[2,2], vertex_labels=True, vertex_size=175) sage: g439.is_circular_planar() False sage: g439.set_boundary([1,2,3]) sage: g439.is_circular_planar() True Order matters: sage: K23 = graphs.CompleteBipartiteGraph(2,3) sage: K23.set_boundary([0,1,2,3]) sage: K23.is_circular_planar() False sage: K23.set_boundary([0,2,1,3]) # Diff Order! sage: K23.is_circular_planar() True sage: K23.is_circular_planar(ordered=False) True """ if not self.is_connected(): raise TypeError("Graph must be connected to use Euler's Formula to compute minimal genus.") from sage.rings.infinity import Infinity from sage.combinat.all import CyclicPermutationsOfPartition from sage.graphs.graph_genus1 import trace_faces, nice_copy
7d819cbf1df622e9f76b4801233dbb334f44d362 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/7d819cbf1df622e9f76b4801233dbb334f44d362/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 11614, 9559, 67, 7088, 297, 12, 2890, 16, 5901, 33, 5510, 4672, 3536, 2860, 1053, 309, 279, 2667, 598, 7679, 353, 15302, 4995, 297, 16, 471, 1083, 3541, 18, 225, 432, 2667, 26...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 11614, 9559, 67, 7088, 297, 12, 2890, 16, 5901, 33, 5510, 4672, 3536, 2860, 1053, 309, 279, 2667, 598, 7679, 353, 15302, 4995, 297, 16, 471, 1083, 3541, 18, 225, 432, 2667, 26...
raise ValueError('Atoms.write destination %r does not specifying arguments %r' % (dest, kwargs))
raise ValueError('Atoms.write destination %r does not support arguments %r' % (dest, write_kwargs))
def write(self, dest, format=None, properties=None, prefix=None, *args, **kwargs): opened = False if format is None: if isinstance(dest, str): opened = True if dest in AtomsWriters: format = dest else: base, ext = os.path.splitext(dest) format = ext[1:] else: format = dest.__class__
9933e949033ef41eb4768325e39d4d7c64cb8c2e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8914/9933e949033ef41eb4768325e39d4d7c64cb8c2e/atoms.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 1570, 16, 740, 33, 7036, 16, 1790, 33, 7036, 16, 1633, 33, 7036, 16, 380, 1968, 16, 2826, 4333, 4672, 10191, 273, 1083, 309, 740, 353, 599, 30, 309, 1549, 12, 104...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 1570, 16, 740, 33, 7036, 16, 1790, 33, 7036, 16, 1633, 33, 7036, 16, 380, 1968, 16, 2826, 4333, 4672, 10191, 273, 1083, 309, 740, 353, 599, 30, 309, 1549, 12, 104...
register.filter('untaxed_discount_cart_total', discount_cart_total)
register.filter('untaxed_discount_cart_total', untaxed_discount_cart_total)
def untaxed_discount_cart_total(cart, discount): """Returns the discounted total for this cart""" total = Decimal('0.00') for item in cart: total += untaxed_discount_line_total(item, discount) return total
e34349006fe7eb835d55d0bbbb06f853c5f2f7e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/171/e34349006fe7eb835d55d0bbbb06f853c5f2f7e3/satchmo_discounts.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 640, 8066, 329, 67, 23650, 67, 11848, 67, 4963, 12, 11848, 16, 12137, 4672, 3536, 1356, 326, 12137, 329, 2078, 364, 333, 7035, 8395, 2078, 273, 11322, 2668, 20, 18, 713, 6134, 225, 364, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 640, 8066, 329, 67, 23650, 67, 11848, 67, 4963, 12, 11848, 16, 12137, 4672, 3536, 1356, 326, 12137, 329, 2078, 364, 333, 7035, 8395, 2078, 273, 11322, 2668, 20, 18, 713, 6134, 225, 364, ...
log.error('osd.py: Bitmap file "%s" doesnt exist!' % filename)
log.error('Image file "%s" doesn\'t exist!' % filename)
def load(url, size=None): """ Load a bitmap and return the image object. If width and height are given, the image is scaled to that. Setting only width or height will keep aspect ratio. """ if size == None: width, height = None, None else: width, height = size if not isinstance(url, (str, unicode)): # image already is an image object image = kaa.mevas.imagelib.open(url) # scale the image if needed if width != None or height != None: image = _resize(image, width, height) return image if url.find('/') == -1 and url.find('.') == -1: # this looks like a 'theme' image surl = theme.image(url) if surl: url = surl filename = os.path.abspath(url) if not os.path.isfile(filename): filename = os.path.join(config.IMAGE_DIR, url[8:]) if not os.path.isfile(filename): log.error('osd.py: Bitmap file "%s" doesnt exist!' % filename) return None try: image = kaa.mevas.imagelib.open(filename) except: log.exception('Unknown Problem while loading image %s' % String(url)) return None # scale the image if needed if width != None or height != None: image = _resize(image, width, height) return image
c0ccdf9b940bd6f364d918a6a4e59650a82c7f0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/c0ccdf9b940bd6f364d918a6a4e59650a82c7f0b/imagelib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 12, 718, 16, 963, 33, 7036, 4672, 3536, 4444, 279, 9389, 471, 327, 326, 1316, 733, 18, 971, 1835, 471, 2072, 854, 864, 16, 326, 1316, 353, 12304, 358, 716, 18, 13274, 1338, 1835,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 718, 16, 963, 33, 7036, 4672, 3536, 4444, 279, 9389, 471, 327, 326, 1316, 733, 18, 971, 1835, 471, 2072, 854, 864, 16, 326, 1316, 353, 12304, 358, 716, 18, 13274, 1338, 1835,...
self.e = Executor( 'emacs', args='.biskit/settings.cfg', strict=0,
args = '.biskit/settings.cfg' if not self.local: args = '-kill ' + args self.e = Executor( 'emacs', args=args, strict=0,
def test_Executor( self ):
925d5757e05fd729553bb5d66a548bf78930a5a6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/482/925d5757e05fd729553bb5d66a548bf78930a5a6/Executor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 6325, 12, 365, 262, 30, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 6325, 12, 365, 262, 30, 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, ...
return dout
if dout.size == 1: return dout else: return masked_array(dout, fill_value=self._fill_value, copy=False)
def __getitem__(self, i): "Get item described by i. Not a copy as in previous versions." self.unshare_mask() m = self._mask dout = self._data[i] if m is nomask: return dout mi = m[i] if mi.size == 1: if mi: return masked else: return dout else: return masked_array(dout, mi, fill_value=self._fill_value)
0a1fa4dc3210882133be19e7d93fd50169673de1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14925/0a1fa4dc3210882133be19e7d93fd50169673de1/ma.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 31571, 972, 12, 2890, 16, 277, 4672, 315, 967, 761, 11893, 635, 277, 18, 2288, 279, 1610, 487, 316, 2416, 5244, 1199, 365, 18, 318, 14419, 67, 4455, 1435, 312, 273, 365, 6315, 44...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 31571, 972, 12, 2890, 16, 277, 4672, 315, 967, 761, 11893, 635, 277, 18, 2288, 279, 1610, 487, 316, 2416, 5244, 1199, 365, 18, 318, 14419, 67, 4455, 1435, 312, 273, 365, 6315, 44...
return HttpResponseRedirect("app_questions")
return HttpResponseRedirect(newclass.parent_program.get_teach_url() + "app_questions")
def makeaclass(self, request, tl, one, two, module, extra, prog, newclass = None): # this is ugly...but it won't recurse and falls # back to @meets_deadline's behavior appropriately if newclass is None and not self.deadline_met(): return meets_deadline(lambda: True)(self, request, tl, one, two, module)
bab72baf1aebe843c664eb7367ad90202478e9c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12041/bab72baf1aebe843c664eb7367ad90202478e9c6/teacherclassregmodule.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 1077, 459, 12, 2890, 16, 590, 16, 8332, 16, 1245, 16, 2795, 16, 1605, 16, 2870, 16, 11243, 16, 394, 1106, 273, 599, 4672, 468, 333, 353, 26920, 2777, 12885, 518, 8462, 1404, 1150...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1077, 459, 12, 2890, 16, 590, 16, 8332, 16, 1245, 16, 2795, 16, 1605, 16, 2870, 16, 11243, 16, 394, 1106, 273, 599, 4672, 468, 333, 353, 26920, 2777, 12885, 518, 8462, 1404, 1150...
util.open_website('http://bugs.gpodder.org/')
if gpodder.interface == gpodder.MAEMO: util.open_website('http://bugs.maemo.org/enter_bug.cgi?product=gPodder') else: util.open_website('http://bugs.gpodder.org/')
def on_bug_tracker_activate(self, widget, *args): util.open_website('http://bugs.gpodder.org/')
19ba2313789c171ce4798f6278b14614946479ab /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12778/19ba2313789c171ce4798f6278b14614946479ab/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 925, 67, 16543, 67, 10014, 12, 2890, 16, 3604, 16, 380, 1968, 4672, 1709, 18, 3190, 67, 21868, 2668, 2505, 2207, 19381, 18, 6403, 369, 765, 18, 3341, 2473, 13, 2, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 925, 67, 16543, 67, 10014, 12, 2890, 16, 3604, 16, 380, 1968, 4672, 1709, 18, 3190, 67, 21868, 2668, 2505, 2207, 19381, 18, 6403, 369, 765, 18, 3341, 2473, 13, 2, -100, -100, ...
globals = {}
globals = []
def main(argv=None): if argv is None: argv = sys.argv parser = OptionParser(description="Checks ECMAScript/JavaScript files for common errors.") parser.add_option( "--action", "-a", dest="actions", metavar="ACTION", choices=["ALL", "undefined_variables", "unused_variables", "maps", "blocks", "fields"], action="append", default=[], help="""Performs the given checks on the input files. This parameter may be supplied multiple times.
a80c150124bfa77b82c81c248f8054afc142d137 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/a80c150124bfa77b82c81c248f8054afc142d137/ecmalint.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 33, 7036, 4672, 225, 309, 5261, 353, 599, 30, 5261, 273, 2589, 18, 19485, 225, 2082, 273, 18862, 12, 3384, 1546, 4081, 7773, 5535, 3651, 19, 16634, 1390, 364, 2975, 1334...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 33, 7036, 4672, 225, 309, 5261, 353, 599, 30, 5261, 273, 2589, 18, 19485, 225, 2082, 273, 18862, 12, 3384, 1546, 4081, 7773, 5535, 3651, 19, 16634, 1390, 364, 2975, 1334...
"""Download a file from downloads data directory.
"""Download a file from downloads data directory, in first tab first window.
def DownloadFileFromDownloadsDataDir(test, file_name): """Download a file from downloads data directory. Args: test: derived from pyauto.PyUITest - base class for UI test cases file_name: name of file to download """ download_dir = os.path.join(os.path.abspath(test.DataDir()), 'downloads') downloaded_pkg = os.path.join(test.GetDownloadDirectory().value(), file_name) # Check if file already exists. If so then delete it. if os.path.exists(downloaded_pkg): RemoveDownloadedTestFile(test, file_name) test.WaitForAllDownloadsToComplete()
4f5f35c401ade94e518a35c77a029b72f22b9c5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/4f5f35c401ade94e518a35c77a029b72f22b9c5d/test_utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13059, 812, 1265, 22141, 751, 1621, 12, 3813, 16, 585, 67, 529, 4672, 3536, 7109, 279, 585, 628, 23011, 501, 1867, 16, 316, 1122, 3246, 1122, 2742, 18, 225, 6634, 30, 1842, 30, 10379, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13059, 812, 1265, 22141, 751, 1621, 12, 3813, 16, 585, 67, 529, 4672, 3536, 7109, 279, 585, 628, 23011, 501, 1867, 16, 316, 1122, 3246, 1122, 2742, 18, 225, 6634, 30, 1842, 30, 10379, ...
if x1>4095: return (2**16)-1
if x1>4095: return 0, (2**16)-1
def getImageScalarRange(image): """ Created: 14.01.2008, KP Description: get the minimum and maximum value of an image based on it's datatype """ x0, x1 = image.GetScalarRange() scalarType = image.GetScalarTypeAsString() if scalarType == "unsigned char": return 0, 255 if scalarType == "unsigned short": if x1>4095: return (2**16)-1 return 0,4095 return x0,x1
9bf906a9ee6742d96bbac9d775b9e805f46a5325 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2877/9bf906a9ee6742d96bbac9d775b9e805f46a5325/ImageOperations.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10567, 13639, 2655, 12, 2730, 4672, 3536, 12953, 30, 5045, 18, 1611, 18, 6976, 28, 16, 1475, 52, 6507, 30, 336, 326, 5224, 471, 4207, 460, 434, 392, 1316, 2511, 603, 518, 1807, 11172, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10567, 13639, 2655, 12, 2730, 4672, 3536, 12953, 30, 5045, 18, 1611, 18, 6976, 28, 16, 1475, 52, 6507, 30, 336, 326, 5224, 471, 4207, 460, 434, 392, 1316, 2511, 603, 518, 1807, 11172, ...
print requirements
def upgrade_project(keys, local_repos=None, remote_repos=None, interactive=True, dry_run=False, term_width=0): """ Upgrade a project, if possible. """ # Before we do anything, save the current working state of the environment to a rollback point. # TODO: If the upgrade fails, we need to rollback to this save point. save_state() if local_repos == None: local_repos = get_local_repos() local = RepositoryUnion(get_local_repos()) requirements = [] # If no explicit project(s) were specified to upgrade, try to upgrade # all of the local projects installed. if len(keys) == 0: for project in local.projects: pkg = local.projects[project].active_package if pkg: keys.append(project) for key in keys: # All of the keys in the local.projects dictionary are lowercase, so # convert all of the user-specified keys to lowercase. key = key.lower() # If the user specified a project which isn't installed, just skip it. try: active_local_projects = [project for project in local.projects[key].projects if project.active] except KeyError: print "Skipping %s because it is not installed on your system." % key continue if active_local_projects: pkg = active_local_projects[0].active_package # Retrieve an upgrade string based on the package name/version. req_str = get_upgrade_str(key, pkg.version) # Create a requirement object from our requirement string. requirement = Requirement.parse(req_str) else: max_pkg = None for pkg in local.projects[key].packages: if max_pkg is None or pkg > max_pkg: max_pkg = pkg if max_pkg is not None: req_str = get_upgrade_str(key, max_pkg.version) requirement = Requirement.parse(req_str) else: requirement = Requirement.parse(project) requirements.append(requirement) # Try to install all of the generated requirements. print requirements install_requirement(requirements, local_repos=local_repos, remote_repos=remote_repos, interactive=interactive, dry_run=dry_run, term_width=term_width) # After we have finished the upgrade, we save the new state. # TODO: If the upgrade failed, we should instead revert to the previous state. save_state()
6b0d5f8e2ba8aa09fff9a9c04aec9b84bba10557 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7707/6b0d5f8e2ba8aa09fff9a9c04aec9b84bba10557/cmdline.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8400, 67, 4406, 12, 2452, 16, 1191, 67, 15564, 33, 7036, 16, 2632, 67, 15564, 33, 7036, 16, 12625, 33, 5510, 16, 10299, 67, 2681, 33, 8381, 16, 2481, 67, 2819, 33, 20, 4672, 3536, 17...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8400, 67, 4406, 12, 2452, 16, 1191, 67, 15564, 33, 7036, 16, 2632, 67, 15564, 33, 7036, 16, 12625, 33, 5510, 16, 10299, 67, 2681, 33, 8381, 16, 2481, 67, 2819, 33, 20, 4672, 3536, 17...
txt += format[i%2] % (fname.capitalize(), fval) i += 1 if i % 2 == 0:
txt += format[i % 2] % (f.capitalize(), fval) if i % 2:
def format_props(self): tkt = self.ticket tkt['id'] = '%s' % tkt['id'] t = self.modtime or tkt['time'] tkt['modified'] = time.strftime('%c', time.localtime(t)) fields = ['id', 'status', 'component', 'modified', 'severity', 'milestone', 'priority', 'version', 'owner', 'reporter'] fields.extend(filter(lambda f: f.startswith('custom_'), self.ticket.keys())) i = 1 width = [0,0,0,0] for f in fields: if not tkt.has_key(f): continue fval = str(tkt[f]) if fval.find('\n') > -1: continue fname = f.startswith('custom_') and f[7:] or f idx = 2*(i % 2) if len(fname) > width[idx]: width[idx] = len(fname) if len(fval) > width[idx+1]: width[idx+1] = len(fval) i += 1 format = (' %%%is: %%-%is%s' % (width[0], width[1], CRLF), '%%%is: %%-%is | ' % (width[2], width[3])) i = 1 l = (width[2] + width[3] + 5) sep = l*'-' + '+' + (self.COLS-l)*'-' txt = sep + CRLF big=[] for f in fields: if not tkt.has_key(f): continue fval = tkt[f] fname = f.startswith('custom_') and f[7:] or f if '\n' in str(fval): big.append((fname.capitalize(), fval)) else: txt += format[i%2] % (fname.capitalize(), fval) i += 1 if i % 2 == 0: txt += '\n' if big: txt += sep for k,v in big: txt += '\n%s:\n%s\n\n' % (k,v) txt += sep return txt
ded62a2a8bea3ff7ebdabe21a68b4f5e1fcdd8f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/ded62a2a8bea3ff7ebdabe21a68b4f5e1fcdd8f8/Notify.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 9693, 12, 2890, 4672, 268, 8629, 273, 365, 18, 16282, 268, 8629, 3292, 350, 3546, 273, 1995, 87, 11, 738, 268, 8629, 3292, 350, 3546, 268, 273, 365, 18, 1711, 957, 578, 268, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 9693, 12, 2890, 4672, 268, 8629, 273, 365, 18, 16282, 268, 8629, 3292, 350, 3546, 273, 1995, 87, 11, 738, 268, 8629, 3292, 350, 3546, 268, 273, 365, 18, 1711, 957, 578, 268, ...
a method of the same name to preform each SMTP comand, and there is a method called 'sendmail' that will do an entiere mail
a method of the same name to perform each SMTP command, and there is a method called 'sendmail' that will do an entire mail
def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n', or Mac '\r' into Internet CRLF end-of-line.""" return re.sub(r'(?m)^\.', '..', re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))
17ab64fb09a6a22668f123a2a6d034f0f3245e19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/17ab64fb09a6a22668f123a2a6d034f0f3245e19/smtplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9298, 396, 12, 892, 4672, 3536, 10257, 501, 364, 2699, 18, 225, 3698, 7676, 2611, 16, 471, 2549, 9480, 9472, 2337, 82, 2187, 578, 13217, 2337, 86, 11, 1368, 21352, 21791, 679, 17, 792, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9298, 396, 12, 892, 4672, 3536, 10257, 501, 364, 2699, 18, 225, 3698, 7676, 2611, 16, 471, 2549, 9480, 9472, 2337, 82, 2187, 578, 13217, 2337, 86, 11, 1368, 21352, 21791, 679, 17, 792, ...
final_results_by_test)
final_results_by_test, include_crashes=True)
def Run(self, result_summary): """Run all our tests on all our test files.
958467b939bbad4b3509a5303ebaabe9d15016e4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/958467b939bbad4b3509a5303ebaabe9d15016e4/run_webkit_tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1939, 12, 2890, 16, 563, 67, 7687, 4672, 3536, 1997, 777, 3134, 7434, 603, 777, 3134, 1842, 1390, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1939, 12, 2890, 16, 563, 67, 7687, 4672, 3536, 1997, 777, 3134, 7434, 603, 777, 3134, 1842, 1390, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
elif len(self) == 0:
elif len(self) == 0 and action == Signal.SIGNAL_DISCONNECTED:
def _changed(self, action): """ Called when a callback connects or disconnects from us. """ if len(self) == 1: # Someone wants to know when we finish, so now we connect to the # underlying InProgress objects to find out when they finish. prefinished = [] for n, ip in enumerate(self._objects): if ip.finished: # This one is finished already, no need to connect to it. prefinished.append(n) continue args = self._get_connect_args(ip, n) ip.connect(self.finish, *args).user_args_first = True ip.exception.connect(self.finish, *args).user_args_first = True
efcbf7a55d2f659cabd72b1394d8345226aa552b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11722/efcbf7a55d2f659cabd72b1394d8345226aa552b/async.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6703, 12, 2890, 16, 1301, 4672, 3536, 11782, 1347, 279, 1348, 23441, 578, 9479, 87, 628, 584, 18, 3536, 309, 562, 12, 2890, 13, 422, 404, 30, 468, 10548, 476, 14805, 358, 5055, 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, 389, 6703, 12, 2890, 16, 1301, 4672, 3536, 11782, 1347, 279, 1348, 23441, 578, 9479, 87, 628, 584, 18, 3536, 309, 562, 12, 2890, 13, 422, 404, 30, 468, 10548, 476, 14805, 358, 5055, 13...
return self.get_result("[ -d /sys/class/net/%s/brif ]; echo $?" % bridge).split()[0] == "0"
return self._first_line(self.get_result("[ -d /sys/class/net/%s/brif ]; echo $?" % bridge)) == "0"
def bridge_exists(self, bridge): return self.get_result("[ -d /sys/class/net/%s/brif ]; echo $?" % bridge).split()[0] == "0"
5808d17fb15dc4e36eba87df3680f4196881636f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3860/5808d17fb15dc4e36eba87df3680f4196881636f/hosts.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10105, 67, 1808, 12, 2890, 16, 10105, 4672, 327, 365, 18, 588, 67, 2088, 2932, 63, 300, 72, 342, 9499, 19, 1106, 19, 2758, 5258, 87, 19, 2848, 430, 308, 31, 3376, 271, 7225, 738, 101...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10105, 67, 1808, 12, 2890, 16, 10105, 4672, 327, 365, 18, 588, 67, 2088, 2932, 63, 300, 72, 342, 9499, 19, 1106, 19, 2758, 5258, 87, 19, 2848, 430, 308, 31, 3376, 271, 7225, 738, 101...
amt = round(amount * line.value_amount, 2)
amt = round(value * line.value_amount, 2)
def compute(self, cr, uid, id, value, date_ref=False, context={}): if not date_ref: date_ref = now().strftime('%Y-%m-%d') pt = self.browse(cr, uid, id, context) amount = value result = [] for line in pt.line_ids: if line.value=='fixed': amt = round(line.value_amount, 2) elif line.value=='procent': amt = round(amount * line.value_amount, 2) elif line.value=='balance': amt = round(amount, 2) if amt: next_date = mx.DateTime.strptime(date_ref, '%Y-%m-%d') + RelativeDateTime(days=line.days) if line.condition == 'end of month': next_date += RelativeDateTime(day=-1) result.append( (next_date.strftime('%Y-%m-%d'), amt) ) amount -= amt return result
daec3af3f484eaf849984ec122e3dd210092fd1d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/daec3af3f484eaf849984ec122e3dd210092fd1d/account.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3671, 12, 2890, 16, 4422, 16, 4555, 16, 612, 16, 460, 16, 1509, 67, 1734, 33, 8381, 16, 819, 12938, 4672, 309, 486, 1509, 67, 1734, 30, 1509, 67, 1734, 273, 2037, 7675, 701, 9982, 29...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3671, 12, 2890, 16, 4422, 16, 4555, 16, 612, 16, 460, 16, 1509, 67, 1734, 33, 8381, 16, 819, 12938, 4672, 309, 486, 1509, 67, 1734, 30, 1509, 67, 1734, 273, 2037, 7675, 701, 9982, 29...
increment(key_incomplete, namespace='S')
incr(key_incomplete, namespace='S')
def real_main(): args = parse_qs(environ['QUERY_STRING']) if not args: print "Status: 301 Moved Permanantly\nLocation: /\n\n", return for a in ('info_hash', 'port'): if a not in args or len(args[a]) < 1: if ERRORS: resps(bencode({'failure reason': "You must provide %s!"%a})) return ip = environ['REMOTE_ADDR'] key = args['info_hash'][0] if STATS: key_complete = '%s!complete'%key key_incomplete = '%s!incomplete'%key left = args.pop('left', [None])[0] err = None if(len(key) > 128): err = "Insanely long key!" else: try: port = int(args['port'][0]) except: err = "Invalid port number!" if err: if ERRORS: resps(bencode({'failure reason': err})) return # Crop raises chance of a clash, plausible deniability for the win! phash = md5("%s/%d" % (ip, port)).hexdigest()[:16] # TODO BT: If left=0, the download is done and we should not return any peers. event = args.pop('event', [None])[0] if event == 'stopped': # Maybe we should only remove it from this track, but this is good enough. mdel(phash, namespace='I') if STATS: # XXX Danger of incomplete underflow! if left == '0': decrement(key_complete, namespace='S') else: decrement(key_incomplete, namespace='S') return # They are going away, don't waste bw/cpu on this. resps(bencode({'interval': INTERVAL, 'peers': []})) elif STATS and event == 'completed': decrement(key_incomplete, namespace='S') increment(key_complete, namespace='S') updatetrack = False # Get existing peers r = get(key, namespace='K') if r: s = r.split('|') if len(s) > 32: ks = sample(s, 32) else: ks = s peers = get_multi(ks, namespace='I') lostpeers = (p for p in ks if p not in peers) if lostpeers: # Remove lost peers s = [k for k in s if k not in lostpeers] updatetrack = True if STATS: # XXX If we underflow, should decrement from '!complete' decrement(key_incomplete, len(lostpeers), namespace='S') if phash in peers: peers.pop(phash, None) # Remove self from returned peers # New track! else: s = [] peers = {} if STATS: mset(key_complete, '0', namespace='S') mset(key_incomplete, '0', namespace='S') # Might be redundant, but ensures we update the port number if it has changed. mset(phash, '|'.join((ip, str(port))), namespace='I') if phash not in s: # Assume new peer s.append(phash) updatetrack = True if STATS: # Should we bother to check event == 'started'? Why? if left == '0': increment(key_complete, namespace='S') else: increment(key_incomplete, namespace='S') if updatetrack: mset(key, '|'.join(s), namespace='K') ps = dict((k, peers[k].split('|')) for k in peers) pl = [{'ip': ps[h][0], 'port': ps[h][1]} for h in ps] if STATS: resps(bencode({'interval':INTERVAL, 'peers':pl, 'complete':get(key_complete, namespace='S'), 'incomplete':get(key_incomplete, namespace='S')})) else: resps(bencode({'interval':INTERVAL, 'peers': pl}))
2fc9438ee448a3f8e5f77c6eab847284091d5fbb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14779/2fc9438ee448a3f8e5f77c6eab847284091d5fbb/main.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2863, 67, 5254, 13332, 833, 273, 1109, 67, 12926, 12, 28684, 3292, 10753, 67, 5804, 19486, 225, 309, 486, 833, 30, 1172, 315, 1482, 30, 26403, 490, 9952, 13813, 304, 970, 715, 64, 82, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2863, 67, 5254, 13332, 833, 273, 1109, 67, 12926, 12, 28684, 3292, 10753, 67, 5804, 19486, 225, 309, 486, 833, 30, 1172, 315, 1482, 30, 26403, 490, 9952, 13813, 304, 970, 715, 64, 82, ...
self.assertEqual(s.get_at((0,0))[2], 255 )
s.blit(d, (0,0), None, BLEND_RGBA_ADD) self.assertEqual(s.get_at((0,0))[3], 255 )
def test_BLEND( self ): """ BLEND_ tests. """
0df2d02eb27a2b720af5b9922834c13150294f69 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1298/0df2d02eb27a2b720af5b9922834c13150294f69/blit_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 38, 900, 2908, 12, 365, 262, 30, 3536, 605, 900, 2908, 67, 7434, 18, 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, 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, 1842, 67, 38, 900, 2908, 12, 365, 262, 30, 3536, 605, 900, 2908, 67, 7434, 18, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
elt.insertBefore__(self.createElt(xml), None)
newElts = self.createElts(xml) for newElt in newElts: elt.insertBefore__(newElt, None)
def addItemAtEnd(self, xml, id): elt = self.findElt(id) if not elt: print "warning: addItemAtEnd: missing element %s" % id else: #print "add item %s at end of %s" % (elt.getAttribute_("id"), id) #print xml[0:79] elt.insertBefore__(self.createElt(xml), None)
e58799d897a7951bd79acce5f6f08838bacfdfb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12354/e58799d897a7951bd79acce5f6f08838bacfdfb8/HTMLDisplay.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15009, 861, 1638, 12, 2890, 16, 2025, 16, 612, 4672, 11572, 273, 365, 18, 4720, 15899, 12, 350, 13, 309, 486, 11572, 30, 1172, 315, 8551, 30, 15009, 861, 1638, 30, 3315, 930, 738, 87, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15009, 861, 1638, 12, 2890, 16, 2025, 16, 612, 4672, 11572, 273, 365, 18, 4720, 15899, 12, 350, 13, 309, 486, 11572, 30, 1172, 315, 8551, 30, 15009, 861, 1638, 30, 3315, 930, 738, 87, ...
self.position = self.road.length -1 self.speed = 0
def update(self, rang): """ Updates the car speed and position, manages blocked pathways and queues. rang (int) : position on the road (0 : last in) """
e11c10673ebcc92a3f3f69e0871c027bf0adbd2e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4798/e11c10673ebcc92a3f3f69e0871c027bf0adbd2e/init.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 2890, 16, 436, 539, 4672, 3536, 15419, 326, 5926, 8632, 471, 1754, 16, 20754, 281, 14547, 589, 3052, 471, 11897, 18, 436, 539, 565, 261, 474, 13, 282, 294, 282, 1754, 603, 32...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 2890, 16, 436, 539, 4672, 3536, 15419, 326, 5926, 8632, 471, 1754, 16, 20754, 281, 14547, 589, 3052, 471, 11897, 18, 436, 539, 565, 261, 474, 13, 282, 294, 282, 1754, 603, 32...
def __init__(self,workdir="",datafile="datafile.hdf5", force_create=False, force_single=False):
def __init__(self,workdir=None,datafile="datafile.hdf5", force_create=False, force_single=False):
def __init__(self,workdir="",datafile="datafile.hdf5", force_create=False, force_single=False): '''Create a hdf5 file from pencil code data. Warning!!! This first implementation either reads an existing file or write a new file. Set force_create to True if you want to force the re-creation of the data with new data. No possibility (yet...) to update the file with new data. workdir: working directory datafile: name of the hdf5 file set force_single to true to force to stock the floats in single precision (useful to decrease the file size, if single precision is sufficient for plotting purpose)''' if os.path.exists(datafile) and force_create==False: mode='a' else: mode='w' self.f=h5py.File(datafile,mode) self.datadir=workdir+'data/' # Are all data file in the workdir/data/ folder ??? self.workdir=workdir if mode=='w': self.__creating=True self.f.attrs['name']='PencilCode' # Setup datafile informations self.f.attrs['ver']=VERSION self.f.attrs['dateC']=self.f.attrs['dateM']=self.f.attrs['dateA']=datestring() self.param=self.f.create_group('param') # Setup param group self.param.create_group('dim') # Read parameters from dim.dat files self.__read_dim() if force_single: self.precision='f' self.param.create_group('init') #Read parameters from params.log file self.param.create_group('run') self.__read_param() self.param.create_group('index') # Read parameters from index.pro file self.__read_index() self.data=self.f.create_group('data') #Setup the data group self.__read_timeseries() self.__read_slices() self.etc=self.f.create_group('etc') #Setup the notes group self.etc.create_group('ext') dt=h5py.new_vlen(str) self.notes=self.etc.create_dataset('notes',(1,),dtype=dt,maxshape=(None,)) self.__creating=False else: # Open an existing file and setup the class members if self.f.attrs.get('name','none') != 'PencilCode': print "Warning! Probably not a pencil code hdf5 file!!!" else: print "Pencil code hdf5 file version: ",self.f.attrs.get('ver','Unset!') if self.f.attrs.get('ver','Unset!') != VERSION: print "Warning! This file is of a different version than this program ("+VERSION+")" print "Created on: ",self.f.attrs.get('dateC','Unset!') print "Last modified on:",self.f.attrs.get('dateM','Unset!') print "Last accessed on:",self.f.attrs.get('dateA','Unset!') self.f.attrs['dateA']=datestring() self.param=self.f['param'] self.data=self.f['data'] self.etc=self.f['etc'] self.notes=self.f['/etc/notes'] self.flush()
bf1a599ad9cde581f4679533ab3c54c55f5e9732 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1377/bf1a599ad9cde581f4679533ab3c54c55f5e9732/hdf5.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1252, 1214, 33, 7036, 16, 892, 768, 1546, 892, 768, 18, 26428, 25, 3113, 2944, 67, 2640, 33, 8381, 16, 2944, 67, 7526, 33, 8381, 4672, 9163, 1684, 279, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1252, 1214, 33, 7036, 16, 892, 768, 1546, 892, 768, 18, 26428, 25, 3113, 2944, 67, 2640, 33, 8381, 16, 2944, 67, 7526, 33, 8381, 4672, 9163, 1684, 279, ...
if not os.path.isdir(os.path.join(dir,elem)):
if not os.path.isdir(os.path.join(dir,elem)):
def get_file_listing(dir, mode, pattern=None): """ Returns the file listing of a given directory. It returns only files. Returns a list of [file,/path/to/file] """ filelist = [] if pattern == (None or ''): listaux = dircache.listdir(dir) else: if dir != '/': dir += '/' dir = escape_pattern(dir + pattern) listaux = glob.glob(dir) listaux.sort(key=str.lower) for elem in listaux: if STOP: return filelist if mode == 0: # Get files if not os.path.isdir(os.path.join(dir,elem)): filelist.append([os.path.basename(elem),os.path.join(dir,elem)]) elif mode == 1: # Get directories if os.path.isdir(os.path.join(dir,elem)): filelist.append([os.path.basename(elem),os.path.join(dir,elem)]) elif mode == 2: # Get files and directories filelist.append([os.path.basename(elem),os.path.join(dir,elem)]) else: # Get files if not os.path.isdir(os.path.join(dir,elem)): filelist.append([os.path.basename(elem),os.path.join(dir,elem)]) return filelist
48fc1c8d86f8cfbba31b22fbb4fd6c28972893ca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/735/48fc1c8d86f8cfbba31b22fbb4fd6c28972893ca/pyrenamer_filefuncs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 768, 67, 21228, 12, 1214, 16, 1965, 16, 1936, 33, 7036, 4672, 3536, 2860, 326, 585, 11591, 434, 279, 864, 1867, 18, 2597, 1135, 1338, 1390, 18, 2860, 279, 666, 434, 306, 768, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 768, 67, 21228, 12, 1214, 16, 1965, 16, 1936, 33, 7036, 4672, 3536, 2860, 326, 585, 11591, 434, 279, 864, 1867, 18, 2597, 1135, 1338, 1390, 18, 2860, 279, 666, 434, 306, 768, ...
sage: n._easy_vector()
sage: n._easy_vector()
def _easy_vector(self): """ Return a very sparse vector v such that v times the eigenvector matrix has all entries nonzero.
fb18d8e25e740d3ee9ca954988873ffd9883a0e6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/fb18d8e25e740d3ee9ca954988873ffd9883a0e6/numerical.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 73, 15762, 67, 7737, 12, 2890, 4672, 3536, 2000, 279, 8572, 9387, 3806, 331, 4123, 716, 331, 4124, 326, 11043, 3074, 1229, 3148, 711, 777, 3222, 16966, 18, 2, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 73, 15762, 67, 7737, 12, 2890, 4672, 3536, 2000, 279, 8572, 9387, 3806, 331, 4123, 716, 331, 4124, 326, 11043, 3074, 1229, 3148, 711, 777, 3222, 16966, 18, 2, -100, -100, -100, -100...
self.year = vc['YEAR'][0]
self.year = str(vc['YEAR'][0])
def set_info_ogg( self, file ): """ Sets all the info variables with useful info from the oggfile.
0da363e44f41820457a5f385cbc8673190f46f40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/0da363e44f41820457a5f385cbc8673190f46f40/audioinfo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 1376, 67, 23972, 12, 365, 16, 585, 262, 30, 3536, 11511, 777, 326, 1123, 3152, 598, 5301, 1123, 628, 326, 320, 14253, 768, 18, 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, 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, 444, 67, 1376, 67, 23972, 12, 365, 16, 585, 262, 30, 3536, 11511, 777, 326, 1123, 3152, 598, 5301, 1123, 628, 326, 320, 14253, 768, 18, 2, -100, -100, -100, -100, -100, -100, -100, -10...
self._links = ()
buildout_section = data.get ('buildout') links = buildout_section and buildout_section.get('find-links', '') self._links = links and links.split() or () allow_hosts = buildout_section and buildout_section.get( 'allow-hosts', '*').split('\n') self._allow_hosts = tuple([host.strip() for host in allow_hosts if host.strip() != ''])
def __init__(self, config_file, cloptions, user_defaults=True, windows_restart=False, command=None):
e5ad49cb3d1c8140b0bd2861299de84eef16bb7f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11359/e5ad49cb3d1c8140b0bd2861299de84eef16bb7f/buildout.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 642, 67, 768, 16, 1219, 573, 16, 729, 67, 7606, 33, 5510, 16, 9965, 67, 19164, 33, 8381, 16, 1296, 33, 7036, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 642, 67, 768, 16, 1219, 573, 16, 729, 67, 7606, 33, 5510, 16, 9965, 67, 19164, 33, 8381, 16, 1296, 33, 7036, 4672, 2, -100, -100, -100, -100, -100, -10...
startofline = tell()
try: startofline = tell() except IOError: startofline = tell = None self.seekable = 0
def readheaders(self): """Read header lines. Read header lines up to the entirely blank line that terminates them. The (normally blank) line that ends the headers is skipped, but not included in the returned list. If a non-header line ends the headers, (which is an error), an attempt is made to backspace over it; it is never included in the returned list. The variable self.status is set to the empty string if all went well, otherwise it is an error message. The variable self.headers is a completely uninterpreted list of lines contained in the header (so printing them will reproduce the header exactly as it appears in the file). """ self.dict = {} self.unixfrom = '' self.headers = list = [] self.status = '' headerseen = "" firstline = 1 startofline = unread = tell = None if hasattr(self.fp, 'unread'): unread = self.fp.unread elif self.seekable: tell = self.fp.tell while 1: if tell: startofline = tell() line = self.fp.readline() if not line: self.status = 'EOF in headers' break # Skip unix From name time lines if firstline and line[:5] == 'From ': self.unixfrom = self.unixfrom + line continue firstline = 0 if headerseen and line[0] in ' \t': # It's a continuation line. list.append(line) x = (self.dict[headerseen] + "\n " + string.strip(line)) self.dict[headerseen] = string.strip(x) continue elif self.iscomment(line): # It's a comment. Ignore it. continue elif self.islast(line): # Note! No pushback here! The delimiter line gets eaten. break headerseen = self.isheader(line) if headerseen: # It's a legal header line, save it. list.append(line) self.dict[headerseen] = string.strip(line[len(headerseen)+1:]) continue else: # It's not a header line; throw it back and stop here. if not self.dict: self.status = 'No headers' else: self.status = 'Non-header line where header expected' # Try to undo the read. if unread: unread(line) elif tell: self.fp.seek(startofline) else: self.status = self.status + '; bad seek' break
97643e4b431b8ae26f447c4f9693e92c1f2ac190 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/97643e4b431b8ae26f447c4f9693e92c1f2ac190/rfc822.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 2485, 12, 2890, 4672, 3536, 1994, 1446, 2362, 18, 225, 2720, 1446, 2362, 731, 358, 326, 21658, 7052, 980, 716, 30559, 2182, 18, 225, 1021, 261, 7959, 1230, 7052, 13, 980, 716, 3930,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2485, 12, 2890, 4672, 3536, 1994, 1446, 2362, 18, 225, 2720, 1446, 2362, 731, 358, 326, 21658, 7052, 980, 716, 30559, 2182, 18, 225, 1021, 261, 7959, 1230, 7052, 13, 980, 716, 3930,...
self.client.voidresp()
self.assertEqual(self.client.voidresp(), "226 transfer complete")
def test_data_connection(self): # clear text sock = self.client.transfercmd('list') self.assertNotIsInstance(sock, ssl.SSLSocket) sock.close() self.client.voidresp()
dbbbc946039920dffbeef9e7a5bd9be2e8685b36 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/dbbbc946039920dffbeef9e7a5bd9be2e8685b36/test_ftplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 892, 67, 4071, 12, 2890, 4672, 468, 2424, 977, 7313, 273, 365, 18, 2625, 18, 13866, 4172, 2668, 1098, 6134, 365, 18, 11231, 1248, 2520, 1442, 12, 15031, 16, 5832, 18, 1260, 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, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 892, 67, 4071, 12, 2890, 4672, 468, 2424, 977, 7313, 273, 365, 18, 2625, 18, 13866, 4172, 2668, 1098, 6134, 365, 18, 11231, 1248, 2520, 1442, 12, 15031, 16, 5832, 18, 1260, 2...
self.draw()
if self.world_coords: self.draw()
def erase(self): self.draw() self.world_coords = None
d64b6d5c2bc893694e7b1dc1f014767c1b70e181 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11522/d64b6d5c2bc893694e7b1dc1f014767c1b70e181/bitmapscroller.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22038, 12, 2890, 4672, 309, 365, 18, 18179, 67, 9076, 30, 365, 18, 9446, 1435, 365, 18, 18179, 67, 9076, 273, 599, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22038, 12, 2890, 4672, 309, 365, 18, 18179, 67, 9076, 30, 365, 18, 9446, 1435, 365, 18, 18179, 67, 9076, 273, 599, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
run_subprocess('%s api.tex' % latex_command)
out, err = run_subprocess('%s api.tex' % latex_command)
def write_latex(docindex, options): # If latex is an intermediate target, then use a temporary # directory for its files. if 'latex' in options.actions: latex_target = options.target['latex'] else: latex_target = tempfile.mkdtemp() log.start_progress('Writing LaTeX docs') # Choose a pdfdriver if we're generating pdf output. if options.pdfdriver=='auto' and ('latex' in options.actions or 'dvi' in options.actions or 'ps' in options.actions or 'pdf' in options.actions): if 'dvi' in options.actions or 'ps' in options.actions: options.pdfdriver = 'latex' else: try: run_subprocess('pdflatex --version') options.pdfdriver = 'pdflatex' except RunSubprocessError, e: options.pdfdriver = 'latex' log.info('%r pdfdriver selected' % options.pdfdriver) from epydoc.docwriter.latex import LatexWriter latex_writer = LatexWriter(docindex, **options.__dict__) latex_writer.write(latex_target) log.end_progress() # Decide how many steps we need to go through. if 'pdf' in options.actions: if options.pdfdriver == 'latex': steps = 6 elif 'ps' in options.actions: steps = 8 elif 'dvi' in options.actions: steps = 7 else: steps = 4 elif 'ps' in options.actions: steps = 5 elif 'dvi' in options.actions: steps = 4 else: # If we're just generating the latex, and not any derived # output format, then we're done. assert 'latex' in options.actions return # Decide whether we need to run latex, pdflatex, or both. if options.pdfdriver == 'latex': latex_commands = ['latex'] elif 'dvi' in options.actions or 'ps' in options.actions: latex_commands = ['latex', 'pdflatex'] else: latex_commands = ['pdflatex'] log.start_progress('Processing LaTeX docs') oldpath = os.path.abspath(os.curdir) running = None # keep track of what we're doing. step = 0. try: try: os.chdir(latex_target) # Clear any old files out of the way. for ext in 'aux log out idx ilg toc ind'.split(): if os.path.exists('api.%s' % ext): os.remove('api.%s' % ext) for latex_command in latex_commands: LaTeX = latex_command.replace('latex', 'LaTeX') # The first pass generates index files. running = latex_command log.progress(step/steps, '%s (First pass)' % LaTeX) step += 1 run_subprocess('%s api.tex' % latex_command) # Build the index. running = 'makeindex' log.progress(step/steps, '%s (Build index)' % LaTeX) step += 1 run_subprocess('makeindex api.idx') # The second pass generates our output. running = latex_command log.progress(step/steps, '%s (Second pass)' % LaTeX) step += 1 out, err = run_subprocess('%s api.tex' % latex_command) # The third pass is only necessary if the second pass # changed what page some things are on. running = latex_command if _RERUN_LATEX_RE.match(out): log.progress(step/steps, '%s (Third pass)' % LaTeX) out, err = run_subprocess('%s api.tex' % latex_command) # A fourth path should (almost?) never be necessary. running = latex_command if _RERUN_LATEX_RE.match(out): log.progress(step/steps, '%s (Fourth pass)' % LaTeX) run_subprocess('%s api.tex' % latex_command) step += 1 # If requested, convert to postscript. if ('ps' in options.actions or ('pdf' in options.actions and options.pdfdriver=='latex')): running = 'dvips' log.progress(step/steps, 'dvips') step += 1 run_subprocess('dvips api.dvi -o api.ps -G0 -Ppdf') # If requested, convert to pdf. if 'pdf' in options.actions and options.pdfdriver=='latex': running = 'ps2pdf' log.progress(step/steps, 'ps2pdf') step += 1 run_subprocess( 'ps2pdf -sPAPERSIZE#letter -dMaxSubsetPct#100 ' '-dSubsetFonts#true -dCompatibilityLevel#1.2 ' '-dEmbedAllFonts#true api.ps api.pdf') # Copy files to their respective targets. if 'dvi' in options.actions: dst = os.path.join(oldpath, options.target['dvi']) shutil.copy2('api.dvi', dst) if 'ps' in options.actions: dst = os.path.join(oldpath, options.target['ps']) shutil.copy2('api.ps', dst) if 'pdf' in options.actions: dst = os.path.join(oldpath, options.target['pdf']) shutil.copy2('api.pdf', dst) except RunSubprocessError, e: if running in ('latex', 'pdflatex'): e.out = re.sub(r'(?sm)\A.*?!( LaTeX Error:)?', r'', e.out) e.out = re.sub(r'(?sm)\s*Type X to quit.*', '', e.out) e.out = re.sub(r'(?sm)^! Emergency stop.*', '', e.out) log.error("%s failed: %s" % (running, (e.out+e.err).lstrip())) except OSError, e: log.error("%s failed: %s" % (running, e)) finally: os.chdir(oldpath) if 'latex' not in options.actions: # The latex output went to a tempdir; clean it up. log.info('Cleaning up %s' % latex_target) try: for filename in os.listdir(latex_target): os.remove(os.path.join(latex_target, filename)) os.rmdir(latex_target) except Exception, e: log.error("Error cleaning up tempdir %s: %s" % (latex_target, e)) log.end_progress()
e7993c1263226ecaf6eee3c8bab6e8900367fcda /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11420/e7993c1263226ecaf6eee3c8bab6e8900367fcda/cli.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 26264, 12, 2434, 1615, 16, 702, 4672, 468, 971, 25079, 353, 392, 12110, 1018, 16, 1508, 999, 279, 6269, 468, 1867, 364, 2097, 1390, 18, 309, 296, 26264, 11, 316, 702, 18, 490...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 26264, 12, 2434, 1615, 16, 702, 4672, 468, 971, 25079, 353, 392, 12110, 1018, 16, 1508, 999, 279, 6269, 468, 1867, 364, 2097, 1390, 18, 309, 296, 26264, 11, 316, 702, 18, 490...
root.update_idletasks()
def update_guild_members(glds): thrds = [] for g in glds: thrds.append(threading.Thread(target=_update_guild_members, args=[g])) thrds[-1].start() for t in thrds: t.join()
a297d3735c8e07d10e9f1f8937e0131696e57ce3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4811/a297d3735c8e07d10e9f1f8937e0131696e57ce3/prolepsis.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 75, 680, 67, 7640, 12, 75, 1236, 87, 4672, 29142, 2377, 273, 5378, 364, 314, 316, 314, 1236, 87, 30, 29142, 2377, 18, 6923, 12, 5930, 310, 18, 3830, 12, 3299, 33, 67, 2725,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 75, 680, 67, 7640, 12, 75, 1236, 87, 4672, 29142, 2377, 273, 5378, 364, 314, 316, 314, 1236, 87, 30, 29142, 2377, 18, 6923, 12, 5930, 310, 18, 3830, 12, 3299, 33, 67, 2725,...
id2name = dict([(th.ident, th.name) for th in threading.enumerate()])
thread_map = dict(threading._active, **threading._limbo) id2name = dict([(threadId, thread.getName()) for threadId, thread in thread_map.items()])
def dumpstacks(signum, frame): # code from http://stackoverflow.com/questions/132058/getting-stack-trace-from-a-running-python-application#answer-2569696 id2name = dict([(th.ident, th.name) for th in threading.enumerate()]) code = [] for threadId, stack in sys._current_frames().items(): code.append("\n# Thread: %s(%d)" % (id2name[threadId], threadId)) for filename, lineno, name, line in traceback.extract_stack(stack): code.append('File: "%s", line %d, in %s' % (filename, lineno, name)) if line: code.append(" %s" % (line.strip())) logging.getLogger('dumpstacks').info("\n".join(code))
128e59690531d8e4ed2e913721a40bf5ad599dd4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/128e59690531d8e4ed2e913721a40bf5ad599dd4/openerp-server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 3772, 87, 12, 2977, 379, 16, 2623, 4672, 468, 981, 628, 1062, 2207, 20672, 18, 832, 19, 9758, 19, 22152, 6260, 28, 19, 588, 1787, 17, 3772, 17, 5129, 17, 2080, 17, 69, 17, 8704...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 3772, 87, 12, 2977, 379, 16, 2623, 4672, 468, 981, 628, 1062, 2207, 20672, 18, 832, 19, 9758, 19, 22152, 6260, 28, 19, 588, 1787, 17, 3772, 17, 5129, 17, 2080, 17, 69, 17, 8704...
self.assertEqual(zlib.crc32(foo), -1808088941)
self.assertEqual(zlib.crc32(foo), 2486878355)
def test_crc32_adler32_unsigned(self): foo = 'abcdefghijklmnop' # explicitly test signed behavior self.assertEqual(zlib.crc32(foo), -1808088941) self.assertEqual(zlib.crc32('spam'), 1138425661) self.assertEqual(zlib.adler32(foo+foo), 3573550353) self.assertEqual(zlib.adler32('spam'), 72286642)
2727503bc9c7df0093d8920713fdb5ae4db65a98 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/2727503bc9c7df0093d8920713fdb5ae4db65a98/test_zlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 22988, 1578, 67, 361, 749, 1578, 67, 22297, 12, 2890, 4672, 8431, 273, 296, 28953, 17680, 8302, 16391, 13607, 556, 11, 468, 8122, 1842, 6726, 6885, 365, 18, 11231, 5812, 12, 94...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 22988, 1578, 67, 361, 749, 1578, 67, 22297, 12, 2890, 4672, 8431, 273, 296, 28953, 17680, 8302, 16391, 13607, 556, 11, 468, 8122, 1842, 6726, 6885, 365, 18, 11231, 5812, 12, 94...
self.parentpath = '/'.join(parentscope.getPhysicalPath()) else : self.browsedpath = self.rootpath self.browsed_url = self.root.absolute_url()
self.parentpath = '/'.join(parentscope.getPhysicalPath())
def setScopeInfos(self, context, request, showbreadcrumbs): """ set scope and all infos related to scope """ browsedpath = request.get('browsedpath', self.browsedpath) # find browser root and rootpath if undefined if self.root is None : if self.rootpath : self.root = aq_inner(self.portal.restrictedTraverse(self.rootpath)) else : root = aq_inner(context) while not INavigationRoot.providedBy(root) : root = aq_inner(root.aq_parent) self.root = root self.rootpath = '/'.join(self.root.getPhysicalPath()) # find scope if undefined # by default scope = browsedpath or first parent folderish or context if context is a folder scope = self.scope if scope is None : if browsedpath : self.scope = scope = aq_inner(self.portal.restrictedTraverse(browsedpath)) else : folder = aq_inner(context) if not bool(getattr(aq_base(folder), 'isPrincipiaFolderish', False)) : folder = aq_inner(folder.aq_parent) self.scope = scope = folder self.scopetitle = scope.pretty_title_or_id() self.scopetype = scopetype = scope.portal_type self.scopeiconclass = 'contenttype-%s divicon' % scopetype.lower().replace(' ','-') # set browsedpath and browsed_url if scope is not self.root : self.browsedpath = '/'.join(scope.getPhysicalPath()) self.browsed_url = scope.absolute_url() parentscope = aq_inner(scope.aq_parent) self.parentpath = '/'.join(parentscope.getPhysicalPath()) else : self.browsedpath = self.rootpath self.browsed_url = self.root.absolute_url() # set breadcrumbs # TODO : use self.catalog if showbreadcrumbs : crumbs = [] item = scope itempath = self.browsedpath while itempath != self.rootpath : crumb = {} crumb['path'] = itempath crumb['title'] = item.title_or_id() crumbs.append(crumb) item = aq_inner(item.aq_parent) itempath = '/'.join(item.getPhysicalPath()) crumbs.reverse() self.breadcrumbs = crumbs
a4d6bade346cc7a831c3083d65f597fbb9a14b46 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9052/a4d6bade346cc7a831c3083d65f597fbb9a14b46/finder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 3876, 7655, 12, 2890, 16, 819, 16, 590, 16, 2405, 31603, 4672, 3536, 444, 2146, 471, 777, 10626, 3746, 358, 2146, 3536, 324, 492, 730, 803, 273, 590, 18, 588, 2668, 70, 492, 730, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 3876, 7655, 12, 2890, 16, 819, 16, 590, 16, 2405, 31603, 4672, 3536, 444, 2146, 471, 777, 10626, 3746, 358, 2146, 3536, 324, 492, 730, 803, 273, 590, 18, 588, 2668, 70, 492, 730, ...
return socket.recv_from(self, addr, buflen, flags)
return socket.recvfrom(self, addr, buflen, flags)
def recv_from(self, addr, buflen=1024, flags=0): self._checkClosed() if self._sslobj: raise ValueError("recv_from not allowed on instances of %s" % self.__class__) else: return socket.recv_from(self, addr, buflen, flags)
980f3149a2485d9d96cf715af88c8aa51ba63d7f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/980f3149a2485d9d96cf715af88c8aa51ba63d7f/ssl.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10665, 67, 2080, 12, 2890, 16, 3091, 16, 1681, 1897, 33, 2163, 3247, 16, 2943, 33, 20, 4672, 365, 6315, 1893, 7395, 1435, 309, 365, 6315, 1049, 383, 441, 30, 1002, 2068, 2932, 18334, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10665, 67, 2080, 12, 2890, 16, 3091, 16, 1681, 1897, 33, 2163, 3247, 16, 2943, 33, 20, 4672, 365, 6315, 1893, 7395, 1435, 309, 365, 6315, 1049, 383, 441, 30, 1002, 2068, 2932, 18334, 6...
if source in self.changed: self.changed.remove(source)
self.added.discard(source) self.changed.discard(source)
def move_handler(self, source, target): source = self.normalize_key(source) target = self.normalize_key(target)
2f96722836e9223bdce8e2755d348a93ef7740a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12681/2f96722836e9223bdce8e2755d348a93ef7740a6/database.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3635, 67, 4176, 12, 2890, 16, 1084, 16, 1018, 4672, 1084, 273, 365, 18, 12237, 67, 856, 12, 3168, 13, 1018, 273, 365, 18, 12237, 67, 856, 12, 3299, 13, 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, 3635, 67, 4176, 12, 2890, 16, 1084, 16, 1018, 4672, 1084, 273, 365, 18, 12237, 67, 856, 12, 3168, 13, 1018, 273, 365, 18, 12237, 67, 856, 12, 3299, 13, 2, -100, -100, -100, -100, -10...
is blocked.'''),
is completely blocked.'''),
def __init__(self, key, name, doc): """Initialze a benchmark test.
bacebd0a5b4e94fc724b2f06b8e2a6be5fba7834 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5745/bacebd0a5b4e94fc724b2f06b8e2a6be5fba7834/test_set.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 498, 16, 508, 16, 997, 4672, 3536, 4435, 8489, 279, 14128, 1842, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 498, 16, 508, 16, 997, 4672, 3536, 4435, 8489, 279, 14128, 1842, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
if not result or user in allow_read:
if not (result or user in allow_read):
def check_perm(self, req, op): '''Check permission for operation based on request data (including authentication info). Return if op allowed, else raise an ErrorResponse exception.'''
c9ded3a250b5743f7a7ceb1235c48a402c830954 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/c9ded3a250b5743f7a7ceb1235c48a402c830954/hgweb_mod.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 12160, 12, 2890, 16, 1111, 16, 1061, 4672, 9163, 1564, 4132, 364, 1674, 2511, 603, 590, 501, 261, 31348, 5107, 1123, 2934, 2000, 309, 1061, 2935, 16, 469, 1002, 392, 27181, 1520...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 12160, 12, 2890, 16, 1111, 16, 1061, 4672, 9163, 1564, 4132, 364, 1674, 2511, 603, 590, 501, 261, 31348, 5107, 1123, 2934, 2000, 309, 1061, 2935, 16, 469, 1002, 392, 27181, 1520...
tlsa = None
def jmol_animate_html(self, chain, cpartition): """Writes out the HTML page which will display the structure using the JMol Applet. """ basename = "%s_CHAIN%s_NTLS%d_ANIMATE" % (self.struct_id, chain.chain_id, cpartition.num_tls_segments())
81092918682cb3b404793cc6abd4020f9621498a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10674/81092918682cb3b404793cc6abd4020f9621498a/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 525, 21260, 67, 304, 4988, 67, 2620, 12, 2890, 16, 2687, 16, 276, 10534, 4672, 3536, 8368, 596, 326, 3982, 1363, 1492, 903, 2562, 326, 3695, 1450, 326, 804, 49, 355, 1716, 1469, 18, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 525, 21260, 67, 304, 4988, 67, 2620, 12, 2890, 16, 2687, 16, 276, 10534, 4672, 3536, 8368, 596, 326, 3982, 1363, 1492, 903, 2562, 326, 3695, 1450, 326, 804, 49, 355, 1716, 1469, 18, 35...
mail_recipients=options.mail_recipients,
mail_recipients=mail_recipients,
def main(): parser = OptionParser(usage="%prog [OPTIONS]") parser.add_option("-b", "--baseurl", help="baseurl of wiki") parser.add_option('-l', '--logfile', help='log output to LOGFILE') parser.add_option('-f', '--from-email', help='From: email address for error mails', ) parser.add_option('-r', '--mail-recipients', help='To: email addresses ("," separated) for error mails', ) parser.add_option('-m', '--max-narticles', help='maximum number of articles for random collections (min is 1)', default=10, ) parser.add_option('-s', '--serviceurl', help="location of the mw-serve server to test", default='http://tools.pediapress.com/mw-serve/', #default='http://localhost:8899/mw-serve/', ) use_help = 'Use --help for usage information.' options, args = parser.parse_args() if options.logfile: utils.start_logging(options.logfile) api = mwapidb.APIHelper(options.baseurl) maxarts = int(getattr(options, "max-narticles", 10)) mail_recipients = None if options.mail_recipients: mail_recipients = options.mail_recipients.split(',') while True: try: checkservice(api, options.serviceurl, options.baseurl, maxarts, from_email=options.from_email, mail_recipients=options.mail_recipients, ) except KeyboardInterrupt: break except: utils.report( system=system, subject='checkservice() failed', from_email=options.from_email, mail_recipients=options.mail_recipients, )
50160b48b641d72a4bf75095f60ef0adc3f1a38a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12391/50160b48b641d72a4bf75095f60ef0adc3f1a38a/mw-serve-stresser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 2082, 273, 18862, 12, 9167, 11613, 14654, 306, 12422, 4279, 13, 2082, 18, 1289, 67, 3482, 2932, 17, 70, 3113, 5238, 1969, 718, 3113, 2809, 1546, 1969, 718, 434, 9050, 7923, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 2082, 273, 18862, 12, 9167, 11613, 14654, 306, 12422, 4279, 13, 2082, 18, 1289, 67, 3482, 2932, 17, 70, 3113, 5238, 1969, 718, 3113, 2809, 1546, 1969, 718, 434, 9050, 7923, ...
lno += True
lno += 1
def _loadFile (self): # shamelessly cribbed from Python's Tools/i18n/msgfmt.py # 25-Mar-2003 Nathan R. Yergler (nathan@zope.org) # 14-Apr-2003 Hacked by Barry Warsaw (barry@zope.com)
07f1316aa38074640a2637ac645f4d1a615224b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/07f1316aa38074640a2637ac645f4d1a615224b3/talgettext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 945, 812, 261, 2890, 4672, 468, 699, 9925, 403, 715, 276, 1533, 2992, 628, 6600, 1807, 19089, 19, 77, 2643, 82, 19, 3576, 8666, 18, 2074, 468, 6969, 17, 49, 297, 17, 6976, 23, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 945, 812, 261, 2890, 4672, 468, 699, 9925, 403, 715, 276, 1533, 2992, 628, 6600, 1807, 19089, 19, 77, 2643, 82, 19, 3576, 8666, 18, 2074, 468, 6969, 17, 49, 297, 17, 6976, 23, 4...
if self._columns[field]._classic_write: upd0 = upd0 + ',"' + field + '"' upd1 = upd1 + ',' + self._columns[field]._symbol_set[0] upd2.append(self._columns[field]._symbol_set[1](vals[field])) else: upd_todo.append(field)
if field in self._columns: if self._columns[field]._classic_write: upd0 = upd0 + ',"' + field + '"' upd1 = upd1 + ',' + self._columns[field]._symbol_set[0] upd2.append(self._columns[field]._symbol_set[1](vals[field])) else: upd_todo.append(field)
def create(self, cr, user, vals, context=None): """ create(cr, user, vals, context) -> int cr = database cursor user = user id vals = dictionary of the form {'field_name':field_value, ...} """ if not context: context = {} self.pool.get('ir.model.access').check(cr, user, self._name, 'create')
d416be1bf5401d5071a57438dd8c044895fc37cc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/d416be1bf5401d5071a57438dd8c044895fc37cc/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2890, 16, 4422, 16, 729, 16, 5773, 16, 819, 33, 7036, 4672, 3536, 752, 12, 3353, 16, 729, 16, 5773, 16, 819, 13, 317, 509, 4422, 273, 2063, 3347, 729, 273, 729, 612, 5773, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2890, 16, 4422, 16, 729, 16, 5773, 16, 819, 33, 7036, 4672, 3536, 752, 12, 3353, 16, 729, 16, 5773, 16, 819, 13, 317, 509, 4422, 273, 2063, 3347, 729, 273, 729, 612, 5773, ...
return next_stage_id
return next_stage_id
def stage_change(self, cr, uid, ids, context=None, order='sequence'): if not context: context = {} stage_pool = self.pool.get('crm.case.stage') stage_type = context and context.get('stage_type','') current_seq = False next_stage_id = False for case in self.browse(cr, uid, ids, context): next_stage = False data = {}
cf13a034f3fe74dbfb01445b84dedc8d9537c58e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cf13a034f3fe74dbfb01445b84dedc8d9537c58e/crm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6009, 67, 3427, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 16, 1353, 2218, 6178, 11, 4672, 309, 486, 819, 30, 819, 273, 2618, 6009, 67, 6011, 273, 365, 18, 6011, 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, 6009, 67, 3427, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 16, 1353, 2218, 6178, 11, 4672, 309, 486, 819, 30, 819, 273, 2618, 6009, 67, 6011, 273, 365, 18, 6011, 18, ...
elif S_ISREG(st.st_mode) and f.endswith(".rpm"):
elif S_ISREG(st.st_mode) and f[-4:] == ".rpm":
def findRpms(dir, uselstat=None, verbose=0): s = os.stat if uselstat: s = os.lstat dirs = [ dir ] files = [] while dirs: d = dirs.pop() for f in os.listdir(d): path = "%s/%s" % (d, f) st = s(path) if S_ISDIR(st.st_mode): dirs.append(path) elif S_ISREG(st.st_mode) and f.endswith(".rpm"): files.append(path) else: if verbose > 2: print "ignoring", path return files
427871e48b993cbe1bec0e26f0693386c8014c95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/427871e48b993cbe1bec0e26f0693386c8014c95/oldpyrpm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 54, 84, 959, 12, 1214, 16, 584, 292, 5642, 33, 7036, 16, 3988, 33, 20, 4672, 272, 273, 1140, 18, 5642, 309, 584, 292, 5642, 30, 272, 273, 1140, 18, 80, 5642, 7717, 273, 306, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 54, 84, 959, 12, 1214, 16, 584, 292, 5642, 33, 7036, 16, 3988, 33, 20, 4672, 272, 273, 1140, 18, 5642, 309, 584, 292, 5642, 30, 272, 273, 1140, 18, 80, 5642, 7717, 273, 306, ...
def iterator_for_legacy_db_feeder_queue(self): for row in self.limited_iteration(self.merge_scan_with_prefix('crash_reports_index_legacy_processed',
def deleting_iterator_for_table(self, table_name,limit=10**6): for row in self.limited_iteration(self.merge_scan_with_prefix(table_name,
def iterator_for_legacy_db_feeder_queue(self): #self.logger.debug('iterator_for_all_legacy_processed') for row in self.limited_iteration(self.merge_scan_with_prefix('crash_reports_index_legacy_processed', '', ['ids:ooid', 'processed_data:json'])):
c3a802cca5a68450f58b4fda05d74a38ee7d8510 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12383/c3a802cca5a68450f58b4fda05d74a38ee7d8510/hbaseClient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2775, 67, 1884, 67, 17386, 67, 1966, 67, 7848, 264, 67, 4000, 12, 2890, 4672, 468, 2890, 18, 4901, 18, 4148, 2668, 9838, 67, 1884, 67, 454, 67, 17386, 67, 11005, 6134, 364, 1027, 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, 2775, 67, 1884, 67, 17386, 67, 1966, 67, 7848, 264, 67, 4000, 12, 2890, 4672, 468, 2890, 18, 4901, 18, 4148, 2668, 9838, 67, 1884, 67, 454, 67, 17386, 67, 11005, 6134, 364, 1027, 316, ...
logRequests=1):
logRequests=1, allow_none=False):
def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler, logRequests=1): self.logRequests = logRequests
abc39365bd1065be5983597fe24f8dddbe98dbc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/abc39365bd1065be5983597fe24f8dddbe98dbc6/SimpleXMLRPCServer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 3091, 16, 590, 1503, 33, 5784, 4201, 8087, 28773, 16, 613, 6421, 33, 21, 16, 1699, 67, 6102, 33, 8381, 4672, 365, 18, 1330, 6421, 273, 613, 6421, 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, 2738, 972, 12, 2890, 16, 3091, 16, 590, 1503, 33, 5784, 4201, 8087, 28773, 16, 613, 6421, 33, 21, 16, 1699, 67, 6102, 33, 8381, 4672, 365, 18, 1330, 6421, 273, 613, 6421, 2, -1...
self.job.stdout.redirect(results)
self.job.logging.redirect(results)
def run_once(self, testdir = None, filesize='100M', type='write', pattern='random'): cmd = os.path.join(self.srcdir, 'src/spew') if not testdir: testdir = self.tmpdir tmpfile = os.path.join(testdir, 'spew-test.%d' % os.getpid()) results = os.path.join(self.resultsdir, 'stdout.%d' % self.iteration) args = '--%s -p %s -b 2k -B 2M %s %s' % \ (type, pattern, filesize, tmpfile) cmd += ' ' + args
45745701a61869dfefa3a869b4545d8443779592 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10349/45745701a61869dfefa3a869b4545d8443779592/spew.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 8243, 12, 2890, 16, 1842, 1214, 273, 599, 16, 14104, 2218, 6625, 49, 2187, 618, 2218, 2626, 2187, 1936, 2218, 9188, 11, 4672, 1797, 273, 1140, 18, 803, 18, 5701, 12, 2890, 18...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 8243, 12, 2890, 16, 1842, 1214, 273, 599, 16, 14104, 2218, 6625, 49, 2187, 618, 2218, 2626, 2187, 1936, 2218, 9188, 11, 4672, 1797, 273, 1140, 18, 803, 18, 5701, 12, 2890, 18...
return self.SimpleTest("chrome", "remoting_unittests")
return self.SimpleTest("chrome", "remoting_unittests", cmd_args=[ "--ui-test-timeout=240000", "--ui-test-action-timeout=120000", "--ui-test-action-max-timeout=280000"])
def TestRemoting(self): return self.SimpleTest("chrome", "remoting_unittests")
afdc527faecd2c6d6005320ef59c18dfdcf59599 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/afdc527faecd2c6d6005320ef59c18dfdcf59599/chrome_tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7766, 1933, 17128, 12, 2890, 4672, 327, 365, 18, 5784, 4709, 2932, 343, 10896, 3113, 315, 2764, 17128, 67, 4873, 16341, 7923, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7766, 1933, 17128, 12, 2890, 4672, 327, 365, 18, 5784, 4709, 2932, 343, 10896, 3113, 315, 2764, 17128, 67, 4873, 16341, 7923, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
pat=re.compile("([a-zA-Z_]*)=(.*)")
pat=re.compile("([0-9a-zA-Z_]*)=(.*)")
def parse_makeconf(mylines): mymakeconf={} pos=0 pat=re.compile("([a-zA-Z_]*)=(.*)") while pos<len(mylines): if len(mylines[pos])<=1: #skip blanks pos += 1 continue if mylines[pos][0] in ["#"," ","\t"]: #skip indented lines, comments pos += 1 continue else: myline=mylines[pos] mobj=pat.match(myline) pos += 1 if mobj.group(2): clean_string = re.sub(r"\"",r"",mobj.group(2)) mymakeconf[mobj.group(1)]=clean_string return mymakeconf
26157f6dd1db14baf957b3014739378d60f6daa3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7327/26157f6dd1db14baf957b3014739378d60f6daa3/catalyst_support.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 81, 581, 17181, 74, 12, 4811, 3548, 4672, 312, 2942, 581, 17181, 74, 12938, 949, 33, 20, 9670, 33, 266, 18, 11100, 2932, 3816, 20, 17, 29, 69, 17, 9600, 17, 62, 67, 15471, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 81, 581, 17181, 74, 12, 4811, 3548, 4672, 312, 2942, 581, 17181, 74, 12938, 949, 33, 20, 9670, 33, 266, 18, 11100, 2932, 3816, 20, 17, 29, 69, 17, 9600, 17, 62, 67, 15471, ...
term = stemmer.stem_word(word)
term = stemmer(word)
def add_text(self, identifier, text, mime_type='text/plain'): ''' "identifier" is (classname, itemid, property) ''' if mime_type != 'text/plain': return if not text: text = ''
95890ad18f8ae204e22c540ea4c89a89e870999a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1906/95890ad18f8ae204e22c540ea4c89a89e870999a/indexer_xapian.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 955, 12, 2890, 16, 2756, 16, 977, 16, 4892, 67, 723, 2218, 955, 19, 7446, 11, 4672, 9163, 315, 5644, 6, 353, 225, 261, 18340, 16, 16862, 16, 1272, 13, 9163, 309, 4892, 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, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 955, 12, 2890, 16, 2756, 16, 977, 16, 4892, 67, 723, 2218, 955, 19, 7446, 11, 4672, 9163, 315, 5644, 6, 353, 225, 261, 18340, 16, 16862, 16, 1272, 13, 9163, 309, 4892, 67, ...
assert crystal_symmetry.unit_cell() is not None assert crystal_symmetry.space_group_info() is not None
if (crystal_symmetry.unit_cell() is None): return None if (crystal_symmetry.space_group_info() is None): return None
def get_special_position_settings(self, special_position_settings=None, crystal_symmetry=None, force_symmetry=False): assert special_position_settings is None or crystal_symmetry is None assert self.crystal_symmetry is not None or crystal_symmetry is not None or special_position_settings is not None if (crystal_symmetry is None): crystal_symmetry = special_position_settings if (self.crystal_symmetry is not None): if (crystal_symmetry is None): crystal_symmetry = self.crystal_symmetry else: crystal_symmetry = self.crystal_symmetry.join_symmetry( other_symmetry=crystal_symmetry, force=force_symmetry) assert crystal_symmetry.unit_cell() is not None assert crystal_symmetry.space_group_info() is not None if (special_position_settings is None): special_position_settings = crystal.special_position_settings( crystal_symmetry=crystal_symmetry) else: special_position_settings = crystal.special_position_settings( crystal_symmetry=crystal_symmetry, min_distance_sym_equiv =special_position_settings.min_distance_sym_equiv, u_star_tolerance =special_position_settings.u_star_tolerance, assert_is_positive_definite =special_position_settings.assert_is_positive_definite) return special_position_settings
c399cbd82107d08f753b4004b07416b016736b86 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/c399cbd82107d08f753b4004b07416b016736b86/interpretation.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 9371, 67, 3276, 67, 4272, 12, 2890, 16, 4582, 67, 3276, 67, 4272, 33, 7036, 16, 4422, 31365, 67, 8117, 18042, 33, 7036, 16, 2944, 67, 8117, 18042, 33, 8381, 4672, 1815, 4582, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9371, 67, 3276, 67, 4272, 12, 2890, 16, 4582, 67, 3276, 67, 4272, 33, 7036, 16, 4422, 31365, 67, 8117, 18042, 33, 7036, 16, 2944, 67, 8117, 18042, 33, 8381, 4672, 1815, 4582, ...
"""Returns generator yielding marked up from/to side by side differences.
r"""Returns generator yielding marked up from/to side by side differences.
def _mdiff(fromlines, tolines, context=None, linejunk=None, charjunk=IS_CHARACTER_JUNK): """Returns generator yielding marked up from/to side by side differences. Arguments: fromlines -- list of text lines to compared to tolines tolines -- list of text lines to be compared to fromlines context -- number of context lines to display on each side of difference, if None, all from/to text lines will be generated. linejunk -- passed on to ndiff (see ndiff documentation) charjunk -- passed on to ndiff (see ndiff documentation) This function returns an interator which returns a tuple: (from line tuple, to line tuple, boolean flag) from/to line tuple -- (line num, line text) line num -- integer or None (to indicate a context seperation) line text -- original line text with following markers inserted: '\0+' -- marks start of added text '\0-' -- marks start of deleted text '\0^' -- marks start of changed text '\1' -- marks end of added/deleted/changed text boolean flag -- None indicates context separation, True indicates either "from" or "to" line contains a change, otherwise False. This function/iterator was originally developed to generate side by side file difference for making HTML pages (see HtmlDiff class for example usage). Note, this function utilizes the ndiff function to generate the side by side difference markup. Optional ndiff arguments may be passed to this function and they in turn will be passed to ndiff. """ import re # regular expression for finding intraline change indices change_re = re.compile('(\++|\-+|\^+)') # create the difference iterator to generate the differences diff_lines_iterator = ndiff(fromlines,tolines,linejunk,charjunk) def _make_line(lines, format_key, side, num_lines=[0,0]): """Returns line of text with user's change markup and line formatting. lines -- list of lines from the ndiff generator to produce a line of text from. When producing the line of text to return, the lines used are removed from this list. format_key -- '+' return first line in list with "add" markup around the entire line. '-' return first line in list with "delete" markup around the entire line. '?' return first line in list with add/delete/change intraline markup (indices obtained from second line) None return first line in list with no markup side -- indice into the num_lines list (0=from,1=to) num_lines -- from/to current line number. This is NOT intended to be a passed parameter. It is present as a keyword argument to maintain memory of the current line numbers between calls of this function. Note, this function is purposefully not defined at the module scope so that data it needs from its parent function (within whose context it is defined) does not need to be of module scope. """ num_lines[side] += 1 # Handle case where no user markup is to be added, just return line of # text with user's line format to allow for usage of the line number. if format_key is None: return (num_lines[side],lines.pop(0)[2:]) # Handle case of intraline changes if format_key == '?': text, markers = lines.pop(0), lines.pop(0) # find intraline changes (store change type and indices in tuples) sub_info = [] def record_sub_info(match_object,sub_info=sub_info): sub_info.append([match_object.group(1)[0],match_object.span()]) return match_object.group(1) change_re.sub(record_sub_info,markers) # process each tuple inserting our special marks that won't be # noticed by an xml/html escaper. for key,(begin,end) in sub_info[::-1]: text = text[0:begin]+'\0'+key+text[begin:end]+'\1'+text[end:] text = text[2:] # Handle case of add/delete entire line else: text = lines.pop(0)[2:] # if line of text is just a newline, insert a space so there is # something for the user to highlight and see. if not text: text = ' ' # insert marks that won't be noticed by an xml/html escaper. text = '\0' + format_key + text + '\1' # Return line of text, first allow user's line formatter to do its # thing (such as adding the line number) then replace the special # marks with what the user's change markup. return (num_lines[side],text) def _line_iterator(): """Yields from/to lines of text with a change indication. This function is an iterator. It itself pulls lines from a differencing iterator, processes them and yields them. When it can it yields both a "from" and a "to" line, otherwise it will yield one or the other. In addition to yielding the lines of from/to text, a boolean flag is yielded to indicate if the text line(s) have differences in them. Note, this function is purposefully not defined at the module scope so that data it needs from its parent function (within whose context it is defined) does not need to be of module scope. """ lines = [] num_blanks_pending, num_blanks_to_yield = 0, 0 while True: # Load up next 4 lines so we can look ahead, create strings which # are a concatenation of the first character of each of the 4 lines # so we can do some very readable comparisons. while len(lines) < 4: try: lines.append(diff_lines_iterator.next()) except StopIteration: lines.append('X') s = ''.join([line[0] for line in lines]) if s.startswith('X'): # When no more lines, pump out any remaining blank lines so the # corresponding add/delete lines get a matching blank line so # all line pairs get yielded at the next level. num_blanks_to_yield = num_blanks_pending elif s.startswith('-?+?'): # simple intraline change yield _make_line(lines,'?',0), _make_line(lines,'?',1), True continue elif s.startswith('--++'): # in delete block, add block coming: we do NOT want to get # caught up on blank lines yet, just process the delete line num_blanks_pending -= 1 yield _make_line(lines,'-',0), None, True continue elif s.startswith(('--?+', '--+', '- ')): # in delete block and see a intraline change or unchanged line # coming: yield the delete line and then blanks from_line,to_line = _make_line(lines,'-',0), None num_blanks_to_yield,num_blanks_pending = num_blanks_pending-1,0 elif s.startswith('-+?'): # intraline change yield _make_line(lines,None,0), _make_line(lines,'?',1), True continue elif s.startswith('-?+'): # intraline change yield _make_line(lines,'?',0), _make_line(lines,None,1), True continue elif s.startswith('-'): # delete FROM line num_blanks_pending -= 1 yield _make_line(lines,'-',0), None, True continue elif s.startswith('+--'): # in add block, delete block coming: we do NOT want to get # caught up on blank lines yet, just process the add line num_blanks_pending += 1 yield None, _make_line(lines,'+',1), True continue elif s.startswith(('+ ', '+-')): # will be leaving an add block: yield blanks then add line from_line, to_line = None, _make_line(lines,'+',1) num_blanks_to_yield,num_blanks_pending = num_blanks_pending+1,0 elif s.startswith('+'): # inside an add block, yield the add line num_blanks_pending += 1 yield None, _make_line(lines,'+',1), True continue elif s.startswith(' '): # unchanged text, yield it to both sides yield _make_line(lines[:],None,0),_make_line(lines,None,1),False continue # Catch up on the blank lines so when we yield the next from/to # pair, they are lined up. while(num_blanks_to_yield < 0): num_blanks_to_yield += 1 yield None,('','\n'),True while(num_blanks_to_yield > 0): num_blanks_to_yield -= 1 yield ('','\n'),None,True if s.startswith('X'): raise StopIteration else: yield from_line,to_line,True def _line_pair_iterator(): """Yields from/to lines of text with a change indication. This function is an iterator. It itself pulls lines from the line iterator. Its difference from that iterator is that this function always yields a pair of from/to text lines (with the change indication). If necessary it will collect single from/to lines until it has a matching pair from/to pair to yield. Note, this function is purposefully not defined at the module scope so that data it needs from its parent function (within whose context it is defined) does not need to be of module scope. """ line_iterator = _line_iterator() fromlines,tolines=[],[] while True: # Collecting lines of text until we have a from/to pair while (len(fromlines)==0 or len(tolines)==0): from_line, to_line, found_diff =line_iterator.next() if from_line is not None: fromlines.append((from_line,found_diff)) if to_line is not None: tolines.append((to_line,found_diff)) # Once we have a pair, remove them from the collection and yield it from_line, fromDiff = fromlines.pop(0) to_line, to_diff = tolines.pop(0) yield (from_line,to_line,fromDiff or to_diff) # Handle case where user does not want context differencing, just yield # them up without doing anything else with them. line_pair_iterator = _line_pair_iterator() if context is None: while True: yield line_pair_iterator.next() # Handle case where user wants context differencing. We must do some # storage of lines until we know for sure that they are to be yielded. else: context += 1 lines_to_write = 0 while True: # Store lines up until we find a difference, note use of a # circular queue because we only need to keep around what # we need for context. index, contextLines = 0, [None]*(context) found_diff = False while(found_diff is False): from_line, to_line, found_diff = line_pair_iterator.next() i = index % context contextLines[i] = (from_line, to_line, found_diff) index += 1 # Yield lines that we have collected so far, but first yield # the user's separator. if index > context: yield None, None, None lines_to_write = context else: lines_to_write = index index = 0 while(lines_to_write): i = index % context index += 1 yield contextLines[i] lines_to_write -= 1 # Now yield the context lines after the change lines_to_write = context-1 while(lines_to_write): from_line, to_line, found_diff = line_pair_iterator.next() # If another change within the context, extend the context if found_diff: lines_to_write = context-1 else: lines_to_write -= 1 yield from_line, to_line, found_diff
37a93df12625acb7635b8d1d2f949000f6eba0b0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/37a93df12625acb7635b8d1d2f949000f6eba0b0/difflib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1264, 3048, 12, 2080, 3548, 16, 6085, 1465, 16, 819, 33, 7036, 16, 980, 78, 1683, 33, 7036, 16, 1149, 78, 1683, 33, 5127, 67, 27858, 67, 46, 16141, 4672, 436, 8395, 1356, 4456, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1264, 3048, 12, 2080, 3548, 16, 6085, 1465, 16, 819, 33, 7036, 16, 980, 78, 1683, 33, 7036, 16, 1149, 78, 1683, 33, 5127, 67, 27858, 67, 46, 16141, 4672, 436, 8395, 1356, 4456, ...
result = self.getMetadataFields(credDict)
result = self.getMetadataFields( credDict )
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...
EXAMPLES:
EXAMPLES::
def __getattr__(self, a): r""" Get an 'append' method from a TestAppendNonlist. We have this method so that we can distinguish how many times the append method is fetched.
a4aad1557cdf06ed8562711534ca467dff85c855 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/a4aad1557cdf06ed8562711534ca467dff85c855/explain_pickle.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 1747, 972, 12, 2890, 16, 279, 4672, 436, 8395, 968, 392, 296, 6923, 11, 707, 628, 279, 7766, 5736, 3989, 1098, 18, 225, 1660, 1240, 333, 707, 1427, 716, 732, 848, 23926, 366...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 1747, 972, 12, 2890, 16, 279, 4672, 436, 8395, 968, 392, 296, 6923, 11, 707, 628, 279, 7766, 5736, 3989, 1098, 18, 225, 1660, 1240, 333, 707, 1427, 716, 732, 848, 23926, 366...
s = args[0]
s = args[0]
def atoi(*args): """atoi(s [,base]) -> int Return the integer represented by the string s in the given base, which defaults to 10. The string s must consist of one or more digits, possibly preceded by a sign. If base is 0, it is chosen from the leading characters of s, 0 for octal, 0x or 0X for hexadecimal. If base is 16, a preceding 0x or 0X is accepted. """ try: s = args[0] except IndexError: raise TypeError('function requires at least 1 argument: %d given' % len(args)) # Don't catch type error resulting from too many arguments to int(). The # error message isn't compatible but the error type is, and this function # is complicated enough already. if type(s) == _StringType: return _apply(_int, args) else: raise TypeError('argument 1: expected string, %s found' % type(s).__name__)
41e1b79f8a54a22203727f5ced66902108fda7d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/41e1b79f8a54a22203727f5ced66902108fda7d7/string.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 622, 11359, 30857, 1968, 4672, 3536, 270, 11359, 12, 87, 306, 16, 1969, 5717, 317, 509, 225, 2000, 326, 3571, 10584, 635, 326, 533, 272, 316, 326, 864, 1026, 16, 1492, 3467, 358, 1728, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 622, 11359, 30857, 1968, 4672, 3536, 270, 11359, 12, 87, 306, 16, 1969, 5717, 317, 509, 225, 2000, 326, 3571, 10584, 635, 326, 533, 272, 316, 326, 864, 1026, 16, 1492, 3467, 358, 1728, ...
def _getProperty(self, id):
def _getProperty(self, id):
def _getProperty(self, id): """Try to get a member property. If the property is not found, raise an AttributeError""" schema = self.Schema() if schema.get(id, None): accessor = getattr(self, schema.get(id).accessor, None) value = accessor() else: base = aq_base(self) value = getattr(base, id) return value
3383b2edd15f038c3c87c5b7dea8678841225f8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/3383b2edd15f038c3c87c5b7dea8678841225f8b/Member.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 1396, 12, 2890, 16, 612, 4672, 3536, 7833, 358, 336, 279, 3140, 1272, 18, 225, 971, 326, 1272, 353, 486, 1392, 16, 1002, 392, 6394, 8395, 1963, 273, 365, 18, 3078, 1435, 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, 1396, 12, 2890, 16, 612, 4672, 3536, 7833, 358, 336, 279, 3140, 1272, 18, 225, 971, 326, 1272, 353, 486, 1392, 16, 1002, 392, 6394, 8395, 1963, 273, 365, 18, 3078, 1435, 309,...
self.set_size_request(preview_total_w, preview_total_h)
self.redraw_thumbnails()
def __init__(self, app): gtk.DrawingArea.__init__(self) self.pixbuf = None self.app = app self.app.brush_selected_callbacks.append(self.brush_selected_cb)
2dbb5d369e4b4c8c2e24744aec7c6232f4bbe6ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7129/2dbb5d369e4b4c8c2e24744aec7c6232f4bbe6ba/brushselectionwindow.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 595, 4672, 22718, 18, 26885, 5484, 16186, 2738, 972, 12, 2890, 13, 365, 18, 14861, 4385, 273, 599, 365, 18, 2910, 273, 595, 365, 18, 2910, 18, 2848, 1218...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 595, 4672, 22718, 18, 26885, 5484, 16186, 2738, 972, 12, 2890, 13, 365, 18, 14861, 4385, 273, 599, 365, 18, 2910, 273, 595, 365, 18, 2910, 18, 2848, 1218...
oscmd("thirdparty\\win-nsis\\makensis.exe /V2 /DCOMPRESSOR="+COMPRESSOR+" /DVERSION="+VERSION+" thirdparty\\win-nsis\\panda.nsi")
oscmd("thirdparty/win-nsis/makensis.exe /V2 /DCOMPRESSOR="+COMPRESSOR+" /DVERSION="+VERSION+" thirdparty/win-nsis/panda.nsi")
if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
4a71a3ad56d88a79d9aba6c9d9fa1abc8c3a885e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/4a71a3ad56d88a79d9aba6c9d9fa1abc8c3a885e/makepanda.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 309, 261, 1125, 422, 296, 2124, 12904, 11, 4672, 2195, 273, 2195, 397, 6619, 318, 536, 315, 397, 498, 397, 1548, 82, 6, 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, 0, 0, 0, 0, 0, 0, 0, 0, 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, 309, 261, 1125, 422, 296, 2124, 12904, 11, 4672, 2195, 273, 2195, 397, 6619, 318, 536, 315, 397, 498, 397, 1548, 82, 6, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...