rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
self.log.debug("DEBUG: priceMidpoint={}".format(priceMidpoint)) | def paint(self, painter, option, widget): """Paints this QGraphicsItem. Assumes that self.pen is set to what we want for the drawing style. """ | 59eb289ffbc945d25132148105cf933538f5f0d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6120/59eb289ffbc945d25132148105cf933538f5f0d1/pricebarchart.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12574,
12,
2890,
16,
21295,
16,
1456,
16,
3604,
4672,
3536,
12699,
87,
333,
2238,
17558,
1180,
18,
225,
25374,
716,
365,
18,
1907,
353,
444,
358,
4121,
732,
2545,
364,
326,
16327,
2154,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12574,
12,
2890,
16,
21295,
16,
1456,
16,
3604,
4672,
3536,
12699,
87,
333,
2238,
17558,
1180,
18,
225,
25374,
716,
365,
18,
1907,
353,
444,
358,
4121,
732,
2545,
364,
326,
16327,
2154,
... | |
self._string_from_ip_int(self.network) + '/' + str(self.prefixlen + prefixlen_diff)) | self._string_from_ip_int(self.network) + '/' + str(self._prefixlen + prefixlen_diff)) | def subnet(self, prefixlen_diff=1): """The subnets which join to make the current subnet. | b8f0b0f0cd36be4aaa5572bcb2e15f37636253a2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4528/b8f0b0f0cd36be4aaa5572bcb2e15f37636253a2/ipaddr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8821,
12,
2890,
16,
1633,
1897,
67,
5413,
33,
21,
4672,
3536,
1986,
19140,
1492,
1233,
358,
1221,
326,
783,
8821,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8821,
12,
2890,
16,
1633,
1897,
67,
5413,
33,
21,
4672,
3536,
1986,
19140,
1492,
1233,
358,
1221,
326,
783,
8821,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
extra_compile_args = extra_compile_args | extra_compile_args = ['-DTHREADING', '-DSWIG_COBJECT_PYTHON'] | def swig_sources (self, sources): | ebe540633d4913ac4deeadf3739c3997055e13d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10522/ebe540633d4913ac4deeadf3739c3997055e13d4/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1352,
360,
67,
10141,
261,
2890,
16,
5550,
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,
... | [
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,
1352,
360,
67,
10141,
261,
2890,
16,
5550,
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... |
egg = _build_egg(tarball, to_dir) | _build_egg(egg, tarball, to_dir) | def _do_download(version, download_base, to_dir, download_delay): egg = 'distribute-%s-py%d.%d.egg' % (version, sys.version_info[0], sys.version_info[1]) if not os.path.exists(egg): tarball = download_setuptools(version, download_base, to_dir, download_delay) egg = _build_egg(tarball, to_dir) sys.path.insert(0, egg) import setuptools setuptools.bootstrap_install_from = egg | b1bd773feed63e4037a9dab96f40c3b147f9414e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/495/b1bd773feed63e4037a9dab96f40c3b147f9414e/distribute_setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
7813,
12,
1589,
16,
4224,
67,
1969,
16,
358,
67,
1214,
16,
4224,
67,
10790,
4672,
25144,
273,
296,
2251,
887,
6456,
87,
17,
2074,
9,
72,
7866,
72,
18,
23171,
11,
738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
7813,
12,
1589,
16,
4224,
67,
1969,
16,
358,
67,
1214,
16,
4224,
67,
10790,
4672,
25144,
273,
296,
2251,
887,
6456,
87,
17,
2074,
9,
72,
7866,
72,
18,
23171,
11,
738,
... |
cmd = cmd + ' -S"' + dotdots + PREFIX+'/include/parser-inc"' cmd = cmd + ' -I"' + dotdots + PREFIX+'/python/include"' | cmd = cmd + ' -S' + dotdots + PREFIX + '/include/parser-inc' cmd = cmd + ' -I' + dotdots + PREFIX + '/python/include' | def Interrogate(ipath=0, opts=0, outd=0, outc=0, src=0, module=0, library=0, files=0): if ((ipath==0)|(opts==0)|(outd==0)|(outc==0)|(src==0)|(module==0)|(library==0)|(files==0)): sys.exit("syntax error in Interrogate directive") ALLIN.append(outd) ipath = [PREFIX+"/tmp"] + ipath + [PREFIX+"/include"] outd = PREFIX+"/pandac/input/"+outd outc = PREFIX+"/tmp/"+outc paths = xpaths(src+"/",files,"") dep = CxxCalcDependenciesAll(paths, ipath) dotdots = "" for i in range(0,src.count("/")+1): dotdots = dotdots + "../" building = 0 for x in opts: if (x[:9]=="BUILDING_"): building = x[9:] if (older(outc, dep) or older(outd, dep)): if (COMPILER=="MSVC7"): cmd = '"' + dotdots + PREFIX+'/bin/interrogate.exe"' cmd = cmd + ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -longlong __int64 -D_X86_ -DWIN32_VC -D_WIN32' cmd = cmd + ' -D"_declspec(param)=" -D_near -D_far -D__near -D__far -D__stdcall' if (OPTIMIZE==1): cmd = cmd + ' ' if (OPTIMIZE==2): cmd = cmd + ' ' if (OPTIMIZE==3): cmd = cmd + ' -DFORCE_INLINING' if (OPTIMIZE==4): cmd = cmd + ' -DFORCE_INLINING' cmd = cmd + ' -S"' + dotdots + PREFIX+'/include/parser-inc"' cmd = cmd + ' -I"' + dotdots + PREFIX+'/python/include"' if (COMPILER=="LINUXA"): cmd = '"' + dotdots + PREFIX + '/bin/interrogate"' cmd = cmd + ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__i386__ -D__const=const' if (OPTIMIZE==1): cmd = cmd + ' ' if (OPTIMIZE==2): cmd = cmd + ' ' if (OPTIMIZE==3): cmd = cmd + ' ' if (OPTIMIZE==4): cmd = cmd + ' ' cmd = cmd + ' -S"' + dotdots + PREFIX+'/include/parser-inc" -S"/usr/include"' cmd = cmd + ' -I"' + dotdots + PREFIX+'/python/include"' cmd = cmd + ' -oc "' + dotdots + outc + '" -od "' + dotdots + outd + '"' cmd = cmd + ' -fnames -string -refcount -assert -python' for x in ipath: cmd = cmd + ' -I"' + dotdots + x + '"' if (building): cmd = cmd + " -DBUILDING_"+building if (opts.count("WITHINPANDA")): cmd = cmd + " -DWITHIN_PANDA" for pkg in PACKAGES: if (PkgSelected(opts,pkg)): cmd = cmd + ' -I"' + dotdots + THIRDPARTY + pkg.lower() + "/include" + '"' cmd = cmd + ' -module "' + module + '" -library "' + library + '"' if ((COMPILER=="MSVC7") and opts.count("DXSDK")): cmd = cmd + ' -I"' + DIRECTXSDK + '/include"' if ((COMPILER=="MSVC7") and opts.count("MAYA5")): cmd = cmd + ' -I"' + Maya5SDK + 'include"' if ((COMPILER=="MSVC7") and opts.count("MAYA6")): cmd = cmd + ' -I"' + Maya6SDK + 'include"' for x in files: cmd = cmd + ' ' + x oslocalcmd(src, cmd) updatefiledate(outd) updatefiledate(outc) | e743cb25c4127c99b6bf2de385cf618b18e32531 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/e743cb25c4127c99b6bf2de385cf618b18e32531/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5294,
15283,
12,
625,
421,
33,
20,
16,
1500,
33,
20,
16,
596,
72,
33,
20,
16,
596,
71,
33,
20,
16,
1705,
33,
20,
16,
1605,
33,
20,
16,
5313,
33,
20,
16,
1390,
33,
20,
4672,
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,
5294,
15283,
12,
625,
421,
33,
20,
16,
1500,
33,
20,
16,
596,
72,
33,
20,
16,
596,
71,
33,
20,
16,
1705,
33,
20,
16,
1605,
33,
20,
16,
5313,
33,
20,
16,
1390,
33,
20,
4672,
309... |
dict = {} | def readmodule(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.''' i = string.rfind(module, '.') if i >= 0: # Dotted module name package = string.strip(module[:i]) submodule = string.strip(module[i+1:]) 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 dict = {} _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 # XXX Should we recursively look for submodules? return dict if type != imp.PY_SOURCE: # not Python source, can't do anything with this module f.close() dict = {} _modules[module] = dict return dict dict = {} _modules[module] = dict imports = [] 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")) # close all classes indented at least as much while classstack and \ classstack[-1][1] >= thisindent: del classstack[-1] if classstack: # and we know the class it belongs to meth_name = m.group("MethodName") lineno = lineno + \ countnl(src, '\n', last_lineno_pos, start) last_lineno_pos = start cur_class = classstack[-1][0] cur_class._addmethod(meth_name, lineno) 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 = string.strip(inherit[1:-1]) names = [] for n in string.splitfields(inherit, ','): n = string.strip(n) if dict.has_key(n): # we know this super class n = dict[n] else: c = string.splitfields(n, '.') 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 string.split(m.group("ImportList"), ','): n = string.strip(n) try: # recursively read the imported module d = readmodule(n, path, inpackage) except: print 'module', n, 'not found' elif m.start("ImportFrom") >= 0: # from module import stuff mod = m.group("ImportFromPath") names = string.split(m.group("ImportFromList"), ',') 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 = string.strip(n) 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 | 4d5c0343252aa15051a12da5ee8efeac3f3ea387 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4d5c0343252aa15051a12da5ee8efeac3f3ea387/pyclbr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
2978,
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,
18,
803... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
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,
18,
803... | |
estr =(('The parameters of %s do not match the '+ 'parameters of the base class method '+ '%s; not inheriting documentation.') % (self.uid(), make_uid(base_method))) self._misc_warnings.append(estr) | if self._COLLECT_PARAM_MISMATCHES: self._param_mismatches.append((self.uid(), make_uid(base_method))) else: estr =(('The parameters of %s do not match the '+ 'parameters of the base class method '+ '%s; not inheriting documentation.') % (self.uid(), make_uid(base_method))) self._misc_warnings.append(estr) | def _find_override(self, cls): """ Find the method that this method overrides. @return: True if we should keep looking for an overridden method. @rtype: C{boolean} """ name = self.uid().shortname() for base in cls.__bases__: if base.__dict__.has_key(name): # We found a candidate for an overriden method. base_method = base.__dict__[name] if type(base_method) is types.FunctionType: base_method = getattr(base, name) | d0164ceec6b7c656820c9cc53370c59eb64d4605 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/d0164ceec6b7c656820c9cc53370c59eb64d4605/objdoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
67,
10601,
12,
2890,
16,
2028,
4672,
3536,
4163,
326,
707,
716,
333,
707,
9515,
18,
632,
2463,
30,
1053,
309,
732,
1410,
3455,
7849,
364,
392,
11000,
707,
18,
632,
86,
723,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
67,
10601,
12,
2890,
16,
2028,
4672,
3536,
4163,
326,
707,
716,
333,
707,
9515,
18,
632,
2463,
30,
1053,
309,
732,
1410,
3455,
7849,
364,
392,
11000,
707,
18,
632,
86,
723,
... |
def __init__(self, xml, quiz_questions): Resource.__init__(self, xml) | def __init__(self, xml, quiz_questions, res_num): Resource.__init__(self, xml, res_num) | def __init__(self, xml, quiz_questions): Resource.__init__(self, xml) | 15b79dab64e9d35a840423eaa436a6e35feb7b63 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12927/15b79dab64e9d35a840423eaa436a6e35feb7b63/bb9_course.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2025,
16,
16479,
67,
9758,
4672,
2591,
16186,
2738,
972,
12,
2890,
16,
2025,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2025,
16,
16479,
67,
9758,
4672,
2591,
16186,
2738,
972,
12,
2890,
16,
2025,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if ((n_aa > n_na) and ((n_aa / len(rn_seq)) >= min_content)) : | if ((n_aa > n_na) and ((float(n_aa) / len(rn_seq)) >= min_content)) : | def is_protein (self, min_content=0.95) : rn_seq, residue_classes = self.get_residue_names_and_classes() n_aa = residue_classes["common_amino_acid"] n_na = residue_classes["common_rna_dna"] if ((n_aa > n_na) and ((n_aa / len(rn_seq)) >= min_content)) : return True return False | 6196a182aa91edb812acd10af6f4b674ea2ae542 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/6196a182aa91edb812acd10af6f4b674ea2ae542/hierarchy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
24807,
261,
2890,
16,
1131,
67,
1745,
33,
20,
18,
8778,
13,
294,
20594,
67,
5436,
16,
14765,
67,
4701,
273,
365,
18,
588,
67,
23388,
67,
1973,
67,
464,
67,
4701,
1435,
290,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
24807,
261,
2890,
16,
1131,
67,
1745,
33,
20,
18,
8778,
13,
294,
20594,
67,
5436,
16,
14765,
67,
4701,
273,
365,
18,
588,
67,
23388,
67,
1973,
67,
464,
67,
4701,
1435,
290,
... |
"Item %s, attribute '%s': referred item %s not found" | __doc__ = "Item %s, attribute '%s': referred item %s not found" | def __str__(self): return self.__doc__ %(self.getItem().itsPath, self.args[1], self.str(self.args[2]), self.str(self.args[3])) | 882ec29c58d7c23ddb882075e0f9b8014f465197 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/882ec29c58d7c23ddb882075e0f9b8014f465197/ItemError.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
365,
16186,
2434,
972,
8975,
2890,
18,
588,
1180,
7675,
1282,
743,
16,
365,
18,
1968,
63,
21,
6487,
365,
18,
701,
12,
2890,
18,
1968,
63,
22,
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,
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,
1001,
701,
972,
12,
2890,
4672,
327,
365,
16186,
2434,
972,
8975,
2890,
18,
588,
1180,
7675,
1282,
743,
16,
365,
18,
1968,
63,
21,
6487,
365,
18,
701,
12,
2890,
18,
1968,
63,
22,
65,... |
[ 140*ka, 0, 0, 70*ka, 0, 0 ], [ 0, 156*kt, 22*kt*L, 0, 54*kt, -13*kt*L ], [ 0, 22*kt*L, 4*kt*L**2, 0, 13*kt*L,-3*kt*L**2], [ 70*ka, 0, 0, 140*ka, 0, 0 ], [ 0, 54*kt, 13*kt*L, 0, 156*kt, -22*kt*L ], [ 0, -13*kt*L,-3*kt*L**2, 0, -22*kt*L, 4*kt*L**2] | [ 140*ka, 0, 0, 70*ka, 0, 0 ], [ 0, 156*kt, 22*kt*L, 0, 54*kt, -13*kt*L ], [ 0, 22*kt*L, 4*kt*L**2, 0, 13*kt*L,-3*kt*L**2], [ 70*ka, 0, 0, 140*ka, 0, 0 ], [ 0, 54*kt, 13*kt*L, 0, 156*kt, -22*kt*L ], [ 0, -13*kt*L,-3*kt*L**2, 0, -22*kt*L, 4*kt*L**2] | def beam2ws(ex,ey,ep,ed,eq=None): """ Compute section forces in a two dimensional beam element on elastic foundation. Parameters: ex = [x1, x2] ey = [y1, y2] element node coordinates ep = [E,A,I,ka,kt] element properties, E: Young's modulus A: cross section area I: moment of inertia ka: axial foundation stiffness kt: transversal foundation stiffness ed = [u1, ... ,u6] element displacement vector eq = [qx, qy] distributed loads, local directions Returns: es = [[N1, V1, M1], [N2, V2, M2]] element forces, local direction """ if asmatrix(ed).shape[0] > 1: print "Only one row is allowed in the ed matrix !!!" return b = mat([[ex[1]-ex[0]],[ey[1]-ey[0]]]) L = asscalar(sqrt(b.T*b)) n = asarray(b/L).reshape(2,) E,A,I,ka,kt = ep qx = 0 qy = 0 if eq != None: qx,qy = eq K1 = mat([ [ E*A/L, 0, 0, -E*A/L, 0, 0 ], [ 0, 12*E*I/L**3, 6*E*I/L**2, 0, -12*E*I/L**3, 6*E*I/L**2], [ 0, 6*E*I/L**2, 4*E*I/L, 0, -6*E*I/L**2, 2*E*I/L ], [-E*A/L, 0, 0, E*A/L, 0, 0 ], [ 0, -12*E*I/L**3,-6*E*I/L**2, 0, 12*E*I/L**3,-6*E*I/L**2], [ 0, 6*E*I/L**2, 2*E*I/L, 0, -6*E*I/L**2, 4*E*I/L ] ]) K2 = L/420*mat([ [ 140*ka, 0, 0, 70*ka, 0, 0 ], [ 0, 156*kt, 22*kt*L, 0, 54*kt, -13*kt*L ], [ 0, 22*kt*L, 4*kt*L**2, 0, 13*kt*L,-3*kt*L**2], [ 70*ka, 0, 0, 140*ka, 0, 0 ], [ 0, 54*kt, 13*kt*L, 0, 156*kt, -22*kt*L ], [ 0, -13*kt*L,-3*kt*L**2, 0, -22*kt*L, 4*kt*L**2] ]) Kle = K1+K2 fle = L*mat([qx/2, qy/2, qy*L/12, qx/2, qy/2, -qy*L/12]).T G = mat([ [ n[0], n[1], 0, 0, 0, 0], [-n[1], n[0], 0, 0, 0, 0], [ 0, 0, 1, 0, 0, 0], [ 0, 0, 0, n[0], n[1], 0], [ 0, 0, 0,-n[1], n[0], 0], [ 0, 0, 0, 0, 0, 1] ]) P = Kle*G*asmatrix(ed).T-fle es = mat([ [-P[0,0],-P[1,0],-P[2,0]], [ P[3,0], P[4,0], P[5,0]] ]) return es | 802fb797c1c505715968b6bf327cad5ed7e0e712 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1235/802fb797c1c505715968b6bf327cad5ed7e0e712/pycalfem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16751,
22,
4749,
12,
338,
16,
402,
16,
881,
16,
329,
16,
11253,
33,
7036,
4672,
3536,
8155,
2442,
26376,
316,
279,
2795,
17469,
16751,
930,
603,
10465,
1392,
367,
18,
225,
7012,
30,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16751,
22,
4749,
12,
338,
16,
402,
16,
881,
16,
329,
16,
11253,
33,
7036,
4672,
3536,
8155,
2442,
26376,
316,
279,
2795,
17469,
16751,
930,
603,
10465,
1392,
367,
18,
225,
7012,
30,
22... |
if not expressionMode: if not inStatementList: statementList = createItemNode("statementList", stream) statementList.addChild(item) while stream.currIsType("token", "COMMA"): stream.next(statementList) | if not inStatementList: statementList = createItemNode("statementList", stream) statementList.addChild(item) while stream.currIsType("token", "COMMA"): stream.next(statementList) if expressionMode: statementList.addChild(readStatement(stream, True, False, True)) else: | def readStatement (stream, expressionMode = False, overrunSemicolon = True, inStatementList = False): item = None eolBefore = stream.hadEolBefore() breakBefore = stream.hadBreakBefore() # print "PROGRESS: %s - %s (%s) [expr=%s]" % (stream.currType(), stream.currDetail(), stream.currLine(), expressionMode) if currIsIdentifier(stream, True): # statement starts with an identifier variable = readVariable(stream, True) variable = readObjectOperation(stream, variable) if stream.currIsType("token", ASSIGN_OPERATORS): # This is an assignment item = createItemNode("assignment", stream) item.set("operator", stream.currDetail()) stream.next(item) item.addListChild("left", variable) item.addListChild("right", readExpression(stream)) elif stream.currIsType("token", "COLON") and not expressionMode: # This is a label item = variable item.type = "label" stream.next(variable) else: # Something else comes after the variable -> It's a sole variable item = variable # Any comments found for the variable belong to the extracted item commentsChild = variable.getChild("commentsBefore", False) if item and commentsChild != None: variable.removeChild(commentsChild) item.addChild(commentsChild, 0) elif stream.currIsType("reserved", "FUNCTION"): item = createItemNode("function", stream) stream.next(item) # Read optional function name if stream.currIsType("name") or stream.currIsType("builtin"): item.set("name", stream.currSource()) stream.next(item) readParamList(item, stream) item.addListChild("body", readBlock(stream)) # Check for direct execution: function() {}() if stream.currIsType("token", "LP"): # The function is executed directly functionItem = item item = createItemNode("call", stream) item.addListChild("operand", functionItem) readParamList(item, stream) item = readObjectOperation(stream, item) elif stream.currIsType("reserved", "VOID"): #stream.next(item) #item = createItemNode("void", stream) #stream.next(item) #item.addChild(readStatement(stream, expressionMode)) #stream.expectCurrType("token", "RP") #stream.next(item, True) #item = readObjectOperation(stream, item) ## [BUG #2599] ported this from TYPEOF operator item = createItemNode("void", stream) item.set("left", True) stream.next(item) item.addListChild("first", readExpression(stream)) elif stream.currIsType("token", "LP"): igroup = createItemNode("group", stream) stream.next(igroup) igroup.addChild(readStatement(stream, expressionMode)) stream.expectCurrType("token", "RP") stream.next(igroup, True) oper = readObjectOperation(stream, igroup) # supports e.g. (this.editor.object || this.editor.iframe).style.marginTop = null; if stream.currIsType("token", ASSIGN_OPERATORS): # This is an assignment item = createItemNode("assignment", stream) item.set("operator", stream.currDetail()) stream.next(item) item.addListChild("left", oper) item.addListChild("right", readExpression(stream)) else: # Something else comes after the variable -> It's a sole variable item = oper elif stream.currIsType("string"): item = createItemNode("constant", stream) item.set("constantType", "string") item.set("value", stream.currSource()) item.set("detail", stream.currDetail()) stream.next(item, True) # This is a member accessor (E.g. "bla.blubb") item = readObjectOperation(stream, item) elif stream.currIsType("number"): item = createItemNode("constant", stream) item.set("constantType", "number") item.set("value", stream.currSource()) item.set("detail", stream.currDetail()) stream.next(item, True) # This is a member accessor (E.g. "bla.blubb") item = readObjectOperation(stream, item) elif stream.currIsType("regexp"): item = createItemNode("constant", stream) item.set("constantType", "regexp") item.set("value", stream.currSource()) stream.next(item, True) # This is a member accessor (E.g. "bla.blubb") item = readObjectOperation(stream, item) elif expressionMode and (stream.currIsType("reserved", "TRUE") or stream.currIsType("reserved", "FALSE")): item = createItemNode("constant", stream) item.set("constantType", "boolean") item.set("value", stream.currSource()) stream.next(item, True) elif expressionMode and stream.currIsType("reserved", "NULL"): item = createItemNode("constant", stream) item.set("constantType", "null") item.set("value", stream.currSource()) stream.next(item, True) elif expressionMode and stream.currIsType("token", "LC"): item = readMap(stream) if stream.currIsType("token", "LB"): item = readObjectOperation(stream, item) elif expressionMode and stream.currIsType("token", "LB"): item = readArray(stream) if stream.currIsType("token", "LB"): item = readObjectOperation(stream, item) elif stream.currIsType("token", SINGLE_LEFT_OPERATORS): item = createItemNode("operation", stream) item.set("operator", stream.currDetail()) item.set("left", True) stream.next(item) item.addListChild("first", readExpression(stream)) elif stream.currIsType("reserved", "TYPEOF"): item = createItemNode("operation", stream) item.set("operator", "TYPEOF") item.set("left", True) stream.next(item) item.addListChild("first", readExpression(stream)) elif stream.currIsType("reserved", "NEW"): item = readInstantiation(stream) item = readObjectOperation(stream, item) elif not expressionMode and stream.currIsType("reserved", "VAR"): item = createItemNode("definitionList", stream) stream.next(item) finished = False while not finished: if not currIsIdentifier(stream, False): raiseSyntaxException(stream.curr(), "identifier") childitem = createItemNode("definition", stream) childitem.set("identifier", stream.currSource()) stream.next(childitem) if stream.currIsType("token", "ASSIGN"): assign = createItemNode("assignment", stream) childitem.addChild(assign) stream.next(assign) assign.addChild(readExpression(stream)) item.addChild(childitem) # Check whether anothe definition follows, e.g. "var a, b=1, c=4" if stream.currIsType("token", "COMMA"): stream.next(item) else: finished = True stream.comment(item, True) elif not expressionMode and stream.currIsType("reserved", LOOP_KEYWORDS): item = readLoop(stream) elif not expressionMode and stream.currIsType("reserved", "DO"): item = readDoWhile(stream) elif not expressionMode and stream.currIsType("reserved", "SWITCH"): item = readSwitch(stream) elif not expressionMode and stream.currIsType("reserved", "TRY"): item = readTryCatch(stream) elif not expressionMode and stream.currIsType("token", "LC"): item = readBlock(stream) elif not expressionMode and stream.currIsType("reserved", "RETURN"): item = createItemNode("return", stream) stream.next(item) # NOTE: The expression after the return keyword is optional if not stream.currIsType("token", "SEMICOLON") and not stream.currIsType("token", "RC"): item.addListChild("expression", readExpression(stream)) stream.comment(item, True) elif not expressionMode and stream.currIsType("reserved", "THROW"): item = createItemNode("throw", stream) stream.next(item) item.addListChild("expression", readExpression(stream)) stream.comment(item, True) elif stream.currIsType("reserved", "DELETE"): # this covers both statement and expression context! item = createItemNode("delete", stream) item.set("left", True) stream.next(item) item.addListChild("expression", readExpression(stream)) stream.comment(item, True) elif not expressionMode and stream.currIsType("reserved", "BREAK"): item = createItemNode("break", stream) stream.next(item) # NOTE: The label after the break keyword is optional if not stream.hadEolBefore() and stream.currIsType("name"): item.set("label", stream.currSource()) # As the label is an attribute, we need to put following comments into after # to differenciate between comments before and after the label stream.next(item, True) elif not expressionMode and stream.currIsType("reserved", "CONTINUE"): item = createItemNode("continue", stream) stream.next(item) # NOTE: The label after the continue keyword is optional if not stream.hadEolBefore() and stream.currIsType("name"): item.set("label", stream.currSource()) stream.next(item, True) if not item: if stream.currIsType("token", "SEMICOLON") and not expressionMode: # This is an empty statement item = createItemNode("emptyStatement", stream) stream.next(item) else: if expressionMode: expectedDesc = "expression" else: expectedDesc = "statement" raiseSyntaxException(stream.curr(), expectedDesc) # check whether this is an operation if (stream.currIsType("token", MULTI_TOKEN_OPERATORS) or stream.currIsType("reserved", MULTI_PROTECTED_OPERATORS) or (stream.currIsType("token", SINGLE_RIGHT_OPERATORS) and not stream.hadEolBefore())): # its an operation -> We've already parsed the first operand (in item) parsedItem = item oper = stream.currDetail() item = createItemNode("operation", stream) item.addListChild("first", parsedItem) item.set("operator", oper) stream.next(item) if oper in MULTI_TOKEN_OPERATORS or oper in MULTI_PROTECTED_OPERATORS: # It's a multi operator -> There must be a second argument item.addListChild("second", readExpression(stream)) if oper == "HOOK": # It's a "? :" operation -> There must be a third argument stream.expectCurrType("token", "COLON") stream.next(item) item.addListChild("third", readExpression(stream)) # Deep scan on single right operators e.g. if(i-- > 4) if oper in SINGLE_RIGHT_OPERATORS and stream.currIsType("token", MULTI_TOKEN_OPERATORS) and expressionMode: paroper = stream.currDetail() paritem = createItemNode("operation", stream) paritem.addListChild("first", item) paritem.set("operator", paroper) stream.next(item) if paroper in MULTI_TOKEN_OPERATORS or paroper in MULTI_PROTECTED_OPERATORS: # It's a multi operator -> There must be a second argument paritem.addListChild("second", readExpression(stream)) if paroper == "HOOK": # It's a "? :" operation -> There must be a third argument stream.expectCurrType("token", "COLON") stream.next(item) paritem.addListChild("third", readExpression(stream)) # return parent item item = paritem # check whether this is a combined statement, e.g. "bla(), i++" #if not expressionMode and not inStatementList and stream.currIsType("token", "COMMA"): #[BUG #2599]: #if not inStatementList and stream.currIsType("token", "COMMA"): # statementList = createItemNode("statementList", stream) # statementList.addChild(item) # while stream.currIsType("token", "COMMA"): # stream.next(statementList) # statementList.addChild(readStatement(stream, False, False, True)) # item = statementList if stream.currIsType("token", "COMMA"): if not expressionMode: if not inStatementList: statementList = createItemNode("statementList", stream) statementList.addChild(item) while stream.currIsType("token", "COMMA"): stream.next(statementList) statementList.addChild(readStatement(stream, False, False, True)) item = statementList else: # expressionMode if not inStatementList: #and False: statementList = createItemNode("statementList", stream) statementList.addChild(item) while stream.currIsType("token", "COMMA"): stream.next(statementList) statementList.addChild(readStatement(stream, True, False, True)) item = statementList # go over the optional semicolon if not expressionMode and overrunSemicolon and stream.currIsType("token", "SEMICOLON"): stream.next(item, True) item.set("eolBefore", eolBefore) item.set("breakBefore", breakBefore) return item | fa4badd2668df654b0bcb304f34d28c0d0bce39f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/fa4badd2668df654b0bcb304f34d28c0d0bce39f/treegenerator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
3406,
261,
3256,
16,
2652,
2309,
273,
1083,
16,
5713,
318,
13185,
17280,
273,
1053,
16,
316,
3406,
682,
273,
1083,
4672,
761,
273,
599,
225,
14775,
4649,
273,
1407,
18,
76,
361,
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,
855,
3406,
261,
3256,
16,
2652,
2309,
273,
1083,
16,
5713,
318,
13185,
17280,
273,
1053,
16,
316,
3406,
682,
273,
1083,
4672,
761,
273,
599,
225,
14775,
4649,
273,
1407,
18,
76,
361,
4... |
E = self.curve() ai = [emb(a) for a in E.a_invariants()] ER = EllipticCurve(ai) E_pari = ER.pari_curve(prec=precision) pt_pari = [pari(emb(self[0])), pari(emb(self[1]))] log_pari = E_pari.ellpointtoz(pt_pari, precision=precision) | if K is rings.QQ: E_work = E pt_pari = [pari(self[0]), pari(self[1])] else: ai = [emb(a) for a in E.a_invariants()] E_work = EllipticCurve(ai) pt_pari = [pari(emb(self[0])), pari(emb(self[1]))] working_prec = precision E_pari = E_work.pari_curve(prec=working_prec) log_pari = E_pari.ellpointtoz(pt_pari, precision=working_prec) | def elliptic_logarithm(self, embedding=None, precision=100, algorithm='pari'): """ Returns the elliptic logarithm of this elliptic curve point. | a9b66a2ea206d0cbe3c288b4e2cd2235a0a8c7e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/a9b66a2ea206d0cbe3c288b4e2cd2235a0a8c7e6/ell_point.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
415,
549,
21507,
67,
1330,
31249,
12,
2890,
16,
15853,
33,
7036,
16,
6039,
33,
6625,
16,
4886,
2218,
1065,
77,
11,
4672,
3536,
2860,
326,
415,
549,
21507,
613,
31249,
434,
333,
415,
54... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
415,
549,
21507,
67,
1330,
31249,
12,
2890,
16,
15853,
33,
7036,
16,
6039,
33,
6625,
16,
4886,
2218,
1065,
77,
11,
4672,
3536,
2860,
326,
415,
549,
21507,
613,
31249,
434,
333,
415,
54... |
field.text = mod[fld] or '' | field.text = str(mod[fld]) or '' | def Ir_Model_Data(model, id): """ Search if the record was previously register in ir_model_data """ args = [ ('model','=', model), ('res_id', '=', id) ] ret = '%s_%d' % (model.replace('.','_'), id) res = model_data.search(args) if res: r = model_data.read(res, ['module','name'])[0] ret = '%s.%s' % (r['module'], r['name']) return ret | 95bd753cb8d70f65da2e6a3a114c62e42da38037 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10003/95bd753cb8d70f65da2e6a3a114c62e42da38037/object_extract_xml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
467,
86,
67,
1488,
67,
751,
12,
2284,
16,
612,
4672,
3536,
5167,
309,
326,
1409,
1703,
7243,
1744,
316,
9482,
67,
2284,
67,
892,
3536,
833,
273,
306,
7707,
2284,
17023,
33,
2187,
938,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
467,
86,
67,
1488,
67,
751,
12,
2284,
16,
612,
4672,
3536,
5167,
309,
326,
1409,
1703,
7243,
1744,
316,
9482,
67,
2284,
67,
892,
3536,
833,
273,
306,
7707,
2284,
17023,
33,
2187,
938,
... |
tmpArray2=rate.BinnedArray(twodbin) for k in range(z): tbins = rArrays[k] tbins.denominator.array += tbins.numerator.array if wnfunc: rate.filter_array(tbins.denominator.array,wnfunc) if wnfunc: rate.filter_array(tbins.numerator.array,wnfunc) tbins.regularize() integrand = 4.0 * pi * tbins.ratio() * dbin.centres()[k]**3 * dbin.delta volArray.array += integrand tmpArray2.array += integrand print >>sys.stderr, "bootstrapping:\t%.1f%% and Calculating smoothed volume:\t%.1f%%\r" % ((100.0 * n / bootnum), (100.0 * k / z)), tmpArray2.array *= tmpArray2.array volArray2.array += tmpArray2.array | tmpArray2=rate.BinnedArray(twodbin) for k in range(z): tbins = rArrays[k] tbins.denominator.array += tbins.numerator.array if wnfunc: rate.filter_array(tbins.denominator.array,wnfunc) if wnfunc: rate.filter_array(tbins.numerator.array,wnfunc) tbins.regularize() integrand = 4.0 * pi * tbins.ratio() * dbin.centres()[k]**3 * dbin.delta volArray.array += integrand tmpArray2.array += integrand print >>sys.stderr, "bootstrapping:\t%.1f%% and Calculating smoothed volume:\t%.1f%%\r" % ((100.0 * n / bootnum), (100.0 * k / z)), tmpArray2.array *= tmpArray2.array volArray2.array += tmpArray2.array | def twoD_SearchVolume(found, missed, twodbin, dbin, wnfunc, livetime, bootnum=1, derr=0.197, dsys=0.074): """ Compute the search volume in the mass/mass plane, bootstrap and measure the first and second moment (assumes the underlying distribution can be characterized by those two parameters) This is gonna be brutally slow derr = (0.134**2+.103**2+.102**2)**.5 = 0.197 which is the 3 detector calibration uncertainty in quadrature. This is conservative since some injections will be H1L1 and have a lower error of .17 the dsys is the DC offset which is the max offset of .074. """ if wnfunc: wnfunc /= wnfunc[(wnfunc.shape[0]-1) / 2, (wnfunc.shape[1]-1) / 2] x = twodbin.shape[0] y = twodbin.shape[1] z = dbin.n rArrays = [] volArray=rate.BinnedArray(twodbin) volArray2=rate.BinnedArray(twodbin) #set up ratio arrays for each distance bin for k in range(z): rArrays.append(rate.BinnedRatios(twodbin)) # Bootstrap to account for errors for n in range(bootnum): #initialize by setting these to zero for k in range(z): rArrays[k].numerator.array = numpy.zeros(rArrays[k].numerator.bins.shape) rArrays[k].denominator.array = numpy.zeros(rArrays[k].numerator.bins.shape) #Scramble the inj population if bootnum > 1: sm, sf = scramble_pop(missed, found) else: sm, sf = missed, found for l in sf:#found: tbin = rArrays[dbin[scramble_dist(l.distance,derr,dsys)]] tbin.incnumerator( (l.mass1, l.mass2) ) for l in sm:#missed: tbin = rArrays[dbin[scramble_dist(l.distance,derr,dsys)]] tbin.incdenominator( (l.mass1, l.mass2) ) tmpArray2=rate.BinnedArray(twodbin) #start with a zero array to compute the mean square for k in range(z): tbins = rArrays[k] tbins.denominator.array += tbins.numerator.array if wnfunc: rate.filter_array(tbins.denominator.array,wnfunc) if wnfunc: rate.filter_array(tbins.numerator.array,wnfunc) tbins.regularize() # logarithmic(d) integrand = 4.0 * pi * tbins.ratio() * dbin.centres()[k]**3 * dbin.delta volArray.array += integrand tmpArray2.array += integrand #4.0 * pi * tbins.ratio() * dbin.centres()[k]**3 * dbin.delta print >>sys.stderr, "bootstrapping:\t%.1f%% and Calculating smoothed volume:\t%.1f%%\r" % ((100.0 * n / bootnum), (100.0 * k / z)), tmpArray2.array *= tmpArray2.array volArray2.array += tmpArray2.array print >>sys.stderr, "" #Mean and variance volArray.array /= bootnum volArray2.array /= bootnum volArray2.array -= volArray.array**2 # Variance volArray.array *= livetime volArray2.array *= livetime*livetime # this gets two powers of live time return volArray, volArray2 | cc0a02e6eb29bd193897bea985536726977a3e46 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/cc0a02e6eb29bd193897bea985536726977a3e46/hm_upperlimit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2795,
40,
67,
2979,
4545,
12,
7015,
16,
25143,
16,
2339,
369,
4757,
16,
1319,
267,
16,
341,
82,
644,
16,
328,
427,
2374,
16,
4835,
2107,
33,
21,
16,
302,
370,
33,
20,
18,
31728,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2795,
40,
67,
2979,
4545,
12,
7015,
16,
25143,
16,
2339,
369,
4757,
16,
1319,
267,
16,
341,
82,
644,
16,
328,
427,
2374,
16,
4835,
2107,
33,
21,
16,
302,
370,
33,
20,
18,
31728,
16... |
return vfqueries[0].binaryop(vfqueries[1:], "OR", "0") | return vfqueries[0].binaryop(vfqueries[1:], "OR") | def Or(*vfqueries): """Return vfquery disjunction of given vfqueries""" return vfqueries[0].binaryop(vfqueries[1:], "OR", "0") | 5d826cf87eabaab894d9b81b3f335fbe09d92619 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3083/5d826cf87eabaab894d9b81b3f335fbe09d92619/vfolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2965,
30857,
90,
74,
13748,
4672,
3536,
990,
28902,
2271,
1015,
18323,
434,
864,
28902,
13748,
8395,
327,
28902,
13748,
63,
20,
8009,
8578,
556,
12,
90,
74,
13748,
63,
21,
30,
6487,
315,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2965,
30857,
90,
74,
13748,
4672,
3536,
990,
28902,
2271,
1015,
18323,
434,
864,
28902,
13748,
8395,
327,
28902,
13748,
63,
20,
8009,
8578,
556,
12,
90,
74,
13748,
63,
21,
30,
6487,
315,... |
self.send_header('Cache-control', 'must-revalidate') | self.send_header('Cache-Control', 'must-revalidate') | def send_error(self, exc_info, template='error.html', content_type='text/html', status=500, env=None, data={}): try: if template.endswith('.cs') and self.hdf: # FIXME: remove this if self.args.has_key('hdfdump'): self.perm.require('TRAC_ADMIN') content_type = 'text/plain' data = str(self.hdf) else: data = self.hdf.render(template) | 04336fa336826e5139bbeb8d1b3b42c23048d7f7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9317/04336fa336826e5139bbeb8d1b3b42c23048d7f7/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
1636,
12,
2890,
16,
3533,
67,
1376,
16,
1542,
2218,
1636,
18,
2620,
2187,
913,
67,
723,
2218,
955,
19,
2620,
2187,
1267,
33,
12483,
16,
1550,
33,
7036,
16,
501,
12938,
4672,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
1636,
12,
2890,
16,
3533,
67,
1376,
16,
1542,
2218,
1636,
18,
2620,
2187,
913,
67,
723,
2218,
955,
19,
2620,
2187,
1267,
33,
12483,
16,
1550,
33,
7036,
16,
501,
12938,
4672,
... |
self.packageList = self.ui.packageList.text().split(",") | self.packageList = str(self.ui.packageList.text()).split(",") | def CreateProfile(self): # Is the Update requested self.updateChecked = self.ui.updateCheckBox.isChecked() # Is Upgrade requested self.upgradeChecked = self.ui.upgradePackagesRadioBox.isChecked() # Is Install Requested self.installChecked = self.ui.installPackagesRadioBox.isChecked() | eebc2e811b96a3af21277186877d056b322b1e8c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12499/eebc2e811b96a3af21277186877d056b322b1e8c/AptOfflineQtCreateProfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
4029,
12,
2890,
4672,
468,
2585,
326,
2315,
3764,
365,
18,
2725,
11454,
273,
365,
18,
4881,
18,
2725,
19174,
18,
291,
11454,
1435,
468,
2585,
17699,
3764,
365,
18,
15097,
11454,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
4029,
12,
2890,
4672,
468,
2585,
326,
2315,
3764,
365,
18,
2725,
11454,
273,
365,
18,
4881,
18,
2725,
19174,
18,
291,
11454,
1435,
468,
2585,
17699,
3764,
365,
18,
15097,
11454,
27... |
[(strength, max_strength)] = strength_pattern.findall(output) if max_strength and strength: | [(strength, max_strength)] = strength_pattern.findall(output) if max_strength and strength: | def GetSignalStrength(self): """ Get the signal strength of the current network. | 7e6f7938d58289f9834c788447be53928f51b07b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12280/7e6f7938d58289f9834c788447be53928f51b07b/wnettools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
11208,
27624,
12,
2890,
4672,
3536,
968,
326,
4277,
21638,
434,
326,
783,
2483,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
11208,
27624,
12,
2890,
4672,
3536,
968,
326,
4277,
21638,
434,
326,
783,
2483,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print "barrier: checking client present:", name | self.report("checking client present: " + name) | def master_release(self): # Check everyone is still there, that they have not # crashed or disconnected in the meantime. allpresent = 1 for name in self.waiting: (client, addr) = self.waiting[name] | bb655f3af134dd0fb185950c28aa4391201eb99d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12268/bb655f3af134dd0fb185950c28aa4391201eb99d/barrier.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4171,
67,
9340,
12,
2890,
4672,
468,
2073,
3614,
476,
353,
4859,
1915,
16,
716,
2898,
1240,
486,
468,
4422,
13912,
578,
17853,
316,
326,
3722,
957,
18,
777,
6706,
273,
404,
364,
508,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4171,
67,
9340,
12,
2890,
4672,
468,
2073,
3614,
476,
353,
4859,
1915,
16,
716,
2898,
1240,
486,
468,
4422,
13912,
578,
17853,
316,
326,
3722,
957,
18,
777,
6706,
273,
404,
364,
508,
3... |
of SL(3). | of SL(3):: | def branching_rule_from_plethysm(chi, cartan_type, return_matrix = False): """ INPUT: - ``chi`` - the character of an irreducible representation pi of a group G - ``cartan_type`` - a classical Cartan type (A,B,C or D). It is assumed that the image of the irreducible representation pi naturally has its image in the group G. Returns a branching rule for this plethysm. EXAMPLE: The adjoint representation SL(3) --> GL(8) factors through SO(8). The branching rule in question will describe how representations of SO(8) composed with this homomorphism decompose into irreducible characters of SL(3). sage: A2 = WeylCharacterRing("A2") sage: A2 = WeylCharacterRing("A2", style="coroots") sage: ad = A2(1,1) sage: ad.degree() 8 sage: ad.frobenius_schur_indicator() 1 This confirms that ad has degree 8 and is orthogonal, hence factors through SO(8)=D4. sage: br = branching_rule_from_plethysm(ad,"D4") sage: D4 = WeylCharacterRing("D4") sage: [D4(f).branch(A2,rule = br) for f in D4.fundamental_weights()] [A2(1,1), A2(1,1) + A2(0,3) + A2(3,0), A2(1,1), A2(1,1)] """ ct = CartanType(cartan_type) if ct[0] not in ["A","B","C","D"]: raise ValueError, "not implemented for type %s"%ct[0] if ct[0] is "A": ret = [] for [v,n] in chi.mlist(): ret.extend(n*[v.to_vector()]) M = matrix(ret).transpose() if len(M.columns()) != ct[1] + 1: raise ValueError, "representation has wrong degree for type %s"%ct.__repr__() return lambda x : tuple(M*vector(x)) if ct[0] in ["B","D"]: if chi.frobenius_schur_indicator() != 1: raise ValueError, "character is not orthogonal" if ct[0] is "C": if chi.frobenius_schur_indicator() != -1: raise ValueError, "character is not symplectic" if ct[0] is "B": if is_even(chi.degree()): raise ValueError, "degree is not odd" if ct[0] is ["C","D"]: if is_odd(chi.degree()): raise ValueError, "degree is not even" ret = [] for [v,n] in chi.mlist(): v = v.to_vector() if all(x==0 for x in v): if ct[0] is "B": n = (n-1)/2 else: n = n/2 elif [x for x in v if x !=0][0] < 0: continue ret.extend(n*[v]) M = matrix(ret).transpose() if len(M.columns()) != ct.root_system().ambient_space().dimension(): raise ValueError, "representation has wrong degree for type %s"%ct.__repr__() if return_matrix: return M else: return lambda x : tuple(M*vector(x)) | 40a1bdf0c8a0dea7ba5d2dd2b4dcc1a210f7c884 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/40a1bdf0c8a0dea7ba5d2dd2b4dcc1a210f7c884/weyl_characters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3803,
310,
67,
5345,
67,
2080,
67,
412,
546,
1900,
81,
12,
24010,
16,
7035,
304,
67,
723,
16,
327,
67,
5667,
273,
1083,
4672,
3536,
12943,
30,
225,
300,
12176,
24010,
10335,
300,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3803,
310,
67,
5345,
67,
2080,
67,
412,
546,
1900,
81,
12,
24010,
16,
7035,
304,
67,
723,
16,
327,
67,
5667,
273,
1083,
4672,
3536,
12943,
30,
225,
300,
12176,
24010,
10335,
300,
326,
... |
length += self.spacing * len(self.children) | length += self.spacing * (len(self.children) - 1) | def _calc_size(self): length = 0 breadth = 0 for packing in self.children: child_length, child_breadth = packing.calc_size(self._translate) length += child_length breadth = max(breadth, child_breadth) length += self.spacing * len(self.children) return self._translate(length, breadth) | 3006489c2bc7ffa2c1f50c7de23beaea366b9359 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/3006489c2bc7ffa2c1f50c7de23beaea366b9359/cellpack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12448,
67,
1467,
12,
2890,
4672,
769,
273,
374,
324,
25254,
273,
374,
364,
2298,
310,
316,
365,
18,
5906,
30,
1151,
67,
2469,
16,
1151,
67,
70,
25254,
273,
2298,
310,
18,
12448,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12448,
67,
1467,
12,
2890,
4672,
769,
273,
374,
324,
25254,
273,
374,
364,
2298,
310,
316,
365,
18,
5906,
30,
1151,
67,
2469,
16,
1151,
67,
70,
25254,
273,
2298,
310,
18,
12448,
... |
"Error deleting metadata object in method insertdmt: %s" % e) | "Error deleting metadata object in method insert: %s" % e) | uniq_def = (row[ifos_col],row[name_col],row[vers_col]) | 3422b13f3d3451e9e2a9983e4a71e7bebce99a83 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/3422b13f3d3451e9e2a9983e4a71e7bebce99a83/LDBDServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
10748,
67,
536,
273,
261,
492,
63,
430,
538,
67,
1293,
6487,
492,
63,
529,
67,
1293,
6487,
492,
63,
2496,
67,
1293,
5717,
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,
10748,
67,
536,
273,
261,
492,
63,
430,
538,
67,
1293,
6487,
492,
63,
529,
67,
1293,
6487,
492,
63,
2496,
67,
1293,
5717,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if output == 'pickle': stats_output = 'pickle' else: stats_output = 'html' stats_table = GetStats(request, test_set, output=stats_output) | output = request.GET.get('o', 'html') if output not in ['pickle', 'xhr', 'html', 'csv']: return http.HttpResponse('Invalid output specified') stats_table = GetStats(request, test_set, output) | def Home(request): """Our Home page.""" recent_tests = memcache.get(key=RECENT_TESTS_MEMCACHE_KEY) if not recent_tests: ScheduleRecentTestsUpdate() output = request.GET.get('o', 'html') results_params = [] for category in settings.CATEGORIES: results_uri_string = request.GET.get('%s_results' % category) if results_uri_string: results_params.append('%s_results=%s' % (category, results_uri_string)) stats_tables = {} test_set = None category = request.GET.get('category') if category: test_set = all_test_sets.GetTestSet(category) else: if len(results_params) > 0: for category in settings.CATEGORIES: if request.GET.get('%s_results' % category): test_set = all_test_sets.GetTestSet(category) break # If we still got no test_set, take the first one in settings.CATEGORIES if not test_set: category = settings.CATEGORIES[0] test_set = all_test_sets.GetTestSet(category) # Tell GetStats what to output. if output == 'pickle': stats_output = 'pickle' else: stats_output = 'html' stats_table = GetStats(request, test_set, output=stats_output) # Show a static message above the table. if category in settings.STATIC_CATEGORIES and output in ['xhr', 'html']: stats_table = '%s%s' % (STATIC_MESSAGE, stats_table) if output in ['xhr', 'pickle']: return http.HttpResponse(stats_table) else: current_ua_string = request.META['HTTP_USER_AGENT'] current_ua = UserAgent.factory(current_ua_string) params = { 'page_title': 'Home', 'results_params': '&'.join(results_params), 'stats_table_category': test_set.category, 'stats_table': stats_table, 'recent_tests': recent_tests, 'message': request.GET.get('message'), 'current_ua': current_ua.pretty(), 'current_ua_string': current_ua_string } return Render(request, 'home.html', params) | 90f0e9b2212f7936175289bedbe6b3ae97c1d849 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5745/90f0e9b2212f7936175289bedbe6b3ae97c1d849/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21321,
12,
2293,
4672,
3536,
51,
295,
21321,
1363,
12123,
225,
8399,
67,
16341,
273,
20549,
18,
588,
12,
856,
33,
862,
19666,
67,
16961,
55,
67,
12286,
8495,
67,
3297,
13,
309,
486,
83... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21321,
12,
2293,
4672,
3536,
51,
295,
21321,
1363,
12123,
225,
8399,
67,
16341,
273,
20549,
18,
588,
12,
856,
33,
862,
19666,
67,
16961,
55,
67,
12286,
8495,
67,
3297,
13,
309,
486,
83... |
for base in bases: if 'UnIndex' in base: found = True break | if idx.meta_type == 'PathIndex': found = True else: for base in bases: if 'UnIndex' in base: found = True break | def manage_convertIndexes(self, REQUEST=None, RESPONSE=None, URL1=None): """Recreate indexes derived from UnIndex because the implementation of __len__ changed in Zope 2.8. Pre-Zope 2.7 installation used to implement __len__ as persistent attribute of the index instance which is totally incompatible with the new extension class implementation based on new-style classes. """ | 1d84ac1ebc20288889702e26940c925ae230bcd9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1d84ac1ebc20288889702e26940c925ae230bcd9/ZCatalog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
6283,
8639,
12,
2890,
16,
12492,
33,
7036,
16,
20645,
33,
7036,
16,
1976,
21,
33,
7036,
4672,
3536,
426,
2640,
5596,
10379,
628,
1351,
1016,
2724,
326,
4471,
434,
1001,
1897,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
6283,
8639,
12,
2890,
16,
12492,
33,
7036,
16,
20645,
33,
7036,
16,
1976,
21,
33,
7036,
4672,
3536,
426,
2640,
5596,
10379,
628,
1351,
1016,
2724,
326,
4471,
434,
1001,
1897,
... |
email = r1['email'] | def get_userIdByVerificationId(self, verificationId): """Get the user ID from a email-verification ID """ da = self.zsqlalchemy uet = da.createMapper('user_email')[1] evt = da.createMapper('email_verification')[1] s1 = evt.select() s1.append_whereclause(evt.c.verification_id == verificationId) r1 = s1.execute().fetchone() email = r1['email'] retval = '' if r1: s2 = uet.select() s2.append_whereclause(uet.c.email.op('ILIKE')(email)) r2 = s2.execute().fetchone() if r2: return r2['user_id'] assert type(retval) == str return retval | 55565e7c94f321e55a417b8fecc89b8d742c32ee /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6270/55565e7c94f321e55a417b8fecc89b8d742c32ee/CustomUserFolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
18991,
858,
13483,
548,
12,
2890,
16,
11805,
548,
4672,
3536,
967,
326,
729,
1599,
628,
279,
2699,
17,
27726,
1599,
3536,
5248,
273,
365,
18,
94,
4669,
24182,
582,
278,
273,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
18991,
858,
13483,
548,
12,
2890,
16,
11805,
548,
4672,
3536,
967,
326,
729,
1599,
628,
279,
2699,
17,
27726,
1599,
3536,
5248,
273,
365,
18,
94,
4669,
24182,
582,
278,
273,
5... | |
args = [ | args = [ | def get_take_put_kernel(dtype, idx_dtype, with_offsets, vec_count=1): ctx = { "idx_tp": dtype_to_ctype(idx_dtype), "tp": dtype_to_ctype(dtype), "tex_tp": dtype_to_ctype(dtype, with_fp_tex_hack=True), } args = [ VectorArg(idx_dtype, "gmem_dest_idx"), VectorArg(idx_dtype, "gmem_src_idx"), ] + [ VectorArg(dtype, "dest%d" % i) for i in range(vec_count) ] + [ ScalarArg(idx_dtype, "offset%d" % i) for i in range(vec_count) if with_offsets ] + [ScalarArg(numpy.intp, "n")] preamble = "#include <pycuda-helpers.hpp>\n\n" + "\n".join( "texture <%s, 1, cudaReadModeElementType> tex_src%d;" % (ctx["tex_tp"], i) for i in range(vec_count)) if with_offsets: def get_copy_insn(i): return ("dest%d[dest_idx] = " "fp_tex1Dfetch(tex_src%d, src_idx+offset%d);" % (i, i, i)) else: def get_copy_insn(i): return ("dest%d[dest_idx] = " "fp_tex1Dfetch(tex_src%d, src_idx);" % (i, i)) body = (("%(idx_tp)s src_idx = gmem_src_idx[i];\n" "%(idx_tp)s dest_idx = gmem_dest_idx[i];\n" % ctx) + "\n".join(get_copy_insn(i) for i in range(vec_count))) mod = get_elwise_module(args, body, "take_put", preamble=preamble) func = mod.get_function("take_put") tex_src = [mod.get_texref("tex_src%d" % i) for i in range(vec_count)] func.prepare( "PP"+(vec_count*"P") +(bool(with_offsets)*vec_count*idx_dtype.char) +numpy.dtype(numpy.uintp).char, (1,1,1), texrefs=tex_src) return func, tex_src | 2034b081c720026cdb97d74afd308e6c459a1bcf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12870/2034b081c720026cdb97d74afd308e6c459a1bcf/elementwise.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
22188,
67,
458,
67,
8111,
12,
8972,
16,
2067,
67,
8972,
16,
598,
67,
16542,
16,
7062,
67,
1883,
33,
21,
4672,
1103,
273,
288,
315,
3465,
67,
6834,
6877,
3182,
67,
869,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
22188,
67,
458,
67,
8111,
12,
8972,
16,
2067,
67,
8972,
16,
598,
67,
16542,
16,
7062,
67,
1883,
33,
21,
4672,
1103,
273,
288,
315,
3465,
67,
6834,
6877,
3182,
67,
869,
67,
... |
assert dc.to == ccl.lbound() and dc.rbound() == cdc.rbound() | def connect_with_next_base(self, bdcl): """Connect this chain with the next level of our base delta chunklist. The goal in this game is to mark as many of our chunks rigid, hence they cannot be changed by any of the upcoming bases anymore. Once all our chunks are marked like that, we can stop all processing :param bdcl: data chunk list being one of our bases. They must be fed in consequtively and in order, towards the earliest ancestor delta :return: True if processing was done. Use it to abort processing of remaining streams""" assert self is not bdcl if self.frozen == 1: # Can that ever be hit ? return False # END early abort nfc = 0 # number of frozen chunks dci = 0 # delta chunk index slen = len(self) # len of self sold = slen while dci < slen: dc = self[dci] dci += 1 if dc.flags: nfc += 1 continue # END skip frozen chunks # all data chunks must be frozen, we are topmost already # (Also if its a copy operation onto the lowest base, but we cannot # determine that without the number of deltas to come) if dc.has_data(): dc.flags = True nfc += 1 continue # END skip add chunks # copy chunks # integrate the portion of the base list into ourselves. Lists # dont support efficient insertion ( just one at a time ), but for now # we live with it. Internally, its all just a 32/64bit pointer, and # the portions of moved memory should be smallish. Maybe we just rebuild # ourselves in order to reduce the amount of insertions ... ccl = delta_list_slice(bdcl, dc.so, dc.ts) # move the target bounds into place to match with our chunk ofs = dc.to - dc.so for cdc in ccl: cdc.to += ofs # END update target bounds assert dc.to == ccl.lbound() and dc.rbound() == cdc.rbound() if len(ccl) == 1: self[dci-1] = ccl[0] else: # maybe try to compute the expenses here, and pick the right algorithm # It would normally be faster than copying everything physically though # TODO: Use a deque here, and decide by the index whether to extend # or extend left ! post_dci = self[dci:] del(self[dci-1:]) # include deletion of dc self.extend(ccl) self.extend(post_dci) slen = len(self) dci += len(ccl)-1 # deleted dc, added rest # END handle chunk replacement # END for each chunk if nfc == slen: self.frozen = True return False # END handle completeness return True | 0381cae63284e237a7023e9d40c7772690a2f84e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13766/0381cae63284e237a7023e9d40c7772690a2f84e/fun.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
67,
1918,
67,
4285,
67,
1969,
12,
2890,
16,
13837,
830,
4672,
3536,
5215,
333,
2687,
598,
326,
1024,
1801,
434,
3134,
1026,
3622,
2441,
1098,
18,
1021,
17683,
316,
333,
7920,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
67,
1918,
67,
4285,
67,
1969,
12,
2890,
16,
13837,
830,
4672,
3536,
5215,
333,
2687,
598,
326,
1024,
1801,
434,
3134,
1026,
3622,
2441,
1098,
18,
1021,
17683,
316,
333,
7920,
353,
... | |
if self.graph.__class__ != FreeViz: | if self.__class__ != FreeViz: | def optimize_FAST_Separation(self, steps = 10, singleStep = False, distances=None): optimizer = [orangeom.optimizeAnchors, orangeom.optimizeAnchorsRadial, orangeom.optimizeAnchorsR][self.restrain] ai = self.graph.attributeNameIndex attrIndices = [ai[label] for label in self.getShownAttributeList()] if not attrIndices: return | c474403ff8c39e9e3151c39b55fcbee01a0c2b96 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6366/c474403ff8c39e9e3151c39b55fcbee01a0c2b96/orngLinProj.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10979,
67,
2046,
882,
67,
5097,
4302,
12,
2890,
16,
6075,
273,
1728,
16,
2202,
4160,
273,
1083,
16,
12491,
33,
7036,
4672,
13066,
273,
306,
280,
726,
362,
18,
29155,
979,
15482,
16,
57... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10979,
67,
2046,
882,
67,
5097,
4302,
12,
2890,
16,
6075,
273,
1728,
16,
2202,
4160,
273,
1083,
16,
12491,
33,
7036,
4672,
13066,
273,
306,
280,
726,
362,
18,
29155,
979,
15482,
16,
57... |
retlist = x, fval, direc, iter, _powell_funcalls, warnflag | retlist = x, fval, direc, iter, fcalls[0], warnflag | def fmin_powell(func, x0, args=(), xtol=1e-4, ftol=1e-4, maxiter=None, maxfun=None, full_output=0, disp=1, retall=0): """Minimize a function using modified Powell's method. Description: Uses a modification of Powell's method to find the minimum of a function of N variables Inputs: func -- the Python function or method to be minimized. x0 -- the initial guess. args -- extra arguments for func. Outputs: (xopt, {fopt, xi, direc, iter, funcalls, warnflag}, {allvecs}) xopt -- minimizer of function fopt -- value of function at minimum: fopt = func(xopt) direc -- current direction set iter -- number of iterations funcalls -- number of function calls warnflag -- Integer warning flag: 1 : 'Maximum number of function evaluations.' 2 : 'Maximum number of iterations.' allvecs -- a list of solutions at each iteration Additional Inputs: xtol -- line-search error tolerance. ftol -- acceptable relative error in func(xopt) for convergence. maxiter -- the maximum number of iterations to perform. maxfun -- the maximum number of function evaluations. full_output -- non-zero if fval and warnflag outputs are desired. disp -- non-zero to print convergence messages. retall -- non-zero to return a list of the solution at each iteration """ global _powell_funcalls x = asarray(x0) if retall: allvecs = [x] N = len(x) rank = len(x.shape) if not -1 < rank < 2: raise ValueError, "Initial guess must be a scalar or rank-1 sequence." if maxiter is None: maxiter = N * 1000 if maxfun is None: maxfun = N * 1000 direc = eye(N,typecode='d') fval = squeeze(apply(func, (x,)+args)) _powell_funcalls = 1 x1 = x.copy() iter = 0; ilist = range(N) while 1: fx = fval bigind = 0 delta = 0.0 for i in ilist: direc1 = direc[i] fx2 = fval fval, x, direc1 = _linesearch_powell(func, x, direc1, args=args, tol=xtol*100) if (fx2 - fval) > delta: delta = fx2 - fval bigind = i iter += 1 if retall: allvecs.append(x) if (2.0*(fx - fval) <= ftol*(abs(fx)+abs(fval))+1e-20): break if _powell_funcalls >= maxfun: break if iter >= maxiter: break # Construct the extrapolated point direc1 = x - x1 x2 = 2*x - x1 x1 = x.copy() fx2 = squeeze(apply(func, (x2,)+args)) _powell_funcalls +=1 if (fx > fx2): t = 2.0*(fx+fx2-2.0*fval) temp = (fx-fval-delta) t *= temp*temp temp = fx-fx2 t -= delta*temp*temp if t < 0.0: fval, x, direc1 = _linesearch_powell(func, x, direc1, args=args, tol=xtol*100) direc[bigind] = direc[-1] direc[-1] = direc1 warnflag = 0 if _powell_funcalls >= maxfun: warnflag = 1 if disp: print "Warning: Maximum number of function evaluations has "\ "been exceeded." elif iter >= maxiter: warnflag = 2 if disp: print "Warning: Maximum number of iterations has been exceeded" else: if disp: print "Optimization terminated successfully." print " Current function value: %f" % fval print " Iterations: %d" % iter print " Function evaluations: %d" % _powell_funcalls x = squeeze(x) if full_output: retlist = x, fval, direc, iter, _powell_funcalls, warnflag if retall: retlist += (allvecs,) else: retlist = x if retall: retlist = (x, allvecs) return retlist | 926e615eebcd9f2ca3373b1887f74b532b10bda4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/926e615eebcd9f2ca3373b1887f74b532b10bda4/optimize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
1154,
67,
23509,
1165,
12,
644,
16,
619,
20,
16,
833,
33,
9334,
619,
3490,
33,
21,
73,
17,
24,
16,
284,
3490,
33,
21,
73,
17,
24,
16,
25743,
33,
7036,
16,
943,
12125,
33,
70... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
1154,
67,
23509,
1165,
12,
644,
16,
619,
20,
16,
833,
33,
9334,
619,
3490,
33,
21,
73,
17,
24,
16,
284,
3490,
33,
21,
73,
17,
24,
16,
25743,
33,
7036,
16,
943,
12125,
33,
70... |
if self._cmd(output, self._buildDirname, self._dict['Pre-install-command']): | if _cmd(output, self._buildDirname, self._dict['Pre-install-command']): | def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" if self._dict.has_key('Pre-install-command'): if self._cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Pre-install-command']) self.beforeInstall() installcmd = self._dict.get('Install-command') if not installcmd: installcmd = '"%s" setup.py install' % sys.executable if self._cmd(output, self._buildDirname, installcmd): return "install %s: running \"%s\" failed" % \ (self.fullname(), installcmd) self.afterInstall() if self._dict.has_key('Post-install-command'): if self._cmd(output, self._buildDirname, self._dict['Post-install-command']): return "post-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Post-install-command']) return None | a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
2261,
3386,
12,
2890,
16,
876,
33,
7036,
4672,
3536,
6410,
279,
2202,
1084,
2181,
18,
225,
971,
876,
353,
864,
518,
1410,
506,
279,
585,
17,
5625,
733,
471,
518,
903,
6798,
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,
3799,
2261,
3386,
12,
2890,
16,
876,
33,
7036,
4672,
3536,
6410,
279,
2202,
1084,
2181,
18,
225,
971,
876,
353,
864,
518,
1410,
506,
279,
585,
17,
5625,
733,
471,
518,
903,
6798,
279,
... |
custom_layout.addWidget(send_button) custom_layout.addSpacing(30) | send_button.text_edit = QtGui.QTextEdit("<i><font color= self.connect(send_button.text_edit, QtCore.SIGNAL('cursorPositionChanged()'), clear_desc_area) send_button.text_edit.setMaximumHeight(70) vlayout.addWidget(send_button.text_edit) vlayout.addWidget(send_button) hlayout.addSpacing(30) hlayout.addLayout(vlayout) hlayout.addSpacing(30) send_button.text_label = QtGui.QLabel(_("If you have encountered a problem while using %s, " "you should send your logging reports to help us to " "fix the bug.") % conf.PRODUCTNAME) send_button.text_label.setWordWrap(True) custom_layout.addWidget(send_button.text_label) custom_layout.addLayout(hlayout) | def send_debug_reports(): control = self.sender() control.setEnabled(False) import urllib report_files = glob.glob(os.path.join(os.path.dirname(conf.LOGFILE ), "*")) | eacbd9b0390bb42bafdc565727cd8273c84a3e4f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1208/eacbd9b0390bb42bafdc565727cd8273c84a3e4f/gui_pyqt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
4148,
67,
20195,
13332,
3325,
273,
365,
18,
15330,
1435,
3325,
18,
542,
1526,
12,
8381,
13,
1930,
11527,
2605,
67,
2354,
273,
4715,
18,
10581,
12,
538,
18,
803,
18,
5701,
12,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
4148,
67,
20195,
13332,
3325,
273,
365,
18,
15330,
1435,
3325,
18,
542,
1526,
12,
8381,
13,
1930,
11527,
2605,
67,
2354,
273,
4715,
18,
10581,
12,
538,
18,
803,
18,
5701,
12,... |
main.addTimeout(tick, 0.5) | reactor.callLater(0.5, tick) | def tick(): main.addTimeout(tick, 0.5) | bab83b2334ff22888211143cd7d31a7bc54d6980 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/bab83b2334ff22888211143cd7d31a7bc54d6980/row_xml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4024,
13332,
19178,
18,
1991,
20607,
12,
20,
18,
25,
16,
4024,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
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,
4024,
13332,
19178,
18,
1991,
20607,
12,
20,
18,
25,
16,
4024,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
GROUP BY l.partner_id', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids), self.date_from)) | AND (l.date <= %s)\ GROUP BY l.partner_id', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids), self.date_from, self.date_from,)) | def _get_lines(self, form): res = [] self.cr.execute('SELECT DISTINCT res_partner.id AS id,\ res_partner.name AS name \ FROM res_partner,account_move_line AS l, account_account\ WHERE (l.account_id=account_account.id) \ AND ((reconcile_id IS NULL)\ OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ AND (l.partner_id=res_partner.id)\ AND ' + self.query + ' \ ORDER BY res_partner.name', (self.date_from,)) partners = self.cr.dictfetchall() ## mise a 0 du total for i in range(7): self.total_account.append(0) # # Build a string like (1,2,3) for easy use in SQL query partner_ids = [x['id'] for x in partners] if not partner_ids: return [] # This dictionary will store the debit-credit for all partners, using partner_id as key. move_state = ['draft','posted'] if self.target_move == 'posted': move_state = ['posted'] | e33b0323f7d3bcc8461ccb90e8996b9fa5978836 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e33b0323f7d3bcc8461ccb90e8996b9fa5978836/account_aged_partner_balance.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
3548,
12,
2890,
16,
646,
4672,
400,
273,
5378,
365,
18,
3353,
18,
8837,
2668,
4803,
23286,
400,
67,
31993,
18,
350,
5355,
612,
17211,
400,
67,
31993,
18,
529,
5355,
508,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
3548,
12,
2890,
16,
646,
4672,
400,
273,
5378,
365,
18,
3353,
18,
8837,
2668,
4803,
23286,
400,
67,
31993,
18,
350,
5355,
612,
17211,
400,
67,
31993,
18,
529,
5355,
508,
... |
self.Done = ( self.__pos >= self.__end ) | self.Done = self.__pos >= self.__end >= 0 | def send( self, sock ): | ae37ecc26da47957c1efb547058805e36b4f0d73 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8169/ae37ecc26da47957c1efb547058805e36b4f0d73/Response.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
12,
365,
16,
7313,
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,
1366,
12,
365,
16,
7313,
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,
... |
pdir = os.path.join(os.path.dirname(logfile),pname) if not os.path.isdir(pdir): try: os.makedirs(pdir) except: fatal("error creating directory " + pdir) | def run_tests(pname, file, logfile): errs = ok = 0 f = open(logfile, 'a') pdir = os.path.join(os.path.dirname(logfile),pname) if not os.path.isdir(pdir): try: os.makedirs(pdir) except: fatal("error creating directory " + pdir) for line in open(file): if line[0] == '\n' or line[0] == '#': continue tname = line.split()[0] if line.find('TESTDIR') >= 0: pdir = os.path.join(pdir, tname) line = line.replace('TESTDIR',pdir) if not os.path.isdir(pdir): try: os.makedirs(pdir) except: fatal("error creating directory " + pdir) outfile = os.path.join(pdir, tname + '.dat') line = line.replace('TESTOUT', outfile) line = line.split() cmd = ' '.join(line[1:]) debug("Test %s: %s" % (tname, cmd)) ostr = "\t<Name>%s</Name>\n" % tname ostr += "\t<Path>%s</Path>\n" % os.path.dirname(file) ostr += "\t<FullName>%s</FullName>\n" % tname ostr += "\t<FullCommandLine>%s</FullCommandLine>\n" % cgi.escape(cmd) ostr += "\t<Results><Measurement><Value>" exe = os.popen("/bin/bash -c '%s 2>&1'" % cmd) for line in exe: ostr += cgi.escape(line) ostr += "</Value></Measurement></Results>" ret = exe.close() if ret: ret >>= 8 debug("%s Failed" % line[0]) ostr = "<Test Status=\"failed\">\n" + ostr errs += 1 else: ostr = "<Test Status=\"passed\">\n" + ostr ok += 1 ostr += "</Test>\n" f.write(ostr) f.close() return ok, errs | 8e6952e6cea42e1b68f4fd094849c10d6eb4e6ed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5963/8e6952e6cea42e1b68f4fd094849c10d6eb4e6ed/testing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
12,
84,
529,
16,
585,
16,
15204,
4672,
6962,
273,
1529,
273,
374,
284,
273,
1696,
12,
28806,
16,
296,
69,
6134,
364,
980,
316,
1696,
12,
768,
4672,
309,
980,
63,
20,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
12,
84,
529,
16,
585,
16,
15204,
4672,
6962,
273,
1529,
273,
374,
284,
273,
1696,
12,
28806,
16,
296,
69,
6134,
364,
980,
316,
1696,
12,
768,
4672,
309,
980,
63,
20,... | |
Flag to determine whether to skip test. If the condition is a callable, it is used at runtime to dynamically make the decision. This is useful for tests that may require costly imports, to delay the cost until the test suite is actually executed. | Flag to determine whether to skip test. If the condition is a callable, it is used at runtime to dynamically make the decision. This is useful for tests that may require costly imports, to delay the cost until the test suite is actually executed. | def skipif(skip_condition, msg=None): ''' Make function raise SkipTest exception if skip_condition is true Parameters ---------- skip_condition : bool or callable. Flag to determine whether to skip test. If the condition is a callable, it is used at runtime to dynamically make the decision. This is useful for tests that may require costly imports, to delay the cost until the test suite is actually executed. msg : string Message to give on raising a SkipTest exception Returns ------- decorator : function Decorator, which, when applied to a function, causes SkipTest to be raised when the skip_condition was True, and the function to be called normally otherwise. Notes ----- You will see from the code that we had to further decorate the decorator with the nose.tools.make_decorator function in order to transmit function name, and various other metadata. ''' def skip_decorator(f): # Local import to avoid a hard nose dependency and only incur the # import time overhead at actual test-time. import nose # Allow for both boolean or callable skip conditions. if callable(skip_condition): skip_val = lambda : skip_condition() else: skip_val = lambda : skip_condition def get_msg(func,msg=None): """Skip message with information about function being skipped.""" if msg is None: out = 'Test skipped due to test condition.' else: out = msg return "Skipping test: %s. %s" % (func.__name__,out) # We need to define *two* skippers because Python doesn't allow both # return with value and yield inside the same function. def skipper_func(*args, **kwargs): """Skipper for normal test functions.""" if skip_val(): raise nose.SkipTest(get_msg(f,msg)) else: return f(*args, **kwargs) def skipper_gen(*args, **kwargs): """Skipper for test generators.""" if skip_val(): raise nose.SkipTest(get_msg(f,msg)) else: for x in f(*args, **kwargs): yield x # Choose the right skipper to use when building the actual generator. if nose.util.isgenerator(f): skipper = skipper_gen else: skipper = skipper_func return nose.tools.make_decorator(f)(skipper) return skip_decorator | b208e8049f1e16b76ec733ca98a7bb826b61d330 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4224/b208e8049f1e16b76ec733ca98a7bb826b61d330/decorators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2488,
430,
12,
7457,
67,
4175,
16,
1234,
33,
7036,
4672,
9163,
4344,
445,
1002,
6611,
4709,
1520,
309,
2488,
67,
4175,
353,
638,
225,
7012,
12181,
2488,
67,
4175,
294,
1426,
578,
4140,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2488,
430,
12,
7457,
67,
4175,
16,
1234,
33,
7036,
4672,
9163,
4344,
445,
1002,
6611,
4709,
1520,
309,
2488,
67,
4175,
353,
638,
225,
7012,
12181,
2488,
67,
4175,
294,
1426,
578,
4140,
... |
win32pdhutil.GetPerformanceAttributes('Process','IDProcess',procname) | win32pdhutil.GetPerformanceAttributes('Process','ID Process',procname) | def killProcName(procname): # Change suggested by Dan Knierim, who found that this performed a # "refresh", allowing us to kill processes created since this was run # for the first time. try: win32pdhutil.GetPerformanceAttributes('Process','IDProcess',procname) except: pass pids = win32pdhutil.FindPerformanceAttributesByName(procname) # If _my_ pid in there, remove it! try: pids.remove(win32api.GetCurrentProcessId()) except ValueError: pass if len(pids)==0: result = "Can't find %s" % procname elif len(pids)>1: result = "Found too many %s's - pids=`%s`" % (procname,pids) else: handle = win32api.OpenProcess(win32con.PROCESS_TERMINATE, 0,pids[0]) win32api.TerminateProcess(handle,0) win32api.CloseHandle(handle) result = "" return result | 92982718109bc27148771c54e64ff705074e3be5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/677/92982718109bc27148771c54e64ff705074e3be5/killProcName.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
15417,
461,
12,
9381,
529,
4672,
468,
7576,
22168,
635,
463,
304,
1475,
82,
2453,
381,
16,
10354,
1392,
716,
333,
9591,
279,
468,
315,
9144,
3113,
15632,
584,
358,
8673,
8488,
2522... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
15417,
461,
12,
9381,
529,
4672,
468,
7576,
22168,
635,
463,
304,
1475,
82,
2453,
381,
16,
10354,
1392,
716,
333,
9591,
279,
468,
315,
9144,
3113,
15632,
584,
358,
8673,
8488,
2522... |
family = Family(fam) if code in family.obsolete and family.obsolete[code]: code = family.obsolete[code] | def getSite(code = None, fam = None, user=None): if code == None: code = default_code if fam == None: fam = default_family # if we got an outdated code, use the new one instead. family = Family(fam) if code in family.obsolete and family.obsolete[code]: code = family.obsolete[code] key = '%s:%s'%(fam,code) if not _sites.has_key(key): _sites[key] = Site(code=code, fam=fam, user=user) return _sites[key] | 7b53868b9b739a43b411b49889d02e6d60ef916f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/7b53868b9b739a43b411b49889d02e6d60ef916f/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11021,
12,
710,
273,
599,
16,
26688,
273,
599,
16,
729,
33,
7036,
4672,
309,
981,
422,
599,
30,
981,
273,
805,
67,
710,
309,
26688,
422,
599,
30,
26688,
273,
805,
67,
9309,
468,
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,
11021,
12,
710,
273,
599,
16,
26688,
273,
599,
16,
729,
33,
7036,
4672,
309,
981,
422,
599,
30,
981,
273,
805,
67,
710,
309,
26688,
422,
599,
30,
26688,
273,
805,
67,
9309,
468,
309,... | |
if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy32(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') | m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy32(arg0) | def matrix(arg0=None, arg1=None, arg2=None, arg3=None, sparse=None): """ Create a matrix. INPUT: Supported formats 1. matrix([sparse=True]): the 0x0 matrix over ZZ 2. matrix(list_of_rows, [sparse=True]): matrix with each row constructed from the list_of_rows 3. matrix(nrows, entries, [sparse=True]): matrix with given number of rows and flat list of entries 4. matrix(nrows, ncols, entries, [sparse=True]): matrix with given number of rows and columns with flat list of entries 5. matrix(ring, list_of_row, [sparse=True]): matrix over ring with rows the elements of the list_of_rows 6. matrix(ring, nrows, entries, [sparse=True]): matrix over ring with given number of rows and entries from the flat list 7. matrix(ring, nrows, ncols, entries, [sparse=True]): matrix over the given ring with given number of rows and columns and entries. 8. matrix(numpy_array) The sparse option is optional, must be explicitly named (i.e., sparse=True), and may be either True or False. The entries can instead be a dictionary of key:value pairs of the form (i,j):x, where i,j are integers instead of a list. If sparse is not specified and the entries are a dictionary, it default to True. OUTPUT: a matrix EXAMPLES: 1. The degenerate matrix input format: sage: m = matrix(); m [] sage: parent(m) Full MatrixSpace of 0 by 0 dense matrices over Integer Ring sage: m = matrix(sparse=True); m [] sage: parent(m) Full MatrixSpace of 0 by 0 sparse matrices over Integer Ring 2. The "matrix(list_of_rows, [sparse])" input format. Notice that SAGE is careful to find a sensible common ring for all the entries (using the Sequence object): sage: x = polygen(QQ) sage: m = matrix([[1/3,2+x],[3,4]]); m [ 1/3 x + 2] [ 3 4] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in x over Rational Field sage: m = matrix([[1,2],[3,4/7]]); m [ 1 2] [ 3 4/7] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: m = matrix([[1,2,3], [RDF(2), CDF(1,2), 3]]); m [ 1.0 2.0 3.0] [ 2.0 1.0 + 2.0*I 3.0] sage: parent(m) Full MatrixSpace of 2 by 3 dense matrices over Complex Double Field sage: V = GF(7)^2 sage: m = matrix([V.0, V.0+2*V.1], sparse=True); m [1 0] [1 2] sage: parent(m) Full MatrixSpace of 2 by 2 sparse matrices over Finite Field of size 7 3. matrix(nrows, entries, [sparse]): sage: matrix(2,[1,2,3, 4,5,6]) [1 2 3] [4 5 6] sage: matrix(3, [1,2, 3/4, 5/6, 7*x, 8*x]) [ 1 2] [3/4 5/6] [7*x 8*x] The number of rows must divide the number of entries. sage: matrix(5,[1,2,3, 4,5,6]) Traceback (most recent call last): ... TypeError: entries has the wrong length 4. matrix(nrows, ncols, entries, [sparse]): sage: matrix(2,3, [1,2,3, 4,5,6]) [1 2 3] [4 5 6] sage: matrix(3,2, [1,2, 3/4, 5/6, 7*x, 8*x]) [ 1 2] [3/4 5/6] [7*x 8*x] The length of the entry list must be the same as the number of rows times columns. sage: matrix(3,3, [1,2, 3/4, 5/6, 7*x, 8*x]) Traceback (most recent call last): ... TypeError: entries has the wrong length 5. matrix(ring, list_of_row, [sparse]): sage: m = matrix(QQ, [[1,2], [3,4]]); m [1 2] [3 4] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: m = matrix(GF(7), [[1/3,2/3,1/2], [3/4,4/5,7]]); m [5 3 4] [6 5 0] sage: parent(m) Full MatrixSpace of 2 by 3 dense matrices over Finite Field of size 7 6. matrix(ring, nrows, entries, [sparse]): sage: M = ZZ^4 sage: m = matrix(QQ, [M([1,2,3,4]), M([-1,0,3,4])]); m [ 1 2 3 4] [-1 0 3 4] sage: parent(m) Full MatrixSpace of 2 by 4 dense matrices over Rational Field 7. matrix(ring, nrows, ncols, entries, [sparse]) sage: matrix(QQ, 2, 2, [1,2,3,4]) [1 2] [3 4] sage: matrix(GF(5), 2, 3, range(6)) [0 1 2] [3 4 0] sage: matrix(ZZ, 10, 10, range(100)).parent() Full MatrixSpace of 10 by 10 dense matrices over Integer Ring sage: matrix(ZZ, 10, 10, range(100), sparse=True).parent() Full MatrixSpace of 10 by 10 sparse matrices over Integer Ring sage: R = PolynomialRing(QQ, 9, 'x') sage: A = matrix(R, 3, 3, R.gens()); A [x0 x1 x2] [x3 x4 x5] [x6 x7 x8] sage: det(A) -x2*x4*x6 + x1*x5*x6 + x2*x3*x7 - x0*x5*x7 - x1*x3*x8 + x0*x4*x8 CREATING SPARSE MATRICES FROM DICTS: sage: a = matrix({(1,2):10, (2,3):5/1}) sage: print a, a.parent() [ 0 0 0 0] [ 0 0 10 0] [ 0 0 0 5] Full MatrixSpace of 3 by 4 sparse matrices over Rational Field sage: a = matrix({(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] True sage: a = matrix(3,{(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(3,5,{(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0 0 0] [ 0 0 10 0 0] [ 0 0 0 0 0] True sage: a = matrix(QQ, 3, {(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(QQ, 3, {(1,2):10}, sparse=True) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(QQ, 3, 5, {(1,2):10}, sparse=True) sage: print a, a.is_sparse() [ 0 0 0 0 0] [ 0 0 10 0 0] [ 0 0 0 0 0] True 8. Creating a matrix from a numpy array Any numpy array with a datatype of float or complex may be passed to matrix If the data type is float the result will be a matrix over the real double field. complex numpy arrays will give matrices over the complex double field. The data of the numpy array must be contiguous, so slices of other matrices will raise an exception. sage: import numpy sage: n=numpy.array([[1,2],[3,4]],float) sage: m=matrix(n) sage: n=numpy.array([[numpy.complex(0,1),numpy.complex(0,2)],[3,4]],complex) sage: m=matrix(n) TESTS: sage: import numpy sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'float32') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'float64') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'complex64') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'complex128') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = matrix([[1,2],[3,4]]) sage: b = matrix(a.numpy()); b [1 2] [3 4] sage: a == b True sage: c = matrix(a.numpy('float32')); c [1.0 2.0] [3.0 4.0] """ if hasattr(arg0, '_matrix_'): if arg1 is None: arg1 = rings.ZZ return arg0._matrix_(arg1) if hasattr(arg1, '_matrix_'): return arg1._matrix_(arg0) if arg0 is None: # 1. matrix([sparse]): # the 0x0 matrix over ZZ # the degenerate matrix ring = rings.ZZ nrows = 0 ncols = 0 entries = [] elif isinstance(arg0, (list, tuple)): # 2. matrix(list_of_rows, [sparse]): # matrix with each row constructed from the list_of_rows # list of rows if not (arg1 is None and arg2 is None and arg3 is None): raise TypeError, "invalid input" nrows = len(arg0) if nrows == 0: ncols = 0 else: ncols = len(arg0[0]) w = sum([list(v) for v in arg0], []) entries, ring = prepare(w) elif isinstance(arg0, dict): # 2. matrix(dict_of_rows, sparse=True): if sparse is None: sparse = True entries, ring = prepare_dict(arg0) nrows = nrows_from_dict(entries) ncols = ncols_from_dict(entries) elif not rings.is_Ring(arg0) and isinstance(arg1, (list, tuple)) and arg2 is None and arg3 is None: # 3. matrix(nrows, entries, [sparse]): # matrix with given number of rows and flat list of entries nrows = int(arg0) entries, ring = prepare(arg1) ncols = len(entries) // nrows elif not rings.is_Ring(arg0) and isinstance(arg1, dict) and arg2 is None and arg3 is None: # 3. matrix(nrows, entries, sparse=True): # matrix with given number of rows and sparse dict of entries if sparse is None: sparse = True nrows = int(arg0) entries, ring = prepare_dict(arg1) ncols = ncols_from_dict(entries) elif not rings.is_Ring(arg0) and isinstance(arg2, (list, tuple)) and arg3 is None: # 4. matrix(nrows, ncols, entries, [sparse]): # matrix with given number of rows and columns with flat list of entries nrows = int(arg0) ncols = int(arg1) entries, ring = prepare(arg2) elif not rings.is_Ring(arg0) and isinstance(arg2, dict) and arg3 is None: # 4. matrix(nrows, ncols, entries, sparse=True): # matrix with given number of rows and columns with flat list of entries if sparse is None: sparse = True nrows = int(arg0) ncols = int(arg1) entries, ring = prepare_dict(arg2) elif rings.is_Ring(arg0) and isinstance(arg1, (list, tuple)) and arg2 is None and arg3 is None: # 5. matrix(ring, list_of_row, [sparse]): # matrix over ring with rows the elements of the list_of_rows ring = arg0 nrows = len(arg1) if nrows == 0: ncols = 0 else: try: ncols = len(arg1[0]) except TypeError: raise TypeError, "If making a matrix with the matrix(ring, list_of_row, [sparse]) constructor, the second input must be a list of rows." entries = sum([list(v) for v in arg1], []) elif rings.is_Ring(arg0) and isinstance(arg1, dict) and arg2 is None and arg3 is None: # 5. matrix(ring, dict, sparse=True): # matrix over ring with rows the elements the dict if sparse is None: sparse = True ring = arg0 entries = arg1 nrows = nrows_from_dict(entries) elif rings.is_Ring(arg0) and isinstance(arg2, (list, tuple)) and arg3 is None: # 6. matrix(ring, nrows, entries, [sparse]): # matrix over ring with given number of rows and entries from the flat list ring = arg0 nrows = int(arg1) entries = arg2 if nrows == 0: ncols = 0 else: ncols = len(entries) // nrows elif rings.is_Ring(arg0) and isinstance(arg2, dict) and arg3 is None: # 6. matrix(ring, nrows, entries, sparse=True) # matrix over ring with given number of rows and entries from the dict if sparse is None: sparse = True ring = arg0 nrows = int(arg1) entries = arg2 if nrows == 0: ncols = 0 else: ncols = ncols_from_dict(entries) elif rings.is_Ring(arg0): # 7. matrix(ring, nrows, ncols, entries, [sparse]): # matrix over the given ring with given number of rows and columns and entries. ring = arg0 nrows = int(arg1) if arg2 is None: ncols = nrows else: ncols = int(arg2) entries = arg3 if isinstance(entries, dict): if sparse is None: sparse = True else: import numpy if isinstance(arg0,numpy.ndarray): str_dtype = str(arg0.dtype) if str_dtype.count('float32')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy32(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('float64')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('complex64')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(CDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy32(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('complex128')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(CDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('object') == 1: #Get the raw nested list from the numpy array #and feed it back into matrix try: return matrix( map(list, list(arg0)) ) except TypeError: raise TypeError("cannot convert numpy matrix to SAGE matrix") else: raise TypeError("cannot convert numpy matrix to SAGE matrix") else: raise TypeError, "unknown matrix constructor format. Type matrix? for help" if sparse is None: sparse = False return matrix_space.MatrixSpace(ring, nrows, ncols, sparse=sparse)(entries) | afaca1e12ee60ebc48a960e19c48135538784f50 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/afaca1e12ee60ebc48a960e19c48135538784f50/constructor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3148,
12,
3175,
20,
33,
7036,
16,
1501,
21,
33,
7036,
16,
1501,
22,
33,
7036,
16,
1501,
23,
33,
7036,
16,
9387,
33,
7036,
4672,
3536,
1788,
279,
3148,
18,
225,
12943,
30,
19503,
6449... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3148,
12,
3175,
20,
33,
7036,
16,
1501,
21,
33,
7036,
16,
1501,
22,
33,
7036,
16,
1501,
23,
33,
7036,
16,
9387,
33,
7036,
4672,
3536,
1788,
279,
3148,
18,
225,
12943,
30,
19503,
6449... |
r_deps = (spec.get('dependencies', []) + spec.get('dependencies_original', [])) | r_deps = list(set((spec.get('dependencies', []) + spec.get('dependencies_original', [])))) | def DeepDependencyTargets(target_dicts, roots): """Returns the recursive list of target dependencies. """ dependencies = set() for r in roots: spec = target_dicts[r] r_deps = (spec.get('dependencies', []) + spec.get('dependencies_original', [])) for d in r_deps: if d not in roots: dependencies.add(d) for d in DeepDependencyTargets(target_dicts, r_deps): if d not in roots: dependencies.add(d) return list(dependencies) | f32f06914cb9e40f584ccb5ce022dc3d702ccefc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6220/f32f06914cb9e40f584ccb5ce022dc3d702ccefc/common.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17084,
7787,
9432,
12,
3299,
67,
16287,
16,
12876,
4672,
3536,
1356,
326,
5904,
666,
434,
1018,
5030,
18,
3536,
5030,
273,
444,
1435,
364,
436,
316,
12876,
30,
857,
273,
1018,
67,
16287,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17084,
7787,
9432,
12,
3299,
67,
16287,
16,
12876,
4672,
3536,
1356,
326,
5904,
666,
434,
1018,
5030,
18,
3536,
5030,
273,
444,
1435,
364,
436,
316,
12876,
30,
857,
273,
1018,
67,
16287,... |
db = cx_Oracle.Connection("TESTJERX001/TESTJERX001@//10.11.216.4:1521/JERX001") | db = cx_Oracle.Connection(u'TESTJERX001/TESTJERX001@//10.11.216.4:1521/JERX001') | def write_dispatch_waybill_compass(self,waybill_id): db = cx_Oracle.Connection("TESTJERX001/TESTJERX001@//10.11.216.4:1521/JERX001") cursor = db.cursor()#connections['compas'].cursor() self.ErrorMessages = '' self.ErrorCodes = '' # gather wb info the_waybill = Waybill.objects.get(id=waybill_id) lineItems = the_waybill.loadingdetail_set.select_related() LTI= lineItems[0].siNo dispatch_person = EpicPerson.objects.get(person_pk = the_waybill.dispatcherName) # make dispatch remarks:::: dispatch_remarks = the_waybill.dispatchRemarks CODE = the_waybill.waybillNumber DOCUMENT_CODE = 'wb' DISPATCH_DATE=the_waybill.dateOfDispatch.strftime("%Y%m%d") ORIGIN_TYPE=LTI.ORIGIN_TYPE ORIGIN_LOCATION_CODE=LTI.ORIGIN_LOCATION_CODE ORIGIN_CODE=LTI.ORIGIN_WH_CODE ORIGIN_DESCR='' DESTINATION_LOCATION_CODE=LTI.DESTINATION_LOCATION_CODE DESTINATION_CODE=str(the_waybill.destinationWarehouse.ORG_CODE) PRO_ACTIVITY_CODE="" ACTIVITY_OUC="" LNDARRM_CODE="" LTI_ID=LTI.LTI_ID LOADING_DATE=the_waybill.dateOfLoading.strftime("%Y%m%d") ORGANIZATION_ID=LTI.CONSEGNEE_CODE TRAN_TYPE_CODE=the_waybill.transactionType TRAN_TYPE_DESCR=the_waybill.transportVehicleRegistration MODETRANS_CODE=the_waybill.transportType COMMENTS= dispatch_remarks PERSON_CODE=dispatch_person.code PERSON_OUC=dispatch_person.org_unit_code CERTIFING_TITLE=dispatch_person.title TRANS_CONTRACTOR_CODE=LTI.TRANSPORT_CODE SUPPLIER1_OUC=LTI.TRANSPORT_OUC DRIVER_NAME=the_waybill.transportDriverName LICENSE=the_waybill.transportDriverLicenceID VEHICLE_REGISTRATION=the_waybill.transportVehicleRegistration TRAILER_PLATE=the_waybill.transportTrailerRegistration CONTAINER_NUMBER=the_waybill.containerOneNumber ## For each lineItems all_ok = True db.begin() for lineItem in lineItems: COMM_CATEGORY_CODE = lineItem.siNo.COMM_CATEGORY_CODE COMM_CODE = lineItem.siNo.COMMODITY_CODE COI_CODE = lineItem.siNo.coi_code() #get stock TheStockItems = EpicStock.objects.filter(origin_id__contains=COI_CODE) PCKKCODE = TheStockItems[0].package_code ALLCODE = TheStockItems[0].allocation_code QUALITY = TheStockItems[0].qualitycode #'G' UnitsLoaded = lineItem.numberUnitsLoaded UnitNet= lineItem.siNo.UNIT_WEIGHT_NET UnitGross = lineItem.siNo.UNIT_WEIGHT_GROSS NetTotal =(UnitNet * UnitsLoaded) / 1000 strNetTotal = "%.3f" % NetTotal GrossTotal = (UnitGross * UnitsLoaded) / 1000 strGrossTotal = "%.3f" % GrossTotal | c497ff3c7ca806866130c41e5403acfcbf770652 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12559/c497ff3c7ca806866130c41e5403acfcbf770652/compas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
10739,
67,
1888,
17240,
67,
2919,
428,
12,
2890,
16,
1888,
17240,
67,
350,
4672,
1319,
273,
9494,
67,
23601,
18,
1952,
12,
89,
11,
16961,
46,
654,
60,
11664,
19,
16961,
46,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10739,
67,
1888,
17240,
67,
2919,
428,
12,
2890,
16,
1888,
17240,
67,
350,
4672,
1319,
273,
9494,
67,
23601,
18,
1952,
12,
89,
11,
16961,
46,
654,
60,
11664,
19,
16961,
46,
... |
else: return make_refnode(builder, fromdocname, obj[0], name, contnode, name) | elif len(matches) > 1: env.warn(fromdocname, 'more than one target found for cross-reference ' '%r: %s' % (target, ', '.join(match[0] for match in matches)), node.line) name, obj = matches[0] return make_refnode(builder, fromdocname, obj[0], name, contnode, name) | def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode): if (typ == 'mod' or typ == 'obj' and target in self.data['modules']): docname, synopsis, platform, deprecated = \ self.data['modules'].get(target, ('','','', '')) if not docname: return None else: title = '%s%s%s' % ((platform and '(%s) ' % platform), synopsis, (deprecated and ' (deprecated)' or '')) return make_refnode(builder, fromdocname, docname, 'module-' + target, contnode, title) else: modname = node.get('py:module') clsname = node.get('py:class') searchorder = node.hasattr('refspecific') and 1 or 0 name, obj = self.find_obj(env, modname, clsname, target, typ, searchorder) if not obj: return None else: return make_refnode(builder, fromdocname, obj[0], name, contnode, name) | 48fa04df3a8eddf165f7afcf6b995be8011117b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7032/48fa04df3a8eddf165f7afcf6b995be8011117b7/python.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2245,
67,
22044,
12,
2890,
16,
1550,
16,
628,
2434,
529,
16,
2089,
16,
3815,
16,
1018,
16,
756,
16,
466,
2159,
4672,
309,
261,
12846,
422,
296,
1711,
11,
578,
3815,
422,
296,
2603,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2245,
67,
22044,
12,
2890,
16,
1550,
16,
628,
2434,
529,
16,
2089,
16,
3815,
16,
1018,
16,
756,
16,
466,
2159,
4672,
309,
261,
12846,
422,
296,
1711,
11,
578,
3815,
422,
296,
2603,
1... |
students = User.objects.filter(student_dict['classreg']).distinct() | students = ESPUser.objects.filter(student_dict['classreg']).distinct() | def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | 31971e2cdd1f3e5433a6f37dcefc370f576c70c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12041/31971e2cdd1f3e5433a6f37dcefc370f576c70c5/nametagmodule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1215,
270,
278,
1341,
12,
2890,
16,
590,
16,
8332,
16,
1245,
16,
2795,
16,
1605,
16,
2870,
16,
11243,
4672,
3536,
2103,
15135,
278,
1341,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1215,
270,
278,
1341,
12,
2890,
16,
590,
16,
8332,
16,
1245,
16,
2795,
16,
1605,
16,
2870,
16,
11243,
4672,
3536,
2103,
15135,
278,
1341,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if self.tree.openElements[-1].name != "p": self.parser.parseError("unexpected-end-tag", {"name": "p"}) if self.tree.elementInScope("p"): while self.tree.elementInScope("p"): self.tree.openElements.pop() else: self.startTagCloseP(impliedTagToken("p", "StartTag")) self.endTagP(impliedTagToken("p")) | if self.tree.openElements[-1].name != "p": self.parser.parseError("unexpected-end-tag", {"name": "p"}) node = self.tree.openElements.pop() while node.name != "p": node = self.tree.openElements.pop() | def endTagP(self, token): if self.tree.elementInScope("p"): self.tree.generateImpliedEndTags("p") if self.tree.openElements[-1].name != "p": self.parser.parseError("unexpected-end-tag", {"name": "p"}) if self.tree.elementInScope("p"): while self.tree.elementInScope("p"): self.tree.openElements.pop() else: self.startTagCloseP(impliedTagToken("p", "StartTag")) self.endTagP(impliedTagToken("p")) | 01073e1a1379e85ed96e699ae08f7268edc39afd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4487/01073e1a1379e85ed96e699ae08f7268edc39afd/html5parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29765,
52,
12,
2890,
16,
1147,
4672,
309,
365,
18,
3413,
18,
2956,
382,
3876,
2932,
84,
6,
4672,
365,
18,
3413,
18,
7163,
2828,
2092,
1638,
3453,
2932,
84,
7923,
309,
365,
18,
3413,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29765,
52,
12,
2890,
16,
1147,
4672,
309,
365,
18,
3413,
18,
2956,
382,
3876,
2932,
84,
6,
4672,
365,
18,
3413,
18,
7163,
2828,
2092,
1638,
3453,
2932,
84,
7923,
309,
365,
18,
3413,
... |
out.write(' ' + make_variable(test[0], 'SH_TEMP', types[0]) + ' out;\n') | out.write(' ' + make_variable(test[0], 'SH_TEMP', types[0], True) + ' out;\n') | def output(self, out): self.output_header(out) test_nb = 0 for test, testcalls in self.tests: types = test[2] src_arg_types = zip(test[1], types[1:]) for i, call in enumerate(testcalls): testname = make_testname(src_arg_types, types, call.key()) out.write(' { // ' + testname + '\n') out.write(init_inputs(' ', src_arg_types)) out.write(init_expected(' ', test[0], types[0])) out.write('\n') out.write(' ' + make_variable(test[0], 'SH_TEMP', types[0]) + ' out;\n') out.write(' ' + str(call) + ';\n') out.write('\n') out.write(' if (test.check("' + testname + '", out, exp' + ') != 0) errors++;\n') out.write(' }\n\n') self.output_footer(out) | 8976924ff6eb127faa58d059c4cb78dd8ae9e8a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1804/8976924ff6eb127faa58d059c4cb78dd8ae9e8a5/shtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
876,
12,
2890,
16,
596,
4672,
365,
18,
2844,
67,
3374,
12,
659,
13,
1842,
67,
6423,
273,
374,
364,
1842,
16,
1842,
12550,
316,
365,
18,
16341,
30,
1953,
273,
1842,
63,
22,
65,
1705,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
876,
12,
2890,
16,
596,
4672,
365,
18,
2844,
67,
3374,
12,
659,
13,
1842,
67,
6423,
273,
374,
364,
1842,
16,
1842,
12550,
316,
365,
18,
16341,
30,
1953,
273,
1842,
63,
22,
65,
1705,
... |
print str(i)+": ", read_pdb(pathx) | stats = read_pdb(pathx) print "%d:%s:%s" % (i, pathx, stats) | def read_pdb(path): sec = time.time() records = pdbmodule.read(path) sec = time.time() - sec if records != None: print "%s: %d records in %.2f seconds" % ( path, len(records), sec) else: print "%s: NO RECORDS" % (path) for rec in records: if rec["RECORD"] == "REMARK": try: text = rec["text"] except KeyError: pass else: if text.find("RESOLUTION RANGE HIGH") == 1: print text | 7ec4c6518170b22cfaef5e2cd7fdbf21624c8b92 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10674/7ec4c6518170b22cfaef5e2cd7fdbf21624c8b92/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
17414,
12,
803,
4672,
1428,
377,
273,
813,
18,
957,
1435,
3853,
273,
10892,
2978,
18,
896,
12,
803,
13,
1428,
377,
273,
813,
18,
957,
1435,
300,
1428,
225,
309,
3853,
480,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
17414,
12,
803,
4672,
1428,
377,
273,
813,
18,
957,
1435,
3853,
273,
10892,
2978,
18,
896,
12,
803,
13,
1428,
377,
273,
813,
18,
957,
1435,
300,
1428,
225,
309,
3853,
480,
5... |
expr = parser.parse_type() parser.skip_ws() if not parser.eof: | try: expr = parser.parse_type() parser.skip_ws() if not parser.eof: return None except DefinitionError: | def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode): parser = DefinitionParser(target) expr = parser.parse_type() parser.skip_ws() if not parser.eof: return None target = unicode(expr) if target not in self.data['objects']: return None obj = self.data['objects'][target] return make_refnode(builder, fromdocname, obj[0], target, contnode, target) | 9da129aeb9a67d386c40bd67cb7b0854de864c81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5532/9da129aeb9a67d386c40bd67cb7b0854de864c81/cpp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2245,
67,
22044,
12,
2890,
16,
1550,
16,
628,
2434,
529,
16,
2089,
16,
3815,
16,
1018,
16,
756,
16,
466,
2159,
4672,
2082,
273,
10849,
2678,
12,
3299,
13,
225,
775,
30,
3065,
273,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2245,
67,
22044,
12,
2890,
16,
1550,
16,
628,
2434,
529,
16,
2089,
16,
3815,
16,
1018,
16,
756,
16,
466,
2159,
4672,
2082,
273,
10849,
2678,
12,
3299,
13,
225,
775,
30,
3065,
273,
20... |
display_options() | response = display_options() | def list_bugs(): log.msg("\n\nFollowing are the list of bugs present.\n") for each_bug in bugs_number: each_bug = each_bug.split('.')[1] log.msg("%s\n" % (each_bug) ) | 3e4b6948e5de0256496cda0c85ed5e12b8789374 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12499/3e4b6948e5de0256496cda0c85ed5e12b8789374/pypt_core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
67,
19381,
13332,
613,
18,
3576,
31458,
82,
64,
82,
8328,
310,
854,
326,
666,
434,
22398,
3430,
8403,
82,
7923,
364,
1517,
67,
925,
316,
22398,
67,
2696,
30,
1517,
67,
925,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
67,
19381,
13332,
613,
18,
3576,
31458,
82,
64,
82,
8328,
310,
854,
326,
666,
434,
22398,
3430,
8403,
82,
7923,
364,
1517,
67,
925,
316,
22398,
67,
2696,
30,
1517,
67,
925,
273,
... |
"""urlopen() raises IOError if the underlying socket does not send any data. ( self.fakehttp('') | self.fakehttp(b"") | def test_empty_socket(self): """urlopen() raises IOError if the underlying socket does not send any data. (#1680230) """ self.fakehttp('') try: self.assertRaises(IOError, urllib.urlopen, 'http://something') finally: self.unfakehttp() | 2bb94b201ecea28a1860ea048c1185fe9aefab93 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/2bb94b201ecea28a1860ea048c1185fe9aefab93/test_urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5531,
67,
7814,
12,
2890,
4672,
3536,
295,
18589,
1435,
14183,
8340,
309,
326,
6808,
2987,
1552,
486,
1366,
1281,
501,
18,
23885,
23329,
3103,
5082,
13,
3536,
365,
18,
28395,
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,
1842,
67,
5531,
67,
7814,
12,
2890,
4672,
3536,
295,
18589,
1435,
14183,
8340,
309,
326,
6808,
2987,
1552,
486,
1366,
1281,
501,
18,
23885,
23329,
3103,
5082,
13,
3536,
365,
18,
28395,
2... |
'<small><ul>\n <li><a href="http://nohost/test_folder_1_/wiki/RootPage" name="RootPage">RootPage</a> <b><-- You are here.</b> ...\n</ul>\n</small>' | '<small><ul>\n <li><a href="http://nohost/test_folder_1_/wiki/RootPage" name="RootPage">RootPage</a> <b><-- You are here.</b></li> ...\n</ul>\n</small>' | def test_context(self): self.assertEquals(self.wiki.RootPage.context(), ' ') # XXX should be as below I think self.assertEquals(self.wiki.RootPage.context(with_siblings=1), '<small><ul>\n <li><a href="http://nohost/test_folder_1_/wiki/RootPage" name="RootPage">RootPage</a> <b><-- You are here.</b> ...\n</ul>\n</small>' ) self.assertEquals(self.wiki.ChildPage.context(), '<small><ul>\n <li><a href="http://nohost/test_folder_1_/wiki/RootPage" name="RootPage">RootPage</a>\n<ul>\n <li><a href="http://nohost/test_folder_1_/wiki/ChildPage" name="ChildPage">ChildPage</a> <b><-- You are here.</b>\n</ul>\n</ul>\n</small>' ) | 8c0c1d9c28f63d3c661947d51a81074722b511e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5225/8c0c1d9c28f63d3c661947d51a81074722b511e0/testParents.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2472,
12,
2890,
4672,
365,
18,
11231,
8867,
12,
2890,
18,
13044,
18,
2375,
1964,
18,
2472,
9334,
5183,
10600,
4359,
13,
468,
11329,
1410,
506,
487,
5712,
467,
15507,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2472,
12,
2890,
4672,
365,
18,
11231,
8867,
12,
2890,
18,
13044,
18,
2375,
1964,
18,
2472,
9334,
5183,
10600,
4359,
13,
468,
11329,
1410,
506,
487,
5712,
467,
15507,
365,
18,
... |
cPickle.dump(key, key_file, cPickle.HIGHEST_PROTOCOL) | if sys.platform == 'win32': cPickle.dump(key, key_file) else: cPickle.dump(key, key_file, cPickle.HIGHEST_PROTOCOL) | def module_from_key(self, key, fn=None): rval = None try: _version, _rest = key except: raise ValueError("Invalid key. key must have form (version, rest)", key) if key in self.entry_from_key: # we have seen this key either in this process or previously #debug('OLD KEY HASH', hash(key), hash(key[1][0]), key[1][0]) name = self.entry_from_key[key] | 34736410034ae227077cfdd63b7214eb3408525e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/34736410034ae227077cfdd63b7214eb3408525e/cmodule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1605,
67,
2080,
67,
856,
12,
2890,
16,
498,
16,
2295,
33,
7036,
4672,
14267,
273,
599,
775,
30,
389,
1589,
16,
389,
8792,
273,
498,
1335,
30,
1002,
2068,
2932,
1941,
498,
18,
498,
12... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1605,
67,
2080,
67,
856,
12,
2890,
16,
498,
16,
2295,
33,
7036,
4672,
14267,
273,
599,
775,
30,
389,
1589,
16,
389,
8792,
273,
498,
1335,
30,
1002,
2068,
2932,
1941,
498,
18,
498,
12... |
len(groups) - 1 | len(thousands_sep) * (len(groups) - 1) | def _group(s, monetary=False): conv = localeconv() thousands_sep = conv[monetary and 'mon_thousands_sep' or 'thousands_sep'] grouping = conv[monetary and 'mon_grouping' or 'grouping'] if not grouping: return (s, 0) result = "" seps = 0 if s[-1] == ' ': stripped = s.rstrip() right_spaces = s[len(stripped):] s = stripped else: right_spaces = '' left_spaces = '' groups = [] for interval in _grouping_intervals(grouping): if not s or s[-1] not in "0123456789": # only non-digit characters remain (sign, spaces) left_spaces = s s = '' break groups.append(s[-interval:]) s = s[:-interval] if s: groups.append(s) groups.reverse() return ( left_spaces + thousands_sep.join(groups) + right_spaces, len(groups) - 1 ) | 7c33bd5ecba73625a3e48685a62870dd6a9806f1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/7c33bd5ecba73625a3e48685a62870dd6a9806f1/locale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1655,
12,
87,
16,
31198,
33,
8381,
4672,
6292,
273,
1191,
17181,
90,
1435,
286,
24810,
67,
10814,
273,
6292,
63,
2586,
14911,
471,
296,
2586,
67,
451,
24810,
67,
10814,
11,
578,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1655,
12,
87,
16,
31198,
33,
8381,
4672,
6292,
273,
1191,
17181,
90,
1435,
286,
24810,
67,
10814,
273,
6292,
63,
2586,
14911,
471,
296,
2586,
67,
451,
24810,
67,
10814,
11,
578,
2... |
doLog = logger.info if debug else logger.debug | def merge(self, rsInternal, inbound=None, isDiff=True, filter=None, readOnly=False, debug=False): assert isinstance(rsInternal, eim.RecordSet) doLog = logger.info if debug else logger.debug | 0994226df20585ccced9d85a73495b053d54d4f6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/0994226df20585ccced9d85a73495b053d54d4f6/shares.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2691,
12,
2890,
16,
3597,
3061,
16,
13357,
33,
7036,
16,
353,
5938,
33,
5510,
16,
1034,
33,
7036,
16,
15075,
33,
8381,
16,
1198,
33,
8381,
4672,
1815,
1549,
12,
5453,
3061,
16,
425,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2691,
12,
2890,
16,
3597,
3061,
16,
13357,
33,
7036,
16,
353,
5938,
33,
5510,
16,
1034,
33,
7036,
16,
15075,
33,
8381,
16,
1198,
33,
8381,
4672,
1815,
1549,
12,
5453,
3061,
16,
425,
... | |
if uri != self.account.contact[uri.parameters.get('transport', 'udp')]: | if uri != self.account.contact[uri.parameters.get('transport', 'udp')] and uri in self._neighbours: self._neighbours.remove(uri) | def _browse_cb(self, file, flags, interface_index, error_code, service_name, regtype, reply_domain): notification_center = NotificationCenter() if error_code != bonjour.kDNSServiceErr_NoError: self._discover_timer = reactor.callLater(1, self._command_channel.send, Command('discover')) return if not (flags & bonjour.kDNSServiceFlagsAdd): uri = FrozenSIPURI.parse(service_name.strip('<>').encode('utf-8')) if uri != self.account.contact[uri.parameters.get('transport', 'udp')]: notification_center.post_notification('BonjourAccountDidRemoveNeighbour', sender=self.account, data=TimestampedNotificationData(uri=uri)) return try: file = bonjour.DNSServiceResolve(0, interface_index, service_name, regtype, reply_domain, self._resolve_cb) except bonjour.BonjourError: # Maybe we should log the error, but how? -Luci pass else: bonjour_file = BonjourFile(file, 'resolution') self._files.append(bonjour_file) self._select_proc.kill(RestartSelect) | c44a524038950f0f09908ef523f839223f5c0b63 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5703/c44a524038950f0f09908ef523f839223f5c0b63/account.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
25731,
67,
7358,
12,
2890,
16,
585,
16,
2943,
16,
1560,
67,
1615,
16,
555,
67,
710,
16,
1156,
67,
529,
16,
960,
723,
16,
4332,
67,
4308,
4672,
3851,
67,
5693,
273,
8050,
8449,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
25731,
67,
7358,
12,
2890,
16,
585,
16,
2943,
16,
1560,
67,
1615,
16,
555,
67,
710,
16,
1156,
67,
529,
16,
960,
723,
16,
4332,
67,
4308,
4672,
3851,
67,
5693,
273,
8050,
8449,
... |
cmd_obj = self.get_command_obj (command) for (key, val) in cmd_options.items(): cmd_obj.set_option (key, val) | opt_dict = self.get_option_dict(command) for (opt, val) in cmd_options.items(): opt_dict[opt] = ("setup script", val) | def __init__ (self, attrs=None): """Construct a new Distribution instance: initialize all the attributes of a Distribution, and then uses 'attrs' (a dictionary mapping attribute names to values) to assign some of those attributes their "real" values. (Any attributes not mentioned in 'attrs' will be assigned to some null value: 0, None, an empty list or dictionary, etc.) Most importantly, initialize the 'command_obj' attribute to the empty dictionary; this will be filled in with real command objects by 'parse_command_line()'.""" | 2cef47a4265957a44358e62355d96572d0624e43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/2cef47a4265957a44358e62355d96572d0624e43/dist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
3422,
33,
7036,
4672,
3536,
7249,
279,
394,
17547,
791,
30,
4046,
777,
326,
1677,
434,
279,
17547,
16,
471,
1508,
4692,
296,
7039,
11,
261,
69,
3880,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
261,
2890,
16,
3422,
33,
7036,
4672,
3536,
7249,
279,
394,
17547,
791,
30,
4046,
777,
326,
1677,
434,
279,
17547,
16,
471,
1508,
4692,
296,
7039,
11,
261,
69,
3880,
28... |
r = pollster.poll (timeout) | r = pollster.poll(timeout) | def poll3 (timeout=0.0, map=None): # Use the poll() support added to the select module in Python 2.0 if map is None: map=socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) pollster = select.poll() if map: for fd, obj in map.iteritems(): flags = 0 if obj.readable(): flags = select.POLLIN if obj.writable(): flags = flags | select.POLLOUT if flags: pollster.register(fd, flags) try: r = pollster.poll (timeout) except select.error, err: if err[0] != EINTR: raise r = [] for fd, flags in r: obj = map.get(fd) if obj is None: continue readwrite(obj, flags) | d560ace3a76d1fa162fa40ec90a158d4d3540036 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d560ace3a76d1fa162fa40ec90a158d4d3540036/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
23,
261,
4538,
33,
20,
18,
20,
16,
852,
33,
7036,
4672,
468,
2672,
326,
7672,
1435,
2865,
3096,
358,
326,
2027,
1605,
316,
6600,
576,
18,
20,
309,
852,
353,
599,
30,
852,
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,
7672,
23,
261,
4538,
33,
20,
18,
20,
16,
852,
33,
7036,
4672,
468,
2672,
326,
7672,
1435,
2865,
3096,
358,
326,
2027,
1605,
316,
6600,
576,
18,
20,
309,
852,
353,
599,
30,
852,
33,
... |
window["event_entry"].set_text(gamemodel["Event"]) window["site_entry"].set_text(gamemodel["Site"]) window["round_spinbutton"].set_value(gamemodel["Round"]) | window["event_entry"].set_text(gamemodel.tags["Event"]) window["site_entry"].set_text(gamemodel.tags["Site"]) window["round_spinbutton"].set_value(gamemodel.tags["Round"]) | def on_properties1_activate (widget): gamemodel = gameDic[gamewidget.cur_gmwidg()] window["event_entry"].set_text(gamemodel["Event"]) window["site_entry"].set_text(gamemodel["Site"]) window["round_spinbutton"].set_value(gamemodel["Round"]) # Notice: GtkCalender month goes from 0 to 11, but gamemodel goes from # 1 to 12 window["game_info_calendar"].clear_marks() window["game_info_calendar"].select_month( gamemodel["Month"]-1, gamemodel["Year"]) window["game_info_calendar"].select_day(gamemodel["Day"]) window["game_info"].show() def hide_window(button, *args): window["game_info"].hide() return True def accept_new_properties(button, *args): gamemodel = gameDic[gamewidget.cur_gmwidg()] gamemodel["Event"] = window["event_entry"].get_text() gamemodel["Site"] = window["site_entry"].get_text() gamemodel["Round"] = window["round_spinbutton"].get_value() gamemodel["Year"] = window["game_info_calendar"].get_date()[0] gamemodel["Month"] = window["game_info_calendar"].get_date()[1] + 1 gamemodel["Day"] = window["game_info_calendar"].get_date()[2] window["game_info"].hide() return True window["game_info"].connect("delete-event", hide_window) window["game_info_cancel_button"].connect("clicked", hide_window) window["game_info_ok_button"].connect("clicked", accept_new_properties) | db0c55ec84ea56d40654af445f29b75c71129dd2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5339/db0c55ec84ea56d40654af445f29b75c71129dd2/Main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
4738,
21,
67,
10014,
261,
6587,
4672,
7920,
2284,
273,
7920,
40,
335,
63,
13957,
6587,
18,
1397,
67,
23336,
30902,
75,
1435,
65,
2742,
9614,
2575,
67,
4099,
6,
8009,
542,
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,
603,
67,
4738,
21,
67,
10014,
261,
6587,
4672,
7920,
2284,
273,
7920,
40,
335,
63,
13957,
6587,
18,
1397,
67,
23336,
30902,
75,
1435,
65,
2742,
9614,
2575,
67,
4099,
6,
8009,
542,
67,
... |
if os.path.isfile(each + app): return True | if os.path.isfile(each + app): return True | def appcheck(app): path = os.getenv('PATH') path = path.replace(':', '/ ') path = path.split(' ') for each in path: if os.path.isfile(each + app): return True return False | b81255317d66ac5faf074e5bddef0919e248972b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12044/b81255317d66ac5faf074e5bddef0919e248972b/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
595,
1893,
12,
2910,
4672,
589,
273,
1140,
18,
588,
3074,
2668,
4211,
6134,
589,
273,
589,
18,
2079,
2668,
30,
2187,
1173,
8624,
589,
273,
589,
18,
4939,
2668,
8624,
364,
1517,
316,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
595,
1893,
12,
2910,
4672,
589,
273,
1140,
18,
588,
3074,
2668,
4211,
6134,
589,
273,
589,
18,
2079,
2668,
30,
2187,
1173,
8624,
589,
273,
589,
18,
4939,
2668,
8624,
364,
1517,
316,
58... |
class Stack: x = MARGIN y = MARGIN def __init__(self, game): self.game = game self.cards = [] def __repr__(self): return "<Stack at (%d, %d)>" % (self.x, self.y) def reset(self): self.cards = [] def acceptable(self, cards): return 1 def accept(self, card): self.cards.append(card) card.onclick(self.clickhandler) card.onmove(self.movehandler) card.onrelease(self.releasehandler) card.ondouble(self.doublehandler) card.tkraise() self.placecard(card) def placecard(self, card): card.moveto(self.x, self.y) def showtop(self): if self.cards: self.cards[-1].showface() def clickhandler(self, event): pass def movehandler(self, event): pass def releasehandler(self, event): pass def doublehandler(self, event): pass class PoolStack(Stack): def __init__(self, game): Stack.__init__(self, game) self.bottom = Bottom(self) def releasehandler(self, event): | class OpenStack(Stack): def usermovehandler(self, cards): card = cards[0] stack = self.game.closeststack(card) if not stack or stack is self or not stack.acceptable(cards): Stack.usermovehandler(self, cards) else: for card in cards: self.delete(card) stack.add(card) self.game.wincheck() def userdoubleclickhandler(self): | def randperm(n): r = range(n) x = [] while r: i = random.choice(r) x.append(i) r.remove(i) return x | 20ce2dd6aa77ea628b49c0c6b820d66211a9a61d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20ce2dd6aa77ea628b49c0c6b820d66211a9a61d/solitaire.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5605,
12160,
12,
82,
4672,
436,
273,
1048,
12,
82,
13,
619,
273,
5378,
1323,
436,
30,
277,
273,
2744,
18,
11569,
12,
86,
13,
619,
18,
6923,
12,
77,
13,
436,
18,
4479,
12,
77,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5605,
12160,
12,
82,
4672,
436,
273,
1048,
12,
82,
13,
619,
273,
5378,
1323,
436,
30,
277,
273,
2744,
18,
11569,
12,
86,
13,
619,
18,
6923,
12,
77,
13,
436,
18,
4479,
12,
77,
13,
... |
el = self.document.getroot().cssselect('.bloc-video-edito h2')[0] | el = self.document.getroot().cssselect('div.bloc-produit-haut h1')[0] | def get_title(self): el = self.document.getroot().cssselect('.bloc-video-edito h2')[0] if el is not None: return unicode(el.text.strip()) else: return None | d4ecc0c5de4690c529d24afcdd6d285b2a2144f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7471/d4ecc0c5de4690c529d24afcdd6d285b2a2144f0/video.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2649,
12,
2890,
4672,
415,
273,
365,
18,
5457,
18,
588,
3085,
7675,
5212,
4025,
2668,
2892,
18,
70,
1829,
17,
11776,
305,
17,
3395,
322,
366,
21,
6134,
63,
20,
65,
309,
415,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2649,
12,
2890,
4672,
415,
273,
365,
18,
5457,
18,
588,
3085,
7675,
5212,
4025,
2668,
2892,
18,
70,
1829,
17,
11776,
305,
17,
3395,
322,
366,
21,
6134,
63,
20,
65,
309,
415,... |
index = hash(key) % len(servers) first_host, first_port = servers.pop(index) | while len(servers) > 0: host, port = pick_server(key, servers) | def get_db(self, key): servers = list(self.servers) | fe41b1369e3b0c60b358a2596db118215c47dc7f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10481/fe41b1369e3b0c60b358a2596db118215c47dc7f/tyrant_client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1966,
12,
2890,
16,
498,
4672,
7084,
273,
666,
12,
2890,
18,
14247,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1966,
12,
2890,
16,
498,
4672,
7084,
273,
666,
12,
2890,
18,
14247,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
tools.convert_csv_import(cr, m, os.path.basename(xml), fp.read(), idref, noupdate=True) | tools.convert_csv_import(cr, m, os.path.basename(xml), fp.read(), idref, mode=mode, noupdate=True) | def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs): # **kwargs is passed directly to convert_xml_import if not status: status = {} status = status.copy() package_todo = [] statusi = 0 pool = pooler.get_pool(cr.dbname) # 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 and perform_checks: 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 perform_checks 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() | 2b1ecd58d65406803cdc279c6cfc52635b945107 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/2b1ecd58d65406803cdc279c6cfc52635b945107/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
2978,
67,
4660,
12,
3353,
16,
2667,
16,
1267,
33,
7036,
16,
3073,
67,
12366,
33,
5510,
16,
2826,
4333,
4672,
468,
2826,
4333,
353,
2275,
5122,
358,
1765,
67,
2902,
67,
5666,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
2978,
67,
4660,
12,
3353,
16,
2667,
16,
1267,
33,
7036,
16,
3073,
67,
12366,
33,
5510,
16,
2826,
4333,
4672,
468,
2826,
4333,
353,
2275,
5122,
358,
1765,
67,
2902,
67,
5666,
... |
data = '%s%s' % (w.backto(), __groups_actions(title)) | data = w.page_body_start(uri, http_user, ctxtnav, title, False) | def skel(req, name, sure = False, apply_skel = configuration.users.default_skel): """ TO BE IMPLEMENTED ! reapply a user's skel with confirmation.""" users.reload() profiles.reload() groups.reload() title = _("Skeleton reapplying for group %s") % name data = '%s%s' % (w.backto(), __groups_actions(title)) if not sure: allusers = u.UsersList(configuration) allgroups = g.GroupsList(configuration, allusers) description = _('''This will reset the desktops, icons and menus of all members of the group, according to the content of the skel you choose. This will NOT alter any of the user personnal data, nor the group shared data.''') pri_group = allgroups.groups[allusers.users[users.UsersList.login_to_uid(login)]['gid']]['name'] # liste des skels du profile en cours. def filter_skels(pri_group, sk_list): ''' TODO: to be converted to licorn model if pri_group == configuration.mNames['RESPONSABLES_GROUP']: return filter(lambda x: x.rfind("/%s/" % configuration.mNames['RESPONSABLES_GROUP']) != -1, sk_list) elif pri_group == configuration.mNames['USAGERS_GROUP']: return filter(lambda x: x.rfind("/%s/" % configuration.mNames['USAGERS_GROUP']) != -1, sk_list) else: ''' return sk_list form_options = _("Which skel do you wish to reapply to members of this group? %s") \ % w.select("apply_skel", filter_skels(pri_group, configuration.users.skels), func = os.path.basename) data += w.question( _("Are you sure you want to reapply this skel to all of the members of %s?") % login, description, yes_values = [ _("Apply") + ' >>', "/users/skel/%s/sure" % login, _("A") ], no_values = [ '<< ' + _("Cancel"), "/groups/list", _("N") ], form_options = form_options) return w.page(title, data) else: # we are sure, do it ! command = [ "sudo", "mod", "user", "--quiet", "--no-colors", "--login", login, '--apply-skel', skel ] return w.page(title, data + w.run(command, req, successfull_redirect = "/groups/list", err_msg = _("Failed to apply skel %s to members of group %s.") % (os.path.basename(apply_skel), login))) | e74a9415e90d5a3af83e10abed2f1876ae4e528a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/e74a9415e90d5a3af83e10abed2f1876ae4e528a/groups.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4343,
292,
12,
3658,
16,
508,
16,
3071,
273,
1083,
16,
2230,
67,
7771,
292,
273,
1664,
18,
5577,
18,
1886,
67,
7771,
292,
4672,
3536,
8493,
9722,
15694,
28485,
6404,
401,
283,
9010,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4343,
292,
12,
3658,
16,
508,
16,
3071,
273,
1083,
16,
2230,
67,
7771,
292,
273,
1664,
18,
5577,
18,
1886,
67,
7771,
292,
4672,
3536,
8493,
9722,
15694,
28485,
6404,
401,
283,
9010,
27... |
page.category = 'BUILD' | page.category = tr('BUILD') | def help_response(char, arguments, response): global pages if response.button == 0: return page = pages.find(char.account.name) # Delete previous page if page and 5 in response.switches: pages.remove(page) char.socket.sysmessage('Your page has been removed.', 0x846) char.log(LOG_MESSAGE, "%s (%s) deletes his gm page.\n" % (char.name, page.account)) return if len(response.text[1]) + len(response.text[2]) + len(response.text[3]) + len(response.text[4]) == 0: char.socket.sysmessage('You have to enter a message for your page.', 0x846) onHelp(char) return # Gather information message = (response.text[1], response.text[2], response.text[3], response.text[4]) created = time.time() if not page: page = Page(char) page.message = message page.created = created if 1 in response.switches: page.category = 'BUG' elif 2 in response.switches: page.category = 'STUCK' elif 3 in response.switches: page.category = 'GAMEPLAY' else: page.category = 'BUILD' pages.add(page, True) char.socket.sysmessage('Your page has been queued.', 0x846) | d8b7b7c1b9e926bd4732e104ef67fe1e1cc770bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/d8b7b7c1b9e926bd4732e104ef67fe1e1cc770bf/pages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2809,
67,
2740,
12,
3001,
16,
1775,
16,
766,
4672,
2552,
4689,
225,
309,
766,
18,
5391,
422,
374,
30,
327,
225,
1363,
273,
4689,
18,
4720,
12,
3001,
18,
4631,
18,
529,
13,
225,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2809,
67,
2740,
12,
3001,
16,
1775,
16,
766,
4672,
2552,
4689,
225,
309,
766,
18,
5391,
422,
374,
30,
327,
225,
1363,
273,
4689,
18,
4720,
12,
3001,
18,
4631,
18,
529,
13,
225,
468,
... |
This is a third.""", """ P>|this is one paragraph. | P>|This is another. | P>|This is a third. |""") | This is a third.""", '<para>this is one paragraph.</para>'+ '<para>This is another.</para><para>This is a '+ 'third.</para>') | def testPara(self): self.checkParse(""" this is one paragraph. | 1bf9a33460557ea6e40d8a5a22f69b20e446dccf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/1bf9a33460557ea6e40d8a5a22f69b20e446dccf/epytext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
23529,
12,
2890,
4672,
365,
18,
1893,
3201,
2932,
3660,
333,
353,
1245,
10190,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
23529,
12,
2890,
4672,
365,
18,
1893,
3201,
2932,
3660,
333,
353,
1245,
10190,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if get_verbose() >= 2: print "R[%02d].m_col %s"%(r+1,self.hex_str_vector(P)) K = KeyExpansion(K,r+1) if get_verbose() >= 2: print "R[%02d].k_sch %s"%(r+1,self.hex_str_vector(K)) | if get_verbose() >= 2: print "R[%02d].m_col %s"%(r+1, self.hex_str_vector(P)) K = KeyExpansion(K, r+1) if get_verbose() >= 2: print "R[%02d].k_sch %s"%(r+1, self.hex_str_vector(K)) | def __call__(self, P, K): r""" Encrypts the plaintext $P$ using the key $K$. | 26b5b14a2a46b23848ccefac3b41425cf353e86a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/26b5b14a2a46b23848ccefac3b41425cf353e86a/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
453,
16,
1475,
4672,
436,
8395,
8594,
20261,
326,
11917,
271,
52,
8,
1450,
326,
498,
271,
47,
8,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
453,
16,
1475,
4672,
436,
8395,
8594,
20261,
326,
11917,
271,
52,
8,
1450,
326,
498,
271,
47,
8,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return _Nstd(x, axis) | N = asarray(x).shape[axis] return _Nstd(x, axis)*sqrt(N/(N-1.)) | def std(x, axis=0): return _Nstd(x, axis) | 5b270e2f541c763012e0acd4fa5e23933029b9db /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14925/5b270e2f541c763012e0acd4fa5e23933029b9db/mlab.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2044,
12,
92,
16,
2654,
33,
20,
4672,
423,
273,
10455,
12,
92,
2934,
4867,
63,
4890,
65,
327,
389,
50,
5084,
12,
92,
16,
2654,
17653,
24492,
12,
50,
19,
12,
50,
17,
21,
18,
3719,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2044,
12,
92,
16,
2654,
33,
20,
4672,
423,
273,
10455,
12,
92,
2934,
4867,
63,
4890,
65,
327,
389,
50,
5084,
12,
92,
16,
2654,
17653,
24492,
12,
50,
19,
12,
50,
17,
21,
18,
3719,
... |
def post(self): | def get(self): | def post(self): """ Called when a new ride needs to be added to the database. Probably with all of this data it should be done as a form post. Arguments: - `self`: Web Arguments: - max_passengers - num_passengers - driver - start_point_title - start_point_lat - start_point_long - destination_title - destination_lat - destination_long - part_of_day - ToD - contact - ridecomments - driver """ | 77683a51337178ae30286b6a777530baaa315d6d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9768/77683a51337178ae30286b6a777530baaa315d6d/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
3536,
11782,
1347,
279,
394,
436,
831,
4260,
358,
506,
3096,
358,
326,
2063,
18,
14610,
6906,
598,
777,
434,
333,
501,
518,
1410,
506,
2731,
487,
279,
646,
1603,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
4672,
3536,
11782,
1347,
279,
394,
436,
831,
4260,
358,
506,
3096,
358,
326,
2063,
18,
14610,
6906,
598,
777,
434,
333,
501,
518,
1410,
506,
2731,
487,
279,
646,
1603,
1... |
result = self._decoded_text | def read(self, n=None): if n is None: n = -1 decoder = self._decoder or self._get_decoder() result = self._decoded_text if n < 0: result += decoder.decode(self.buffer.read(), True) self._decoded_text = "" self._snapshot = None return result else: while len(result) < n: input_chunk, decoded = self._read_chunk() result += decoded if not input_chunk: break self._decoded_text = result[n:] return result[:n] | 1e18b9ecf014bdc7f0b206c49c140c4f21edcb70 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/1e18b9ecf014bdc7f0b206c49c140c4f21edcb70/io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
290,
33,
7036,
4672,
309,
290,
353,
599,
30,
290,
273,
300,
21,
8320,
273,
365,
6315,
21070,
578,
365,
6315,
588,
67,
21070,
1435,
309,
290,
411,
374,
30,
563,
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,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
290,
33,
7036,
4672,
309,
290,
353,
599,
30,
290,
273,
300,
21,
8320,
273,
365,
6315,
21070,
578,
365,
6315,
588,
67,
21070,
1435,
309,
290,
411,
374,
30,
563,
101... | |
idx1 = self.il.Add(PaletteMapping.bitmapForComponent(className, 'Component')) | idx1 = self.il.Add(PaletteStore.bitmapForComponent(className, 'Component')) | def refreshCtrl(self): #if self.opened: return | 2cdb4eebf12a06661b772677eac5c3fafa4757a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/2cdb4eebf12a06661b772677eac5c3fafa4757a9/DataView.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
12418,
12,
2890,
4672,
468,
430,
365,
18,
25304,
30,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
12418,
12,
2890,
4672,
468,
430,
365,
18,
25304,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.assertEqual(all[2 - 2 * flipped], (sub2_path, ["link"], ["tmp3"])) for root, dirs, files in os.walk(walk_path, followlinks=True): if root == link_path: self.assertEqual(dirs, []) self.assertEqual(files, ["tmp4"]) break else: self.fail("Didn't follow symlink with followlinks=True") | self.assertEqual(all[2 - 2 * flipped], sub2_tree) if hasattr(os, "symlink"): for root, dirs, files in os.walk(walk_path, followlinks=True): if root == link_path: self.assertEqual(dirs, []) self.assertEqual(files, ["tmp4"]) break else: self.fail("Didn't follow symlink with followlinks=True") def tearDown(self): | def test_traversal(self): import os from os.path import join | bdae60942f53ae9ccd2a45cbf2f4b752564aedde /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/bdae60942f53ae9ccd2a45cbf2f4b752564aedde/test_os.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
31750,
287,
12,
2890,
4672,
1930,
1140,
628,
1140,
18,
803,
1930,
1233,
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,
1842,
67,
31750,
287,
12,
2890,
4672,
1930,
1140,
628,
1140,
18,
803,
1930,
1233,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
data = MCLPData(self, solc, i, lastv, vals[0], vals[1], vals[2]) | data = MCSOLData(self, solc, i, lastv, vals[0], vals[1], vals[2]) | def __init__(self, m, sol, solc, channel): gui_list.List.__init__(self, "SOLPARMS for " + m.name + " channel " + str(channel), [ ("Name", 250), ("Value", 250) ]) self.sol = sol self.solc = solc self.channel = channel i = 0 j = 0 rv = True v = [ 0 ] while (rv): lastv = v[0] rv = solc.get_val(i, v) if (rv): vals = rv.split(" ", 2) if (len(vals) == 3): # Valid parm if (vals[1] == "integer"): w = [ 0 ] x = [ "" ] err = OpenIPMI.solconfig_enum_val(i, 0, w, x) if (err != OpenIPMI.enosys): vals[1] = "enum" pass pass data = MCLPData(self, solc, i, lastv, vals[0], vals[1], vals[2]) if (v[0] == 0): title = vals[0] else: x = [ "" ] err = OpenIPMI.solconfig_enum_idx(i, lastv, x) if (err): title = vals[0] + "[" + str(lastv) + "]" else: title = vals[0] + "[" + x[0] + "]" pass pass if (vals[1] == "enum"): nval = [ 0 ] sval = [ "" ] OpenIPMI.solconfig_enum_val(data.parm, int(vals[2]), nval, sval) value = sval[0] pass else: value = vals[2] pass | 8e216799a18770fdffc0196128c80f9737f56541 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3867/8e216799a18770fdffc0196128c80f9737f56541/_mc_solparm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
312,
16,
3704,
16,
3704,
71,
16,
1904,
4672,
13238,
67,
1098,
18,
682,
16186,
2738,
972,
12,
2890,
16,
315,
19815,
2778,
3537,
364,
315,
397,
312,
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,
1001,
2738,
972,
12,
2890,
16,
312,
16,
3704,
16,
3704,
71,
16,
1904,
4672,
13238,
67,
1098,
18,
682,
16186,
2738,
972,
12,
2890,
16,
315,
19815,
2778,
3537,
364,
315,
397,
312,
18,
... |
def process_multistmt(self, vars, pseudo_docstring): | def process_multi_stmt(self, stmt1, rest, pseudo_docstring): | def process_multistmt(self, vars, pseudo_docstring): """ The statement handler for a set of semicolon-separated statements, such as: >>> x=1; y=2; z=3 This handler wraps the individual statements in a suite, and delegates to C{process_suite}. """ # Get a list of the small-statements. small_stmts = ([vars['stmt1']] + [s for s in vars['rest'] if s[0] == symbol.small_stmt]) # Wrap them up to look like a suite. stmts = [[symbol.stmt, [symbol.simple_stmt, s, [token.NEWLINE, '']]] for s in small_stmts] suite = [symbol.suite] + stmts | 623254ead6d3654b739ef3e3eba393de6722bf4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/623254ead6d3654b739ef3e3eba393de6722bf4f/docparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
7027,
67,
10589,
12,
2890,
16,
3480,
21,
16,
3127,
16,
12454,
67,
24675,
4672,
3536,
1021,
3021,
1838,
364,
279,
444,
434,
23682,
17,
24622,
6317,
16,
4123,
487,
30,
225,
408... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
7027,
67,
10589,
12,
2890,
16,
3480,
21,
16,
3127,
16,
12454,
67,
24675,
4672,
3536,
1021,
3021,
1838,
364,
279,
444,
434,
23682,
17,
24622,
6317,
16,
4123,
487,
30,
225,
408... |
def _filter(list, skip): result = [] for item in list: if item not in skip: result.append(item) return result | def _filter(flist, skip): return list(ifilterfalse(skip.__contains__, flist)) | def _filter(list, skip): result = [] for item in list: if item not in skip: result.append(item) return result | 114ba69ec79c13b96191944cf6b6fc03ffabd71d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/114ba69ec79c13b96191944cf6b6fc03ffabd71d/filecmp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2188,
12,
74,
1098,
16,
2488,
4672,
327,
666,
12,
430,
1088,
5743,
12,
7457,
16186,
12298,
972,
16,
284,
1098,
3719,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
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,
2188,
12,
74,
1098,
16,
2488,
4672,
327,
666,
12,
430,
1088,
5743,
12,
7457,
16186,
12298,
972,
16,
284,
1098,
3719,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if verbose: print >>sys.stderr, "indexing ..." | def ligolw_burca2(database, likelihood_ratio, verbose = False): """ Assigns likelihood ratio values to excess power coincidences. database is pylal.SnglBurstUtils.CoincDatabase instance, and likelihood_ratio is a LikelihoodRatio class instance. """ # # Find document parts. # if None in (database.coinc_def_table, database.coinc_table, database.time_slide_table): raise ValueError, "database appears to be missing coinc tables" if verbose: print >>sys.stderr, "indexing ..." definer_ids = set([database.coinc_def_table.get_coinc_def_id([lsctables.SnglBurstTable.tableName], create_new = False)]) try: definer_ids.add(database.coinc_def_table.get_coinc_def_id([lsctables.SnglBurstTable.tableName, lsctables.SimBurstTable.tableName], create_new = False)) except KeyError: # there appear to be no injections in this file pass time_slides = database.time_slide_table.as_dict() # # Iterate over coincs, assigning likelihood ratios to burst+burst # coincs, and sim+burst coincs if the document contains them. # if verbose: print >>sys.stderr, "computing likelihood ratios ..." n_coincs = len(coinc_table) cursor = database.connection.cursor() for n, (coinc_event_id, coinc_def_id, time_slide_id) in enumerate(database.connection.cursor().execute("SELECT coinc_event_id, coinc_def_id, time_slide_id FROM coinc_event")): if verbose and not n % 200: print >>sys.stderr, "\t%.1f%%\r" % (100.0 * n / n_coincs), if coinc_def_id in definer_ids: # retrieve sngl_burst events, sorted by instrument # name events = map(database.sngl_burst_table._row_from_cols, cursor.execute(""" | fff526a4a6763c8941da7a474ff199cd27bc5bc1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/fff526a4a6763c8941da7a474ff199cd27bc5bc1/ligolw_burca2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16917,
355,
91,
67,
70,
295,
5353,
22,
12,
6231,
16,
18067,
67,
9847,
16,
3988,
273,
1083,
4672,
3536,
12093,
87,
18067,
7169,
924,
358,
23183,
7212,
13170,
13478,
2369,
18,
2063,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16917,
355,
91,
67,
70,
295,
5353,
22,
12,
6231,
16,
18067,
67,
9847,
16,
3988,
273,
1083,
4672,
3536,
12093,
87,
18067,
7169,
924,
358,
23183,
7212,
13170,
13478,
2369,
18,
2063,
353,
... | |
Verifies the results of all_graph_colorings in three ways: 1) all colorings are unique 2) number of m-colorings is `P(m)` (where `P` is the chromatic polynomial of the graph being tested) 3) colorings are valid -- that is, that no two vertices of the same color share an edge. | Verifies the results of ``all_graph_colorings()`` in three ways: polynomial of the graph being tested) the same color share an edge. | def random_all_graph_colorings(self,tests = 1000): r""" Verifies the results of all_graph_colorings in three ways: 1) all colorings are unique 2) number of m-colorings is `P(m)` (where `P` is the chromatic polynomial of the graph being tested) 3) colorings are valid -- that is, that no two vertices of the same color share an edge. | 0d7c50e7966c0248757876bb79ed98d62c5f0550 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/0d7c50e7966c0248757876bb79ed98d62c5f0550/graph_coloring.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2744,
67,
454,
67,
4660,
67,
3266,
899,
12,
2890,
16,
16341,
273,
4336,
4672,
436,
8395,
6160,
5032,
326,
1686,
434,
777,
67,
4660,
67,
3266,
899,
316,
8925,
16226,
30,
404,
13,
777,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2744,
67,
454,
67,
4660,
67,
3266,
899,
12,
2890,
16,
16341,
273,
4336,
4672,
436,
8395,
6160,
5032,
326,
1686,
434,
777,
67,
4660,
67,
3266,
899,
316,
8925,
16226,
30,
404,
13,
777,
... |
createReftestProfile(profileDir) | createReftestProfile(options, profileDir) | def main(): parser = OptionParser() # we want to pass down everything from automation.__all__ addCommonOptions(parser, defaults=dict(zip(automation.__all__, [getattr(automation, x) for x in automation.__all__]))) parser.add_option("--appname", action = "store", type = "string", dest = "app", default = os.path.join(SCRIPT_DIRECTORY, automation.DEFAULT_APP), help = "absolute path to application, overriding default") parser.add_option("--extra-profile-file", action = "append", dest = "extraProfileFiles", default = [], help = "copy specified files/dirs to testing profile") parser.add_option("--leak-threshold", action = "store", type = "int", dest = "leakThreshold", default = 0, help = "fail if the number of bytes leaked through " "refcounted objects (or bytes in classes with " "MOZ_COUNT_CTOR and MOZ_COUNT_DTOR) is greater " "than the given number") options, args = parser.parse_args() if len(args) != 1: print >>sys.stderr, "No reftest.list specified." sys.exit(1) options.app = getFullPath(options.app) if not os.path.exists(options.app): print """Error: Path %(app)s doesn't exist. | 0d7034fc6862c2246bd1e5f34fe518b2ade75133 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/0d7034fc6862c2246bd1e5f34fe518b2ade75133/runreftest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2082,
273,
18862,
1435,
225,
468,
732,
2545,
358,
1342,
2588,
7756,
628,
17539,
16186,
454,
972,
527,
6517,
1320,
12,
4288,
16,
3467,
33,
1576,
12,
4450,
12,
5854,
11978,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2082,
273,
18862,
1435,
225,
468,
732,
2545,
358,
1342,
2588,
7756,
628,
17539,
16186,
454,
972,
527,
6517,
1320,
12,
4288,
16,
3467,
33,
1576,
12,
4450,
12,
5854,
11978,
16... |
def BboxFromDatasec(string, stageName = 'lsst.ip.isr.bboxfromdatasec'): c = re.compile('^(\d)\:(\d)\,(\d)\:(\d)$') m = c.match(string) if m: startCol, endCol, startRow, endRow = m.groups() startCol -= floor((1 + 0.5 - afwImage.PixelZeroPos)) startRow -= floor((1 + 0.5 - afwImage.PixelZeroPos)) else: raise pexExcept.LsstException, '%s : Cannot parse %s' % (stageName, string) bbox = afwImage.BBox(afwImage.PointI(startCol, startRow), endCol-startCol, endRow-startRow) return bbox | def BboxFromDatasec(string, stageName = 'lsst.ip.isr.bboxfromdatasec'): c = re.compile('^(\d)\:(\d)\,(\d)\:(\d)$') m = c.match(string) if m: startCol, endCol, startRow, endRow = m.groups() # Beware the FITS convention startCol -= floor((1 + 0.5 - afwImage.PixelZeroPos)) startRow -= floor((1 + 0.5 - afwImage.PixelZeroPos)) else: raise pexExcept.LsstException, '%s : Cannot parse %s' % (stageName, string) bbox = afwImage.BBox(afwImage.PointI(startCol, startRow), endCol-startCol, endRow-startRow) return bbox | 9178ba52aa57399136f285c8a065b1707c990801 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6526/9178ba52aa57399136f285c8a065b1707c990801/IsrStages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
605,
2147,
1265,
751,
3321,
12,
1080,
16,
6009,
461,
273,
296,
3251,
334,
18,
625,
18,
291,
86,
18,
20737,
2080,
892,
3321,
11,
4672,
225,
276,
273,
283,
18,
11100,
2668,
66,
4713,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
605,
2147,
1265,
751,
3321,
12,
1080,
16,
6009,
461,
273,
296,
3251,
334,
18,
625,
18,
291,
86,
18,
20737,
2080,
892,
3321,
11,
4672,
225,
276,
273,
283,
18,
11100,
2668,
66,
4713,
7... | |
self.check = CheckButtons(self.axFilt, ('Filter','Zero-Phase','Spectrogram','Public Event'),(self.flagFilt,self.flagFiltZPH,self.flagSpectrogram,self.flagPublicEvent)) | self.check = CheckButtons(self.axFilt, ('Filter','Zero-Phase','Spectrogram','Public Event'),(False,False,self.flagSpectrogram,False)) | def addFiltButtons(self): #add filter buttons self.axFilt = self.fig.add_axes([0.22, 0.02, 0.15, 0.15],frameon=False,axisbg='lightgrey') self.check = CheckButtons(self.axFilt, ('Filter','Zero-Phase','Spectrogram','Public Event'),(self.flagFilt,self.flagFiltZPH,self.flagSpectrogram,self.flagPublicEvent)) self.check.on_clicked(self.funcFilt) self.axFiltTyp = self.fig.add_axes([0.40, 0.02, 0.15, 0.15],frameon=False,axisbg='lightgrey') self.radio = RadioButtons(self.axFiltTyp, ('Bandpass', 'Bandstop', 'Lowpass', 'Highpass'),activecolor='k') self.radio.on_clicked(self.funcFiltTyp) | 4e8f536428831ce605c623aa5fc17a6b33b5b712 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10346/4e8f536428831ce605c623aa5fc17a6b33b5b712/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
42,
4526,
14388,
12,
2890,
4672,
468,
1289,
1034,
9502,
365,
18,
651,
42,
4526,
273,
365,
18,
470,
18,
1289,
67,
10855,
3816,
20,
18,
3787,
16,
374,
18,
3103,
16,
374,
18,
3600,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
42,
4526,
14388,
12,
2890,
4672,
468,
1289,
1034,
9502,
365,
18,
651,
42,
4526,
273,
365,
18,
470,
18,
1289,
67,
10855,
3816,
20,
18,
3787,
16,
374,
18,
3103,
16,
374,
18,
3600,... |
icmp.checksum = ip.cksum() | icmp.checksum = icmp_packet.calc_checksum() ip.len = len(ip.bytes) + len(icmp.bytes) + len(echo.bytes) ip.checksum = ip.calc_checksum() | def test_icmpv4_ping(self): ip = ipv4() ip.version = 4 ip.hlen = 5 ip.tos = 0 ip.length = 84 ip.id = 1234 ip.flags = 0 ip.offset = 0 ip.ttl = 64 ip.protocol = IPPROTO_ICMP ip.src = inet_atol("127.0.0.1") ip.dst = inet_atol("127.0.0.1") | 1b9c113436714ef740f07a190debb88532218206 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5910/1b9c113436714ef740f07a190debb88532218206/icmpv4test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
335,
1291,
90,
24,
67,
1382,
12,
2890,
4672,
2359,
273,
9205,
24,
1435,
2359,
18,
1589,
273,
1059,
2359,
18,
76,
1897,
273,
1381,
2359,
18,
14627,
273,
374,
2359,
18,
2469,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
335,
1291,
90,
24,
67,
1382,
12,
2890,
4672,
2359,
273,
9205,
24,
1435,
2359,
18,
1589,
273,
1059,
2359,
18,
76,
1897,
273,
1381,
2359,
18,
14627,
273,
374,
2359,
18,
2469,
... |
def set_uriprefix(self, prefix): """ Outputs the document, adds the given prefix to with the relative uris. XXX Rewrite with walk. """ s = u'' for child in self.children: if isinstance(child, Element): s += self._set_uriprefix(child, prefix) else: s += unicode(child) return s def _set_uriprefix(self, node, prefix): if isinstance(node, (XML.Raw, XML.Comment)): return unicode(node) s = u'<%s' % node.qname for attribute in node.attributes: if hasattr(attribute, 'set_uriprefix'): s += ' ' + attribute.set_uriprefix(prefix) else: s += ' ' + unicode(attribute) s += u'>' for child in node.children: s += self._set_uriprefix(child, prefix) s += node.get_closetag() return s | def set_uriprefix(self, prefix): """ Outputs the document, adds the given prefix to with the relative uris. | d667bd473319049b4dbaef7603f61f10aec6674c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d667bd473319049b4dbaef7603f61f10aec6674c/XHTML.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
295,
625,
266,
904,
12,
2890,
16,
1633,
4672,
3536,
26168,
326,
1668,
16,
4831,
326,
864,
1633,
358,
598,
326,
3632,
21476,
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,
295,
625,
266,
904,
12,
2890,
16,
1633,
4672,
3536,
26168,
326,
1668,
16,
4831,
326,
864,
1633,
358,
598,
326,
3632,
21476,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
proc = subprocess.Popen(all, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE, cwd=cwd, env=clean_environ(self.environ)) | proc = Popen(all, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE, cwd=cwd, env=environ) | def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | c39d56b5208d2509cb30fe1ab8fb1f4136b925f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8710/c39d56b5208d2509cb30fe1ab8fb1f4136b925f2/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
2728,
16,
380,
1968,
16,
2826,
9987,
4672,
3536,
1939,
326,
1296,
16,
598,
326,
864,
1775,
18,
225,
1021,
12176,
4263,
10335,
1237,
848,
1240,
3476,
17,
24622,
1775,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1086,
12,
2890,
16,
2728,
16,
380,
1968,
16,
2826,
9987,
4672,
3536,
1939,
326,
1296,
16,
598,
326,
864,
1775,
18,
225,
1021,
12176,
4263,
10335,
1237,
848,
1240,
3476,
17,
24622,
1775,
... |
return [self(i) for i in range(1, 1+2**(self.cartanType.n))] | return [self(Integer(i)) for i in range(1, 1+2**(self.cartanType.n))] | def list(self): return [self(i) for i in range(1, 1+2**(self.cartanType.n))] | 159c30089bab1b13af9e1095b1ee2b33969b7e53 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/159c30089bab1b13af9e1095b1ee2b33969b7e53/spins.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
12,
2890,
4672,
327,
306,
2890,
12,
77,
13,
364,
277,
316,
1048,
12,
21,
16,
404,
15,
22,
636,
12,
2890,
18,
11848,
304,
559,
18,
82,
3719,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
666,
12,
2890,
4672,
327,
306,
2890,
12,
77,
13,
364,
277,
316,
1048,
12,
21,
16,
404,
15,
22,
636,
12,
2890,
18,
11848,
304,
559,
18,
82,
3719,
65,
2,
-100,
-100,
-100,
-100,
-100... |
self.options["%s.actions-pre" % self.program].append(value) | program.get("actions-pre").append(value) | def handleOption(self, sec, opt, value): if sec in self.options: # Mirrors or lists to handle | e3d00bde989431745d3c2d68912693a977e97fa9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2406/e3d00bde989431745d3c2d68912693a977e97fa9/xmlreport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
1895,
12,
2890,
16,
1428,
16,
2153,
16,
460,
4672,
309,
1428,
316,
365,
18,
2116,
30,
468,
490,
27026,
578,
6035,
358,
1640,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
1895,
12,
2890,
16,
1428,
16,
2153,
16,
460,
4672,
309,
1428,
316,
365,
18,
2116,
30,
468,
490,
27026,
578,
6035,
358,
1640,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
def testCreateAndDeleteEmptyDocumentAtomTitle(self): self.new_entry.title = gdata.atom.Title(text=self.TITLE) created_entry = self.doclist.Post(self.new_entry, '/feeds/documents/private/full') self.doclist.Delete(created_entry.GetEditLink().href) self.assertEqual(created_entry.title.text, self.TITLE) self.assertEqual(created_entry.category[0].label, 'document') | def testCreateAndDeleteEmptyDocumentAtomTitle(self): self.new_entry.title = gdata.atom.Title(text=self.TITLE) created_entry = self.doclist.Post(self.new_entry, '/feeds/documents/private/full') self.doclist.Delete(created_entry.GetEditLink().href) self.assertEqual(created_entry.title.text, self.TITLE) self.assertEqual(created_entry.category[0].label, 'document') | dcc46816af19bac967f4b588353a3ee4514dd5d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6580/dcc46816af19bac967f4b588353a3ee4514dd5d2/service_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1684,
1876,
2613,
1921,
2519,
3641,
4247,
12,
2890,
4672,
365,
18,
2704,
67,
4099,
18,
2649,
273,
314,
892,
18,
7466,
18,
4247,
12,
955,
33,
2890,
18,
14123,
13,
2522,
67,
4099,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1684,
1876,
2613,
1921,
2519,
3641,
4247,
12,
2890,
4672,
365,
18,
2704,
67,
4099,
18,
2649,
273,
314,
892,
18,
7466,
18,
4247,
12,
955,
33,
2890,
18,
14123,
13,
2522,
67,
4099,
... | |
self.log.verbose('Executing site admin command: %s' %command) result = shellCall(0,command,callbackFunction=self.sendOutput) | self.log.verbose( 'Executing site admin command: %s' % command ) result = shellCall( 0, command, callbackFunction = self.sendOutput ) | def submitJob(self,executableFile,jdl,proxy,localID): """ Method to submit job, should be overridden in sub-class. """ | 05f4284330e23d8d74d0844cee3520964f66a942 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/05f4284330e23d8d74d0844cee3520964f66a942/TorqueComputingElement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4879,
2278,
12,
2890,
16,
17751,
812,
16,
78,
5761,
16,
5656,
16,
3729,
734,
4672,
3536,
2985,
358,
4879,
1719,
16,
1410,
506,
11000,
316,
720,
17,
1106,
18,
3536,
2,
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,
4879,
2278,
12,
2890,
16,
17751,
812,
16,
78,
5761,
16,
5656,
16,
3729,
734,
4672,
3536,
2985,
358,
4879,
1719,
16,
1410,
506,
11000,
316,
720,
17,
1106,
18,
3536,
2,
-100,
-100,
-100,... |
for j in range(len(rmerge_info[dataset]['1_N'])): batch = int(rmerge_info[dataset]['2_BATCH'][j]) | for j in range(len(rmerge_info[dataset]['1_N_batch'])): batch = int(rmerge_info[dataset]['2_Batch_number'][j]) | def analyse(self): | 82c831407f7342907fe991f75ab507ec669c96c7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3290/82c831407f7342907fe991f75ab507ec669c96c7/CCP4IntraRadiationDamageDetector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31087,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31087,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
Check that answers agree over a range of precisions: | Check that answers agree over a range of precisions: | def padic_regulator(self, p, prec=20, height=None, check_hypotheses=True): r""" Computes the cyclotomic p-adic regulator of this curve. | 77e84d4f066518dc9af0ea574f4e195cfcaeb1a9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/77e84d4f066518dc9af0ea574f4e195cfcaeb1a9/ell_rational_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4627,
335,
67,
1574,
11775,
12,
2890,
16,
293,
16,
13382,
33,
3462,
16,
2072,
33,
7036,
16,
866,
67,
76,
879,
10370,
281,
281,
33,
5510,
4672,
436,
8395,
14169,
281,
326,
6143,
830,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4627,
335,
67,
1574,
11775,
12,
2890,
16,
293,
16,
13382,
33,
3462,
16,
2072,
33,
7036,
16,
866,
67,
76,
879,
10370,
281,
281,
33,
5510,
4672,
436,
8395,
14169,
281,
326,
6143,
830,
... |
pdbStreamFile.write('''SRCSRV: ini ------------------------------------------------\r\nVERSION=1\r\nSRCSRV: variables ------------------------------------------\r\nCVS_EXTRACT_CMD=%fnchdir%(%CVS_WORKINGDIR%)cvs.exe -d %fnvar%(%var2%) checkout -r %var4% %var3%\r\nCVS_EXTRACT_TARGET=%targ%\%var2%\%fnbksl%(%var3%)\%fnfile%(%var1%)\r\nCVS_WORKING_DIR=%targ%\%var2%\%fnbksl%(%var3%)\r\nMYSERVER=%CVSROOT%\r\nSRCSRVTRG=%CVS_WORKING_DIR%\r\nSRCSRVCMD=%CVS_EXTRACT_CMD%\r\nSRCSRV: source files ---------------------------------------\r\n''') | pdbStreamFile.write('''SRCSRV: ini ------------------------------------------------\r\nVERSION=1\r\nSRCSRV: variables ------------------------------------------\r\nCVS_EXTRACT_CMD=%fnchdir%(%CVS_WORKINGDIR%)cvs.exe -d %fnvar%(%var2%) checkout -r %var4% %var3%\r\nCVS_EXTRACT_TARGET=%targ%\%var2%\%fnbksl%(%var3%)\%fnfile%(%var1%)\r\nCVS_WORKING_DIR=%targ%\r\nMYSERVER=''') pdbStreamFile.write(cvs_root) pdbStreamFile.write('''\r\nSRCSRVTRG=%targ%\%fnbksl%(%var3%)\r\nSRCSRVCMD=%CVS_EXTRACT_CMD%\r\nSRCSRV: source files ---------------------------------------\r\n''') | def SourceIndex(fileStream, outputPath): """Takes a list of files, writes info to a data block in a .stream file""" # Creates a .pdb.stream file in the mozilla\objdir to be used for source indexing # Create the srcsrv data block that indexes the pdb file result = True pdbStreamFile = open(outputPath, "w") pdbStreamFile.write('''SRCSRV: ini ------------------------------------------------\r\nVERSION=1\r\nSRCSRV: variables ------------------------------------------\r\nCVS_EXTRACT_CMD=%fnchdir%(%CVS_WORKINGDIR%)cvs.exe -d %fnvar%(%var2%) checkout -r %var4% %var3%\r\nCVS_EXTRACT_TARGET=%targ%\%var2%\%fnbksl%(%var3%)\%fnfile%(%var1%)\r\nCVS_WORKING_DIR=%targ%\%var2%\%fnbksl%(%var3%)\r\nMYSERVER=%CVSROOT%\r\nSRCSRVTRG=%CVS_WORKING_DIR%\r\nSRCSRVCMD=%CVS_EXTRACT_CMD%\r\nSRCSRV: source files ---------------------------------------\r\n''') pdbStreamFile.write(fileStream) # can't do string interpolation because the source server also uses this and so there are % in the above pdbStreamFile.write("SRCSRV: end ------------------------------------------------\r\n\n") pdbStreamFile.close() return result | 237293f2635f411eb4f2d7a1758b1b6b20490cb7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11102/237293f2635f411eb4f2d7a1758b1b6b20490cb7/symbolstore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4998,
1016,
12,
768,
1228,
16,
19566,
4672,
3536,
11524,
279,
666,
434,
1390,
16,
7262,
1123,
358,
279,
501,
1203,
316,
279,
263,
3256,
585,
8395,
468,
10210,
279,
263,
17414,
18,
3256,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4998,
1016,
12,
768,
1228,
16,
19566,
4672,
3536,
11524,
279,
666,
434,
1390,
16,
7262,
1123,
358,
279,
501,
1203,
316,
279,
263,
3256,
585,
8395,
468,
10210,
279,
263,
17414,
18,
3256,
... |
@return: -1 - no more fixups otherwise returns the next | @return: -1 - no more fixups otherwise returns the next | def GetNextFixupEA(ea): """ Find next address with fixup information @param ea: current address @return: -1 - no more fixups otherwise returns the next address with fixup information """ return idaapi.get_next_fixup_ea(ea) | 507ea15b7a89e88e413b47a9fe03b571d956c14a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4773/507ea15b7a89e88e413b47a9fe03b571d956c14a/idc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2134,
8585,
416,
41,
37,
12,
24852,
4672,
3536,
4163,
1024,
1758,
598,
2917,
416,
1779,
225,
632,
891,
24164,
30,
783,
1758,
225,
632,
2463,
30,
300,
21,
300,
1158,
1898,
2917,
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,
968,
2134,
8585,
416,
41,
37,
12,
24852,
4672,
3536,
4163,
1024,
1758,
598,
2917,
416,
1779,
225,
632,
891,
24164,
30,
783,
1758,
225,
632,
2463,
30,
300,
21,
300,
1158,
1898,
2917,
18... |
path = get_path(self.sip_address, application, node, **kwargs) | path = get_path('sip:'+self.sip_address, application, node, **kwargs) | def _delete(self, application, node=None, etag=None, headers=None, **kwargs): headers = self._update_headers(headers) path = get_path(self.sip_address, application, node, **kwargs) return self.con.request('DELETE', path, etag=etag, headers=headers) | 430ba67d7d1513ec27bfae76c4a6cf75392dd2d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3443/430ba67d7d1513ec27bfae76c4a6cf75392dd2d3/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3733,
12,
2890,
16,
2521,
16,
756,
33,
7036,
16,
13655,
33,
7036,
16,
1607,
33,
7036,
16,
2826,
4333,
4672,
1607,
273,
365,
6315,
2725,
67,
2485,
12,
2485,
13,
589,
273,
336,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3733,
12,
2890,
16,
2521,
16,
756,
33,
7036,
16,
13655,
33,
7036,
16,
1607,
33,
7036,
16,
2826,
4333,
4672,
1607,
273,
365,
6315,
2725,
67,
2485,
12,
2485,
13,
589,
273,
336,
67... |
(r, w) = os.pipe() self._readpipe = os.fdopen(r, 'r') self._fdSetNonblock(self._readpipe.fileno()) self._writepipe = os.fdopen(w, 'w') | io_r = tempfile.TemporaryFile() w = os.dup(io_r.fileno()) self._readpipe = io_r self._writepipe = os.fdopen(w, 'w+b') | def _setupOutputLogging(self): # UGLY... set up the transaction to record output from scriptlets (r, w) = os.pipe() # need fd objects, and read should be non-blocking self._readpipe = os.fdopen(r, 'r') self._fdSetNonblock(self._readpipe.fileno()) self._writepipe = os.fdopen(w, 'w') self.base.ts.scriptFd = self._writepipe.fileno() rpm.setVerbosity(rpm.RPMLOG_INFO) rpm.setLogFile(self._writepipe) | 45df3ce6e9f83addfa7a8e0e0c72570a73a26e49 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5445/45df3ce6e9f83addfa7a8e0e0c72570a73a26e49/rpmtrans.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8401,
1447,
7735,
12,
2890,
4672,
468,
587,
43,
7076,
2777,
444,
731,
326,
2492,
358,
1409,
876,
628,
2728,
17307,
261,
86,
16,
341,
13,
273,
1140,
18,
14772,
1435,
468,
1608,
519... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8401,
1447,
7735,
12,
2890,
4672,
468,
587,
43,
7076,
2777,
444,
731,
326,
2492,
358,
1409,
876,
628,
2728,
17307,
261,
86,
16,
341,
13,
273,
1140,
18,
14772,
1435,
468,
1608,
519... |
return ''.join(data) | return '\r\n'.join(data) | def to_str(self): state = self.state | 416f800d511b64f2a9a6332dcd1c387a46fa3796 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/416f800d511b64f2a9a6332dcd1c387a46fa3796/response.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
701,
12,
2890,
4672,
919,
273,
365,
18,
2019,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
701,
12,
2890,
4672,
919,
273,
365,
18,
2019,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.precompile_hook() | def build_extensions (self): | 1a5dae80130b8295865f2c9455b28a72efc63ac3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/1a5dae80130b8295865f2c9455b28a72efc63ac3/build_ext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
9489,
261,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
9489,
261,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
self.langbox.set_markup('' + str(self.fromLang()) + ' | ' + str(self.toLang()) + ': ') | self.langbox.set_markup(str(self.fromLang()) + ' | ' + \ str(self.toLang()) + ': ') | def __init__(self, fromLang = 'auto', toLang = 'en'): traduisons_icon = gtk.gdk.pixbuf_new_from_file(os.path.join(appPath, "data", "traduisons_icon.ico")) google_logo = gtk.gdk.PixbufLoader('png') google_logo.write(base64.b64decode(''' | 882d67c8fe0f86c4b7052562c51b41df492db552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9947/882d67c8fe0f86c4b7052562c51b41df492db552/traduisons.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
628,
7275,
273,
296,
6079,
2187,
358,
7275,
273,
296,
275,
11,
4672,
1284,
2544,
4530,
87,
67,
3950,
273,
22718,
18,
75,
2883,
18,
14861,
4385,
67,
2704,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
628,
7275,
273,
296,
6079,
2187,
358,
7275,
273,
296,
275,
11,
4672,
1284,
2544,
4530,
87,
67,
3950,
273,
22718,
18,
75,
2883,
18,
14861,
4385,
67,
2704,... |
The quaternion algebra of the form (a,b/R), where i^2=a, j^2 = b, and i*j=-j*i=k. | The quaternion algebra of the form (a,b/K), where i^2=a, j^2 = b, and j*i=-i*j. K is a field not of characteristic and a,b are nonzero elements of K. | def vector_space(self): """ Return vector space with inner product associated to self. | fe177d7e9e5b87a4c01b1082cf61c4d867951ed1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/fe177d7e9e5b87a4c01b1082cf61c4d867951ed1/quaternion_algebra.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3806,
67,
2981,
12,
2890,
4672,
3536,
2000,
3806,
3476,
598,
3443,
3017,
3627,
358,
365,
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,
... | [
1,
1,
1,
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,
3806,
67,
2981,
12,
2890,
4672,
3536,
2000,
3806,
3476,
598,
3443,
3017,
3627,
358,
365,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
default='False', cmd='-f', ) | default='False', cmd='-f', odesc='<specification path>') | def parse(self, argv, do_getopt=True): '''Parse options''' ret = {} if do_getopt: try: opts, args = getopt.getopt(argv, self.buildGetopt(), []) except getopt.GetoptError, err: self.helpExit(err) if '-h' in argv: self.helpExit('', 0) for key in self.keys(): option = self[key] if do_getopt: option.parse(opts, []) else: option.parse([], argv) if hasattr(option, '_value'): val = option.value self[key] = val | 388ae76f595adfa23b4b04f1a567d2cb66c684b3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11867/388ae76f595adfa23b4b04f1a567d2cb66c684b3/Options.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
5261,
16,
741,
67,
588,
3838,
33,
5510,
4672,
9163,
3201,
702,
26418,
325,
273,
2618,
309,
741,
67,
588,
3838,
30,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
5261,
16,
741,
67,
588,
3838,
33,
5510,
4672,
9163,
3201,
702,
26418,
325,
273,
2618,
309,
741,
67,
588,
3838,
30,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588... |
self.wfile.flush() | if not self.wfile.closed: self.wfile.flush() | def finish(self): self.wfile.flush() self.wfile.close() self.rfile.close() | 16d38f3364e5a5c420db017e50296b15434aecdb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/16d38f3364e5a5c420db017e50296b15434aecdb/SocketServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
12,
2890,
4672,
309,
486,
365,
18,
91,
768,
18,
12204,
30,
365,
18,
91,
768,
18,
11330,
1435,
365,
18,
91,
768,
18,
4412,
1435,
365,
18,
86,
768,
18,
4412,
1435,
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,
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,
4076,
12,
2890,
4672,
309,
486,
365,
18,
91,
768,
18,
12204,
30,
365,
18,
91,
768,
18,
11330,
1435,
365,
18,
91,
768,
18,
4412,
1435,
365,
18,
86,
768,
18,
4412,
1435,
2,
-100,
-10... |
args = outParamForm("result", member.realtype) | args = outParamForm(resultname, member.realtype) | def pfail(msg): raise UserError( member.iface.name + '.' + member.name + ": " "parameter " + param.name + ": " + msg) | 8896184edbd95bdc709171e1892d30700ae56acd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/8896184edbd95bdc709171e1892d30700ae56acd/qsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
6870,
12,
3576,
4672,
1002,
2177,
668,
12,
3140,
18,
31479,
18,
529,
397,
2611,
397,
3140,
18,
529,
397,
6398,
315,
315,
6775,
315,
397,
579,
18,
529,
397,
6398,
315,
397,
1234,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
293,
6870,
12,
3576,
4672,
1002,
2177,
668,
12,
3140,
18,
31479,
18,
529,
397,
2611,
397,
3140,
18,
529,
397,
6398,
315,
315,
6775,
315,
397,
579,
18,
529,
397,
6398,
315,
397,
1234,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.