rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
deprint(recClass,type,type_count[type]) | def buildPatch(self,log,progress): """Merge last version of record with patched destructable data as needed.""" if not self.isActive: return modFile = self.patchFile keep = self.patchFile.getKeeper() id_data = self.id_data type_count = {} for recClass in self.srcClasses: type = recClass.classType if type not in modFile.tops: continue type_count[type] = 0 deprint(recClass,type,type_count[type]) for record in modFile.tops[type].records: fid = record.fid if fid not in id_data: continue for attr,value in id_data[fid].iteritems(): if record.__getattribute__(attr) != value: break else: continue for attr,value in id_data[fid].iteritems(): record.__setattr__(attr,value) keep(fid) type_count[type] += 1 log.setHeader('= '+self.__class__.name) log(_("=== Source Mods")) for mod in self.sourceMods: log("* " +mod.s) log(_("\n=== Modified Records")) for type,count in sorted(type_count.items()): if count: log("* %s: %d" % (type,count)) | 71ba0f617496acea9c633a3b0ab4532794a926b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/71ba0f617496acea9c633a3b0ab4532794a926b1/bosh.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
7332,
12,
2890,
16,
1330,
16,
8298,
4672,
3536,
6786,
1142,
1177,
434,
1409,
598,
25786,
23819,
429,
501,
487,
3577,
12123,
309,
486,
365,
18,
291,
3896,
30,
327,
681,
812,
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,
1361,
7332,
12,
2890,
16,
1330,
16,
8298,
4672,
3536,
6786,
1142,
1177,
434,
1409,
598,
25786,
23819,
429,
501,
487,
3577,
12123,
309,
486,
365,
18,
291,
3896,
30,
327,
681,
812,
273,
... | |
for key in ('LDFLAGS', 'BASECFLAGS', | for key in ('LDFLAGS', 'BASECFLAGS', 'LDSHARED', | def get_config_vars(*args): """With no arguments, return a dictionary of all configuration variables relevant for the current platform. Generally this includes everything needed to build extensions and install both pure modules and extensions. On Unix, this means every variable defined in Python's installed Makefile; on Windows and Mac OS it's a much smaller set. With arguments, return a list of values that result from looking up each argument in the configuration variable dictionary. """ global _config_vars if _config_vars is None: func = globals().get("_init_" + os.name) if func: func() else: _config_vars = {} # Normalized versions of prefix and exec_prefix are handy to have; # in fact, these are the standard versions used most places in the # Distutils. _config_vars['prefix'] = PREFIX _config_vars['exec_prefix'] = EXEC_PREFIX if 'srcdir' not in _config_vars: _config_vars['srcdir'] = project_base # Convert srcdir into an absolute path if it appears necessary. # Normally it is relative to the build directory. However, during # testing, for example, we might be running a non-installed python # from a different directory. if python_build and os.name == "posix": base = os.path.dirname(os.path.abspath(sys.executable)) if (not os.path.isabs(_config_vars['srcdir']) and base != os.getcwd()): # srcdir is relative and we are not in the same directory # as the executable. Assume executable is in the build # directory and make srcdir absolute. srcdir = os.path.join(base, _config_vars['srcdir']) _config_vars['srcdir'] = os.path.normpath(srcdir) if sys.platform == 'darwin': kernel_version = os.uname()[2] # Kernel version (8.4.3) major_version = int(kernel_version.split('.')[0]) if major_version < 8: # On Mac OS X before 10.4, check if -arch and -isysroot # are in CFLAGS or LDFLAGS and remove them if they are. # This is needed when building extensions on a 10.3 system # using a universal build of python. for key in ('LDFLAGS', 'BASECFLAGS', # a number of derived variables. These need to be # patched up as well. 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'): flags = _config_vars[key] flags = re.sub('-arch\s+\w+\s', ' ', flags) flags = re.sub('-isysroot [^ \t]*', ' ', flags) _config_vars[key] = flags else: # Allow the user to override the architecture flags using # an environment variable. # NOTE: This name was introduced by Apple in OSX 10.5 and # is used by several scripting languages distributed with # that OS release. if 'ARCHFLAGS' in os.environ: arch = os.environ['ARCHFLAGS'] for key in ('LDFLAGS', 'BASECFLAGS', # a number of derived variables. These need to be # patched up as well. 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'): flags = _config_vars[key] flags = re.sub('-arch\s+\w+\s', ' ', flags) flags = flags + ' ' + arch _config_vars[key] = flags # If we're on OSX 10.5 or later and the user tries to # compiles an extension using an SDK that is not present # on the current machine it is better to not use an SDK # than to fail. # # The major usecase for this is users using a Python.org # binary installer on OSX 10.6: that installer uses # the 10.4u SDK, but that SDK is not installed by default # when you install Xcode. # m = re.search('-isysroot\s+(\S+)', _config_vars['CFLAGS']) if m is not None: sdk = m.group(1) if not os.path.exists(sdk): for key in ('LDFLAGS', 'BASECFLAGS', # a number of derived variables. These need to be # patched up as well. 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'): flags = _config_vars[key] flags = re.sub('-isysroot\s+\S+(\s|$)', ' ', flags) _config_vars[key] = flags if args: vals = [] for name in args: vals.append(_config_vars.get(name)) return vals else: return _config_vars | 1c3f44da2293ff262551485a55061e1613d12a61 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/1c3f44da2293ff262551485a55061e1613d12a61/sysconfig.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1425,
67,
4699,
30857,
1968,
4672,
3536,
1190,
1158,
1775,
16,
327,
279,
3880,
434,
777,
1664,
3152,
9368,
364,
326,
783,
4072,
18,
225,
3055,
1230,
333,
6104,
7756,
3577,
358,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1425,
67,
4699,
30857,
1968,
4672,
3536,
1190,
1158,
1775,
16,
327,
279,
3880,
434,
777,
1664,
3152,
9368,
364,
326,
783,
4072,
18,
225,
3055,
1230,
333,
6104,
7756,
3577,
358,
... |
print e | print e | def cookPackageObject(repos, cfg, recipeClass, buildBranch, prep=True, macros={}): """ Turns a package recipe object into a change set. Returns the absolute changeset created, a list of the names of the packages built, and and a tuple with a function to call and its arguments, which should be called when the build root for the package can be safely removed (the changeset returned refers to files in that build root, so those files can't be removed until the changeset has been comitted or saved) @param repos: Repository to both look for source files and file id's in. @type repos: repository.Repository @param cfg: conary configuration @type cfg: conarycfg.ConaryConfiguration @param recipeClass: class which will be instantiated into a recipe @type recipeClass: class descended from recipe.Recipe @param buildBranch: the branch the new build will be committed to @type buildBranch: versions.Version @param prep: If true, the build stops after the package is unpacked and None is returned instead of a changeset. @type prep: boolean @param macros: set of macros for the build @type macros: dict @rtype: tuple """ built = [] fullName = recipeClass.name lcache = lookaside.RepositoryCache(repos) srcdirs = [ os.path.dirname(recipeClass.filename), cfg.sourcePath % {'pkgname': recipeClass.name} ] recipeObj = recipeClass(cfg, lcache, srcdirs, macros) # populate the repository source lookaside cache from the :source component # XXXXXXX Ack, this will get the latest version of file that's in a # :source component -- not the version of the file that comes # from the same version as the recipe we're currently cooking! srcName = fullName + ':source' try: srcVersion = repos.getTroveLatestVersion(srcName, buildBranch) except repository.PackageMissing: srcVersion = None if srcVersion: for f in repos.iterFilesInTrove(srcName, srcVersion, None, withFiles=True): fileId, path, version, fileObj = f assert(path[0] != "/") # we might need to retrieve this source file # to enable a build, so we need to find the # sha1 hash of it since that's how it's indexed # in the file store if isinstance(fileObj, files.RegularFile): # it only makes sense to fetch regular files, skip # anything that isn't lcache.addFileHash(path, fileObj.contents.sha1()) builddir = cfg.buildPath + "/" + recipeObj.name use.track(True) try: recipeObj.setup() except Exception, e: if cfg.debugRecipeExceptions: raise #allow debugger to handle it else: print e # XXX maybe print out some nicer, warmer info? sys.exit(1) recipeObj.unpackSources(builddir) # if we're only extracting, continue to the next recipe class. if prep: return cwd = os.getcwd() util.mkdirChain(builddir + '/' + recipeObj.mainDir()) try: os.chdir(builddir + '/' + recipeObj.mainDir()) util.mkdirChain(cfg.tmpDir) destdir = tempfile.mkdtemp("", "conary-%s-" % recipeObj.name, cfg.tmpDir) recipeObj.doBuild(builddir, destdir) log.info('Processing %s', recipeClass.name) recipeObj.doDestdirProcess() # includes policy use.track(False) finally: os.chdir(cwd) grpName = recipeClass.name # build up the name->fileid mapping so we reuse fileids wherever # possible; we do this by looking in the database for the latest # group for each flavor avalable on the branch and recursing # through its subpackages; this mechanism continues to work as # subpackages come and go. ident = _IdGen() try: versionList = repos.getTroveFlavorsLatestVersion(grpName, buildBranch) except repository.PackageNotFound: versionList = [] troveList = [ (grpName, x[0], x[1]) for x in versionList ] while troveList: troves = repos.getTroves(troveList) troveList = [] for trove in troves: ident.populate(repos, trove) troveList += [ x for x in trove.iterTroveList() ] requires = deps.deps.DependencySet() provides = deps.deps.DependencySet() flavor = deps.deps.DependencySet() bldList = recipeObj.getPackages() for buildPkg in bldList: flavor.union(buildPkg.flavor) nextVersion = helper.nextVersion(repos, grpName, recipeClass.version, flavor, buildBranch, binary = True) grp = package.Trove(grpName, nextVersion, flavor, None) packageList = [] for buildPkg in bldList: (p, fileMap) = _createComponent(repos, buildBranch, buildPkg, nextVersion, ident) requires.union(p.getRequires()) provides.union(p.getProvides()) built.append((p.getName(), p.getVersion().asString())) packageList.append((p, fileMap)) grp.addTrove(p.getName(), p.getVersion(), p.getFlavor()) grp.setRequires(requires) grp.setProvides(provides) changeSet = changeset.CreateFromFilesystem(packageList) changeSet.addPrimaryPackage(grpName, nextVersion, None) grpDiff = grp.diff(None, absolute = 1)[0] changeSet.newPackage(grpDiff) return (changeSet, built, (recipeObj.cleanup, (builddir, destdir))) | dde87bc70a94ebba2fa92be36ba8038f9400daea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/dde87bc70a94ebba2fa92be36ba8038f9400daea/cook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15860,
2261,
921,
12,
15564,
16,
2776,
16,
16100,
797,
16,
1361,
7108,
16,
13237,
33,
5510,
16,
24302,
12938,
4672,
3536,
22425,
87,
279,
2181,
16100,
733,
1368,
279,
2549,
444,
18,
2860... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15860,
2261,
921,
12,
15564,
16,
2776,
16,
16100,
797,
16,
1361,
7108,
16,
13237,
33,
5510,
16,
24302,
12938,
4672,
3536,
22425,
87,
279,
2181,
16100,
733,
1368,
279,
2549,
444,
18,
2860... |
_ZIP_PREFIX = asbytes('PK\x03\x04') N = len(format.MAGIC_PREFIX) magic = fid.read(N) fid.seek(-N, 1) if magic.startswith(_ZIP_PREFIX): return NpzFile(fid) elif magic == format.MAGIC_PREFIX: if mmap_mode: return format.open_memmap(file, mode=mmap_mode) else: return format.read_array(fid) else: try: return _cload(fid) except: raise IOError, \ "Failed to interpret file %s as a pickle" % repr(file) | try: _ZIP_PREFIX = asbytes('PK\x03\x04') N = len(format.MAGIC_PREFIX) magic = fid.read(N) fid.seek(-N, 1) if magic.startswith(_ZIP_PREFIX): own_fid = False return NpzFile(fid, own_fid=True) elif magic == format.MAGIC_PREFIX: if mmap_mode: return format.open_memmap(file, mode=mmap_mode) else: return format.read_array(fid) else: try: return _cload(fid) except: raise IOError, \ "Failed to interpret file %s as a pickle" % repr(file) finally: if own_fid: fid.close() | def load(file, mmap_mode=None): """ Load a pickled, ``.npy``, or ``.npz`` binary file. Parameters ---------- file : file-like object or string The file to read. It must support ``seek()`` and ``read()`` methods. If the filename extension is ``.gz``, the file is first decompressed. mmap_mode: {None, 'r+', 'r', 'w+', 'c'}, optional If not None, then memory-map the file, using the given mode (see `numpy.memmap`). The mode has no effect for pickled or zipped files. A memory-mapped array is stored on disk, and not directly loaded into memory. However, it can be accessed and sliced like any ndarray. Memory mapping is especially useful for accessing small fragments of large files without reading the entire file into memory. Returns ------- result : array, tuple, dict, etc. Data stored in the file. Raises ------ IOError If the input file does not exist or cannot be read. See Also -------- save, savez, loadtxt memmap : Create a memory-map to an array stored in a file on disk. Notes ----- - If the file contains pickle data, then whatever is stored in the pickle is returned. - If the file is a ``.npy`` file, then an array is returned. - If the file is a ``.npz`` file, then a dictionary-like object is returned, containing ``{filename: array}`` key-value pairs, one for each file in the archive. Examples -------- Store data to disk, and load it again: >>> np.save('/tmp/123', np.array([[1, 2, 3], [4, 5, 6]])) >>> np.load('/tmp/123.npy') array([[1, 2, 3], [4, 5, 6]]) Mem-map the stored array, and then access the second row directly from disk: >>> X = np.load('/tmp/123.npy', mmap_mode='r') >>> X[1, :] memmap([4, 5, 6]) """ import gzip if isinstance(file, basestring): fid = open(file, "rb") elif isinstance(file, gzip.GzipFile): fid = seek_gzip_factory(file) else: fid = file # Code to distinguish from NumPy binary files and pickles. _ZIP_PREFIX = asbytes('PK\x03\x04') N = len(format.MAGIC_PREFIX) magic = fid.read(N) fid.seek(-N, 1) # back-up if magic.startswith(_ZIP_PREFIX): # zip-file (assume .npz) return NpzFile(fid) elif magic == format.MAGIC_PREFIX: # .npy file if mmap_mode: return format.open_memmap(file, mode=mmap_mode) else: return format.read_array(fid) else: # Try a pickle try: return _cload(fid) except: raise IOError, \ "Failed to interpret file %s as a pickle" % repr(file) | 8630830bb05bd13aab0fcd869c8339c1515460de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14925/8630830bb05bd13aab0fcd869c8339c1515460de/npyio.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
12,
768,
16,
30749,
67,
3188,
33,
7036,
4672,
3536,
4444,
279,
6002,
1259,
16,
1375,
8338,
82,
2074,
68,
9191,
578,
1375,
8338,
6782,
94,
10335,
3112,
585,
18,
225,
7012,
12181,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
12,
768,
16,
30749,
67,
3188,
33,
7036,
4672,
3536,
4444,
279,
6002,
1259,
16,
1375,
8338,
82,
2074,
68,
9191,
578,
1375,
8338,
6782,
94,
10335,
3112,
585,
18,
225,
7012,
12181,
... |
p.add_option('-d', '--debug', action='store_true', default=False, dest='debug', help='enable verbose debug') | if hasattr(SuDoKu, 'debug'): p.add_option('-d', '--debug', action='store_true', default=False, dest='debug', help='enable verbose debug') | def main(): p = optparse.OptionParser(usage='usage: %prog [options] [problem]') # Actions p.add_option('-r', '--resolve', action='store_true', default=False, dest='resolve', help='resolve a problem (default)') p.add_option('-g', '--generate', action='store_true', default=False, dest='generate', help='generate a problem') p.add_option('-e', '--estimate', action='store_true', default=False, dest='estimate', help='estimate the difficulty of a problem') p.add_option('-s', '--show', action='store_true', default=False, dest='show', help='print a problem without resolving it') # Options p.add_option('-i', '--input', default='', dest='filename', metavar='SDK', help='read problem from a file instead of command line') p.add_option('-f', '--format', default='console', dest='format', metavar='FMT', help='output format: console (default), html, string') p.add_option('-c', '--count', dest='count', type='int', metavar='CNT', help='number of problems to generate') p.add_option('-d', '--debug', action='store_true', default=False, dest='debug', help='enable verbose debug') (options, args) = p.parse_args() def exit_on_error(error): print error print p.print_help() sys.exit(1) resolve_by_default = not any([options.resolve, options.generate, options.estimate, options.show]) # Read problem if necessary s = SuDoKu(estimate=options.estimate, debug=options.debug) if resolve_by_default or options.resolve or options.show: if len(args) == 1: s.from_string(args[0]) elif options.filename == '-': s.from_string(sys.stdin.read()) elif options.filename != '': with open(options.filename) as filein: s.from_string(filein.read()) else: exit_on_error('Error: No problem specified.') # Check actions if resolve_by_default: options.resolve = True if (options.resolve and options.generate): exit_on_error('Incompatible options: --resolve and --generate.') if (options.resolve and options.show): exit_on_error('Incompatible options: --resolve and --show.') if (options.generate and options.show): exit_on_error('Incompatible options: --generate and --show.') if options.estimate and not (options.resolve or options.generate): exit_on_error('--estimate requires --resolve or --generate.') if options.count is not None and not options.generate: exit_on_error('--count requires --generate.') # Execute actions if options.resolve: for grid in s.resolve(): print s.to_string(options.format, grid) if options.estimate: print s.estimate() if options.generate: for i in range(options.count or 1): s.generate() print s.to_string(options.format) if options.estimate: s.resolve() print s.estimate() if options.show: print s.to_string(options.format) | 1588a260131eec562f815b85692d211b5a263dee /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8366/1588a260131eec562f815b85692d211b5a263dee/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
225,
293,
273,
2153,
2670,
18,
1895,
2678,
12,
9167,
2218,
9167,
30,
738,
14654,
306,
2116,
65,
306,
18968,
3864,
13,
468,
18765,
293,
18,
1289,
67,
3482,
2668,
17,
86,
21... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
225,
293,
273,
2153,
2670,
18,
1895,
2678,
12,
9167,
2218,
9167,
30,
738,
14654,
306,
2116,
65,
306,
18968,
3864,
13,
468,
18765,
293,
18,
1289,
67,
3482,
2668,
17,
86,
21... |
return self.decode(line)[0] | return self.decode(line,self.errors)[0] | def readline(self, size=None): | c6c283840316dec54244b311657511e95e742eb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c6c283840316dec54244b311657511e95e742eb0/codecs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12023,
12,
2890,
16,
963,
33,
7036,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12023,
12,
2890,
16,
963,
33,
7036,
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,... |
new_population.append(child); print 'Best: ', max(self.__population) print 'Population average fitness', self.average_fitness() | new_population.append(child.mutate()); best_fitness = max(self.__population).fitness best_size = len(max(self.__population).node_genes) avg_pop = self.average_fitness() print 'Best: ', best_fitness, best_size, avg_pop | def epoch(self, n): ''' Runs NEAT's genetic algorithm for n epochs. All the speciation methods are handled here ''' for generation in xrange(n): print 'Running generation',generation # evaluate individuals self.evaluate() self.__speciate() # speciates the population self.__compute_spawn_levels() # compute spawn levels for each species | db26cce1efb182672b95b72d2d69389682d6fba4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8056/db26cce1efb182672b95b72d2d69389682d6fba4/speciation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7632,
12,
2890,
16,
290,
4672,
9163,
1939,
87,
12901,
789,
1807,
3157,
7943,
4886,
364,
290,
25480,
18,
4826,
326,
857,
7072,
2590,
854,
7681,
2674,
9163,
225,
364,
9377,
316,
12314,
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,
7632,
12,
2890,
16,
290,
4672,
9163,
1939,
87,
12901,
789,
1807,
3157,
7943,
4886,
364,
290,
25480,
18,
4826,
326,
857,
7072,
2590,
854,
7681,
2674,
9163,
225,
364,
9377,
316,
12314,
12,... |
@param default: the default value to use if the key doesn't exist. @type default: string | def __getitem__(self, key, default=None): """ If the key ends with _escaped, then this will retrieve the value for the key and escape it. | 0a9c43a9f1cd83052a21299d004e9103f1d25faf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11836/0a9c43a9f1cd83052a21299d004e9103f1d25faf/tools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
498,
16,
805,
33,
7036,
4672,
3536,
971,
326,
498,
3930,
598,
389,
16502,
16,
1508,
333,
903,
4614,
326,
460,
364,
326,
498,
471,
4114,
518,
18,
2,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
498,
16,
805,
33,
7036,
4672,
3536,
971,
326,
498,
3930,
598,
389,
16502,
16,
1508,
333,
903,
4614,
326,
460,
364,
326,
498,
471,
4114,
518,
18,
2,
-1... | |
raise TypeError | else: raise TypeError | def __call__(self, x, check=True): """ Coerce x into this multivariate polynomial ring. | 6f6720d3237c423bffd664416a41627498fe14c8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/6f6720d3237c423bffd664416a41627498fe14c8/multi_polynomial_ring.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
619,
16,
866,
33,
5510,
4672,
3536,
7695,
2765,
619,
1368,
333,
1778,
27693,
16991,
9221,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
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,
619,
16,
866,
33,
5510,
4672,
3536,
7695,
2765,
619,
1368,
333,
1778,
27693,
16991,
9221,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
res = struct.unpack('ihHIIHH',fid.read(20)) | if _big_endian: fmt = '>' else: fmt = '<' res = struct.unpack(fmt+'ihHIIHH',fid.read(20)) | def _read_fmt_chunk(fid): res = struct.unpack('ihHIIHH',fid.read(20)) size, comp, noc, rate, sbytes, ba, bits = res if (comp != 1 or size > 16): print "Warning: unfamiliar format bytes..." if (size>16): fid.read(size-16) return size, comp, noc, rate, sbytes, ba, bits | c2ac1b60fe07fe1621f2a8c7ec72a47cc7a8dc39 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12971/c2ac1b60fe07fe1621f2a8c7ec72a47cc7a8dc39/wavfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
67,
8666,
67,
6551,
12,
27268,
4672,
309,
389,
14002,
67,
22910,
30,
1325,
273,
7481,
469,
30,
1325,
273,
9138,
400,
273,
1958,
18,
17309,
12,
8666,
6797,
7392,
44,
6954,
175... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
896,
67,
8666,
67,
6551,
12,
27268,
4672,
309,
389,
14002,
67,
22910,
30,
1325,
273,
7481,
469,
30,
1325,
273,
9138,
400,
273,
1958,
18,
17309,
12,
8666,
6797,
7392,
44,
6954,
175... |
return False, [u"levels/campaigns/default/level1"] | return False, [u"levels/campaign/level1"] | def main(screen): main = ["New game", "Custom Level", "Level Editor", "Quit."] levels = dircache.listdir('levels/') buttons = main dircache.annotate('levels/', levels) button_height = 37 menu_margin = 30 offset = 0 clevel = False edit = False update = True bgcolor = 255, 255, 255 fgcolor = 0, 0, 0 menuhover = -1 font = pygame.font.SysFont("Bitstream Vera Sans", 24) labels = [] for button in buttons: labels.append(font.render(button, 1, fgcolor)) while True: event = pygame.event.wait() if update: update = False labels = [] if clevel: i = offset*8 labels.append(font.render("Return to main menu", 1, fgcolor)) labels.append(font.render("Previous page", 1, fgcolor)) while i < (1+offset)*8: if i < len(levels): labels.append(font.render(levels[i], 1, fgcolor)) else: labels.append(font.render("(empty)", 1, fgcolor)) i += 1 labels.append(font.render("Next page", 1, fgcolor)) else: for choices in main: labels.append(font.render(choices, 1, fgcolor)) if event.type == pygame.VIDEOEXPOSE: screen.fill(bgcolor) for i in range(len(labels)): screen.blit(labels[i], (menu_margin, i * button_height + menu_margin)) if menuhover != -1: rect = labels[menuhover].get_rect() rect[0] += menu_margin - 4 rect[1] += menu_margin + menuhover * button_height - 3 rect[2] += 8 rect[3] += 6 pygame.draw.rect(screen, (255,0,0), rect, 3) pygame.display.update() elif event.type == pygame.KEYDOWN: if event.key == pygame.K_ESCAPE: sys.exit(0) elif event.type == pygame.MOUSEBUTTONDOWN: for i in range(len(labels)): rect = labels[i].get_rect() if (event.pos[0] < rect[2] + menu_margin and event.pos[0] > menu_margin and event.pos[1] > menu_margin + i*button_height and event.pos[1] < menu_margin + (i+1)*button_height): if clevel: if i == 0: clevel = False update = True elif i == 1: if offset != 0: offset -= 1 update = True elif i == 10: update = True offset += 1 else: if i+offset*6 - 2 < len(levels): if "/" in levels[offset*6+i-2]: returnlist = [] for level in dircache.listdir('levels/' + levels[offset*6+i-2]): returnlist.append("levels/" + levels[offset*6+i-2] + level) else: returnlist = ["levels/" + levels[offset*6+i-2]] print returnlist return edit, returnlist else: if i == 0: return False, [u"levels/campaigns/default/level1"] elif i == 1: clevel = True edit = False update = True elif i == 2: edit = True clevel = True update = True elif i == 3: sys.exit(0) elif event.type == pygame.MOUSEMOTION: menuhover = -1 for i in range(len(labels)): rect = labels[i].get_rect() if (event.pos[0] < rect[2] + menu_margin and event.pos[0] > menu_margin and event.pos[1] > menu_margin + i*button_height and event.pos[1] < menu_margin + (i+1)*button_height): menuhover = i | ece1ebef5edd0f73654e220a6ce02b52a0ef8056 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14575/ece1ebef5edd0f73654e220a6ce02b52a0ef8056/menu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
9252,
4672,
2774,
273,
8247,
1908,
7920,
3113,
315,
3802,
4557,
3113,
315,
2355,
18451,
3113,
315,
25365,
1199,
65,
7575,
273,
1577,
2493,
18,
1098,
1214,
2668,
12095,
2473,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
9252,
4672,
2774,
273,
8247,
1908,
7920,
3113,
315,
3802,
4557,
3113,
315,
2355,
18451,
3113,
315,
25365,
1199,
65,
7575,
273,
1577,
2493,
18,
1098,
1214,
2668,
12095,
2473,
13,
... |
ziplines = zipfp.open(TESTFN).readlines() | with zipfp.open(TESTFN) as zipopen: ziplines = zipopen.readlines() | def zip_readlines_test(self, f, compression): self.make_test_archive(f, compression) | b851957a42b68791e7491840103c69844875e2e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/b851957a42b68791e7491840103c69844875e2e0/test_zipfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3144,
67,
896,
3548,
67,
3813,
12,
2890,
16,
284,
16,
9154,
4672,
365,
18,
6540,
67,
3813,
67,
10686,
12,
74,
16,
9154,
13,
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,
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,
3144,
67,
896,
3548,
67,
3813,
12,
2890,
16,
284,
16,
9154,
4672,
365,
18,
6540,
67,
3813,
67,
10686,
12,
74,
16,
9154,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
return (-1, res, warning, '') | return (-1, res, 'Line ' + str(counter) +' : ' + warning, '') | fields_def = self.fields_get(cr, uid, context=context) | adc4f059ec5a18fd24c9b935975c6013dc05fb4e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/adc4f059ec5a18fd24c9b935975c6013dc05fb4e/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1466,
67,
536,
273,
365,
18,
2821,
67,
588,
12,
3353,
16,
4555,
16,
819,
33,
2472,
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,
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,
1466,
67,
536,
273,
365,
18,
2821,
67,
588,
12,
3353,
16,
4555,
16,
819,
33,
2472,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.suffixes = [ ] | def __init__(self): # we're definitely going to be importing something in the future, # so let's just load the OS-related facilities. if not _os_stat: _os_bootstrap() | 3bb578c128019318d72c12251571beb14136d83b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3bb578c128019318d72c12251571beb14136d83b/imputil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
468,
732,
4565,
2217,
25818,
8554,
358,
506,
25077,
5943,
316,
326,
3563,
16,
468,
1427,
2231,
1807,
2537,
1262,
326,
5932,
17,
9243,
5853,
5076,
18,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
468,
732,
4565,
2217,
25818,
8554,
358,
506,
25077,
5943,
316,
326,
3563,
16,
468,
1427,
2231,
1807,
2537,
1262,
326,
5932,
17,
9243,
5853,
5076,
18,
309... | |
elif o[0] in ("-z", "--raw-citations"): | elif o[0] in ("-z", "--raw-references"): | def get_cli_options(): """Get the various arguments and options from the command line and populate a dictionary of cli_options. @return: (tuple) of 2 elements. First element is a dictionary of cli options and flags, set as appropriate; Second element is a list of cli arguments. """ global cli_opts ## dictionary of important flags and values relating to cli call of program: cli_opts = { 'treat_as_reference_section' : 0, 'output_raw' : 0, 'verbosity' : 0, 'xmlfile' : 0, 'dictfile' : 0, } try: myoptions, myargs = getopt.getopt(sys.argv[1:], "hVv:zrx:d:", \ ["help", "version", "verbose=", "raw-references", "output-raw-refs", "xmlfile=", "dictfile="]) except getopt.GetoptError, err: ## Invalid option provided - usage message usage(wmsg="Error: %(msg)s." % { 'msg' : str(err) }) for o in myoptions: if o[0] in ("-V","--version"): ## version message and exit sys.stdout.write("%s\n" % __revision__) sys.stdout.flush() sys.exit(0) elif o[0] in ("-h","--help"): ## help message and exit usage() elif o[0] in ("-r", "--output-raw-refs"): cli_opts['output_raw'] = 1 elif o[0] in ("-v", "--verbose"): if not o[1].isdigit(): cli_opts['verbosity'] = 0 elif int(o[1]) not in xrange(0, 10): cli_opts['verbosity'] = 0 else: cli_opts['verbosity'] = int(o[1]) elif o[0] in ("-z", "--raw-citations"): ## treat input as pure reference lines: cli_opts['treat_as_reference_section'] = 1 elif o[0] in ("-x", "--xmlfile"): ## Write out MARC XML references to the specified file cli_opts['xmlfile'] = o[1] elif o[0] in ("-d", "--dictfile"): ## Write out the statistics of all titles matched during the ## extraction job to the specified file cli_opts['dictfile'] = o[1] if len(myargs) == 0: ## no arguments: error message usage(wmsg="Error: no full-text.") return (cli_opts, myargs) | 209ab90f80656ac0052209690c9e1fcf27f24854 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/209ab90f80656ac0052209690c9e1fcf27f24854/refextract.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4857,
67,
2116,
13332,
3536,
967,
326,
11191,
1775,
471,
702,
628,
326,
1296,
980,
471,
6490,
279,
3880,
434,
4942,
67,
2116,
18,
632,
2463,
30,
261,
8052,
13,
434,
576,
2186,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4857,
67,
2116,
13332,
3536,
967,
326,
11191,
1775,
471,
702,
628,
326,
1296,
980,
471,
6490,
279,
3880,
434,
4942,
67,
2116,
18,
632,
2463,
30,
261,
8052,
13,
434,
576,
2186,... |
N += 1.0 | N[freq[freqcnt]] += 1.0 amp[freq[freqcnt]] += float(tmp[0])**2/2.0 + float(tmp[1])**2/2.0 + float(tmp[2])**2/2.0 + float(tmp[3])**2/2.0 | def plot_systematics(filelist,cp,dir,epoch,dag,opts): flist = [] for file in filelist: if os.path.split(file)[-1][:8] == "out-bin-": flist.append(file) freq = [] freqfile = cp.get('noisecomp','freq-file') for line in open(freqfile,'r').readlines(): freq.append(float(line.strip())) hfr1 = {} hfi1 = {} htr1 = {} hti1 = {} Ai = {} Ar = {} N = 0.0 for f in freq: hfr1[f] = 0.0 hfi1[f] = 0.0 htr1[f] = 0.0 hti1[f] = 0.0 Ai[f] = 0.0 Ar[f] = 0.0 freqcnt = 0; print "\tfirst pass through systematics files..." for file in flist: try: input = open(file,'r') except: print "WARNING: file " + file + " doesn't exist" continue for line in input.readlines(): tmp = line.split() if len(tmp) == 1: continue N += 1.0 htr1[freq[freqcnt]] += float(tmp[0]) hti1[freq[freqcnt]] += float(tmp[1]) hfr1[freq[freqcnt]] += float(tmp[2]) hfi1[freq[freqcnt]] += float(tmp[3]) freqcnt += 1 if freqcnt >= len(freq): freqcnt = 0 #if N > 100000: break #Actually make it the mean for f in freq: htr1[f] /= N hti1[f] /= N hfr1[f] /= N hfi1[f] /= N Ai[f] = ((hti1[f]-hfi1[f])*hfr1[f] - (htr1[f]-hfr1[f])*hfi1[f]) / (hfi1[f]*hfi1[f]+hfr1[f]*hfr1[f]) Ar[f] = (htr1[f] - hfr1[f] + Ai[f]*hfi1[f]) / hfr1[f] + 1.0 fname = "Ar_Ai_"+epoch[1]+"-"+epoch[2]+".txt" fl = open(fname,'w') fl.write("#freq h(t) re sys\th(t) im sys\th(t) mag sys\th(t) phase sys\n") mag = {} phase = {} for f in freq: mag[f] = sqrt(Ar[f]*Ar[f]+Ai[f]*Ai[f]) phase[f] = atan2(Ai[f],Ar[f]) fl.write(str(f) + "\t"+str(Ar[f])+"\t"+str(Ai[f])+"\t"+str(mag[f])+"\t"+str(phase[f])+"\n") fl.close() xr1 = {} xi1 = {} xr2 = {} xi2 = {} xr3 = {} xi3 = {} xr4 = {} xi4 = {} amp = {} N = 0.0 for f in freq: xr1[f] = 0.0 xi1[f] = 0.0 xr2[f] = 0.0 xi2[f] = 0.0 xr3[f] = 0.0 xi3[f] = 0.0 xr4[f] = 0.0 xi4[f] = 0.0 freqcnt = 0; realHistVecs = {} imagHistVecs = {} binVec = [] for f in freq: realHistVecs[f] = zeros(2000) imagHistVecs[f] = zeros(2000) for b in range(-1000,1000): binVec.append(float(b)*.001) print "\tsecond pass through systematics files..." #Compute the moments of the distribution for file in flist: try: input = open(file,'r') except: print "WARNING: file " + file + " doesn't exist" continue for line in input.readlines(): tmp = line.split() if len(tmp) == 1: continue N += 1.0 htr = float(tmp[0]) hti = float(tmp[1]) hfr = float(tmp[2]) hfi = float(tmp[3]) amp[freq[freqcnt]] = sqrt(htr*htr+hti*hti) xr = htr-Ar[freq[freqcnt]]*hfr + Ai[freq[freqcnt]]*hfi xi = hti-Ar[freq[freqcnt]]*hfi - Ai[freq[freqcnt]]*hfr bin(binVec,realHistVecs[freq[freqcnt]],xr/amp[freq[freqcnt]]) bin(binVec,imagHistVecs[freq[freqcnt]],xi/amp[freq[freqcnt]]) xr1[freq[freqcnt]] += xr xi1[freq[freqcnt]] += xi xr2[freq[freqcnt]] += xr*xr xi2[freq[freqcnt]] += xi*xi xr3[freq[freqcnt]] += xr*xr*xr xi3[freq[freqcnt]] += xi*xi*xi xr4[freq[freqcnt]] += xr*xr*xr*xr xi4[freq[freqcnt]] += xi*xi*xi*xi freqcnt += 1 if freqcnt >= len(freq): freqcnt = 0 #if N > 100000: break #Put them in units of the noise amplitude for f in freq: xr1[f] /= N xi1[f] /= N xr2[f] = sqrt(xr2[f]/N)/amp[f] xi2[f] = sqrt(xi2[f]/N)/amp[f] if xr3[f]: xr3[f] = pow(abs(xr3[f]/N),1.0/3.0)/amp[f]*xr3[f]/abs(xr3[f]) else: xr3[f] = 0.0 if xi3[f]: xi3[f] = pow(abs(xi3[f]/N),1.0/3.0)/amp[f]*xi3[f]/abs(xi3[f]) else: xi3[f] = 0.0 xr4[f] = pow(abs(xr4[f]/N-3.0*pow(xr2[f]*amp[f],4)),1.0/4.0)/amp[f]*(xr4[f]/N-3.0*pow(xr2[f]*amp[f],4))/abs(xr4[f]/N-3.0*pow(xr2[f]*amp[f],4)) xi4[f] = pow(abs(xi4[f]/N-3.0*pow(xi2[f]*amp[f],4)),1.0/4.0)/amp[f]*(xi4[f]/N-3.0*pow(xi2[f]*amp[f],4))/abs(xi4[f]/N-3.0*pow(xi2[f]*amp[f],4)) fname = "x1_x2_x3_x4_"+epoch[1]+"-"+epoch[2]+".txt" fl = open(fname,'w') fl.write("#freq \t xr \t xi \t xr^2 \t xi^2 \t xr^3 \t xi^3 \t xr^4 \t xi^4 \n") for f in freq: fl.write(str(f) + '\t' + str(xr1[f]) + '\t' + str(xi1[f]) + '\t' + str(xr2[f]) + '\t' + str(xi2[f]) + '\t' + str(xr3[f]) + '\t' + str(xi3[f]) + '\t' + str(xr4[f]) + '\t' + str(xi4[f]) + '\n') fl.close() # Plot the results print "\tplotting..." # Plot the systematic in magnitude magfigname = "sys_mag"+epoch[1]+"-"+epoch[2]+".png" figure(1) plot(mag.keys(),mag.values()) title('h(t) and h(f) magnitude systematics '+epoch[1]+"-"+epoch[2]+'\n') xlabel('Freq') ylabel('Mag') savefig(dir + '/'+ magfigname) thumb = 'thumb-'+magfigname savefig(dir + '/'+ thumb,dpi=20) clf() close() # Plot the systematic in phase phasefigname = "sys_phase"+epoch[1]+"-"+epoch[2]+".png" figure(1) plot(phase.keys(),phase.values()) title('h(t) and h(f) phase systematics '+epoch[1]+"-"+epoch[2]+'\n') xlabel('Freq') ylabel('Phase') savefig(dir + '/'+ phasefigname) thumb = 'thumb-'+phasefigname savefig(dir + '/'+ thumb,dpi=20) clf() close() # Plot the residual moments x2figname = "sys_x2_"+epoch[1]+"-"+epoch[2]+".png" figure(1) plot(xr2.keys(),xr2.values()) plot(xi2.keys(),xi2.values(),'r') legend(['real','imaginary']) title('residual noise sqrt of second moment '+epoch[1]+"-"+epoch[2]+'\n') xlabel('Freq') ylabel('sigma') savefig(dir + '/'+ x2figname) thumb = 'thumb-'+x2figname savefig(dir + '/'+ thumb,dpi=20) clf() close() # Plot the residual moments x3figname = "sys_x3_"+epoch[1]+"-"+epoch[2]+".png" figure(1) plot(xr3.keys(),xr3.values()) plot(xi3.keys(),xi3.values(),'r') legend(['real','imaginary']) title('residual noise cube root of third moment '+epoch[1]+"-"+epoch[2]+'\n') xlabel('Freq') ylabel('cube root of skew') savefig(dir + '/'+ x3figname) thumb = 'thumb-'+x3figname savefig(dir + '/'+ thumb,dpi=20) clf() close() # Plot the residual moments x4figname = "sys_x4_"+epoch[1]+"-"+epoch[2]+".png" figure(1) plot(xr4.keys(),xr4.values()) plot(xi4.keys(),xi4.values(),'r') legend(['real','imaginary']) title('residual noise fourth root of excess kurtosis '+epoch[1]+"-"+epoch[2]+'\n') xlabel('Freq') ylabel('fourth root of excess kurtosis') savefig(dir + '/'+ x4figname) thumb = 'thumb-'+x4figname savefig(dir + '/'+ thumb,dpi=20) clf() close() pgname = dir + '/' + "sys_plots"+epoch[1]+"-"+epoch[2]+".html" page = open(pgname,'w') page.write('<h2>Plots of systematic errors between h(t) and h(f) '+epoch[1]+"-"+epoch[2]+'</h2><hr><br><br>\n') page.write('<h3>Systematics in magnitude and phase and moments of the residual distributions</h3><hr>\n') page.write('<img src='+magfigname+' width=600>\n') page.write('<img src='+phasefigname+' width=600>\n') page.write('<img src='+x2figname+' width=600>\n') page.write('<img src='+x3figname+' width=600>\n') page.write('<img src='+x4figname+' width=600><br><br>\n') page.write('<h3>Raw distribution of residual noise</h3><hr><br>\n') for f in freq: figname = "n_hist_"+str(f)+'_'+epoch[1]+"-"+epoch[2]+".png" figure(1) plot(binVec,realHistVecs[f]) plot(binVec,imagHistVecs[f],'r') legend(['real','imaginary']) title('residual noise distribution '+epoch[1]+"-"+epoch[2]+'\n'+'freq = '+str(f)) ylabel('Number') xlabel('n / amp of h(t)') savefig(dir + '/'+ figname) thumb = 'thumb-'+figname savefig(dir + '/'+ thumb,dpi=20) clf() close() page.write('<a href='+figname+'><img src='+thumb+'></a>\n') page.close | d006b44160af1f27ae3106345b7396ce51a9bff2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5758/d006b44160af1f27ae3106345b7396ce51a9bff2/strain.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
67,
4299,
270,
2102,
12,
7540,
5449,
16,
4057,
16,
1214,
16,
12015,
16,
30204,
16,
4952,
4672,
284,
1098,
273,
5378,
364,
585,
316,
26204,
30,
309,
1140,
18,
803,
18,
4939,
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,
3207,
67,
4299,
270,
2102,
12,
7540,
5449,
16,
4057,
16,
1214,
16,
12015,
16,
30204,
16,
4952,
4672,
284,
1098,
273,
5378,
364,
585,
316,
26204,
30,
309,
1140,
18,
803,
18,
4939,
12,
... |
for y in range(image.get_rect()[3] // height): tiles.append(image.subsurface(0, y * height, width, height)) | for y in range(tile_image.get_rect()[3] // height): tiles.append(tile_image.subsurface(0, y * height, width, height)) | def load_tiles(tiles_path, width, height): tile_image = pygame.image.load(tiles_path) tiles = [] for y in range(image.get_rect()[3] // height): tiles.append(image.subsurface(0, y * height, width, height)) tiles[-1].set_colorkey((255, 0, 255)) return tiles | 0f2b1796ec58ef2792ba7effdf9c8251bfa645e7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14575/0f2b1796ec58ef2792ba7effdf9c8251bfa645e7/yva.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
28366,
12,
28366,
67,
803,
16,
1835,
16,
2072,
4672,
4769,
67,
2730,
273,
2395,
13957,
18,
2730,
18,
945,
12,
28366,
67,
803,
13,
225,
12568,
273,
5378,
364,
677,
316,
1048,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
28366,
12,
28366,
67,
803,
16,
1835,
16,
2072,
4672,
4769,
67,
2730,
273,
2395,
13957,
18,
2730,
18,
945,
12,
28366,
67,
803,
13,
225,
12568,
273,
5378,
364,
677,
316,
1048,
... |
spec = PerfectSpecializer(Loop(A.ops)) | spec = PerfectSpecializer(Loop(A.inputargs, A.ops)) | def test_A_find_nodes(): spec = PerfectSpecializer(Loop(A.ops)) spec.find_nodes() node = spec.nodes[A.l] assert isinstance(node.cls.source, FixedList) assert node.expanded_fields.keys() == [ConstInt(0)] | b9f890a8e721d63e12651c6fbae7c1a5a8e0cb31 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/b9f890a8e721d63e12651c6fbae7c1a5a8e0cb31/test_list_optimize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
37,
67,
4720,
67,
4690,
13332,
857,
273,
5722,
74,
386,
1990,
3926,
12,
6452,
12,
37,
18,
2630,
1968,
16,
432,
18,
4473,
3719,
857,
18,
4720,
67,
4690,
1435,
756,
273,
857,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
37,
67,
4720,
67,
4690,
13332,
857,
273,
5722,
74,
386,
1990,
3926,
12,
6452,
12,
37,
18,
2630,
1968,
16,
432,
18,
4473,
3719,
857,
18,
4720,
67,
4690,
1435,
756,
273,
857,... |
sage: C.cliques_node_clique_number(cliques=E) | sage: C.cliques_vertex_clique_number(cliques=E) | def cliques_node_clique_number(self, nodes=None, with_labels=False, cliques=None): r""" Returns a list of sizes of the largest maximal cliques containing each node. (Returns a single value if only one input node). | 139028392b54ae237314b7536b21897e9b1d7ed3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/139028392b54ae237314b7536b21897e9b1d7ed3/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4942,
29896,
67,
2159,
67,
4857,
1857,
67,
2696,
12,
2890,
16,
2199,
33,
7036,
16,
598,
67,
5336,
33,
8381,
16,
4942,
29896,
33,
7036,
4672,
436,
8395,
2860,
279,
666,
434,
8453,
434,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4942,
29896,
67,
2159,
67,
4857,
1857,
67,
2696,
12,
2890,
16,
2199,
33,
7036,
16,
598,
67,
5336,
33,
8381,
16,
4942,
29896,
33,
7036,
4672,
436,
8395,
2860,
279,
666,
434,
8453,
434,
... |
if snmpNotifyType == 1: | if notifyType == 1: | def sendNotification( self, snmpEngine, notificationTarget, notificationName, additionalNames=None, contextName='', cbFun=None, cbCtx=None ): # 3.3 ( notifyTag, notifyType ) = config.getNotificationInfo( snmpEngine, notificationTarget ) pendingReqsCount = { 0: 0 } for targetAddrName in config.getTargetNames(snmpEngine, notifyTag): ( transportDomain, transportAddress, timeout, retryCount, params ) = config.getTargetAddr(snmpEngine, targetAddrName) ( messageProcessingModel, securityModel, securityName, securityLevel ) = config.getTargetParams(snmpEngine, params) | 2ef6d66432dc958997df2634ee4c2d01795d156e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/587/2ef6d66432dc958997df2634ee4c2d01795d156e/ntforg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
4386,
12,
365,
16,
15366,
4410,
16,
3851,
2326,
16,
3851,
461,
16,
3312,
1557,
33,
7036,
16,
819,
461,
2218,
2187,
2875,
22783,
33,
7036,
16,
2875,
6442,
33,
7036,
262,
30,
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,
1366,
4386,
12,
365,
16,
15366,
4410,
16,
3851,
2326,
16,
3851,
461,
16,
3312,
1557,
33,
7036,
16,
819,
461,
2218,
2187,
2875,
22783,
33,
7036,
16,
2875,
6442,
33,
7036,
262,
30,
468,
... |
extraFiles = string.join(self.addToOutputSandbox,';') if paramsDict.has_key('OutputSandbox'): | extraFiles = string.join( self.addToOutputSandbox, ';' ) if paramsDict.has_key( 'OutputSandbox' ): | def _toJDL(self,xmlFile=''): #messy but need to account for xml file being in /tmp/guid dir """Creates a JDL representation of itself as a Job. """ #Check if we have to do old bootstrap... classadJob = ClassAd('[]') | 50b3322668816ba92ea3f9b253d993dc34c53a21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/50b3322668816ba92ea3f9b253d993dc34c53a21/Job.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
869,
46,
8914,
12,
2890,
16,
2902,
812,
2218,
11,
4672,
468,
81,
403,
93,
1496,
1608,
358,
2236,
364,
2025,
585,
3832,
316,
342,
5645,
19,
14066,
1577,
3536,
2729,
279,
804,
8914,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
869,
46,
8914,
12,
2890,
16,
2902,
812,
2218,
11,
4672,
468,
81,
403,
93,
1496,
1608,
358,
2236,
364,
2025,
585,
3832,
316,
342,
5645,
19,
14066,
1577,
3536,
2729,
279,
804,
8914,... |
self.output_text.insert_at_cursor("dir - a list of API functions\n" + "help <function> - show documentation for a function\n" + "clear - clear text buffer\n" "--------------------------------\n") | self.output_text.insert_at_cursor(self.defaultOutput) | def OnMenuItemClick(self,arg): xmlString = pkg_resources.resource_string(__name__,"APIConsole.glade") wTree = gtk.glade.xml_new_from_buffer(xmlString, len(xmlString),"APITestDialog") signal = {"on_Activate" : self.Execute} wTree.signal_autoconnect(signal) window = wTree.get_widget("APITestDialog") self.API.set_window_icon(window) self.command = wTree.get_widget("entry1") self.output = wTree.get_widget("textview1") self.scrollwindow = wTree.get_widget("scrolledwindow1") self.output_text = gtk.TextBuffer() self.output_text.insert_at_cursor("dir - a list of API functions\n" + "help <function> - show documentation for a function\n" + "clear - clear text buffer\n" "--------------------------------\n") self.output.set_buffer(self.output_text) self.output.scroll_mark_onscreen(self.output_text.get_insert()) self.completion_model = gtk.ListStore(str) window.show_all() | 9db0f8ec5825fdc0dd1df0521f9575de94e7bd14 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10033/9db0f8ec5825fdc0dd1df0521f9575de94e7bd14/APIConsole.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
12958,
6563,
12,
2890,
16,
3175,
4672,
2025,
780,
273,
3475,
67,
4683,
18,
3146,
67,
1080,
12,
972,
529,
972,
10837,
2557,
10215,
18,
7043,
2486,
7923,
341,
2471,
273,
22718,
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,
2755,
12958,
6563,
12,
2890,
16,
3175,
4672,
2025,
780,
273,
3475,
67,
4683,
18,
3146,
67,
1080,
12,
972,
529,
972,
10837,
2557,
10215,
18,
7043,
2486,
7923,
341,
2471,
273,
22718,
18,
... |
is_import = re.compile('^[ \t]*import[ \t]*(?P<imp>[^ | is_import = re.compile('^[ \t]*import[ \t]+(?P<imp>[^ | obj_def = '[A-Za-z_][A-Za-z0-9_.]*' | 429e4a8df8863aa5ec7c9cf159385ab8418d2992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/429e4a8df8863aa5ec7c9cf159385ab8418d2992/moduleparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1081,
67,
536,
273,
5271,
37,
17,
15948,
17,
94,
67,
6362,
37,
17,
15948,
17,
94,
20,
17,
29,
27799,
65,
4035,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1081,
67,
536,
273,
5271,
37,
17,
15948,
17,
94,
67,
6362,
37,
17,
15948,
17,
94,
20,
17,
29,
27799,
65,
4035,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
raise TableDBError, dberror[1] | raise TableDBError, dberror.args[1] | def Drop(self, table): """Remove an entire table from the database""" txn = None try: txn = self.env.txn_begin() | d84da1b67a12df114de2f76e0644174f07f2c834 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/d84da1b67a12df114de2f76e0644174f07f2c834/dbtables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10895,
12,
2890,
16,
1014,
4672,
3536,
3288,
392,
7278,
1014,
628,
326,
2063,
8395,
7827,
273,
599,
775,
30,
7827,
273,
365,
18,
3074,
18,
24790,
67,
10086,
1435,
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,
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,
10895,
12,
2890,
16,
1014,
4672,
3536,
3288,
392,
7278,
1014,
628,
326,
2063,
8395,
7827,
273,
599,
775,
30,
7827,
273,
365,
18,
3074,
18,
24790,
67,
10086,
1435,
2,
-100,
-100,
-100,
... |
def symbol_item_event(self, widget, event, data): if (event and event.type == gtk.gdk.BUTTON_PRESS): | def symbol_item_event(self, item, event, text): if event.type == gtk.gdk.MOTION_NOTIFY: if event.state & gtk.gdk.BUTTON1_MASK: x=event.x y=event.y item.set( x= x, y= y) return True if event.type == gtk.gdk.BUTTON_RELEASE: | def symbol_item_event(self, widget, event, data): if (event and event.type == gtk.gdk.BUTTON_PRESS): if event.button == 1: if(not self.cursqre): return False | 15224ee039b09bc3adde951be03dd817fa58b82f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11306/15224ee039b09bc3adde951be03dd817fa58b82f/sudoku.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3273,
67,
1726,
67,
2575,
12,
2890,
16,
761,
16,
871,
16,
977,
4672,
565,
309,
871,
18,
723,
422,
22718,
18,
75,
2883,
18,
49,
1974,
1146,
67,
4400,
12096,
30,
309,
871,
18,
2019,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3273,
67,
1726,
67,
2575,
12,
2890,
16,
761,
16,
871,
16,
977,
4672,
565,
309,
871,
18,
723,
422,
22718,
18,
75,
2883,
18,
49,
1974,
1146,
67,
4400,
12096,
30,
309,
871,
18,
2019,
... |
variables = namespace.variables postional, named = self._arguments.set_to(variables, arguments) self._tracelog_args(output, postional, named) | try: return self._run(output, namespace, arguments) finally: namespace.end_user_keyword() def _run(self, output, namespace, arguments): positional, named = self._arguments.set_to(namespace.variables, arguments) self._tracelog_args(output, positional, named) | def run(self, output, namespace, arguments): namespace.start_user_keyword(self) variables = namespace.variables postional, named = self._arguments.set_to(variables, arguments) self._tracelog_args(output, postional, named) self._verify_keyword_is_valid() self.timeout.start() self._run_kws(output, namespace) ret = self._get_return_value(variables) namespace.end_user_keyword() output.trace('Return: %s' % utils.unic(ret)) return ret | 09a98786aa120bbf31e2b6600aa73567261c4e5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7408/09a98786aa120bbf31e2b6600aa73567261c4e5f/userkeyword.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
876,
16,
1981,
16,
1775,
4672,
1981,
18,
1937,
67,
1355,
67,
11041,
12,
2890,
13,
775,
30,
327,
365,
6315,
2681,
12,
2844,
16,
1981,
16,
1775,
13,
3095,
30,
1981,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
876,
16,
1981,
16,
1775,
4672,
1981,
18,
1937,
67,
1355,
67,
11041,
12,
2890,
13,
775,
30,
327,
365,
6315,
2681,
12,
2844,
16,
1981,
16,
1775,
13,
3095,
30,
1981,... |
try: simdata_loglevel = eval("SimData.LOG_%s" % simdata_loglevel.upper()) except: print "Invalid SimData logging level, defaulting to 'ALERT'" simdata_loglevel = SimData.LOG_ALERT SimData.log().setLogPriority(simdata_loglevel) | def main(argv): global log_classes initDynamicLoading() setDefaultJoystick() action = None # process command line options program = argv[0] all_args = argv[1:] log_classes = [] other_args = [] pause = 0 simdata_loglevel = "ALERT" config = findConfig() for arg in all_args: if arg == '--compile-data': action = compileData elif arg == '--dump-data': action = dumpData elif arg.startswith('--dump-data='): action = dumpData other_args.append(arg) elif arg == '--client-node': action = runClientNode elif arg == '--echo-server-node': action = runEchoServerNode elif arg == '--pause': pause = 1 elif arg in ("--help", "-h", "-help"): if action == None: print printUsage() print sys.exit(1) else: other_args.append(arg) elif arg.startswith("--config="): config = arg[9:] elif arg.startswith("--log="): log_classes.extend(arg[6:].split(':')) elif arg.startswith("--slog="): simdata_loglevel = arg[7:] else: other_args.append(arg) if action is None: action = runCSPSim loadSimData() SimData.log().setLogCategory(SimData.LOG_ALL) SimData.log().setLogPriority(SimData.LOG_DEBUG) loadCSP() try: simdata_loglevel = eval("SimData.LOG_%s" % simdata_loglevel.upper()) except: print "Invalid SimData logging level, defaulting to 'ALERT'" simdata_loglevel = SimData.LOG_ALERT SimData.log().setLogPriority(simdata_loglevel) print "Loading configuration from '%s'." % config if not CSP.openConfig(config): print "Unable to open primary configuration file (%s)" % config sys.exit(0) if pause: print "Hit <ctrl-break> to temporarily exit and set breakpoints." print "When you are done, continue execution and hit <enter>." sys.stdin.readline() action(other_args) | 94661ef29cba181b6a9e410a25555e266eb0174d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14747/94661ef29cba181b6a9e410a25555e266eb0174d/CSPSim.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
2552,
613,
67,
4701,
225,
1208,
9791,
10515,
1435,
9277,
46,
83,
1094,
1200,
1435,
225,
1301,
273,
599,
225,
468,
1207,
1296,
980,
702,
5402,
273,
5261,
63,
20,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
2552,
613,
67,
4701,
225,
1208,
9791,
10515,
1435,
9277,
46,
83,
1094,
1200,
1435,
225,
1301,
273,
599,
225,
468,
1207,
1296,
980,
702,
5402,
273,
5261,
63,
20,
... | |
lines = [] index = 0 for line in parse(data, self.schema): row = Row(line) row.index = index lines.append(row) index = index + 1 | def _load_state(self, resource): data = resource.read() | 3db18d733c8b07e2f853c3c8aecb4094d10c2cd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/3db18d733c8b07e2f853c3c8aecb4094d10c2cd7/csv_.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
945,
67,
2019,
12,
2890,
16,
1058,
4672,
501,
273,
1058,
18,
896,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
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,
389,
945,
67,
2019,
12,
2890,
16,
1058,
4672,
501,
273,
1058,
18,
896,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
source = self.source_list.get_stream(item.source_name, item.source_stream_id) | source = self.source_list.get_stream(item.source_name, item.source_stream_index) | def handle_item_added(self, item): if item.type() != 'video': return | f4567684762459477f205a737f109e24266fd53e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10170/f4567684762459477f205a737f109e24266fd53e/qttest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1726,
67,
9665,
12,
2890,
16,
761,
4672,
309,
761,
18,
723,
1435,
480,
296,
9115,
4278,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1726,
67,
9665,
12,
2890,
16,
761,
4672,
309,
761,
18,
723,
1435,
480,
296,
9115,
4278,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.isbn, verbose=self.verbose, lang='all')[0] | self.isbn, verbose=self.verbose, lang='all')[0] | def fetch(self): if not self.isbn: return try: lang = get_lang() lang = lang[:2] if re.match(r'(fr.*|de.*)', lang) else 'all' if lang == 'all': self.results = get_social_metadata(self.title, self.book_author, self.publisher, self.isbn, verbose=self.verbose, lang='all')[0] else: tmploc = ThreadwithResults(AmazonError, self.verbose, get_social_metadata, self.title, self.book_author, self.publisher,self.isbn, verbose=self.verbose, lang=lang) tmpnoloc = ThreadwithResults(AmazonError, self.verbose, get_social_metadata, self.title, self.book_author, self.publisher, self.isbn, verbose=self.verbose, lang='all') tmploc.start() tmpnoloc.start() tmploc.join() tmpnoloc.join() tmploc= tmploc.get_result() if tmploc is not None: tmploc = tmploc[0] tmpnoloc= tmpnoloc.get_result() if tmpnoloc is not None: tmpnoloc = tmpnoloc[0] print tmpnoloc if tmploc is not None and tmpnoloc is not None: if tmploc.rating is None: tmploc.rating = tmpnoloc.rating if tmploc.comments is not None: tmploc.comments = tmpnoloc.comments if tmploc.tags is None: tmploc.tags = tmpnoloc.tags self.results = tmploc except Exception, e: self.exception = e self.tb = traceback.format_exc() | 5c89b576e31b85e17cf14e85a72b1b876f87579c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/5c89b576e31b85e17cf14e85a72b1b876f87579c/amazonbis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
12,
2890,
4672,
309,
486,
365,
18,
291,
13392,
30,
327,
775,
30,
3303,
273,
336,
67,
4936,
1435,
3303,
273,
3303,
10531,
22,
65,
309,
283,
18,
1916,
12,
86,
11,
12,
4840,
4509,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
12,
2890,
4672,
309,
486,
365,
18,
291,
13392,
30,
327,
775,
30,
3303,
273,
336,
67,
4936,
1435,
3303,
273,
3303,
10531,
22,
65,
309,
283,
18,
1916,
12,
86,
11,
12,
4840,
4509,... |
elif platform == 'cygwin': x11_inc = find_file('X11/Xlib.h', [], inc_dirs) if x11_inc is None: return | def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. | 0d238d0ff7583530d6d2b431452827633dc877bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/0d238d0ff7583530d6d2b431452827633dc877bd/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
16099,
2761,
12,
2890,
16,
7290,
67,
8291,
16,
2561,
67,
8291,
4672,
468,
1021,
389,
16099,
2761,
1605,
18,
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,
5966,
67,
16099,
2761,
12,
2890,
16,
7290,
67,
8291,
16,
2561,
67,
8291,
4672,
468,
1021,
389,
16099,
2761,
1605,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
for member in self.site().categorymembers(self): | for member in self.site().categorymembers(self, namespaces): | def members(self, recurse=False): """Yield all category contents (subcats, pages, and files).""" for member in self.site().categorymembers(self): yield member if recurse: if not isinstance(recurse, bool) and recurse: recurse = recurse - 1 for subcat in self.subcategories(): for article in subcat.members(recurse): yield article | 93414042cc1b5fa35e10139396ab008a679183b7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9005/93414042cc1b5fa35e10139396ab008a679183b7/page.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4833,
12,
2890,
16,
11502,
33,
8381,
4672,
3536,
16348,
777,
3150,
2939,
261,
1717,
24750,
16,
4689,
16,
471,
1390,
13,
12123,
364,
3140,
316,
365,
18,
4256,
7675,
4743,
7640,
12,
2890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4833,
12,
2890,
16,
11502,
33,
8381,
4672,
3536,
16348,
777,
3150,
2939,
261,
1717,
24750,
16,
4689,
16,
471,
1390,
13,
12123,
364,
3140,
316,
365,
18,
4256,
7675,
4743,
7640,
12,
2890,
... |
0.42882919 + 0.15487170*I | 0.42882 + 0.15487*I | def __pow__(self, right): """ EXAMPLES: sage: C, i = ComplexField(20).objgen() sage: a = i^2; a -1.0000000 sage: a.parent() Complex Field with 20 bits of precision sage: a = (1+i)^i; a 0.42882919 + 0.15487170*I sage: (1+i)^(1+i) 0.27395725 + 0.58370113*I sage: a.parent() Complex Field with 20 bits of precision sage: i^i 0.20787954 sage: (2+i)^(0.5) 1.4553471 + 0.34356070*I """ if isinstance(right, (int, long, integer.Integer)): return ring_element.RingElement.__pow__(self, right) z = self._pari_() P = self.parent() w = P(right)._pari_() m = z**w return P(m) | 0f85c81e959512e75d1c3f66db056b379125ea81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/0f85c81e959512e75d1c3f66db056b379125ea81/complex_number.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
23509,
972,
12,
2890,
16,
2145,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
385,
16,
277,
273,
16060,
974,
12,
3462,
2934,
2603,
4507,
1435,
272,
410,
30,
279,
273,
277,
66,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
23509,
972,
12,
2890,
16,
2145,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
385,
16,
277,
273,
16060,
974,
12,
3462,
2934,
2603,
4507,
1435,
272,
410,
30,
279,
273,
277,
66,... |
return [] | return None | def col(self, col=None): if col is None: return self.cols() if col >= self._NCOLS or col < 0: return [] blanks = 0 start = self._COLOFF * col end = start + self._NROWS - 1 if end < start: end = start if end >= self._SIZE: blanks = end - self._SIZE + 1 end = self._SIZE - 1 if start >= self._SIZE: return [] set = self._DATA[start:end+1] if self._PAD: set.extend([None] * blanks) return set | a7c11467257543ed9e92ed3beebad89e6808a850 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1390/a7c11467257543ed9e92ed3beebad89e6808a850/table.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
645,
12,
2890,
16,
645,
33,
7036,
4672,
309,
645,
353,
599,
30,
327,
365,
18,
6842,
1435,
309,
645,
1545,
365,
6315,
50,
4935,
55,
578,
645,
411,
374,
30,
327,
599,
7052,
87,
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,
645,
12,
2890,
16,
645,
33,
7036,
4672,
309,
645,
353,
599,
30,
327,
365,
18,
6842,
1435,
309,
645,
1545,
365,
6315,
50,
4935,
55,
578,
645,
411,
374,
30,
327,
599,
7052,
87,
273,
... |
libma57_src = ['ma57_lib.c','nlpy_alloc.c'] pyma57_src = ['_pyma57.c'] | pyma57_src = ['ma57_lib.c','nlpy_alloc.c','_pyma57.c'] | def configuration(parent_package='',top_path=None): import numpy import os import ConfigParser from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info, NotFoundError # Read relevant NLPy-specific configuration options. nlpy_config = ConfigParser.SafeConfigParser() nlpy_config.read(os.path.join(top_path, 'site.cfg')) hsl_dir = nlpy_config.get('HSL', 'hsl_dir') metis_dir = nlpy_config.get('HSL', 'metis_dir') metis_lib = nlpy_config.get('HSL', 'metis_lib') galahad_dir = nlpy_config.get('GALAHAD', 'galahad_dir') print 'hsl_dir = ', hsl_dir config = Configuration('linalg', parent_package, top_path) # Get info from site.cfg blas_info = get_info('blas_opt',0) if not blas_info: print 'No blas info found' # Relevant files for building MA27 extension. ma27_src = ['fd05ad.f', 'id05ad.f', 'ma27ad.f'] libma27_src = ['ma27_lib.c','ma27fact.f','nlpy_alloc.c'] pyma27_src = ['_pyma27.c'] # Relevant files for building MA57 extension. ma57_src = ['fd05ad.f', 'ma57ad.f', 'mc47ad.f', 'mc71ad.f', 'fd15ad.f', 'mc21ad.f', 'mc59ad.f', 'mc34ad.f', 'mc64ad.f'] libma57_src = ['ma57_lib.c','nlpy_alloc.c'] pyma57_src = ['_pyma57.c'] # Build PyMA27 ma27_sources = [os.path.join('src',name) for name in libma27_src] ma27_sources += [os.path.join(hsl_dir,name) for name in ma27_src] config.add_library( name='ma27', sources=ma27_sources, include_dirs=[hsl_dir,'src'], extra_info=blas_info, ) config.add_extension( name='_pyma27', sources=[os.path.join('src',name) for name in pyma27_src], depends=[], libraries=['ma27'], include_dirs=['src'], extra_info=blas_info, ) # Build PyMA57 ma57_sources = [os.path.join('src',name) for name in libma57_src] ma57_sources += [os.path.join(hsl_dir,name) for name in ma57_src] config.add_library( name='ma57', sources=ma57_sources, libraries=[metis_lib], library_dirs=[metis_dir], include_dirs=[hsl_dir,'src'], extra_info=blas_info, ) config.add_extension( name='_pyma57', sources=[os.path.join('src',name) for name in pyma57_src], libraries=[metis_lib,'ma57'], library_dirs=[metis_dir], include_dirs=['src'], extra_info=blas_info, ) config.add_subpackage('scaling') config.make_config_py() return config | 6429173ec73b7f648fb4fd70656d66ec9c89737d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13857/6429173ec73b7f648fb4fd70656d66ec9c89737d/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1664,
12,
2938,
67,
5610,
2218,
2187,
3669,
67,
803,
33,
7036,
4672,
1930,
3972,
1930,
1140,
1930,
25076,
628,
3972,
18,
4413,
5471,
18,
23667,
67,
1367,
1930,
4659,
628,
3972,
18,
4413,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1664,
12,
2938,
67,
5610,
2218,
2187,
3669,
67,
803,
33,
7036,
4672,
1930,
3972,
1930,
1140,
1930,
25076,
628,
3972,
18,
4413,
5471,
18,
23667,
67,
1367,
1930,
4659,
628,
3972,
18,
4413,... |
self.fields['body'].help_text = _(u'Please describe why this thread had to be moved. ') + self.fields['body'].help_text | self.fields['body'].help_text = string_concat(ugettext_lazy(u'Please describe why this thread had to be moved.'), ' ', self.fields['body'].help_text) | def __init__(self, *args, **kwargs): super(MoveAndAnnotateForm, self).__init__(*args, **kwargs) | dae65d9d091195170a36d9f34820415deb0a18e5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11563/dae65d9d091195170a36d9f34820415deb0a18e5/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
2240,
12,
7607,
1876,
31638,
1204,
16,
365,
2934,
972,
2738,
972,
30857,
1968,
16,
2826,
4333,
13,
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,
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,
380,
1968,
16,
2826,
4333,
4672,
2240,
12,
7607,
1876,
31638,
1204,
16,
365,
2934,
972,
2738,
972,
30857,
1968,
16,
2826,
4333,
13,
2,
-100,
-100,
-100,
... |
self.xyzChanged = 0 self.atomsChanged = 0 self.forcePickle = 0 self.initVersion = self.version() self.info = { 'date':t.dateSortString() } | def __init__( self, source=None, pdbCode=None, noxyz=0, skipRes=None ): """ - PDBModel() creates an empty Model to which coordinates (field xyz) and PDB infos (field atoms) have still to be added. - PDBModel( file_name ) creates a complete model with coordinates and PDB infos taken from file_name (pdb, pdb.gz, pickled PDBModel) - PDBModel( PDBModel ) creates a copy of the given model - PDBModel( PDBModel, noxyz=1 ) creates a copy without coordinates | e05a50659228672e62cb4012d838f99d6b1e4156 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/482/e05a50659228672e62cb4012d838f99d6b1e4156/PDBModel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
1084,
33,
7036,
16,
10892,
1085,
33,
7036,
16,
1158,
17177,
33,
20,
16,
2488,
607,
33,
7036,
262,
30,
3536,
300,
21601,
1488,
1435,
3414,
392,
1008,
3164,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
365,
16,
1084,
33,
7036,
16,
10892,
1085,
33,
7036,
16,
1158,
17177,
33,
20,
16,
2488,
607,
33,
7036,
262,
30,
3536,
300,
21601,
1488,
1435,
3414,
392,
1008,
3164,... | |
self.frame = tk.Frame(self) | self.frame = tk.Frame(self, width=self.width, height=self.height) | def draw(self): """Draw widgets.""" self.style.apply(self) #self.frame = tk.Frame(self, width=self.width, height=self.height) self.frame = tk.Frame(self) self.frame.pack(fill='both', expand=True) self.resizable(width=True, height=True) # Single-application GUI if len(self.apps) == 1: app = self.apps[0] app.draw(self.frame) app.pack(anchor='n', fill='both', expand=True) # Multi-application (tabbed) GUI else: tabs = Tabs(self.frame, 'top') for app in self.apps: app.draw(tabs) tabs.add(app.program, app) tabs.draw() tabs.pack(anchor='n', fill='both', expand=True) #self.frame.pack_propagate(False) | 0c5eab086f89a25584eec70b1d8840144b78481c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4675/0c5eab086f89a25584eec70b1d8840144b78481c/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
3536,
6493,
10965,
12123,
365,
18,
4060,
18,
9010,
12,
2890,
13,
468,
2890,
18,
3789,
273,
13030,
18,
3219,
12,
2890,
16,
1835,
33,
2890,
18,
2819,
16,
2072,
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,
3724,
12,
2890,
4672,
3536,
6493,
10965,
12123,
365,
18,
4060,
18,
9010,
12,
2890,
13,
468,
2890,
18,
3789,
273,
13030,
18,
3219,
12,
2890,
16,
1835,
33,
2890,
18,
2819,
16,
2072,
33,
... |
if alignment=="left": indent=0 | if alignment == "left": indent = 0 | def paintText(draw, x, y, width, height, text, font, colour, alignment): """Takes a piece of text and draws it onto an image inside a bounding box.""" #The text is wider than the width of the bounding box lines,tmp,h = intelliDraw(draw,text,font,width) j = 0 for i in lines: if (j*h) < (height-h): write( "Wrapped text = " + i.encode("ascii", "replace"), False) if alignment=="left": indent=0 elif alignment=="center" or alignment=="centre": indent=(width/2) - (draw.textsize(i,font)[0] /2) elif alignment=="right": indent=width - draw.textsize(i,font)[0] else: indent=0 draw.text( (x+indent,y+j*h),i , font=font, fill=colour) else: write( "Truncated text = " + i.encode("ascii", "replace"), False) #Move to next line j = j + 1 | c82d8a0c4a33fc669861191621297cdbb83d3d9b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13713/c82d8a0c4a33fc669861191621297cdbb83d3d9b/mythburn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12574,
1528,
12,
9446,
16,
619,
16,
677,
16,
1835,
16,
2072,
16,
977,
16,
3512,
16,
15046,
16,
8710,
4672,
3536,
11524,
279,
11151,
434,
977,
471,
30013,
518,
10170,
392,
1316,
4832,
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,
12574,
1528,
12,
9446,
16,
619,
16,
677,
16,
1835,
16,
2072,
16,
977,
16,
3512,
16,
15046,
16,
8710,
4672,
3536,
11524,
279,
11151,
434,
977,
471,
30013,
518,
10170,
392,
1316,
4832,
2... |
access *: private | if 0: access *: private | def close(self): self._ensure_header_written() if self._nframeswritten != self._nframes or \ self._datalength != self._datawritten: self._patchheader() self._file.flush() self._file = None | c0567b79e54024dd1c1fa1d2102623eb96163515 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c0567b79e54024dd1c1fa1d2102623eb96163515/sunau.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
365,
6315,
15735,
67,
3374,
67,
9748,
1435,
309,
365,
6315,
82,
10278,
9748,
480,
365,
6315,
82,
10278,
578,
521,
365,
6315,
72,
3145,
1288,
480,
365,
6315,
892,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1746,
12,
2890,
4672,
365,
6315,
15735,
67,
3374,
67,
9748,
1435,
309,
365,
6315,
82,
10278,
9748,
480,
365,
6315,
82,
10278,
578,
521,
365,
6315,
72,
3145,
1288,
480,
365,
6315,
892,
... |
for iname in sys.argv[1:]: | for iname in inames: | pat = r'typedef *(list|vector) *< *([^ ].*[^ ]) *>' | 11ace61991eeade2a6548e8a8ab7571d7e74cf65 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/310/11ace61991eeade2a6548e8a8ab7571d7e74cf65/extract_some_templates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
9670,
273,
436,
1404,
388,
536,
380,
12,
1098,
96,
7737,
13,
380,
32,
380,
8178,
308,
4509,
5969,
308,
13,
380,
1870,
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,
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,
9670,
273,
436,
1404,
388,
536,
380,
12,
1098,
96,
7737,
13,
380,
32,
380,
8178,
308,
4509,
5969,
308,
13,
380,
1870,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
def _step_direction(self, p): | def _perform_step(self, p, grad, coeff): states = p.states for (g, state) in zip(grad,states): state.x += coeff * g def _step_direction(self, p, dostep = True): | def iterstats(self): return {'grad norm': self.cur_grad_norm} | 0ba80740ba1ae1f95289a79fc05208c58ebe6f01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9024/0ba80740ba1ae1f95289a79fc05208c58ebe6f01/parameter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
5296,
12,
2890,
4672,
327,
13666,
9974,
4651,
4278,
365,
18,
1397,
67,
9974,
67,
7959,
97,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
5296,
12,
2890,
4672,
327,
13666,
9974,
4651,
4278,
365,
18,
1397,
67,
9974,
67,
7959,
97,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
icons = [os.path.join("Icons",name) for name in Icons] | icons = [os.path.join(package_dir, "Icons",name) for name in Icons] txts = [os.path.join(package_dir, name) for name in txt_files] | def get_source_files(self): # returns the .py files, the .txt files, and the icons icons = [os.path.join("Icons",name) for name in Icons] return build_py.get_source_files(self)+txt_files+icons | 32de522b61242bda7170138380e1663bfc8924c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/32de522b61242bda7170138380e1663bfc8924c4/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3168,
67,
2354,
12,
2890,
4672,
468,
1135,
326,
263,
2074,
1390,
16,
326,
263,
5830,
1390,
16,
471,
326,
17455,
17455,
273,
306,
538,
18,
803,
18,
5701,
12,
5610,
67,
1214,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3168,
67,
2354,
12,
2890,
4672,
468,
1135,
326,
263,
2074,
1390,
16,
326,
263,
5830,
1390,
16,
471,
326,
17455,
17455,
273,
306,
538,
18,
803,
18,
5701,
12,
5610,
67,
1214,
... |
output = subprocess.Popen(cmd, stdout=subprocess.PIPE).stdout.read() return output.strip() | try: output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0] return output.strip() finally: reap_children() | def run_pydoc(module_name, *args): """ Runs pydoc on the specified module. Returns the stripped output of pydoc. """ cmd = [sys.executable, pydoc.__file__, " ".join(args), module_name] output = subprocess.Popen(cmd, stdout=subprocess.PIPE).stdout.read() return output.strip() | 8561d129a702534f16a5b0ee716fc4211f1b3e2d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/8561d129a702534f16a5b0ee716fc4211f1b3e2d/test_pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
2074,
2434,
12,
2978,
67,
529,
16,
380,
1968,
4672,
3536,
1939,
87,
2395,
2434,
603,
326,
1269,
1605,
18,
2860,
326,
13300,
876,
434,
2395,
2434,
18,
3536,
1797,
273,
306,
94... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
2074,
2434,
12,
2978,
67,
529,
16,
380,
1968,
4672,
3536,
1939,
87,
2395,
2434,
603,
326,
1269,
1605,
18,
2860,
326,
13300,
876,
434,
2395,
2434,
18,
3536,
1797,
273,
306,
94... |
return http.Response(stream=s) | return HTMLResponse(stream=s) | def render(self, ctx): dir = os.path.abspath(self.worksheet.data_directory()) filename = ctx.args['name'][0] if ctx.args.has_key('action'): if ctx.args['action'][0] == 'delete': path = '%s/%s'%(self.worksheet.data_directory(), filename) os.unlink(path) return http.Response(stream = message("Successfully deleted '%s'"%filename, '/home/' + self.worksheet.filename())) s = notebook.html_download_or_delete_datafile(self.worksheet, self.username, filename) return http.Response(stream=s) | 39855fabbbbe971c1c1d64566b1625e9c1c6d482 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/39855fabbbbe971c1c1d64566b1625e9c1c6d482/twist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
1577,
273,
1140,
18,
803,
18,
5113,
803,
12,
2890,
18,
1252,
8118,
18,
892,
67,
5149,
10756,
1544,
273,
1103,
18,
1968,
3292,
529,
3546,
63,
20,
65,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
1577,
273,
1140,
18,
803,
18,
5113,
803,
12,
2890,
18,
1252,
8118,
18,
892,
67,
5149,
10756,
1544,
273,
1103,
18,
1968,
3292,
529,
3546,
63,
20,
65,
3... |
getLog(prefix="verbose").info("invXml: %s" % invXml) | getLog(prefix="verbose.").info("invXml: %s" % invXml) | def runInvcol(pkgPath): runInv = 0 if not os.path.exists( os.path.join(pkgPath, "out.xml") ): getLog(prefix="verbose").info("invcol output files dont exist, running inventory") runInv = 1 else: fd = open("/proc/uptime", "r") line = fd.readline() fd.close() systemUptimeSeconds = float(line.split()[0]) statinfo = os.stat(os.path.join(pkgPath, "out.xml")) if systemUptimeSeconds < (time.time() - statinfo.st_mtime): getLog(prefix="verbose").info("invcol output not up-to-date: %s < %s" % (systemUptimeSeconds, (time.time() - statinfo.st_mtime))) runInv = 1 if runInv: try: os.unlink(os.path.join(pkgPath, "err.xml")) except OSError: pass env = dict(os.environ) env["LD_LIBRARY_PATH"] = os.path.pathsep.join([os.environ.get('LD_LIBRARY_PATH',''), pkgPath]) common.loggedCmd( [os.path.join(pkgPath,"invcol"), "-outc=out.xml", "-logc=err.xml"], env=env, cwd=pkgPath, timeout=1200, logger=getLog(), raiseExc=False) fd = open(os.path.join(pkgPath, "out.xml")) invXml = fd.read() fd.close() try: errXml="" fd = open(os.path.join(pkgPath, "err.xml")) errXml = fd.read() fd.close() except IOError, e: pass getLog(prefix="verbose").info("invXml: %s" % invXml) return invXml, errXml | 18a1a46e998a1339a4dbc3a5f1bdb35e2a32c60d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/38/18a1a46e998a1339a4dbc3a5f1bdb35e2a32c60d/dup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
3605,
1293,
12,
10657,
743,
4672,
1086,
3605,
273,
374,
309,
486,
1140,
18,
803,
18,
1808,
12,
1140,
18,
803,
18,
5701,
12,
10657,
743,
16,
315,
659,
18,
2902,
7923,
262,
30,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
3605,
1293,
12,
10657,
743,
4672,
1086,
3605,
273,
374,
309,
486,
1140,
18,
803,
18,
1808,
12,
1140,
18,
803,
18,
5701,
12,
10657,
743,
16,
315,
659,
18,
2902,
7923,
262,
30,
9... |
result = self.jobDB.selectJobs( { 'Status': self.__jobStates } ) | result = self.jobDB.selectJobs( { 'Status': self.__jobStates } ) | def execute( self ): #Get jobs from DB result = self.jobDB.selectJobs( { 'Status': self.__jobStates } ) if not result[ 'OK' ]: gLogger.error( "Cannot retrieve jobs in states %s" % self.__jobStates ) return result jobsList = result[ 'Value' ] for i in range( len( jobsList ) ): jobsList[i] = int( jobsList[i] ) jobsList.sort() self.log.info( "Got %s jobs for this iteration" % len( jobsList ) ) if not jobsList: return S_OK() #Check jobs that are already being optimized newJobsList = self._optimizingJobs.addJobs( jobsList ) if not newJobsList: return S_OK() #Get attrs of jobs to be optimized result = self.jobDB.getAttributesForJobList( newJobsList ) if not result[ 'OK' ]: gLogger.error( "Cannot retrieve attributes for %s jobs %s" % len( newJobsList ) ) return result jobsToProcess = result[ 'Value' ] for jobId in jobsToProcess: self.log.info( "== Processing job %s == " % jobId ) jobAttrs = jobsToProcess[ jobId ] result = self.__dispatchJob( jobId, jobAttrs, False ) if not result[ 'OK' ]: gLogger.error( "There was a problem optimizing job", "JID %s: %s" % ( jobId, result[ 'Message' ] ) ) return S_OK() | 76604cb547c24d2712e0393bdd8c3d7348989097 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/76604cb547c24d2712e0393bdd8c3d7348989097/ThreadedMightyOptimizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
365,
262,
30,
468,
967,
6550,
628,
2383,
563,
273,
365,
18,
4688,
2290,
18,
4025,
7276,
12,
288,
296,
1482,
4278,
365,
16186,
4688,
7629,
225,
289,
262,
309,
486,
563,
63,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
365,
262,
30,
468,
967,
6550,
628,
2383,
563,
273,
365,
18,
4688,
2290,
18,
4025,
7276,
12,
288,
296,
1482,
4278,
365,
16186,
4688,
7629,
225,
289,
262,
309,
486,
563,
63,
... |
self.drawing_area[2])/self.current_step) - 1 result.append(float(self.drawing_area[2] + tmp*self.current_step)) | self.drawing_area[1])/self.current_step) - 1 result.append(float(self.drawing_area[1] + tmp*self.current_step)) | def snap_to_grid(self, x, y): result = [] tmp = round(((x+(self.current_step)) - self.drawing_area[0])/self.current_step) - 1 result.append(float(self.drawing_area[0] + tmp*self.current_step)) | 524a5141123df0fdc71c52fa7b1aa574eda6a04f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11306/524a5141123df0fdc71c52fa7b1aa574eda6a04f/redraw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10915,
67,
869,
67,
5222,
12,
2890,
16,
619,
16,
677,
4672,
563,
273,
5378,
1853,
273,
3643,
12443,
12,
92,
15,
12,
2890,
18,
2972,
67,
4119,
3719,
300,
365,
18,
9446,
310,
67,
5036,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10915,
67,
869,
67,
5222,
12,
2890,
16,
619,
16,
677,
4672,
563,
273,
5378,
1853,
273,
3643,
12443,
12,
92,
15,
12,
2890,
18,
2972,
67,
4119,
3719,
300,
365,
18,
9446,
310,
67,
5036,... |
rbnfs = set() | def GenResIndex(dat_list_file_path): res_index = "res_index.txt" locales = set() brkitrs = set() colls = set() currs = set() langs = set() regions = set() zones = set() rbnfs = set() for line in open(dat_list_file_path, "r"): if line.find("root.") >= 0: continue if line.find("res_index") >= 0: continue if line.find("_.res") >= 0: continue; if line.find("brkitr/") >= 0: end = line.find(".res") if end > 0: brkitrs.add(line[line.find("/")+1:end]) elif line.find("coll/") >= 0: end = line.find(".res") if end > 0: colls.add(line[line.find("/")+1:end]) elif line.find("curr/") >= 0: end = line.find(".res") if end > 0: currs.add(line[line.find("/")+1:end]) elif line.find("lang/") >= 0: end = line.find(".res") if end > 0: langs.add(line[line.find("/")+1:end]) elif line.find("region/") >= 0: end = line.find(".res") if end > 0: regions.add(line[line.find("/")+1:end]) elif line.find("zone/") >= 0: end = line.find(".res") if end > 0: zones.add(line[line.find("/")+1:end]) elif line.find("rbnf/") >= 0: end = line.find(".res") if end > 0: rbnfs.add(line[line.find("/")+1:end]) elif line.find(".res") >= 0: # We need to determine the resource is locale resource or misc resource. # To determine the locale resource, we assume max script length is 3. end = line.find(".res") if end <= 3 or (line.find("_") <= 3 and line.find("_") > 0): locales.add(line[:end]) ShowMissing(brkitrs, locales, "brkitr", dat_list_file_path) ShowMissing(colls, locales, "coll", dat_list_file_path) ShowMissing(currs, locales, "curr", dat_list_file_path) ShowMissing(langs, locales, "lang", dat_list_file_path) ShowMissing(regions, locales, "region", dat_list_file_path) ShowMissing(zones, locales, "zone", dat_list_file_path) ShowMissing(rbnfs, locales, "rbnf", dat_list_file_path) WriteIndex(os.path.join(TMP_DAT_PATH, res_index), locales, CLDR_VERSION) WriteIndex(os.path.join(TMP_DAT_PATH, "brkitr", res_index), brkitrs) WriteIndex(os.path.join(TMP_DAT_PATH, "coll", res_index), colls) WriteIndex(os.path.join(TMP_DAT_PATH, "curr", res_index), currs) WriteIndex(os.path.join(TMP_DAT_PATH, "lang", res_index), langs) WriteIndex(os.path.join(TMP_DAT_PATH, "region", res_index), regions) WriteIndex(os.path.join(TMP_DAT_PATH, "zone", res_index), zones) WriteIndex(os.path.join(TMP_DAT_PATH, "rbnf", res_index), rbnfs) # Call genrb to generate new res_index.res. InvokeIcuTool("genrb", TMP_DAT_PATH, [res_index]) InvokeIcuTool("genrb", os.path.join(TMP_DAT_PATH, "brkitr"), [res_index]) InvokeIcuTool("genrb", os.path.join(TMP_DAT_PATH, "coll"), [res_index]) InvokeIcuTool("genrb", os.path.join(TMP_DAT_PATH, "curr"), [res_index]) InvokeIcuTool("genrb", os.path.join(TMP_DAT_PATH, "lang"), [res_index]) InvokeIcuTool("genrb", os.path.join(TMP_DAT_PATH, "region"), [res_index]) InvokeIcuTool("genrb", os.path.join(TMP_DAT_PATH, "zone"), [res_index]) if len(rbnfs): InvokeIcuTool("genrb", os.path.join(TMP_DAT_PATH, "rbnf"), [res_index]) | 89f309f809ddaba6a3ba4a31a8ee74cfa5e85be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10672/89f309f809ddaba6a3ba4a31a8ee74cfa5e85be3/icu_dat_generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10938,
607,
1016,
12,
3404,
67,
1098,
67,
768,
67,
803,
4672,
400,
67,
1615,
273,
315,
455,
67,
1615,
18,
5830,
6,
225,
6922,
273,
444,
1435,
5186,
8691,
5453,
273,
444,
1435,
645,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10938,
607,
1016,
12,
3404,
67,
1098,
67,
768,
67,
803,
4672,
400,
67,
1615,
273,
315,
455,
67,
1615,
18,
5830,
6,
225,
6922,
273,
444,
1435,
5186,
8691,
5453,
273,
444,
1435,
645,
3... | |
lang_obj=pool.get('res.lang') lang_ids=lang_obj.search(cr, uid, []) langs=lang_obj.browse(cr, uid, lang_ids) for lang in langs: if lang.code and lang.code != 'en_US': filename=os.path.join(tools.config["root_path"], "i18n", lang.code + ".csv") tools.trans_load(cr.dbname, filename, lang.code) | def _update(self, cr, uid, data, context): pool=pooler.get_pool(cr.dbname) form=data['form'] if 'profile' in data['form'] and data['form']['profile'] > 0: module_obj=pool.get('ir.module.module') module_obj.state_update(cr, uid, [data['form']['profile']], 'to install', ['uninstalled'], context) | 5a2e996a3900c63b5d1c8375878756c478b4f0b3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/5a2e996a3900c63b5d1c8375878756c478b4f0b3/wizard_base_setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
2845,
33,
6011,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13,
646,
33,
892,
3292,
687,
3546,
309,
296,
5040,
11,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2725,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
2845,
33,
6011,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13,
646,
33,
892,
3292,
687,
3546,
309,
296,
5040,
11,
... | |
except (ValueError,TypeError): pass | except (ValueError,TypeError,decimal.InvalidOperation): pass | def _convertNumberWithCulture(variant, f): try: return f(variant) except (ValueError,TypeError): try: europeVsUS = str(variant).replace(",",".") return f(europeVsUS) except (ValueError,TypeError): pass | 74ab8571f116533d1cec2d41b38fa26c64a882ae /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/677/74ab8571f116533d1cec2d41b38fa26c64a882ae/adodbapi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6283,
1854,
1190,
39,
29923,
12,
8688,
16,
284,
4672,
775,
30,
327,
284,
12,
8688,
13,
1335,
261,
23610,
16,
19030,
4672,
775,
30,
425,
24428,
16082,
3378,
273,
609,
12,
8688,
293... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6283,
1854,
1190,
39,
29923,
12,
8688,
16,
284,
4672,
775,
30,
327,
284,
12,
8688,
13,
1335,
261,
23610,
16,
19030,
4672,
775,
30,
425,
24428,
16082,
3378,
273,
609,
12,
8688,
293... |
@return: -1 if bad structure type ID is passed otherwise | @return: -1 if bad structure type ID is passed otherwise | def GetMemberQty(sid): """ Get number of members of a structure @param sid: structure type ID @return: -1 if bad structure type ID is passed otherwise returns number of members. """ s = idaapi.get_struc(sid) if not s: return -1 return s.memqty | f6eb09ba783822659c8520f1385c89f40cdd4a71 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6984/f6eb09ba783822659c8520f1385c89f40cdd4a71/idc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
4419,
53,
4098,
12,
7453,
4672,
3536,
968,
1300,
434,
4833,
434,
279,
3695,
225,
632,
891,
7348,
30,
3695,
618,
1599,
225,
632,
2463,
30,
300,
21,
309,
5570,
3695,
618,
1599,
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,
968,
4419,
53,
4098,
12,
7453,
4672,
3536,
968,
1300,
434,
4833,
434,
279,
3695,
225,
632,
891,
7348,
30,
3695,
618,
1599,
225,
632,
2463,
30,
300,
21,
309,
5570,
3695,
618,
1599,
353,... |
return doc and string.strip(string.split(doc, "\n")[0]) or None | return doc and doc.split("\n")[0].strip() or None | def shortDescription(self): """Returns a one-line description of the test, or None if no description has been provided. | 0f10f8b8ab4e454af2afa444bd55397be9910a03 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7167/0f10f8b8ab4e454af2afa444bd55397be9910a03/unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3025,
3291,
12,
2890,
4672,
3536,
1356,
279,
1245,
17,
1369,
2477,
434,
326,
1842,
16,
578,
599,
309,
1158,
2477,
711,
2118,
2112,
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,
0,
0,
0,
0,
0,
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,
3025,
3291,
12,
2890,
4672,
3536,
1356,
279,
1245,
17,
1369,
2477,
434,
326,
1842,
16,
578,
599,
309,
1158,
2477,
711,
2118,
2112,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
t = d.tasks[variant] if t: seen.add(d) if t.type == 'cobjects' and d in self.depends: task.add_objects.append(d.name) else: task.uselib_local.append(d.name) task.inheritedoptions.merge(t.inheritedoptions) | if d == None: continue seen.add(d) if d not in blacklist: t = d.tasks[variant] if t: if t.type == 'cobjects' and d in self.depends+extradepends: task.add_objects.append(d.name) else: task.uselib_local.append(d.name) task.inheritedoptions.merge(t.inheritedoptions) | def gentask(self, bld, env, variant, type, options = coptions(), inheritedoptions = coptions(), extradepends = []): if not self.tasks.has_key(variant): if type=='dummy' or not env['PLATFORM'] in self.platforms or not env['ARCHITECTURE'] in self.archs: task = None # will deploy files that were scheduled to be deployed self.sourcetree.make_sources(bld, env, self.root) else: optim,compiler,platform,architecture,version = variant.split('-') task = bld.new_task_gen() task.target = self.name task.env = env.copy() task.type = type task.features = ['cc', 'cxx', type] task.usemaster = self.usemaster task.inheritedoptions = coptions() task.inheritedoptions.merge(inheritedoptions) task.uselib = [optim] if self.category != '3rdparty': task.uselib.append('warnall') task.uselib_local = [] task.add_objects = [] task.install_path = os.path.abspath(os.path.join(env['PREFIX'],env['DEPLOY']['prefix'],env['DEPLOY'][self.install_path])) dps = self.depends + extradepends seen = set() while dps: d = dps.pop(0) t = d.tasks[variant] if t: seen.add(d) if t.type == 'cobjects' and d in self.depends: task.add_objects.append(d.name) else: task.uselib_local.append(d.name) task.inheritedoptions.merge(t.inheritedoptions) dps += [dep for dep in d.depends if dep not in seen] task.options = self.getoptions(env['PLATFORM'], env['ARCHITECTURE']) task.options.merge(options) task.options.merge(task.inheritedoptions) try: task.pchsource = self.pchsource task.pchheader = self.pchheader task.pchfullheader = self.pchfullheader except AttributeError: pass | bb9405bd0d9f5558082aacf11e1b5e9479adec61 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7302/bb9405bd0d9f5558082aacf11e1b5e9479adec61/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
314,
319,
835,
12,
2890,
16,
324,
1236,
16,
1550,
16,
5437,
16,
618,
16,
702,
273,
1825,
573,
9334,
12078,
2116,
273,
1825,
573,
9334,
2870,
27360,
273,
5378,
4672,
309,
486,
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,
314,
319,
835,
12,
2890,
16,
324,
1236,
16,
1550,
16,
5437,
16,
618,
16,
702,
273,
1825,
573,
9334,
12078,
2116,
273,
1825,
573,
9334,
2870,
27360,
273,
5378,
4672,
309,
486,
365,
18,
... |
locations = \ KindCollection.update(parcel, 'locations') locations.kind = pim.Location.getKind(parcel.itsView) locations.recursive = True | locations = KindCollection.update( parcel, 'locations', kind = pim.Location.getKind(parcel.itsView), recursive = True) | def GetColorForHue (hue): rgb = wx.Image.HSVtoRGB (wx.Image_HSVValue (hue / 360.0, 0.5, 1.0)) return ColorType (rgb.red, rgb.green, rgb.blue, 255) | b08eb6642354633e4de341cadb8747c0ebfabaa4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/b08eb6642354633e4de341cadb8747c0ebfabaa4/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2957,
1290,
44,
344,
261,
76,
344,
4672,
6917,
273,
7075,
18,
2040,
18,
13173,
58,
869,
11343,
261,
27226,
18,
2040,
67,
13173,
58,
620,
261,
76,
344,
342,
12360,
18,
20,
16,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2957,
1290,
44,
344,
261,
76,
344,
4672,
6917,
273,
7075,
18,
2040,
18,
13173,
58,
869,
11343,
261,
27226,
18,
2040,
67,
13173,
58,
620,
261,
76,
344,
342,
12360,
18,
20,
16,
37... |
return 1 | print "openbabel timeout (100 sec)" return False | def launch_ne1_openbabel(self, in_format, infile, out_format, outfile): """ Runs NE1's own version of Open Babel for translating to/from MMP and many chemistry file formats. It will not work with other versions of Open Babel since they to not support MMP file format (yet). <in_format> - the chemistry format of the input file, specified by the file format extension. <infile> is the input file. <out_format> - the chemistry format of the output file, specified by the file format extension. <outfile> is the converted file. Example: babel -immp methane.mmp -oxyz methane.xyz """ # filePath = the current directory NE-1 is running from. filePath = os.path.dirname(os.path.abspath(sys.argv[0])) # "program" is the full path to *NE1's own* Open Babel executable. if sys.platform == 'win32': program = os.path.normpath(filePath + '/../bin/babel.exe') else: program = os.path.normpath(filePath + '/../bin/babel') if not os.path.exists(program): print "Babel program not found here: ", program return 1 # Will (Ware) had this debug arg for our version of Open Babel, but # I've no idea if it works now or what it does. Mark 2007-06-05. if debug_flags.atom_debug: debugvar = "WWARE_DEBUG=1" print "debugvar =", debugvar else: debugvar = None if debug_flags.atom_debug: print "program =", program infile = os.path.normpath(infile) outfile = os.path.normpath(outfile) in_format = "-i"+in_format out_format = "-o"+out_format arguments = QStringList() i = 0 for arg in [in_format, infile, out_format, outfile, debugvar]: if not arg: continue # For debugvar. if debug_flags.atom_debug: print "argument", i, " :", repr(arg) i += 1 arguments.append(arg) # Looks like Will's special debugging code. Mark 2007-06-05 if debug_babel: # wware 060906 Create a shell script to re-run Open Babel outf = open("rerunbabel.sh", "w") # On the Mac, "-f" prevents running .bashrc # On Linux it disables filename wildcards (harmless) outf.write("#!/bin/sh -f\n") for a in arguments: outf.write(str(a) + " \\\n") outf.write("\n") outf.close() # Need to set these environment variables on MacOSX so that babel can # find its libraries. Brian Helfrich 2007/06/05 if sys.platform == 'darwin': babelLibPath = os.path.normpath(filePath + '/../Frameworks') os.environ['DYLD_LIBRARY_PATH'] = babelLibPath babelLibPath = babelLibPath + '/openbabel' os.environ['BABEL_LIBDIR'] = babelLibPath | fe33539a47bace84edcbe2f654c91dc7daae70e9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/fe33539a47bace84edcbe2f654c91dc7daae70e9/ops_files.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8037,
67,
4644,
21,
67,
3190,
70,
873,
12,
2890,
16,
316,
67,
2139,
16,
14568,
16,
596,
67,
2139,
16,
8756,
4672,
3536,
1939,
87,
12901,
21,
1807,
4953,
1177,
434,
3502,
605,
873,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8037,
67,
4644,
21,
67,
3190,
70,
873,
12,
2890,
16,
316,
67,
2139,
16,
14568,
16,
596,
67,
2139,
16,
8756,
4672,
3536,
1939,
87,
12901,
21,
1807,
4953,
1177,
434,
3502,
605,
873,
36... |
prev = next + 1 | prev = next | def collect_net (next, buffer, collect, terminate): "consume a buffer of netstrings into a stallable collector sink" lb = len (buffer) if next > 0: if next >= lb: collect (buffer) return next - lb, '', False # buffer more ... if buffer[next] == ',': collect (buffer[:next]) if terminate (None): return 0, buffer[next+1:], True # stop now! else: raise NetstringError, '3 missing comma' prev = next + 1 else: prev = 0 while prev < lb: pos = buffer.find (':', prev) if pos < 0: if prev > 0: buffer = buffer[prev:] if not buffer.isdigit (): raise NetstringError, '1 not a netstring' return 0, buffer, False # buffer more ... try: next = pos + int (buffer[prev:pos]) + 1 except: raise NetstringError, '2 not a length' if next >= lb: collect (buffer[pos+1:]) return next - lb, '', False # buffer more elif buffer[next] == ',': if terminate (buffer[pos+1:next]): return 0, buffer[next+1:], True # stop now! else: raise NetstringError, '3 missing comma' prev = next + 1 # continue ... return 0, '', False # buffer consumed. | 6383480fc26df1471331555d640e3c004ec429fb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2577/6383480fc26df1471331555d640e3c004ec429fb/async_net.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3274,
67,
2758,
261,
4285,
16,
1613,
16,
3274,
16,
10850,
4672,
315,
21224,
279,
1613,
434,
2901,
10219,
1368,
279,
384,
454,
429,
8543,
9049,
6,
7831,
273,
562,
261,
4106,
13,
309,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3274,
67,
2758,
261,
4285,
16,
1613,
16,
3274,
16,
10850,
4672,
315,
21224,
279,
1613,
434,
2901,
10219,
1368,
279,
384,
454,
429,
8543,
9049,
6,
7831,
273,
562,
261,
4106,
13,
309,
10... |
]) | ]) tmp.close() except gobject.GError, error: print "gobject.GError: %s: %s" % (item.Path, error) | def getBilds(self): self.mainViewModel.clear() self.bilds=[] for k, item in self.Backend.listBilder({}).iteritems(): self.bilds.append(item) tmp = gtk.gdk.PixbufLoader() bildbin = item.getBildBin() if bildbin != None: tmp.write(bildbin) pbuf = tmp.get_pixbuf().scale_simple(100, 100 ,gtk.gdk.INTERP_NEAREST) self.mainViewModel.append([ pbuf, item.Attributes["name"], item.Attributes["category"] ]) | ec03acf5068a6326149941b73c88e123d5f4b7c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2709/ec03acf5068a6326149941b73c88e123d5f4b7c3/bijutsukan.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2882,
545,
87,
12,
2890,
4672,
365,
18,
5254,
1767,
1488,
18,
8507,
1435,
365,
18,
70,
545,
87,
33,
8526,
364,
417,
16,
761,
316,
365,
18,
7172,
18,
1098,
38,
545,
264,
23506,
2934,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2882,
545,
87,
12,
2890,
4672,
365,
18,
5254,
1767,
1488,
18,
8507,
1435,
365,
18,
70,
545,
87,
33,
8526,
364,
417,
16,
761,
316,
365,
18,
7172,
18,
1098,
38,
545,
264,
23506,
2934,
... |
repopath = cmdutil.findrepo(os.getcwd()) | if args: repopath = args[0] if not hg.islocal(repopath): raise util.Abort(_('only a local queue repository ' 'may be initialized')) else: repopath = cmdutil.findrepo(os.getcwd()) if not repopath: raise util.Abort(_('There is no Mercurial repository here ' '(.hg not found)')) | def mqinit(orig, ui, *args, **kwargs): mq = kwargs.pop('mq', None) if not mq: return orig(ui, *args, **kwargs) repopath = cmdutil.findrepo(os.getcwd()) repo = hg.repository(ui, repopath) return qinit(ui, repo, True) | 1eb444cc60ac6bf8a2661157aa568f2b4248e01b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/1eb444cc60ac6bf8a2661157aa568f2b4248e01b/mq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18327,
2738,
12,
4949,
16,
5915,
16,
380,
1968,
16,
2826,
4333,
4672,
18327,
273,
1205,
18,
5120,
2668,
11636,
2187,
599,
13,
225,
309,
486,
18327,
30,
327,
1647,
12,
4881,
16,
380,
19... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18327,
2738,
12,
4949,
16,
5915,
16,
380,
1968,
16,
2826,
4333,
4672,
18327,
273,
1205,
18,
5120,
2668,
11636,
2187,
599,
13,
225,
309,
486,
18327,
30,
327,
1647,
12,
4881,
16,
380,
19... |
import win32api handle = win32api.OpenProcess(1, 0, pid) return (0 != win32api.TerminateProcess(handle, 0)) | print "windows doesn't kill processes yet" | def KillPID(self, data=None): """ Kill VNC instance, called by the Stop Button or Application ends. @author: Derek Buranen @author: Aaron Gerber """ if self.returnPID != 0: if sys.platform == 'win32': import win32api handle = win32api.OpenProcess(1, 0, pid) return (0 != win32api.TerminateProcess(handle, 0)) else: os.kill(self.returnPID, signal.SIGKILL) self.returnPID = 0 self.connectButton.Enable(True) self.stopButton.Enable(False) self.statusBar.SetStatusText("Idle", 1) else: self.statusBar.SetStatusText("Idle", 1) return | b72e8b7e02605c976108f5ec7b0e44bff6190432 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3659/b72e8b7e02605c976108f5ec7b0e44bff6190432/Gitso.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20520,
16522,
12,
2890,
16,
501,
33,
7036,
4672,
3536,
20520,
776,
10346,
791,
16,
2566,
635,
326,
5131,
12569,
578,
4257,
3930,
18,
225,
632,
4161,
30,
463,
822,
79,
605,
295,
304,
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,
20520,
16522,
12,
2890,
16,
501,
33,
7036,
4672,
3536,
20520,
776,
10346,
791,
16,
2566,
635,
326,
5131,
12569,
578,
4257,
3930,
18,
225,
632,
4161,
30,
463,
822,
79,
605,
295,
304,
27... |
IN_CLASSB_HOST = (0xffffffff & ~IN_CLASSB_NET) | IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) | def IN_CLASSB(a): return ((((in_addr_t)(a)) & 0xc0000000) == 0x80000000) | 906d1812758081d4b4fd397f0de531fc41b2e899 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/906d1812758081d4b4fd397f0de531fc41b2e899/IN.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2120,
67,
5237,
38,
12,
69,
4672,
327,
261,
12443,
12,
267,
67,
4793,
67,
88,
21433,
69,
3719,
473,
374,
6511,
17877,
13,
422,
374,
92,
28,
17877,
13,
225,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2120,
67,
5237,
38,
12,
69,
4672,
327,
261,
12443,
12,
267,
67,
4793,
67,
88,
21433,
69,
3719,
473,
374,
6511,
17877,
13,
422,
374,
92,
28,
17877,
13,
225,
2,
-100,
-100,
-100,
-100,... |
self._logger.debug("Ignore table created.") | self._logger.info("Ignore table created.") | def _initCreateIgnoreTable(self): c = self._conn.cursor() try: c.execute("""create table ignore (ignoreid integer primary key autoincrement, trackid integer)""") self._logger.debug("Ignore table created.") except sqlite3.OperationalError as err: if str(err) != "table ignore already exists": raise err self._logger.debug("Ignore table found.") c.close() | afb8ac357cf5a6a40289a31d13b33e838bf2bdb1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8545/afb8ac357cf5a6a40289a31d13b33e838bf2bdb1/Database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
1684,
3777,
1388,
12,
2890,
4672,
276,
273,
365,
6315,
4646,
18,
9216,
1435,
775,
30,
276,
18,
8837,
2932,
3660,
2640,
1014,
2305,
261,
6185,
350,
3571,
3354,
498,
2059,
30033... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
1684,
3777,
1388,
12,
2890,
4672,
276,
273,
365,
6315,
4646,
18,
9216,
1435,
775,
30,
276,
18,
8837,
2932,
3660,
2640,
1014,
2305,
261,
6185,
350,
3571,
3354,
498,
2059,
30033... |
def set_state_draft(self, cursor, user, ids, context=None): self.write(cursor, user, ids, { | def set_state_draft(self, cursor, user, inventory_id, context=None): self.write(cursor, user, inventory_id, { | def set_state_draft(self, cursor, user, ids, context=None): self.write(cursor, user, ids, { 'state': 'draft', }, context=context) | e664c00398db6f26980418c61a0704103c5db3c9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9298/e664c00398db6f26980418c61a0704103c5db3c9/inventory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2019,
67,
17153,
12,
2890,
16,
3347,
16,
729,
16,
13086,
67,
350,
16,
819,
33,
7036,
4672,
365,
18,
2626,
12,
9216,
16,
729,
16,
13086,
67,
350,
16,
288,
296,
2019,
4278,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2019,
67,
17153,
12,
2890,
16,
3347,
16,
729,
16,
13086,
67,
350,
16,
819,
33,
7036,
4672,
365,
18,
2626,
12,
9216,
16,
729,
16,
13086,
67,
350,
16,
288,
296,
2019,
4278,
... |
(uid, name, table_prefix, latest_revision, svn_url, summary_limit, trunk, tags, branches, diff_url) = cl | (uid, name, table_prefix, latest_revision, svn_url) = cl | def insert_commit(db, cursor, table_prefix, log): """Adds a pysvn.PysvnLog entry into the svnLogBrowser database.""" revision = log['revision'].number date = time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(log['date'])) commit_table = '%s_commits' % table_prefix changes_table = '%s_changes' % table_prefix changes = [(revision, action, path, copy_path, copy_rev) for (action, path, copy_path, copy_rev) in get_changes(log['changed_paths'])] try: cursor.execute("INSERT INTO `" + commit_table + "` (`revision`, `author`, `date`, `message`) VALUES (%s, %s, %s, %s)", (revision, clear_null(log['author']), date, clear_null(log['message']))) except dbapi.DatabaseError, e: (code, message) = e # 1062 = Duplicate key error, meaning this commit was already added. if code != 1062: print "Error adding commit to database: %s" % e db.rollback() return # If the above was added successfully, we'll add the changed paths now. try: cursor.executemany("INSERT INTO `" + changes_table + "` (`revision`, `action`, `path`, `copy_path`, `copy_revision`) VALUES (%s, %s, %s, %s, %s)", changes) except dbapi.DatabaseError, e: print "Error adding change information (for revision %s) to the database: %s" % (revision, e) db.rollback() return db.commit() | e1a6a4299b080b2a9b1bc9bb1faf602108cb0963 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6255/e1a6a4299b080b2a9b1bc9bb1faf602108cb0963/slb-update.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2243,
67,
7371,
12,
1966,
16,
3347,
16,
1014,
67,
3239,
16,
613,
4672,
3536,
3655,
279,
21027,
25031,
18,
52,
1900,
25031,
1343,
1241,
1368,
326,
5893,
82,
1343,
9132,
2063,
12123,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2243,
67,
7371,
12,
1966,
16,
3347,
16,
1014,
67,
3239,
16,
613,
4672,
3536,
3655,
279,
21027,
25031,
18,
52,
1900,
25031,
1343,
1241,
1368,
326,
5893,
82,
1343,
9132,
2063,
12123,
225,
... |
print ",".join([label.replace(",","_") for label in ["H","K","L"]+labels]) | print >> out, ",".join([label.replace(",","_") for label in ["H","K","L"]+labels]) | def show_column_data_spreadsheet(self, out=None): if (out is None): out = sys.stdout miller_indices, labels, pairs = self._show_column_data_preparation() print ",".join([label.replace(",","_") for label in ["H","K","L"]+labels]) for iref,h in enumerate(miller_indices): row = [str(i) for i in h] for i,(data,selection) in enumerate(pairs): if (selection[iref]): row.append("%.7g" % data[iref]) else: row.append("") print ",".join(row) return self | 622e4ab9ca619b430a8b62000903788b023dc835 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/696/622e4ab9ca619b430a8b62000903788b023dc835/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
2827,
67,
892,
67,
26007,
8118,
12,
2890,
16,
596,
33,
7036,
4672,
309,
261,
659,
353,
599,
4672,
596,
273,
2589,
18,
10283,
312,
24462,
67,
6836,
16,
3249,
16,
5574,
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,
2405,
67,
2827,
67,
892,
67,
26007,
8118,
12,
2890,
16,
596,
33,
7036,
4672,
309,
261,
659,
353,
599,
4672,
596,
273,
2589,
18,
10283,
312,
24462,
67,
6836,
16,
3249,
16,
5574,
273,
... |
[output.write(generateChap(formatTime(Trims2ts[i][0],tcType), formatTime(Trims2ts[i][1],tcType),i+1,chapType)) for i in range(len(Trims2ts))] | [output.write(generateChap(formatTime(Trims2ts[i][0],1), formatTime(Trims2ts[i][1],1),i+1,chapType)) for i in range(len(Trims2ts))] | def main(): p = optparse.OptionParser(description='Grabs avisynth trims and outputs chapter file, qpfile and/or cuts audio (works with cfr and vfr input)', version='VFR Chapter Creator 0.7.1', usage='%prog [options] infile.avs{}'.format(" [outfile.avs]" if chapparseExists else "")) p.add_option('--label', '-l', action="store", help="Look for a trim() statement only on lines matching LABEL, interpreted as a regular expression. Default: case insensitive trim", dest="label") p.add_option('--input', '-i', action="store", help='Audio file to be cut', dest="input") p.add_option('--output', '-o', action="store", help='Cut audio from MKVMerge', dest="output") p.add_option('--fps', '-f', action="store", help='Frames per second (for cfr input)', dest="fps") p.add_option('--ofps', action="store", help='Output frames per second', dest="ofps") p.add_option('--timecodes', '-t', action="store", help='Timecodes file from the vfr video (v1 needs tcConv)', dest="timecodes") p.add_option('--chapters', '-c', action="store", help='Chapters file [.%s/.txt]' % "/.".join(exts.keys()), dest="chapters") p.add_option('--qpfile', '-q', action="store", help='QPFile for x264 (frame-accurate only if used with final framecount)', dest="qpfile") p.add_option('--verbose', '-v', action="store_true", help='Verbose', dest="verbose") p.add_option('--merge', '-m', action="store_true", help='Merge cut files', dest="merge") p.add_option('--remove', '-r', action="store_true", help='Remove cut files', dest="remove") p.add_option('--frames', action="store", help='Number of frames for v1 conversion', dest="frames") p.add_option('--test', action="store_true", help="Test mode (do not create new files)", dest="test") (o, a) = p.parse_args() if len(a) < 1: p.error("No avisynth script specified.") elif not o.timecodes and os.path.isfile(a[0] + ".tc.txt"): o.timecodes = a[0] + ".tc.txt" elif o.timecodes and o.fps: p.error("Can't use vfr input AND cfr input") elif o.timecodes and o.ofps: p.error("Can't use ofps with vfr input") elif o.timecodes and os.path.isfile(o.timecodes): o.timecodes = o.timecodes else: o.timecodes = o.fps #Determine chapter type if o.chapters: cExt = re.search("\.(%s)" % "|".join(exts.keys()),o.chapters,re.I) chapType = exts[cExt.group(1).lower()] if cExt else "OGM" else: chapType = '' if not o.output and o.input: o.output = '%s.cut.mka' % re.search("(.*)\.\w*$",o.input).group(1) quiet = '' if o.verbose else '-q' audio = [] Trims = [] with open(a[0], "r") as avsfile: # use only the first non-commented line with trims avs = avsfile.readlines() findTrims = re.compile("(?<!#)[^#]*\s*\.?\s*%s\((\d+)\s*,\s*(\d+)\)%s" % (o.label if o.label else "trim","" if o.label else "(?i)")) trimre = re.compile("(?<!#)trim\((\d+)\s*,\s*(\d+)\)(?i)") for line in avs: if findTrims.match(line): Trims = trimre.findall(line) break if len(Trims) < 1: sys.exit("Error: Avisynth script has no uncommented trims") # Look for AssumeFPS if not o.timecodes: for line in avs: if fpsre.search(line): o.timecodes = '/'.join([i for i in fpsre.search(line).groups()]) if o.verbose: print("\nFound AssumeFPS, setting CFR (%s)" % o.timecodes) break if not o.timecodes: o.timecodes = defaultFps if o.verbose: status = "Avisynth file: %s\n" % a[0] status += "Label: %s\n" % o.label if o.label else "" status += "Audio file: %s\n" % o.input if o.input else "" status += "Cut Audio file: %s\n" % o.output if o.output else "" status += "Timecodes/FPS: %s%s\n" % (o.timecodes," to "+o.ofps if o.ofps else "") if o.ofps != o.timecodes else "" status += "Chapters file: %s%s\n" % o.chapters if o.chapters else "" status += "QP file: %s\n" % o.qpfile if o.qpfile else "" status += "\n" status += "Merge/Rem files: %s/%s\n" % (o.merge,o.remove) if o.merge or o.remove else "" status += "Verbose: %s\n" % o.verbose if o.verbose else "" status += "Test Mode: %s\n" % o.test if o.test else "" print(status) print('In trims: %s' % ', '.join(['(%s,%s)' % (i[0],i[1]) for i in Trims])) # trims' offset calculation Trims2 = [] Trims2ts = [] tcType = determineFormat(o.timecodes) tc = o.timecodes if tcType == 2: nTrims = int(o.frames) if o.frames else int(Trims[-1][1])+2 if os.path.isfile(tc+"v2.txt") == False: tcConv = call('"%s" "%s" "%s" %d' % (tcConv, tc, tc+"v2.txt", nTrims)) if tcConv > 0: sys.exit("Failed to execute tcConv: %d; Please put it in your path" % tcConv) o.timecodes = tc+"v2.txt" for i in range(len(Trims)): fn1 = int(Trims[i][0]) # first frame fn1ts = Ts(fn1,tc,tcType)[0] # first frame timestamp fn2 = int(Trims[i][1]) # last frame fn2ts = Ts(fn2,tc,tcType)[0] # last frame timestamp fn2tsaud = Ts(fn2+1,tc,tcType) # last frame timestamp for audio if i != 0: # if it's not the first trim last = int(Trims[i-1][1])+1 lastts = Ts(last,tc,tcType)[0] offset += fn1-last offsetts += fn1ts-lastts elif fn1 > 0: # if the first trim doesn't start at 0 offset = fn1 offsetts = fn1ts else: offset = 0 offsetts = 0 # apply the offset to the trims fn1 -= offset fn2 -= offset fn1ts -= offsetts fn2ts -= offsetts # convert fps if --ofps if o.ofps and o.timecodes != o.ofps: fn1 = unTs(fn1ts,o.ofps) fn2 = unTs(fn2ts,o.ofps) # add trims and their timestamps to list Trims2.append([fn1,fn2]) Trims2ts.append([fn1ts,fn2ts]) # make list with timecodes to cut audio audio.append(formatTime(fn1ts,tcType)) if len(fn2tsaud) == 1: audio.append(formatTime(fn2tsaud[0],tcType)) if o.verbose: print('Out trims: %s\n' % ', '.join(['(%s,%s)' % (i[0],i[1]) for i in Trims2])) if o.verbose: print('Out timecodes: %s\n' % ', '.join(['(%s,%s)' % (formatTime(Trims2ts[i][0],tcType), formatTime(Trims2ts[i][1],tcType)) for i in range(len(Trims2ts))])) # make qpfile if o.qpfile: if not o.test: with open(o.qpfile, "w") as qpf: for trim in Trims2[1:]: qpf.write('%s K\n' % trim[0]) if o.verbose: print('Writing keyframes to %s\n' % o.qpfile) # make audio cuts if o.input: delayRe = re.search('DELAY ([-]?\d+)',o.input) delay = delayRe.group(1) if delayRe else '0' if audio[0] == "00:00:00.000": includefirst = True audio = audio[1:] else: includefirst = False cuttimes = ','.join(audio) cutCmd = '"%s" -o "%s" --sync 0:%s "%s" --split timecodes:%s %s' % (mkvmerge, o.output + '.split.mka', delay, o.input, cuttimes, quiet) if o.verbose: print('Cutting: %s\n' % cutCmd) if not o.test: cutExec = call(cutCmd) if cutExec == 1: print("Mkvmerge exited with warnings: %d" % cutExec) elif cutExec == 2: sys.exit("Failed to execute mkvmerge: %d" % cutExec) if o.merge: merge = [] for i in range(1,len(audio)+2): if (includefirst == True and i % 2 != 0) or (includefirst == False and i % 2 == 0): merge.append('"%s.split-%03d.mka"' % (o.output, i)) mergeCmd = '"%s" -o "%s" %s %s' % (mkvmerge,o.output, ' +'.join(merge), quiet) if o.verbose: print('\nMerging: %s\n' % ', '.join(merge)) if not o.test: print(mergeCmd) mergeExec = call(mergeCmd) if mergeExec == 1: print("Mkvmerge exited with warnings: %d" % mergeExec) elif mergeExec == 2: sys.exit("Failed to execute mkvmerge: %d" % mergeExec) if o.remove: remove = ['%s.split-%03d.mka' % (o.output, i) for i in range(1,len(audio)+2)] if o.verbose: print('\nDeleting: %s\n' % ', '.join(remove)) if not o.test: [os.unlink(i) if os.path.exists(i) else True for i in remove] # make offseted avs if chapparseExists and len(a) > 1: fNum = [i[0] for i in Trims2] set = {'avs':'"'+a[1]+'"','input':'','resize':''} writeAvisynth(set,fNum) # write chapters if chapType: if chapType == 'MKV': EditionUID = random.randint(100000,1000000) matroskaXmlHeader = '<?xml version="1.0" encoding="UTF-8"?>\n<!-- <!DOCTYPE Tags SYSTEM "matroskatags.dtd"> -->\n<Chapters>' matroskaXmlEditionHeader = """ <EditionEntry> <EditionFlagHidden>{}</EditionFlagHidden> <EditionFlagDefault>{}</EditionFlagDefault> <EditionFlagOrdered>{}</EditionFlagOrdered> <EditionUID>{}</EditionUID> | 71f96ef73d9915935425b67dfff621761ff6819f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14863/71f96ef73d9915935425b67dfff621761ff6819f/vfr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
225,
293,
273,
2153,
2670,
18,
1895,
2678,
12,
3384,
2218,
14571,
2038,
1712,
291,
878,
451,
2209,
87,
471,
6729,
23580,
585,
16,
22859,
768,
471,
19,
280,
6391,
87,
7447,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
225,
293,
273,
2153,
2670,
18,
1895,
2678,
12,
3384,
2218,
14571,
2038,
1712,
291,
878,
451,
2209,
87,
471,
6729,
23580,
585,
16,
22859,
768,
471,
19,
280,
6391,
87,
7447,
... |
self.parent = parent | def __init__(self, parent, title, msg=None, progress=False, vlayout=None, fake=False, resize_callback=None): if sys.platform == "win32": flags = QtCore.Qt.WindowStaysOnTopHint | \ QtCore.Qt.ToolTip elif sys.platform == "linux2": flags = QtCore.Qt.WindowStaysOnTopHint | \ QtCore.Qt.X11BypassWindowManagerHint | \ QtCore.Qt.Popup else: flags = QtCore.Qt.WindowStaysOnTopHint | \ QtCore.Qt.Popup | 6da3a49668769c8248fc6884f3a4fb927515ce5a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1208/6da3a49668769c8248fc6884f3a4fb927515ce5a/gui_pyqt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
2077,
16,
1234,
33,
7036,
16,
4007,
33,
8381,
16,
331,
6741,
33,
7036,
16,
10517,
33,
8381,
16,
7041,
67,
3394,
33,
7036,
4672,
309,
2589,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
2077,
16,
1234,
33,
7036,
16,
4007,
33,
8381,
16,
331,
6741,
33,
7036,
16,
10517,
33,
8381,
16,
7041,
67,
3394,
33,
7036,
4672,
309,
2589,
18,... | |
self.parseAction = None | self.parseAction = list() | def __init__( self, savelist=False ): self.parseAction = None #~ self.name = "<unknown>" # don't define self.name, let subclasses try/except upcall self.strRepr = None self.resultsName = None self.saveAsList = savelist self.skipWhitespace = True self.whiteChars = ParserElement.DEFAULT_WHITE_CHARS self.mayReturnEmpty = False self.keepTabs = False self.ignoreExprs = [] self.debug = False self.streamlined = False self.mayIndexError = True self.errmsg = "" self.modalResults = True self.debugActions = ( None, None, None ) self.re = None | cf270a876802009d82e8d28923bdd6b889a1f506 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3693/cf270a876802009d82e8d28923bdd6b889a1f506/pyparsing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
4087,
5449,
33,
8381,
262,
30,
365,
18,
2670,
1803,
273,
666,
1435,
468,
98,
365,
18,
529,
273,
3532,
8172,
2984,
225,
468,
2727,
1404,
4426,
365,
18,
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,
1001,
2738,
972,
12,
365,
16,
4087,
5449,
33,
8381,
262,
30,
365,
18,
2670,
1803,
273,
666,
1435,
468,
98,
365,
18,
529,
273,
3532,
8172,
2984,
225,
468,
2727,
1404,
4426,
365,
18,
5... |
unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) | unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 36d2f28c044694ad73a4a70a9d869366d0e39ec4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/36d2f28c044694ad73a4a70a9d869366d0e39ec4/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5302,
4873,
1576,
13332,
3536,
6910,
777,
326,
533,
924,
434,
326,
2836,
1576,
2190,
635,
3675,
12697,
10138,
16,
471,
10736,
2690,
1308,
4606,
364,
28769,
434,
999,
18,
1220,
445,
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,
5302,
4873,
1576,
13332,
3536,
6910,
777,
326,
533,
924,
434,
326,
2836,
1576,
2190,
635,
3675,
12697,
10138,
16,
471,
10736,
2690,
1308,
4606,
364,
28769,
434,
999,
18,
1220,
445,
353,
... |
testSourcePort = _justAccept def _testSourcePort(self): | testSourceAddress = _justAccept def _testSourceAddress(self): | def _testFamily(self): self.cli = socket.create_connection((HOST, self.port), timeout=30) self.assertEqual(self.cli.family, 2) | a2c272d06c706a2076ab1d70532ca26c56f0b268 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/a2c272d06c706a2076ab1d70532ca26c56f0b268/test_socket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3813,
9203,
12,
2890,
4672,
365,
18,
4857,
273,
2987,
18,
2640,
67,
4071,
12443,
8908,
16,
365,
18,
655,
3631,
2021,
33,
5082,
13,
365,
18,
11231,
5812,
12,
2890,
18,
4857,
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,
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,
3813,
9203,
12,
2890,
4672,
365,
18,
4857,
273,
2987,
18,
2640,
67,
4071,
12443,
8908,
16,
365,
18,
655,
3631,
2021,
33,
5082,
13,
365,
18,
11231,
5812,
12,
2890,
18,
4857,
18,
... |
print >> err, "Multiple keys: ", hkl | print >> err, "Multiple keys: ", hkl, keys | def run(args): pdb = args[0] hkl = args[1] err = open("_error_"+pdb[-8:-4],"w") proceed = True data = flex.double() sigmas = flex.double() indices = flex.miller_index() flags_ = [] flags = flex.bool() try: cs = crystal_symmetry_from_any.extract_from(pdb) except Exception, e: proceed = False print >> err, "Cannot_extract_crystal symmetry: ", str(e), pdb if(cs is None): proceed = False print >> err, "Cannot_extract_crystal symmetry: ", pdb # # getting keys # if(hkl.count(".Z") == 1 and proceed): os.system("cp "+ hkl + " .") hkl = hkl[-13:] os.system("$HOME/uncompress " + hkl) # to work on BSGC-2 #os.system("gunzip " + hkl) ifo = open(hkl[:-2], "r") lines = ifo.readlines() ifo.close() # getting keys lock_0 = False lock_1 = False keys = [] number_of_loop_records = 0 for i_seq, st in enumerate(lines): st = st.strip() if(st.startswith("loop_")): if(i_seq < len(lines)): if(lines[i_seq+1].strip().startswith("_refln.")): lock_0 = True if(lock_0 and st.startswith("_refln.")): lock_1 = True if(lock_0 and lock_1 and not st.startswith("_refln.")): lock_0 = False lock_1 = False if(lock_0 and lock_1): keys.append(st) if(len(keys) > 0 and st.startswith("loop_")): print >> err, "Multiple keys: ", hkl keys = [] proceed = False break if(proceed and len(keys) <= 4): print >> err, "No keys: ", keys, hkl proceed = False # # we have keys now # if(proceed): h_i = None ; n_h = 0 k_i = None ; n_k = 0 l_i = None ; n_l = 0 f_i = None ; n_f = 0 i_i = None ; n_i = 0 sf_i = None si_i = None t_i = None ; n_t = 0 keys_updated = [] for i_seq, key in enumerate(keys): key = key.strip() key = key.replace("_refln.","") keys_updated.append(key) for i_seq, key in enumerate(keys_updated): if(key == "index_h"): h_i = i_seq n_h += 1 if(key == "index_k"): k_i = i_seq n_k += 1 if(key == "index_l"): l_i = i_seq n_l += 1 if(key in keys_f_obs): f_i = i_seq n_f += 1 if(key in keys_i_obs): i_i = i_seq n_i += 1 if(key in keys_sf_obs): sf_i = i_seq if(key in keys_si_obs): si_i = i_seq if(key in keys_status): t_i = i_seq n_t += 1 if(key not in possible_keys): proceed = False print >> err, "Unknown_key= ", key, keys_updated, hkl break if(n_t > 1 and proceed): print >> err, "Multiple CV sets: ", keys_updated, hkl proceed = False if(n_t == 0 and proceed): proceed = False print >> err, "No CV sets: ", keys_updated, hkl, n_t if([f_i,i_i].count(None) == 2 or n_f > 1 or n_i > 1 and proceed): print >> err, "Multiple/no data sets: ", keys_updated,hkl,n_f,n_i proceed = False if([h_i,k_i,l_i].count(None) > 0 or n_h > 1 or n_k > 1 or n_l > 1 and proceed): print >> err, "Multiple/no index sets: ",\ keys_updated,hkl,n_h,n_k,n_l,"=",h_i,k_i,l_i proceed = False # # Hopefully, we know the numbers of colums with data. Try get it now. # Here we know the data is unique. if(proceed): for st in lines: if(st == ''): break if(proceed): st = st.split() if(indices.size() > 0 and len(st) != len(keys_updated)): break if(len(st) == len(keys_updated)): try: try_h = st[h_i].replace("-","").strip().isdigit() try_k = st[k_i].replace("-","").strip().isdigit() try_l = st[l_i].replace("-","").strip().isdigit() is_digits = try_h and try_k and try_l h_ = int(st[h_i]) k_ = int(st[k_i]) l_ = int(st[l_i]) if(f_i is not None): data_ = float(st[f_i]) else: data_ = float(st[i_i]) except: is_digits = False if(is_digits and [h_,k_,l_].count(0)<3): if(abs(h_)>10000 or abs(k_)>10000 or abs(l_)>10000): proceed = False indices.append([h_, k_, l_]) data.append(data_) if(sf_i is not None): assert f_i is not None try: sigmas.append(float(st[sf_i])) except: proceed = False elif(si_i is not None): assert i_i is not None try: sigmas.append(float(st[si_i])) except: proceed = False flags_.append(st[t_i]) if(not proceed): print >> err, "Could not get column data (hkl,fo,flags,sigma): ", hkl if(indices.size() == 0 or data.size() == 0 or len(flags_) == 0): proceed = False if(indices.size() > 0 and proceed): assert indices.size() == data.size() assert indices.size() == len(flags_) if(sigmas.size() > 0): assert sigmas.size() == data.size() else: sigmas = flex.double(data.size(), 1.0) flags, cif_selection, proceed = get_array_of_r_free_flags( proceed = proceed, flags = flags_, cs = cs, indices = indices, pdb = pdb, err = err) # # now we're ready to set up a miller array (and may be even output it) # if(proceed): if(f_i is not None): data_label = "FOBS" else: data_label = "IOBS" proceed, file_name = \ compose_and_write_mtz(indices = indices, data = data, sigmas = sigmas, flags = flags, cif_selection = cif_selection, pdb = pdb, err = err, proceed = proceed, cs = cs, observation_type = data_label) if(proceed): result, fmodel, format = one_run(pdb = pdb, hkl = file_name, error_out = err) os.system("rm -rf %s"%file_name) if(result is not None): proceed, file_name = \ compose_and_write_mtz(indices = fmodel.f_obs.indices(), data = fmodel.f_obs.data(), sigmas = fmodel.f_obs.sigmas(), flags = fmodel.r_free_flags.data(), cif_selection = None, pdb = pdb, err = err, proceed = proceed, cs = cs, observation_type = "FOBS") ofo = open("_result_"+pdb[-8:-4],"w") print >> ofo, result ofo.flush() ofo.close() err.flush() err.close() os.system("rm -rf "+hkl[:-2]) | cf5de54d5a19987033117eda1c56f66c46af7810 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/696/cf5de54d5a19987033117eda1c56f66c46af7810/pdb_refl_cif_to_mtz.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
1968,
4672,
10892,
273,
833,
63,
20,
65,
366,
16391,
273,
833,
63,
21,
65,
393,
273,
1696,
2932,
67,
1636,
9548,
15,
17414,
18919,
28,
30,
17,
24,
6487,
6,
91,
7923,
11247,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
1968,
4672,
10892,
273,
833,
63,
20,
65,
366,
16391,
273,
833,
63,
21,
65,
393,
273,
1696,
2932,
67,
1636,
9548,
15,
17414,
18919,
28,
30,
17,
24,
6487,
6,
91,
7923,
11247,... |
obj_uid = make_uid(obj) | obj_uid = make_uid(obj, obj_parent_uid, obj_name) | def _find_object_in_module(name, module, docmap): """ Search for an object or variable named C{name} in the given module, given the DocMap C{docmap}. """ # Is it an object in the containing module? try: components = name.split('.') # Use getattr to follow all components but the last one. obj = module for component in components[:-1]: obj_parent = obj obj_name = component try: obj = getattr(obj, component) except: try: obj = obj.__getattribute__(obj, component) except: return None obj_uid = make_uid(obj) # Is it a variable in obj? var = _find_variable_in(components[-1], obj_uid, docmap) if var is not None: return var # Is it an object in obj? try: obj = getattr(obj, components[-1]) except: try: obj = obj.__getattribute__(obj, components[1]) except: return None try: return make_uid(obj, obj_uid, components[-1]) except: return None except KeyError: return None | 31f2443ff158310b2c0d3ff0dd4578b48152cb2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/31f2443ff158310b2c0d3ff0dd4578b48152cb2c/uid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
67,
1612,
67,
267,
67,
2978,
12,
529,
16,
1605,
16,
997,
1458,
4672,
3536,
5167,
364,
392,
733,
578,
2190,
4141,
385,
95,
529,
97,
316,
326,
864,
1605,
16,
864,
326,
3521,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1612,
67,
267,
67,
2978,
12,
529,
16,
1605,
16,
997,
1458,
4672,
3536,
5167,
364,
392,
733,
578,
2190,
4141,
385,
95,
529,
97,
316,
326,
864,
1605,
16,
864,
326,
3521,... |
it = self._pop_list.item_append(label, data=value) | it = self._pop_list.item_append(label, None, None, None, value) | def _list_update(self): self._pop_list.clear() for label, value in self._items_load(): it = self._pop_list.item_append(label, data=value) | 049dc81258616bd15aca91397ed5dbf9e3f31699 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12343/049dc81258616bd15aca91397ed5dbf9e3f31699/details_widget_entry_button_list.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1098,
67,
2725,
12,
2890,
4672,
365,
6315,
5120,
67,
1098,
18,
8507,
1435,
364,
1433,
16,
460,
316,
365,
6315,
3319,
67,
945,
13332,
518,
273,
365,
6315,
5120,
67,
1098,
18,
1726,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1098,
67,
2725,
12,
2890,
4672,
365,
6315,
5120,
67,
1098,
18,
8507,
1435,
364,
1433,
16,
460,
316,
365,
6315,
3319,
67,
945,
13332,
518,
273,
365,
6315,
5120,
67,
1098,
18,
1726,... |
return messageObject.as_string() | m.chandlerHeaders[message.createChandlerHeader(constants.SHARING_HEADER)] = sendStr | def __createMessageText(self): #XXX: Tnis needs to be base 64 encoded sendStr = "%s%s%s" % (self.url, constants.SHARING_DIVIDER, self.collectionName) | 6259a34016a317d71ffe809f51fffa702adfa3a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/6259a34016a317d71ffe809f51fffa702adfa3a5/sharing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2640,
1079,
1528,
12,
2890,
4672,
468,
15639,
30,
399,
82,
291,
4260,
358,
506,
1026,
5178,
3749,
1366,
1585,
273,
2213,
87,
9,
87,
9,
87,
6,
738,
261,
2890,
18,
718,
16,
6810,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2640,
1079,
1528,
12,
2890,
4672,
468,
15639,
30,
399,
82,
291,
4260,
358,
506,
1026,
5178,
3749,
1366,
1585,
273,
2213,
87,
9,
87,
9,
87,
6,
738,
261,
2890,
18,
718,
16,
6810,... |
str += self._class_summary(doc.classes()) | (classes,excepts) = self._split_classes_and_excepts(doc) str += self._class_summary(classes, 'Classes') str += self._class_summary(excepts, 'Exceptions') | def _module_to_html(self, uid): 'Return an HTML page for a Module' doc = self._docmap[uid] descr = doc.descr() if uid.is_package(): moduletype = 'package' else: moduletype = 'module' str = self._header(`uid`) str += self._navbar(moduletype, uid) | 89bd16eaf8c7e556babe42c6a92621dbc9b8a7e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/89bd16eaf8c7e556babe42c6a92621dbc9b8a7e9/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2978,
67,
869,
67,
2620,
12,
2890,
16,
4555,
4672,
296,
990,
392,
3982,
1363,
364,
279,
5924,
11,
997,
273,
365,
6315,
2434,
1458,
63,
1911,
65,
18426,
273,
997,
18,
28313,
1435,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2978,
67,
869,
67,
2620,
12,
2890,
16,
4555,
4672,
296,
990,
392,
3982,
1363,
364,
279,
5924,
11,
997,
273,
365,
6315,
2434,
1458,
63,
1911,
65,
18426,
273,
997,
18,
28313,
1435,
... |
self.warn(_("Ignoring untrusted configuration option " | self.debug(_("ignoring untrusted configuration option " | def configitems(self, section, untrusted=False): items = self._data(untrusted).items(section) if self.debugflag and not untrusted: for k,v in self._ucfg.items(section): if self._tcfg.get(section, k) != v: self.warn(_("Ignoring untrusted configuration option " "%s.%s = %s\n") % (section, k, v)) return items | 8b81a816b634ba5d27dd34720ad4de810a1d3f93 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/8b81a816b634ba5d27dd34720ad4de810a1d3f93/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
642,
3319,
12,
2890,
16,
2442,
16,
640,
25247,
33,
8381,
4672,
1516,
273,
365,
6315,
892,
12,
318,
25247,
2934,
3319,
12,
3464,
13,
309,
365,
18,
4148,
6420,
471,
486,
640,
25247,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
642,
3319,
12,
2890,
16,
2442,
16,
640,
25247,
33,
8381,
4672,
1516,
273,
365,
6315,
892,
12,
318,
25247,
2934,
3319,
12,
3464,
13,
309,
365,
18,
4148,
6420,
471,
486,
640,
25247,
30,
... |
self.list.append((service, sname, tmp_list[0][0] and tmp_list)) | self.list.append((service, sname, tmp_list[0][0] is not None and tmp_list or None)) | def fillMultiEPG(self, services, stime=-1): if services is None: time_base = self.time_base+self.offs*self.time_epoch*60 test = [ (service[0], 0, time_base, self.time_epoch) for service in self.list ] else: self.cur_event = None self.cur_service = None self.time_base = int(stime) test = [ (service.ref.toString(), 0, self.time_base, self.time_epoch) for service in services ] test.insert(0, 'RnITBD') epg_data = self.queryEPG(test) | b942bab40252e20a5cbefb0cca47ea1ab42688c6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6652/b942bab40252e20a5cbefb0cca47ea1ab42688c6/GraphMultiEpg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
5002,
10541,
43,
12,
2890,
16,
4028,
16,
384,
494,
29711,
21,
4672,
309,
4028,
353,
599,
30,
813,
67,
1969,
273,
365,
18,
957,
67,
1969,
15,
2890,
18,
26600,
14,
2890,
18,
957,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
5002,
10541,
43,
12,
2890,
16,
4028,
16,
384,
494,
29711,
21,
4672,
309,
4028,
353,
599,
30,
813,
67,
1969,
273,
365,
18,
957,
67,
1969,
15,
2890,
18,
26600,
14,
2890,
18,
957,... |
query = """SELECT id_bibrec FROM bibfmt where value = %s""" | query = """SELECT id_bibrec FROM bibfmt WHERE value = %s""" | def find_record_bibfmt(marc): """ receives the xmlmarc containing a record and returns the id in bibrec if the record exists in bibfmt""" # compress the marc value pickled_marc = MySQLdb.escape_string(compress(marc)) query = """SELECT id_bibrec FROM bibfmt where value = %s""" # format for marc xml is xm params = (pickled_marc,) try: res = run_sql(query, params) except Error, error: write_message(" Error during find_record_bibfmt function : %s " % error, verbose=1, stream=sys.stderr) if len(res): return res else: return None | c01e7675eac4ac02844b96fe38be4646d43de28c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/c01e7675eac4ac02844b96fe38be4646d43de28c/bibupload.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
3366,
67,
70,
495,
8666,
12,
3684,
71,
4672,
3536,
17024,
326,
2025,
3684,
71,
4191,
279,
1409,
471,
1135,
326,
612,
316,
25581,
3927,
309,
326,
1409,
1704,
316,
25581,
8666,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
3366,
67,
70,
495,
8666,
12,
3684,
71,
4672,
3536,
17024,
326,
2025,
3684,
71,
4191,
279,
1409,
471,
1135,
326,
612,
316,
25581,
3927,
309,
326,
1409,
1704,
316,
25581,
8666,
... |
rational arithmetic to calculate the matrix of the U operator and its | rational arithmetic to calculate the matrix of the `U` operator and its | def eigenfunctions(self, n, F = None, exact_arith=True): """ Calculate approximations to eigenfunctions of self. These are the eigenfunctions of self.hecke_matrix(p, n), which are approximations to the true eigenfunctions. Returns a list of OverconvergentModularFormElement objects, in increasing order of slope. | 51aabb4f4c1d25de708da4cd9e8295aeb8a186e7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/51aabb4f4c1d25de708da4cd9e8295aeb8a186e7/genus0.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16719,
10722,
12,
2890,
16,
290,
16,
478,
273,
599,
16,
5565,
67,
297,
483,
33,
5510,
4672,
3536,
9029,
26962,
1012,
358,
16719,
10722,
434,
365,
18,
8646,
854,
326,
16719,
10722,
434,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16719,
10722,
12,
2890,
16,
290,
16,
478,
273,
599,
16,
5565,
67,
297,
483,
33,
5510,
4672,
3536,
9029,
26962,
1012,
358,
16719,
10722,
434,
365,
18,
8646,
854,
326,
16719,
10722,
434,
... |
os.getcwd(),node.job().get_dag_directory(),subgax_name) | os.getcwd(),node.job().get_dag_directory(),subdag_name) | def write_abstract_dag(self): """ Write all the nodes in the workflow to the DAX file. """ if not self.__dax_file_path: # this workflow is not dax-compatible, so just return return try: dagfile = open( self.__dag_file_path, 'w' ) except: raise CondorDAGError, "Cannot open file " + self.__dag_file_path | 7fb1d24f3397a3b9a71a336ec908e6d1cc315062 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3589/7fb1d24f3397a3b9a71a336ec908e6d1cc315062/pipeline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
17801,
67,
30204,
12,
2890,
4672,
3536,
2598,
777,
326,
2199,
316,
326,
6095,
358,
326,
463,
2501,
585,
18,
3536,
309,
486,
365,
16186,
72,
651,
67,
768,
67,
803,
30,
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,
1045,
67,
17801,
67,
30204,
12,
2890,
4672,
3536,
2598,
777,
326,
2199,
316,
326,
6095,
358,
326,
463,
2501,
585,
18,
3536,
309,
486,
365,
16186,
72,
651,
67,
768,
67,
803,
30,
468,
... |
self.stream = OggStream(self.fileName) self.soundBuffers = [] self.bufferPos = 0 self.done = False while len(self.soundBuffers) < self.bufferCount and not self.done: | self.stream = OggStream(self.fileName) self.buffersIn = [pygame.sndarray.make_sound(zeros((self.bufferSize, 2), typecode = 's')) for i in range(self.bufferCount + 1)] self.buffersOut = [] self.buffersBusy = [] self.bufferPos = 0 self.done = False self.lastQueueTime = time.time() while len(self.buffersOut) < self.bufferCount and not self.done: | def _reset(self): self.stream = OggStream(self.fileName) self.soundBuffers = [] self.bufferPos = 0 self.done = False | fd83e7c1a811ef09c2d32488bf8a9a0efaef4aae /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7946/fd83e7c1a811ef09c2d32488bf8a9a0efaef4aae/Audio.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6208,
12,
2890,
4672,
365,
18,
3256,
4202,
273,
531,
14253,
1228,
12,
2890,
18,
17812,
13,
365,
18,
29671,
13699,
273,
5378,
365,
18,
4106,
1616,
565,
273,
374,
365,
18,
8734,
540... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6208,
12,
2890,
4672,
365,
18,
3256,
4202,
273,
531,
14253,
1228,
12,
2890,
18,
17812,
13,
365,
18,
29671,
13699,
273,
5378,
365,
18,
4106,
1616,
565,
273,
374,
365,
18,
8734,
540... |
latestReceivedEngineTime ) = self.__timeline[ | latestReceivedEngineTime, latestUpdateTimestamp) = self.__timeline[ | def __generateRequestOrResponseMsg( self, snmpEngine, messageProcessingModel, globalData, maxMessageSize, securityModel, securityEngineID, securityName, securityLevel, scopedPDU, securityStateReference ): snmpEngineID = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID')[0].syntax # 3.1.1 if securityStateReference is not None: # 3.1.1a cachedSecurityData = self._cachePop(securityStateReference) usmUserName = cachedSecurityData['msgUserName'] usmUserAuthProtocol = cachedSecurityData.get('usmUserAuthProtocol') usmUserAuthKeyLocalized = cachedSecurityData.get( 'usmUserAuthKeyLocalized' ) usmUserPrivProtocol = cachedSecurityData.get('usmUserPrivProtocol') usmUserPrivKeyLocalized = cachedSecurityData.get( 'usmUserPrivKeyLocalized' ) securityEngineID = snmpEngineID debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: user info read from cache') elif securityName: # 3.1.1b try: ( usmUserName, usmUserAuthProtocol, usmUserAuthKeyLocalized, usmUserPrivProtocol, usmUserPrivKeyLocalized ) = self.__getUserInfo( snmpEngine.msgAndPduDsp.mibInstrumController, securityEngineID, securityName ) debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: read user info') except NoSuchInstanceError: pysnmpUsmDiscovery, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__PYSNMP-USM-MIB', 'pysnmpUsmDiscovery') __reportUnknownName = not pysnmpUsmDiscovery.syntax if not __reportUnknownName: try: ( usmUserName, usmUserAuthProtocol, usmUserAuthKeyLocalized, usmUserPrivProtocol, usmUserPrivKeyLocalized ) = self.__cloneUserInfo( snmpEngine.msgAndPduDsp.mibInstrumController, securityEngineID, securityName ) except NoSuchInstanceError: __reportUnknownName = 1 | ed8bedac8cbcc84339511222025bfba2f8167ab9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/587/ed8bedac8cbcc84339511222025bfba2f8167ab9/service.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
7163,
691,
1162,
1064,
3332,
12,
365,
16,
15366,
4410,
16,
883,
7798,
1488,
16,
2552,
751,
16,
943,
1079,
1225,
16,
4373,
1488,
16,
4373,
4410,
734,
16,
4373,
461,
16,
4373,
2355... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7163,
691,
1162,
1064,
3332,
12,
365,
16,
15366,
4410,
16,
883,
7798,
1488,
16,
2552,
751,
16,
943,
1079,
1225,
16,
4373,
1488,
16,
4373,
4410,
734,
16,
4373,
461,
16,
4373,
2355... |
_ShutdownInstanceDisks(instance, cfg) | _ShutdownInstanceDisks(lu, instance) | def _StartInstanceDisks(cfg, instance, force): """Start the disks of an instance. """ disks_ok, dummy = _AssembleInstanceDisks(instance, cfg, ignore_secondaries=force) if not disks_ok: _ShutdownInstanceDisks(instance, cfg) if force is not None and not force: logger.Error("If the message above refers to a secondary node," " you can retry the operation using '--force'.") raise errors.OpExecError("Disk consistency error") | b9bddb6bdf7ac5841c732845ce0122c64bb026b1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/b9bddb6bdf7ac5841c732845ce0122c64bb026b1/cmdlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1685,
1442,
22021,
12,
7066,
16,
791,
16,
2944,
4672,
3536,
1685,
326,
17164,
434,
392,
791,
18,
225,
3536,
17164,
67,
601,
16,
9609,
273,
389,
1463,
10045,
1442,
22021,
12,
1336,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1685,
1442,
22021,
12,
7066,
16,
791,
16,
2944,
4672,
3536,
1685,
326,
17164,
434,
392,
791,
18,
225,
3536,
17164,
67,
601,
16,
9609,
273,
389,
1463,
10045,
1442,
22021,
12,
1336,
... |
sage: sr = mq.SR(1,1,1,8,gf2=True) | sage: sr = mq.SR(1, 1, 1, 8, gf2=True) | def inversion_polynomials_single_sbox(self, x= None, w=None, biaffine_only=None, correct_only=None): """ Generator for S-Box inversion polynomials of a single sbox. | cd82551727ddbae04c5b28f55b59ec14654a84ab /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/cd82551727ddbae04c5b28f55b59ec14654a84ab/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
316,
1589,
67,
3915,
13602,
87,
67,
7526,
67,
87,
2147,
12,
2890,
16,
619,
33,
599,
16,
341,
33,
7036,
16,
324,
1155,
1403,
558,
67,
3700,
33,
7036,
16,
3434,
67,
3700,
33,
7036,
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
316,
1589,
67,
3915,
13602,
87,
67,
7526,
67,
87,
2147,
12,
2890,
16,
619,
33,
599,
16,
341,
33,
7036,
16,
324,
1155,
1403,
558,
67,
3700,
33,
7036,
16,
3434,
67,
3700,
33,
7036,
4... |
@todo: Proper errorhandling. Should throw Python exceptions. | @raise IOError: Raised if the model file is not found, can not be read or any other IO related error. @raise JError: Raised if there was a runtime exception thrown by the underlying Java classes, for example, NullPointerException. | def generate_code(fclass): """ Generates c and xml code for a model using the FClass represenation created with flatten_model and template files located in the JModelica installation folder. Default output folder is the current folder from which this module is run. @see: flatten_model @param fclass: Reference to the flattened model object representation. @todo: Proper errorhandling. Should throw Python exceptions. """ xmlpath = common._jm_home+os.sep+'CodeGenTemplates'+os.sep+'jmi_modelica_template.xml' cppath = common._jm_home+os.sep+'CodeGenTemplates'+os.sep+'jmi_modelica_template.c' try: JCompiler.generateCode(fclass, xmlpath, cppath) except jpype.JavaException, ex: _handle_exception(ex) print "! Generating code failed." | 2f2d35507cfe9a5104de512cd9432f3c4a6d6c5f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7711/2f2d35507cfe9a5104de512cd9432f3c4a6d6c5f/compiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
710,
12,
74,
1106,
4672,
3536,
31902,
276,
471,
2025,
981,
364,
279,
938,
1450,
326,
478,
797,
2071,
455,
275,
367,
2522,
598,
5341,
67,
2284,
471,
1542,
1390,
13801,
316,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
710,
12,
74,
1106,
4672,
3536,
31902,
276,
471,
2025,
981,
364,
279,
938,
1450,
326,
478,
797,
2071,
455,
275,
367,
2522,
598,
5341,
67,
2284,
471,
1542,
1390,
13801,
316,
32... |
key_expires__lte = two_months_ago.isoformat()) | user__date_joined__lte = two_months_ago.isoformat()) | def delete_old_accounts(verbose, simulate): """This script will find accounts older than roughly two months that have not been confirmed, and delete them. It can be run once a month, or so. """ two_months_ago = (datetime.date.today() - datetime.timedelta(60)) # get the accounts unconfirmed_ups = UserProfile.objects.filter(emailConfirmed = False, key_expires__lte = two_months_ago.isoformat()) # some redundant code here, but emphasis is on getting it right. for up in unconfirmed_ups: try: user = str(up.user.username) if verbose: print "User \"" + user + "\" deleted." if not simulate: # Gather their foreign keys, delete those, then delete their # profile and user info alerts = up.alert.all() for alert in alerts: alert.delete() # delete the user then the profile. up.user.delete() up.delete() except: if verbose: print "Deleting orphaned profile, " + str(up) if not simulate: # it's an orphan user profile, so we delete it and any alerts # attached to it. alerts = up.alert.all() for alert in alerts: alert.delete() # delete the profile. up.delete() return 0 | b499e48b3f717d9bc004a49071bd8f343c739aba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6762/b499e48b3f717d9bc004a49071bd8f343c739aba/account_management.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
1673,
67,
13739,
12,
11369,
16,
20089,
4672,
3536,
2503,
2728,
903,
1104,
9484,
12156,
2353,
23909,
715,
2795,
8846,
716,
1240,
486,
2118,
19979,
16,
471,
1430,
2182,
18,
2597,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
1673,
67,
13739,
12,
11369,
16,
20089,
4672,
3536,
2503,
2728,
903,
1104,
9484,
12156,
2353,
23909,
715,
2795,
8846,
716,
1240,
486,
2118,
19979,
16,
471,
1430,
2182,
18,
2597,
... |
return | return None | def notify(title, message, timeout = 0, actions = []): if not have_notifications: info('%s: %s', title, message) return import time import dbus.types hints = {} if actions: hints['urgency'] = dbus.types.Byte(NORMAL) else: hints['urgency'] = dbus.types.Byte(LOW) notification_service.Notify('Zero Install', 0, # replaces_id, '', # icon title, message, actions, hints, timeout * 1000) | 44f80dda7329e4c80dc0493daf3ccf8f8be0fe6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10543/44f80dda7329e4c80dc0493daf3ccf8f8be0fe6e/background.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
12,
2649,
16,
883,
16,
2021,
273,
374,
16,
4209,
273,
5378,
4672,
309,
486,
1240,
67,
15286,
30,
1123,
29909,
87,
30,
738,
87,
2187,
2077,
16,
883,
13,
327,
599,
225,
1930,
813... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
12,
2649,
16,
883,
16,
2021,
273,
374,
16,
4209,
273,
5378,
4672,
309,
486,
1240,
67,
15286,
30,
1123,
29909,
87,
30,
738,
87,
2187,
2077,
16,
883,
13,
327,
599,
225,
1930,
813... |
def __init__(self, filename, exclusions, eastasianwidth, expand=1): | def __init__(self, filename, exclusions, eastasianwidth, derivednormalizationprops=None, expand=1): | def __init__(self, filename, exclusions, eastasianwidth, expand=1): self.changed = [] file = open(filename) table = [None] * 0x110000 while 1: s = file.readline() if not s: break s = s.strip().split(";") char = int(s[0], 16) table[char] = s | 750b753ee5c128c1326cf850e328d6193df68639 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/750b753ee5c128c1326cf850e328d6193df68639/makeunicodedata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1544,
16,
29523,
16,
19720,
345,
2779,
2819,
16,
10379,
6130,
1588,
9693,
33,
7036,
16,
4542,
33,
21,
4672,
365,
18,
6703,
273,
5378,
585,
273,
1696,
12,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1544,
16,
29523,
16,
19720,
345,
2779,
2819,
16,
10379,
6130,
1588,
9693,
33,
7036,
16,
4542,
33,
21,
4672,
365,
18,
6703,
273,
5378,
585,
273,
1696,
12,... |
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_random, "ss") | self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_random_image, "ss") | def toggle_slideshow(self, action): if len(self.image_list) > 1: if self.slideshow_mode == False: if self.slideshow_in_fullscreen == True and self.fullscreen_mode == False: self.enter_fullscreen(None) self.slideshow_mode = True self.update_title() self.set_slideshow_sensitivities() if self.curr_slideshow_random == False: self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_next, "ss") else: self.reinitialize_randomlist() self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_random, "ss") self.ss_start.hide() self.ss_stop.show() timer_screensaver = gobject.timeout_add(1000, self.disable_screensaver_in_slideshow_mode) else: self.slideshow_mode = False gobject.source_remove(self.timer_delay) self.update_title() self.set_slideshow_sensitivities() self.set_zoom_sensitivities() self.ss_stop.hide() self.ss_start.show() | 80bd8b120d791a7c2ba16ac790e82ce97ab073e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/80bd8b120d791a7c2ba16ac790e82ce97ab073e3/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10486,
67,
2069,
4369,
13606,
12,
2890,
16,
1301,
4672,
309,
562,
12,
2890,
18,
2730,
67,
1098,
13,
405,
404,
30,
309,
365,
18,
2069,
4369,
13606,
67,
3188,
422,
1083,
30,
309,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10486,
67,
2069,
4369,
13606,
12,
2890,
16,
1301,
4672,
309,
562,
12,
2890,
18,
2730,
67,
1098,
13,
405,
404,
30,
309,
365,
18,
2069,
4369,
13606,
67,
3188,
422,
1083,
30,
309,
365,
... |
"stindex", "obindex", "COMMENT", "label", | "stindex", "obindex", "COMMENT", "label", "input", "memberline", "memberlineni", "methodline", "methodlineni", | def move_elements_by_name(doc, source, dest, name, sep=None): nodes = [] for child in source.childNodes: if child.nodeType == xml.dom.core.ELEMENT and child.tagName == name: nodes.append(child) for node in nodes: source.removeChild(node) dest.appendChild(node) if sep: dest.appendChild(doc.createTextNode(sep)) | 6fd3b456df1736e218c2900c3479631306a4f4d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6fd3b456df1736e218c2900c3479631306a4f4d7/docfixer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
67,
6274,
67,
1637,
67,
529,
12,
2434,
16,
1084,
16,
1570,
16,
508,
16,
5478,
33,
7036,
4672,
2199,
273,
5378,
364,
1151,
316,
1084,
18,
3624,
3205,
30,
309,
1151,
18,
2159,
55... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
67,
6274,
67,
1637,
67,
529,
12,
2434,
16,
1084,
16,
1570,
16,
508,
16,
5478,
33,
7036,
4672,
2199,
273,
5378,
364,
1151,
316,
1084,
18,
3624,
3205,
30,
309,
1151,
18,
2159,
55... |
""" | """ | def flimage_to_ximage(pImage, window, p3): """ flimage_to_ximage(pImage, window, p3) -> num. """ retval = _flimage_to_ximage(pImage, window, p3) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
2730,
67,
869,
67,
92,
2730,
12,
84,
2040,
16,
2742,
16,
293,
23,
4672,
3536,
1183,
2730,
67,
869,
67,
92,
2730,
12,
84,
2040,
16,
2742,
16,
293,
23,
13,
317,
818,
18,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
2730,
67,
869,
67,
92,
2730,
12,
84,
2040,
16,
2742,
16,
293,
23,
4672,
3536,
1183,
2730,
67,
869,
67,
92,
2730,
12,
84,
2040,
16,
2742,
16,
293,
23,
13,
317,
818,
18,
3536,
... |
self.selectActionGroup.setText(self.__tr("Select Group")) self.selectAtomsAction.setText(self.__tr("Select Atoms")) self.selectAtomsAction.setToolTip(self.__tr("Select Atoms")) self.selectAtomsAction.setMenuText(self.__tr("Select Atoms")) self.selectMoleculesAction.setText(self.__tr("Select Molecules")) self.selectMoleculesAction.setToolTip(self.__tr("Select Molecules")) self.selectMoleculesAction.setMenuText(self.__tr("Select Molecules")) self.selectJigsAction.setText(self.__tr("Select Jigs")) self.selectJigsAction.setToolTip(self.__tr("Select Jigs")) self.selectJigsAction.setMenuText(self.__tr("Select Jigs")) self.selectActionGroup.setMenuText(self.__tr("Select Group")) | def languageChange(self): self.setCaption(self.__tr("nanoENGINEER-1")) self.fileOpenAction.setText(self.__tr("Open")) self.fileOpenAction.setMenuText(self.__tr("&Open...")) self.fileOpenAction.setAccel(self.__tr("Ctrl+O")) self.fileSaveAction.setText(self.__tr("Save")) self.fileSaveAction.setMenuText(self.__tr("&Save")) self.fileSaveAction.setAccel(self.__tr("Ctrl+S")) self.fileSaveAsAction.setText(self.__tr("Save As")) self.fileSaveAsAction.setMenuText(self.__tr("Save &As...")) self.fileSaveAsAction.setAccel(QString.null) self.fileImageAction.setText(self.__tr("&Image...")) self.fileImageAction.setMenuText(self.__tr("&Image...")) self.fileImageAction.setAccel(self.__tr("Ctrl+I")) self.fileExitAction.setText(self.__tr("Exit")) self.fileExitAction.setMenuText(self.__tr("E&xit")) self.fileExitAction.setAccel(QString.null) self.editUndoAction.setText(self.__tr("Undo")) self.editUndoAction.setMenuText(self.__tr("&Undo")) self.editUndoAction.setAccel(self.__tr("Ctrl+Z")) self.editRedoAction.setText(self.__tr("Redo")) self.editRedoAction.setMenuText(self.__tr("&Redo")) self.editRedoAction.setAccel(self.__tr("Ctrl+Y")) self.editCutAction.setText(self.__tr("Cut")) self.editCutAction.setMenuText(self.__tr("&Cut")) self.editCutAction.setAccel(self.__tr("Ctrl+X")) self.editCopyAction.setText(self.__tr("Copy")) self.editCopyAction.setMenuText(self.__tr("C&opy")) self.editCopyAction.setAccel(self.__tr("Ctrl+C")) self.editPasteAction.setText(self.__tr("Paste")) self.editPasteAction.setMenuText(self.__tr("&Paste")) self.editPasteAction.setAccel(self.__tr("Ctrl+V")) self.editFindAction.setText(self.__tr("Find")) self.editFindAction.setMenuText(self.__tr("&Find...")) self.helpContentsAction.setText(self.__tr("Contents")) self.helpContentsAction.setMenuText(self.__tr("&Contents...")) self.helpContentsAction.setAccel(QString.null) self.helpAssistantAction.setText(self.__tr("nanoENGINEER-1 Assistant")) self.helpAssistantAction.setAccel(QString.null) self.helpAssistantAction.setMenuText(self.__tr("nanoENGINEER-1 Assistant")) self.helpAboutAction.setText(self.__tr("About nanoENGINEER-1")) self.helpAboutAction.setMenuText(self.__tr("&About nanoENGINEER-1")) self.helpAboutAction.setAccel(QString.null) self.setViewFitToWindowAction.setText(self.__tr("Fit to Window")) self.setViewFitToWindowAction.setMenuText(self.__tr("&Fit to Window")) self.setViewFitToWindowAction.setToolTip(self.__tr("Fit to Window (Ctrl+F)")) self.setViewFitToWindowAction.setAccel(self.__tr("Ctrl+F")) self.fileCloseAction.setText(self.__tr("Close")) self.fileCloseAction.setMenuText(self.__tr("&Close")) self.viewDefviewAction.setText(self.__tr("Orientations")) self.viewDefviewAction.setMenuText(self.__tr("Orientations")) self.viewDefviewAction.setToolTip(self.__tr("Default Views")) self.dispBGColorAction.setText(self.__tr("Background Color...")) self.dispBGColorAction.setMenuText(self.__tr("&Background Color...")) self.selectAllAction.setText(self.__tr("All")) self.selectAllAction.setMenuText(self.__tr("&All")) self.selectAllAction.setToolTip(self.__tr("Select All (Ctrl+A)")) self.selectAllAction.setAccel(self.__tr("Ctrl+A")) self.selectNoneAction.setText(self.__tr("None")) self.selectNoneAction.setMenuText(self.__tr("&None")) self.selectNoneAction.setToolTip(self.__tr("Select None (Ctrl+D)")) self.selectNoneAction.setAccel(self.__tr("Ctrl+D")) self.selectInvertAction.setText(self.__tr("Invert")) self.selectInvertAction.setMenuText(self.__tr("&Invert")) self.selectInvertAction.setToolTip(self.__tr("Select Invert (Ctrl+Shift+I)")) self.selectInvertAction.setAccel(self.__tr("Ctrl+Shift+I")) self.ccAddLayerAction.setText(self.__tr("Add Layer")) self.ccAddLayerAction.setMenuText(self.__tr("Add Layer")) self.toolsDoneAction.setText(self.__tr("Done")) self.toolsDoneAction.setMenuText(self.__tr("Done")) self.toolsCancelAction.setText(self.__tr("Cancel")) self.toolsCancelAction.setMenuText(self.__tr("Cancel")) self.editDeleteAction.setText(self.__tr("Delete")) self.editDeleteAction.setMenuText(self.__tr("&Delete")) self.editDeleteAction.setToolTip(self.__tr("Delete (Del)")) self.editDeleteAction.setAccel(self.__tr("Del")) self.viewToolbarsAction.setText(self.__tr("Toolbars")) self.viewToolbarsAction.setMenuText(self.__tr("&Toolbars")) self.dispObjectColorAction.setText(self.__tr("Chunk Color")) self.dispObjectColorAction.setMenuText(self.__tr("&Chunk Color...")) self.dispOpenBondsAction.setText(self.__tr("Display Open Bonds")) self.dispOpenBondsAction.setMenuText(self.__tr("Display Open Bonds")) self.modifyHydrogenateAction.setText(self.__tr("Hydrogenate")) self.modifyHydrogenateAction.setMenuText(self.__tr("&Hydrogenate")) self.modifyHydrogenateAction.setToolTip(self.__tr("Hydrogenate")) self.modifyPassivateAction.setText(self.__tr("Passivate")) self.modifyPassivateAction.setMenuText(self.__tr("&Passivate")) self.modifyPassivateAction.setToolTip(self.__tr("Passivate (Ctrl+P)")) self.modifyPassivateAction.setAccel(self.__tr("Ctrl+P")) self.jigsMotorAction.setText(self.__tr("Rotary Motor")) self.jigsMotorAction.setMenuText(self.__tr("&Rotary Motor")) self.modifyMinimizeAction.setText(self.__tr("Minimize")) self.modifyMinimizeAction.setMenuText(self.__tr("&Minimize")) self.modifyMinimizeAction.setToolTip(self.__tr("Minimize (Ctrl+M)")) self.modifyMinimizeAction.setAccel(self.__tr("Ctrl+M")) self.elemChangePTableAction.setText(self.__tr("Atom Type")) self.elemChangePTableAction.setMenuText(self.__tr("Atom Type")) self.toggleFileTbarAction.setText(self.__tr("File")) self.toggleFileTbarAction.setMenuText(self.__tr("File")) self.toggleEditTbarAction.setText(self.__tr("Edit")) self.toggleEditTbarAction.setMenuText(self.__tr("Edit")) self.toggleViewTbarAction.setText(self.__tr("View")) self.toggleViewTbarAction.setMenuText(self.__tr("View")) self.toggleModelDispTbarAction.setText(self.__tr("Model Display")) self.toggleModelDispTbarAction.setMenuText(self.__tr("Model Display")) self.toggleSelectTbarAction.setText(self.__tr("Select")) self.toggleSelectTbarAction.setMenuText(self.__tr("Select")) self.toggleToolsTbarAction.setText(self.__tr("Tools")) self.toggleToolsTbarAction.setMenuText(self.__tr("Tools")) self.fileSetWorkDirAction.setText(self.__tr("Set Working Directory...")) self.fileSetWorkDirAction.setMenuText(self.__tr("Set &Working Directory...")) self.dispTrihedronAction.setText(self.__tr("Trihedron")) self.dispTrihedronAction.setMenuText(self.__tr("Trihedron")) self.dispTrihedronAction.setToolTip(self.__tr("Display Trihedron")) self.dispDatumPlanesAction.setText(self.__tr("Display Datum Planes")) self.dispDatumPlanesAction.setMenuText(self.__tr("Display Datum Planes")) self.dispCsysAction.setText(self.__tr("Display Coordinate System")) self.dispCsysAction.setMenuText(self.__tr("Display Coordinate System")) self.dispDatumLinesAction.setText(self.__tr("Display Datum Lines")) self.dispDatumLinesAction.setMenuText(self.__tr("Display Datum Lines")) self.dispGridAction.setText(self.__tr("Display Grid")) self.dispGridAction.setMenuText(self.__tr("Display Grid")) self.selectConnectedAction.setText(self.__tr("Connected")) self.selectConnectedAction.setMenuText(self.__tr("&Connected")) self.selectConnectedAction.setToolTip(self.__tr("Select Connected")) self.selectConnectedAction.setAccel(self.__tr("Ctrl+Shift+C")) self.selectDoublyAction.setText(self.__tr("Doubly")) self.selectDoublyAction.setMenuText(self.__tr("&Doubly")) self.selectDoublyAction.setToolTip(self.__tr("Select Doubly")) self.selectDoublyAction.setAccel(self.__tr("Ctrl+Shift+D")) self.editPreferencesAction.setText(self.__tr("Preferences...")) self.editPreferencesAction.setMenuText(self.__tr("P&references...")) self.jigsBearingAction.setText(self.__tr("Bearing")) self.jigsBearingAction.setMenuText(self.__tr("&Bearing")) self.jigsSpringAction.setText(self.__tr("Spring")) self.jigsSpringAction.setMenuText(self.__tr("&Spring")) self.jigsDynoAction.setText(self.__tr("Dyno")) self.jigsDynoAction.setMenuText(self.__tr("&Dyno")) self.jigsHeatsinkAction.setText(self.__tr("Heatsin&k")) self.jigsHeatsinkAction.setMenuText(self.__tr("Heatsin&k")) self.jigsGroundAction.setText(self.__tr("Ground")) self.jigsGroundAction.setMenuText(self.__tr("&Ground")) self.jigsHandleAction.setText(self.__tr("Handle")) self.jigsHandleAction.setMenuText(self.__tr("&Handle")) self.modifySeparateAction.setText(self.__tr("Separate")) self.modifySeparateAction.setMenuText(self.__tr("&Separate")) self.ccGraphiteAction.setText(self.__tr("Graphite")) self.ccGraphiteAction.setMenuText(self.__tr("Graphite")) self.orient100Action.setText(self.__tr("Surface 100")) self.orient100Action.setMenuText(self.__tr("Surface 100")) self.orient110Action.setText(self.__tr("Surface 110")) self.orient110Action.setMenuText(self.__tr("Surface 110")) self.orient111Action.setText(self.__tr("Surface 111")) self.orient111Action.setMenuText(self.__tr("Surface 111")) self.setViewFrontAction.setText(self.__tr("&Front")) self.setViewFrontAction.setMenuText(self.__tr("&Front")) self.setViewFrontAction.setToolTip(self.__tr("Front")) self.setViewBackAction.setText(self.__tr("Back")) self.setViewBackAction.setMenuText(self.__tr("&Back")) self.setViewTopAction.setText(self.__tr("Top")) self.setViewTopAction.setMenuText(self.__tr("&Top")) self.setViewTopAction.setToolTip(self.__tr("Top")) self.setViewBottomAction.setText(self.__tr("Bottom")) self.setViewBottomAction.setMenuText(self.__tr("Botto&m")) self.setViewRightAction.setText(self.__tr("Right")) self.setViewRightAction.setMenuText(self.__tr("&Right")) self.setViewRightAction.setToolTip(self.__tr("Right")) self.setViewLeftAction.setText(self.__tr("Left")) self.setViewLeftAction.setMenuText(self.__tr("&Left")) self.setViewLeftAction.setToolTip(self.__tr("Left")) self.setViewHomeAction.setText(self.__tr("Home")) self.setViewHomeAction.setMenuText(self.__tr("&Home")) self.setViewHomeAction.setToolTip(self.__tr("Home")) self.setViewHomeAction.setAccel(self.__tr("Home")) self.setViewRecenterAction.setText(self.__tr("Recenter")) self.setViewRecenterAction.setMenuText(self.__tr("&Recenter")) self.setViewRecenterAction.setToolTip(self.__tr("Recenter (Ctrl+R)")) self.setViewRecenterAction.setAccel(self.__tr("Ctrl+R")) self.jigsLinearMotorAction.setText(self.__tr("&Linear Motor")) self.jigsLinearMotorAction.setMenuText(self.__tr("&Linear Motor")) self.toggleModifyTbarAction.setText(self.__tr("Modify")) self.toggleModifyTbarAction.setMenuText(self.__tr("Modify")) self.toolsStartOverAction.setText(self.__tr("Start Over")) self.toolsStartOverAction.setMenuText(self.__tr("Start Over")) self.toolsBackUpAction.setText(self.__tr("Back Up")) self.toolsBackUpAction.setMenuText(self.__tr("Back Up")) self.fileClearAction.setText(self.__tr("Clear")) self.fileClearAction.setMenuText(self.__tr("C&lear")) self.modifyCopyBondAction.setText(self.__tr("Copy Bond")) self.modifyCopyBondAction.setMenuText(self.__tr("&Copy Bond")) self.modifyEdgeBondAction.setText(self.__tr("Edge Bond")) self.modifyEdgeBondAction.setMenuText(self.__tr("Ed&ge Bond")) self.modifyWeldAction.setText(self.__tr("Weld")) self.modifyWeldAction.setMenuText(self.__tr("&Weld")) self.toggleDatumDispTbarAction.setText(self.__tr("Datum Display")) self.toggleDatumDispTbarAction.setMenuText(self.__tr("Datum Display")) self.modifySetElementAction.setText(self.__tr("Change Element")) self.modifySetElementAction.setMenuText(self.__tr("Change &Element...")) self.modifySetElementAction.setAccel(self.__tr("Ctrl+E")) self.fileInsertAction.setText(self.__tr("Inser&t...")) self.fileInsertAction.setMenuText(self.__tr("Inser&t...")) self.modifyDehydrogenateAction.setText(self.__tr("Dehydrogenate")) self.modifyDehydrogenateAction.setMenuText(self.__tr("Dehydrogenate")) self.toggleGridsTbarAction.setText(self.__tr("Grids")) self.toggleGridsTbarAction.setMenuText(self.__tr("Grids")) self.dispCPKAction.setText(self.__tr("CPK")) self.dispCPKAction.setMenuText(self.__tr("CPK")) self.dispDefaultAction.setText(self.__tr("Default")) self.dispDefaultAction.setMenuText(self.__tr("Default")) self.dispInvisAction.setText(self.__tr("Invisible")) self.dispInvisAction.setMenuText(self.__tr("Invisible")) self.dispLinesAction.setText(self.__tr("Lines")) self.dispLinesAction.setMenuText(self.__tr("Lines")) self.dispTubesAction.setText(self.__tr("Tubes")) self.dispTubesAction.setMenuText(self.__tr("Tubes")) self.dispVdWAction.setText(self.__tr("VdW")) self.dispVdWAction.setMenuText(self.__tr("VdW")) self.setPerspectiveActionGroup.setText(self.__tr("ActionGroup")) self.setViewOrthoAction.setText(self.__tr("Ortho")) self.setViewOrthoAction.setMenuText(self.__tr("Or&tho")) self.setViewOrthoAction.setToolTip(self.__tr("Ortho")) self.setViewPerspecAction.setText(self.__tr("Perspective")) self.setViewPerspecAction.setMenuText(self.__tr("&Perspective")) self.setViewPerspecAction.setToolTip(self.__tr("Perspective")) self.setPerspectiveActionGroup.setMenuText(self.__tr("ActionGroup")) self.toolsModeActionGroup.setText(self.__tr("ActionGroup")) self.toolsDepositAtomAction.setText(self.__tr("Build Atoms")) self.toolsDepositAtomAction.setMenuText(self.__tr("Build &Atoms")) self.toolsDepositAtomAction.setToolTip(self.__tr("Build Atoms")) self.toolsCookieCutAction.setText(self.__tr("Cookie Cutter")) self.toolsCookieCutAction.setMenuText(self.__tr("&Cookie Cutter")) self.toolsCookieCutAction.setToolTip(self.__tr("Cookie Cutter")) self.toolsExtrudeAction.setText(self.__tr("Extrude")) self.toolsExtrudeAction.setMenuText(self.__tr("&Extrude")) self.toolsExtrudeAction.setToolTip(self.__tr("Extrude")) self.toolsRevolveAction.setText(self.__tr("Revolve")) self.toolsRevolveAction.setMenuText(self.__tr("&Revolve")) self.toolsRevolveAction.setToolTip(self.__tr("Revolve")) self.toolsMirrorAction.setText(self.__tr("Mirror")) self.toolsMirrorAction.setMenuText(self.__tr("Mi&rror")) self.toolsMirrorAction.setToolTip(self.__tr("Mirror")) self.toolsMirrorCircularBoundaryAction.setText(self.__tr("Mirror Circular Boundary")) self.toolsMirrorCircularBoundaryAction.setMenuText(self.__tr("Mirror Circular &Boundary")) self.toolsMirrorCircularBoundaryAction.setToolTip(self.__tr("Mirror Circular Boundary")) self.toolsAlignToCommonAxisAction.setText(self.__tr("Align To Common Axis")) self.toolsAlignToCommonAxisAction.setMenuText(self.__tr("A&lign To Common Axis")) self.toolsAlignToCommonAxisAction.setToolTip(self.__tr("Align To Common Axis")) self.toolsMoviePlayerAction.setText(self.__tr("Movie Player")) self.toolsMoviePlayerAction.setMenuText(self.__tr("&Movie Player")) self.toolsMoviePlayerAction.setToolTip(self.__tr("Movie Player")) self.toolsSimulatorAction.setText(self.__tr("Simulator")) self.toolsSimulatorAction.setMenuText(self.__tr("S&imulator")) self.toolsSimulatorAction.setToolTip(self.__tr("Simulator")) self.toolsAddBondAction.setText(self.__tr("Add Bond")) self.toolsAddBondAction.setToolTip(self.__tr("Add Bond")) self.toolsAddBondAction.setMenuText(self.__tr("Add Bond")) self.toolsDeleteBondAction.setText(self.__tr("Delete Bond")) self.toolsDeleteBondAction.setToolTip(self.__tr("Delete Bond")) self.toolsDeleteBondAction.setMenuText(self.__tr("Delete Bond")) self.toolsSelectAtomsAction.setText(self.__tr("Select Atoms")) self.toolsSelectAtomsAction.setToolTip(self.__tr("Select Atoms")) self.toolsSelectAtomsAction.setMenuText(self.__tr("Select Atoms")) self.toolsSelectMoleculesAction.setText(self.__tr("Select Chunks")) self.toolsSelectMoleculesAction.setToolTip(self.__tr("Select Chunks")) self.toolsSelectMoleculesAction.setMenuText(self.__tr("Select Chunks")) self.toolsMoveMoleculeAction.setText(self.__tr("Move Chunks")) self.toolsMoveMoleculeAction.setToolTip(self.__tr("Move Chunks")) self.toolsMoveMoleculeAction.setMenuText(self.__tr("Move Chunks")) self.toolsSelectAction.setText(self.__tr("Select")) self.toolsSelectAction.setMenuText(self.__tr("&Select")) self.toolsSelectAction.setToolTip(self.__tr("Select")) self.toolsSelectJigsAction.setText(self.__tr("Select Jigs")) self.toolsSelectJigsAction.setToolTip(self.__tr("Select Jigs")) self.toolsSelectJigsAction.setMenuText(self.__tr("Select Jigs")) self.toolsModeActionGroup.setMenuText(self.__tr("ActionGroup")) self.modifyStretchAction.setText(self.__tr("Stretch")) self.modifyStretchAction.setMenuText(self.__tr("S&tretch")) self.moveMolActionGroup.setText(self.__tr("Move Group")) self.moveMolXAction.setText(self.__tr("X Translate")) self.moveMolXAction.setToolTip(self.__tr("X Translate")) self.moveMolXAction.setMenuText(self.__tr("X Translate")) self.moveMolYAction.setText(self.__tr("Y Translation")) self.moveMolYAction.setToolTip(self.__tr("Y Translation")) self.moveMolYAction.setMenuText(self.__tr("Y Translation")) self.moveMolZAction.setText(self.__tr("Z Translation")) self.moveMolZAction.setToolTip(self.__tr("Z Translation")) self.moveMolZAction.setMenuText(self.__tr("Z Translation")) self.moveMolRotXAction.setText(self.__tr("X Rotation")) self.moveMolRotXAction.setToolTip(self.__tr("X Rotation")) self.moveMolRotXAction.setMenuText(self.__tr("X Rotation")) self.moveMolRotYAction.setText(self.__tr("Y Rotation")) self.moveMolRotYAction.setToolTip(self.__tr("Y Rotation")) self.moveMolRotYAction.setMenuText(self.__tr("Y Rotation")) self.moveMolRotZAction.setText(self.__tr("Z Rotation")) self.moveMolRotZAction.setToolTip(self.__tr("Z Rotation")) self.moveMolRotZAction.setMenuText(self.__tr("Z Rotation")) self.moveMolFreeAction.setText(self.__tr("Move Unconstrained")) self.moveMolFreeAction.setToolTip(self.__tr("Move Unconstrained")) self.moveMolFreeAction.setMenuText(self.__tr("Move Unconstrained")) self.rotateMolFreeAction.setText(self.__tr("Rotate Molecule Unconstrained")) self.rotateMolFreeAction.setToolTip(self.__tr("Rotate Molecule Unconstrained")) self.rotateMolFreeAction.setMenuText(self.__tr("Rotate Molecule Unconstrained")) self.moveRotateMolAction.setText(self.__tr("Move/Rotate Constrained")) self.moveRotateMolAction.setToolTip(self.__tr("Move/Rotate Constrained")) self.moveRotateMolAction.setMenuText(self.__tr("Move/Rotate Constrained")) self.moveMolActionGroup.setMenuText(self.__tr("Move Group")) self.selectActionGroup.setText(self.__tr("Select Group")) self.selectAtomsAction.setText(self.__tr("Select Atoms")) self.selectAtomsAction.setToolTip(self.__tr("Select Atoms")) self.selectAtomsAction.setMenuText(self.__tr("Select Atoms")) self.selectMoleculesAction.setText(self.__tr("Select Molecules")) self.selectMoleculesAction.setToolTip(self.__tr("Select Molecules")) self.selectMoleculesAction.setMenuText(self.__tr("Select Molecules")) self.selectJigsAction.setText(self.__tr("Select Jigs")) self.selectJigsAction.setToolTip(self.__tr("Select Jigs")) self.selectJigsAction.setMenuText(self.__tr("Select Jigs")) self.selectActionGroup.setMenuText(self.__tr("Select Group")) self.nullAction.setText(QString.null) self.nullAction.setMenuText(QString.null) self.jigsStatAction.setText(self.__tr("Thermostat")) self.jigsStatAction.setMenuText(self.__tr("Thermo&stat")) self.dispResetMolColorAction.setText(self.__tr("Reset Chunk Color")) self.dispResetMolColorAction.setMenuText(self.__tr("&Reset Chunk Color")) self.helpWhatsThisAction.setText(self.__tr("What's This")) self.helpWhatsThisAction.setMenuText(self.__tr("What's This")) self.movieResetAction.setText(self.__tr("Reset Movie")) self.movieResetAction.setMenuText(self.__tr("Reset Movie")) self.moviePlayRevActiveAction.setText(self.__tr("Play Reverse")) self.moviePlayRevActiveAction.setMenuText(self.__tr("Play Reverse")) self.moviePlayActiveAction.setText(self.__tr("Play Forward")) self.moviePlayActiveAction.setMenuText(self.__tr("Play Forward")) self.movieMoveToEndAction.setText(self.__tr("Advance To End")) self.movieMoveToEndAction.setMenuText(self.__tr("Advance To End")) self.moviePauseAction.setText(self.__tr("Pause")) self.moviePauseAction.setMenuText(self.__tr("Pause")) self.moviePlayAction.setText(self.__tr("Play Forward")) self.moviePlayAction.setToolTip(self.__tr("Play Forward")) self.moviePlayAction.setMenuText(self.__tr("Play Forward")) self.setViewHomeToCurrentAction.setText(self.__tr("Set Home View to Current View")) self.setViewHomeToCurrentAction.setMenuText(self.__tr("Set Home View to &Current View")) self.modifyAlignCommonAxisAction.setText(self.__tr("Align to Common Axis")) self.modifyAlignCommonAxisAction.setMenuText(self.__tr("&Align to Common Axis")) self.dispSetEltable1Action.setText(self.__tr("Set Atom Colors to Default")) self.dispSetEltable1Action.setMenuText(self.__tr("Set Atom Colors to Default")) self.dispSetEltable2Action.setText(self.__tr("Set Atom Colors to Alternate")) self.dispSetEltable2Action.setMenuText(self.__tr("Set Atom Colors to Alternate")) self.movieDoneAction.setText(self.__tr("Done")) self.movieDoneAction.setMenuText(self.__tr("Done")) self.movieNextFrameAction.setText(self.__tr("Next")) self.movieNextFrameAction.setMenuText(self.__tr("Next")) self.moviePrevFrameAction.setText(self.__tr("Prev")) self.moviePrevFrameAction.setMenuText(self.__tr("Prev")) self.fileSaveMovieAction.setText(self.__tr("Save Movie")) self.fileSaveMovieAction.setMenuText(self.__tr("Save Movie")) self.moviePlayRevAction.setText(self.__tr("Play Reverse")) self.moviePlayRevAction.setMenuText(self.__tr("Play Reverse")) self.fileOpenMovieAction.setText(self.__tr("Open Movie File")) self.fileOpenMovieAction.setMenuText(self.__tr("Open Movie File")) self.movieInfoAction.setText(self.__tr("Movie Information")) self.movieInfoAction.setMenuText(self.__tr("Movie Information")) self.zoomWindowAction.setText(self.__tr("Zoom Window")) self.zoomWindowAction.setMenuText(self.__tr("Zoom Window")) self.panWindowAction.setText(self.__tr("Action")) self.panWindowAction.setMenuText(self.__tr("Action")) self.rotateWindowAction.setText(self.__tr("Action")) self.rotateWindowAction.setMenuText(self.__tr("Action")) self.jigsThermoAction.setText(self.__tr("Thermometer")) self.jigsThermoAction.setMenuText(self.__tr("&Thermometer")) self.fileToolbar.setLabel(self.__tr("File")) self.editToolbar.setLabel(self.__tr("Edit")) self.viewToolbar.setLabel(self.__tr("View")) self.molecularDispToolbar.setLabel(self.__tr("Display Modes")) self.selectToolbar.setLabel(self.__tr("Select")) self.helpToolbar.setLabel(self.__tr("Help")) self.cookieCutterDashboard.setLabel(self.__tr("Cookie Cutter")) self.textLabel2.setText(self.__tr(" Cookie Cutter")) self.textLabel1_3.setText(self.__tr("Thickness (Angstroms):")) QToolTip.add(self.ccLayerThicknessLineEdit,self.__tr("Thickness of layer in Angstroms")) QWhatsThis.add(self.ccLayerThicknessLineEdit,self.__tr("Thickness of layer in Angstroms")) QToolTip.add(self.ccLayerThicknessSpinBox,self.__tr("Number of lattice cells")) QWhatsThis.add(self.ccLayerThicknessSpinBox,self.__tr("Number of lattice cells")) self.selectAtomsDashboard.setLabel(self.__tr("Select Atoms")) self.textLabel2_2.setText(self.__tr("Select Atoms")) self.moveMolDashboard.setLabel(self.__tr("Move Chunks")) self.textLabel1.setText(self.__tr("Move Chunks")) self.moviePlayerDashboard.setLabel(self.__tr("Movie Player Dashboard")) self.textLabel1_4.setText(self.__tr("Movie Player")) self.frameLabel.setText(self.__tr("Frame (500 total):")) self.frameNumberSB.setPrefix(QString.null) self.selectMolDashboard.setLabel(self.__tr("Select Molecule")) self.textLabel1_2.setText(self.__tr("Select Chunks")) self.zoomDashboard.setLabel(self.__tr("Zoom Window")) self.zoomTextLabel.setText(self.__tr("Zoom Window")) self.depositAtomDashboard.setLabel(self.__tr("Build Dashboard")) self.modifyToolbar.setLabel(self.__tr("Modify")) self.toolsToolbar.setLabel(self.__tr("Tools")) self.datumDispDashboard.setLabel(self.__tr("Datum Display")) if self.MenuBar.findItem(3): self.MenuBar.findItem(3).setText(self.__tr("&File")) if self.MenuBar.findItem(4): self.MenuBar.findItem(4).setText(self.__tr("&Edit")) if self.MenuBar.findItem(5): self.MenuBar.findItem(5).setText(self.__tr("&View")) if self.MenuBar.findItem(6): self.MenuBar.findItem(6).setText(self.__tr("&Display")) if self.MenuBar.findItem(7): self.MenuBar.findItem(7).setText(self.__tr("&Jigs")) if self.MenuBar.findItem(8): self.MenuBar.findItem(8).setText(self.__tr("&Modify")) if self.MenuBar.findItem(9): self.MenuBar.findItem(9).setText(self.__tr("&Tools")) if self.MenuBar.findItem(10): self.MenuBar.findItem(10).setText(self.__tr("&Help")) | e48e859515237593d94b403a9c0a7295e08c31f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/e48e859515237593d94b403a9c0a7295e08c31f2/MainWindowUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2653,
3043,
12,
2890,
4672,
365,
18,
542,
21158,
12,
2890,
16186,
313,
2932,
13569,
83,
28980,
654,
17,
21,
6,
3719,
365,
18,
768,
3678,
1803,
18,
542,
1528,
12,
2890,
16186,
313,
2932... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2653,
3043,
12,
2890,
4672,
365,
18,
542,
21158,
12,
2890,
16186,
313,
2932,
13569,
83,
28980,
654,
17,
21,
6,
3719,
365,
18,
768,
3678,
1803,
18,
542,
1528,
12,
2890,
16186,
313,
2932... | |
pkg = list[i] | def filterArchList(list, arch=None): # stage 1: filter packages which are not in compat arch if arch != None and arch != "noarch": error = 0 for pkg in list: pkg = list[i] if pkg["arch"] not in possible_archs: error = 1 printError(0, "%s: Unknow rpm package architecture %s" % (pkg.source, pkg["arch"])) if pkg["arch"] != arch and pkg["arch"] not in arch_compats[arch]: error = 1 printError(0, "%s: Architecture not compatible with machine %s" % (pkg.source, arch)) if error != 0: return -1 # stage 2: filert duplicates: order by name.arch hash = { } i = 0 while i < len(list): pkg = list[i] key = "%s.%s" % (pkg["name"], pkg["arch"]) if not hash.has_key(key): hash[key] = pkg i += 1 else: r = hash[key] ret = pkgCompare(r, pkg) if ret < 0: printWarning(0, "%s was already added, replacing with %s" % \ (r.getNEVRA(), pkg.getNEVRA())) hash[key] = pkg list.remove(r) elif ret == 0: printWarning(0, "%s was already added" % \ pkg.getNEVRA()) list.remove(pkg) else: i += 1 del hash # stage 3: filter duplicates: order by name hash = { } i = 0 while i < len(list): pkg = list[i] removed = 0 if not hash.has_key(pkg["name"]): hash[pkg["name"]] = [ ] hash[pkg["name"]].append(pkg) else: j = 0 while hash[pkg["name"]] and j < len(hash[pkg["name"]]) and \ removed == 0: r = hash[pkg["name"]][j] if pkg["arch"] != r["arch"] and \ buildarchtranslate[pkg["arch"]] != \ buildarchtranslate[r["arch"]]: j += 1 elif r["arch"] in arch_compats[pkg["arch"]]: printWarning(0, "%s was already added, replacing with %s" % \ (r.getNEVRA(), pkg.getNEVRA())) hash[pkg["name"]].remove(r) hash[pkg["name"]].append(pkg) list.remove(r) removed = 1 elif pkg["arch"] == r["arch"]: printWarning(0, "%s was already added" % \ pkg.getNEVRA()) list.remove(pkg) removed = 1 else: j += 1 if removed == 0: hash[pkg["name"]].append(pkg) if removed == 0: i += 1 del hash return 1 | 09db47e95c8e38720cba62816e23ee2235a3c637 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/09db47e95c8e38720cba62816e23ee2235a3c637/functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1034,
12269,
682,
12,
1098,
16,
6637,
33,
7036,
4672,
468,
6009,
404,
30,
1034,
5907,
1492,
854,
486,
316,
4796,
6637,
309,
6637,
480,
599,
471,
6637,
480,
315,
2135,
991,
6877,
555,
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,
1034,
12269,
682,
12,
1098,
16,
6637,
33,
7036,
4672,
468,
6009,
404,
30,
1034,
5907,
1492,
854,
486,
316,
4796,
6637,
309,
6637,
480,
599,
471,
6637,
480,
315,
2135,
991,
6877,
555,
2... | |
'total_entry_encoding':fields.function(_get_sum_entry_encoding, method=True, string="Cash Transaction", help="Total cash transactions"), | 'total_entry_encoding':fields.function(_get_sum_entry_encoding, method=True, store=True, string="Cash Transaction", help="Total cash transactions"), | def _end_balance(self, cursor, user, ids, name, attr, context=None): res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users') | c909e8af22db1f6cfa821df04c7e550448da427b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c909e8af22db1f6cfa821df04c7e550448da427b/account_cash_statement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
409,
67,
12296,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
508,
16,
1604,
16,
819,
33,
7036,
4672,
400,
67,
7095,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
455,
18,
7095,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
409,
67,
12296,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
508,
16,
1604,
16,
819,
33,
7036,
4672,
400,
67,
7095,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
455,
18,
7095,
6... |
print '!!! BANG !!!' | self.debug('!!! BANG !!!') | def incoming(self, message): self.info("Incoming message: %r" % (message)) # loop through all of the apps and notify them of # the incoming message so that they all get a # chance to do what they will with it for phase in self.incoming_phases: for app in self.apps: print '====> ' + phase + ' ' + app.name try: getattr(app, phase)(message) except AttributeError: print '!!! BANG !!!' | d2164926e439895a50efe0459ea74a30c6b2cbd6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11809/d2164926e439895a50efe0459ea74a30c6b2cbd6/router.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6935,
12,
2890,
16,
883,
4672,
365,
18,
1376,
2932,
20370,
883,
30,
738,
86,
6,
738,
261,
2150,
3719,
225,
468,
2798,
3059,
777,
434,
326,
8279,
471,
5066,
2182,
434,
468,
326,
6935,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6935,
12,
2890,
16,
883,
4672,
365,
18,
1376,
2932,
20370,
883,
30,
738,
86,
6,
738,
261,
2150,
3719,
225,
468,
2798,
3059,
777,
434,
326,
8279,
471,
5066,
2182,
434,
468,
326,
6935,
... |
print 'Found valid CMake version' | print 'Found valid CMake version %s' % m.group(1) | def persist_cmake(self): if sys.platform == 'win32': version = '2.8.0' found_cmd = '' for test_cmd in (self.cmake_cmd, r'tool\cmake\bin\%s' % self.cmake_cmd): print 'Testing for CMake version %s by running `%s`...' % (version, test_cmd) p = subprocess.Popen([test_cmd, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) stdout, stderr = p.communicate() if p.returncode == 0 and stdout == 'cmake version %s\r\n' % version: # found one that works, hurrah! print 'Found valid CMake version' found_cmd = test_cmd # HACK: gotta go out so just hacking this for now if found_cmd == r'tool\cmake\bin\%s' % self.cmake_cmd: found_cmd = r'..\tool\cmake\bin\%s' % self.cmake_cmd break if not found_cmd: found_cmake = False # if prompting allowed if not self.no_prompts: msg = 'CMake 2.8.0 not installed. Auto download now? [Y/n]' print msg, yn = raw_input() # if response was anyting but no if yn not in ['n', 'N']: if not os.path.exists('tool'): os.mkdir('tool') err = os.system(r'svn checkout https://synergy-plus.googlecode.com/svn/tools/win/cmake tool\cmake') if err != 0: raise Exception('Unable to get cmake from repository with error code code: ' + str(err)) found_cmd = r'..\tool\cmake\bin\%s' % self.cmake_cmd found_cmake = True # if cmake was not found if not found_cmake: raise Exception('Cannot continue without CMake, exiting.') return found_cmd else: return self.cmake_cmd | 930ed5d26a370e8c81eeada17b350ba562a10865 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6688/930ed5d26a370e8c81eeada17b350ba562a10865/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3898,
67,
71,
6540,
12,
2890,
4672,
309,
2589,
18,
9898,
422,
296,
8082,
1578,
4278,
225,
1177,
273,
296,
22,
18,
28,
18,
20,
11,
1392,
67,
4172,
273,
875,
364,
1842,
67,
4172,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3898,
67,
71,
6540,
12,
2890,
4672,
309,
2589,
18,
9898,
422,
296,
8082,
1578,
4278,
225,
1177,
273,
296,
22,
18,
28,
18,
20,
11,
1392,
67,
4172,
273,
875,
364,
1842,
67,
4172,
316,
... |
def files(root): for path, folders, files in os.walk(root): for file in files: yield path, file | def download_from_web(self, url, file, download_dir): ''' Download the required file from the web The arguments are passed everytime to the function so that, may be in future, we could reuse this function ''' try: block_size = 4096 i = 0 counter = 0 os.chdir(download_dir) temp = urllib2.urlopen(url) headers = temp.info() size = int(headers['Content-Length']) data = open(file,'wb') #INFO: Add the download thread into the Global ProgressBar Thread self.addItem(size) while i < size: data.write (temp.read(block_size)) increment = min(block_size, size - i) i += block_size counter += 1 self.updateValue(increment) self.completed() data.close() temp.close() return True #FIXME: Find out optimal fix for this exception handling except OSError, (errno, strerror): #log.err("%s\n" %(download_dir)) errfunc(errno, strerror, download_dir) except urllib2.HTTPError, errstring: #log.err("%s\n" % (file)) errfunc(errstring.code, errstring.msg, file) except urllib2.URLError, errstring: #We pass error code "1" here becuase URLError # doesn't pass any error code. # URLErrors shouldn't be ignored, hence program termination if errstring.reason.args[0] == 10060: errfunc(errstring.reason.args[0], errstring.reason, url) #errfunc(1, errstring.reason) #pass except IOError, e: if hasattr(e, 'reason'): log.err("%s\n" % (e.reason)) if hasattr(e, 'code') and hasattr(e, 'reason'): errfunc(e.code, e.reason, file) | 64e38e130110f470b3f03ba4df1569d0fa0e4402 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12499/64e38e130110f470b3f03ba4df1569d0fa0e4402/pypt_core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4224,
67,
2080,
67,
4875,
12,
2890,
16,
880,
16,
585,
16,
4224,
67,
1214,
4672,
9163,
13059,
326,
1931,
585,
628,
326,
3311,
1021,
1775,
854,
2275,
3614,
957,
358,
326,
445,
1427,
716,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4224,
67,
2080,
67,
4875,
12,
2890,
16,
880,
16,
585,
16,
4224,
67,
1214,
4672,
9163,
13059,
326,
1931,
585,
628,
326,
3311,
1021,
1775,
854,
2275,
3614,
957,
358,
326,
445,
1427,
716,... | |
if armor and wolfpack.armorinfo.ARMOR_RESNAME_BONI.has_key(resname2): | if (armor or shield) and wolfpack.armorinfo.ARMOR_RESNAME_BONI.has_key(resname2): | def onShowTooltip(viewer, object, tooltip): armor = properties.itemcheck(object, ITEM_ARMOR) weapon = properties.itemcheck(object, ITEM_WEAPON) shield = properties.itemcheck(object, ITEM_SHIELD) if (armor or weapon or shield) and object.amount == 1: # Reinsert the name if we need an ore prefix prefix1 = None if object.hastag('resname'): resname = str(object.gettag('resname')) if armor and wolfpack.armorinfo.ARMOR_RESNAME_BONI.has_key(resname): resinfo = wolfpack.armorinfo.ARMOR_RESNAME_BONI[resname] if resinfo.has_key(MATERIALPREFIX): prefix1 = resinfo[MATERIALPREFIX] if weapon and wolfpack.weaponinfo.WEAPON_RESNAME_BONI.has_key(resname): resinfo = wolfpack.weaponinfo.WEAPON_RESNAME_BONI[resname] if resinfo.has_key(MATERIALPREFIX): prefix1 = resinfo[MATERIALPREFIX] elif object.hasstrproperty( 'resname' ): resname = str( object.getstrproperty( 'resname' ) ) if armor and wolfpack.armorinfo.ARMOR_RESNAME_BONI.has_key(resname): resinfo = wolfpack.armorinfo.ARMOR_RESNAME_BONI[resname] if resinfo.has_key(MATERIALPREFIX): prefix1 = resinfo[MATERIALPREFIX] if weapon and wolfpack.weaponinfo.WEAPON_RESNAME_BONI.has_key(resname): resinfo = wolfpack.weaponinfo.WEAPON_RESNAME_BONI[resname] if resinfo.has_key(MATERIALPREFIX): prefix1 = resinfo[MATERIALPREFIX] prefix2 = None if object.hastag('resname2'): resname2 = str(object.gettag('resname2')) if armor and wolfpack.armorinfo.ARMOR_RESNAME_BONI.has_key(resname2): resinfo = wolfpack.armorinfo.ARMOR_RESNAME_BONI[resname2] if resinfo.has_key(MATERIALPREFIX): prefix2 = resinfo[MATERIALPREFIX] if weapon and wolfpack.weaponinfo.WEAPON_RESNAME_BONI.has_key(resname2): resinfo = wolfpack.weaponinfo.WEAPON_RESNAME_BONI[resname2] if resinfo.has_key(MATERIALPREFIX): prefix2 = resinfo[MATERIALPREFIX] elif object.hasstrproperty( 'resname2' ): resname2 = str( object.getstrproperty( 'resname2' ) ) if armor and wolfpack.armorinfo.ARMOR_RESNAME_BONI.has_key(resname2): resinfo = wolfpack.armorinfo.ARMOR_RESNAME_BONI[resname2] if resinfo.has_key(MATERIALPREFIX): prefix2 = resinfo[MATERIALPREFIX] if weapon and wolfpack.weaponinfo.WEAPON_RESNAME_BONI.has_key(resname2): resinfo = wolfpack.weaponinfo.WEAPON_RESNAME_BONI[resname2] if resinfo.has_key(MATERIALPREFIX): prefix2 = resinfo[MATERIALPREFIX] if len(object.name) == 0: itemname = '#' + str(1020000 + object.id) else: itemname = object.name if prefix1 and prefix2: tooltip.reset() tooltip.add(1053099, "%s %s\t%s" % (prefix1, prefix2, itemname)) elif prefix1 and not prefix2: tooltip.reset() tooltip.add(1053099, "%s\t%s" % (prefix1, itemname)) elif not prefix1 and prefix2: tooltip.reset() tooltip.add(1053099, "%s\t%s" % (prefix2, itemname)) # Exceptional item? if object.hastag('exceptional'): tooltip.add(1060636, '') # 1050043: Crafted by ~param~ serial = int(object.gettag('exceptional')) crafter = wolfpack.findchar(serial) if crafter: tooltip.add(1050043, crafter.name) # Only Armors and Weapons have durability if weapon or armor or shield: tooltip.add(1060639, "%u\t%u" % (object.health, object.maxhealth)) durabilitybonus = properties.fromitem(object, DURABILITYBONUS) if durabilitybonus: if durabilitybonus > 0: tooltip.add(1060410, '+' + str(durabilitybonus)) else: tooltip.add(1060410, str(durabilitybonus)) # Weapon specific properties if weapon: # One or twohanded weapon if object.twohanded: tooltip.add(1061171, '') else: tooltip.add(1061824, '') # Used weaponskill skill = weaponskill(viewer, object) if skill == SWORDSMANSHIP: tooltip.add(1061172, '') elif skill == MACEFIGHTING: tooltip.add(1061173, '') elif skill == FENCING: tooltip.add(1061174, '') elif skill == ARCHERY: tooltip.add(1061175, '') # Special weapon range if object.hasintproperty( 'range' ) or object.hastag( 'range' ): if object.hastag( 'range' ): weaponrange = int( object.gettag( 'range' ) ) else: weaponrange = int( object.getintproperty( 'range', 12 ) ) if weaponrange > 1: tooltip.add( 1061169, str(weaponrange) ) # Max-Mindamage mindamage = object.getintproperty( 'mindamage', 1 ) if object.hastag( 'mindamage' ): mindamage = int( object.gettag( 'mindamage' ) ) maxdamage = object.getintproperty( 'maxdamage', 2 ) if object.hastag( 'maxdamage' ): mindamage = int( object.gettag( 'maxdamage' ) ) tooltip.add( 1061168, "%u\t%u" % ( mindamage, maxdamage ) ) # Speed speed = object.getintproperty( 'speed', 10 ) if object.hastag( 'speed' ): speed = int( object.gettag( 'speed' ) ) tooltip.add(1061167, str(speed)) # Physical Damage Distribution fire = properties.fromitem(object, DAMAGE_FIRE) cold = properties.fromitem(object, DAMAGE_COLD) poison = properties.fromitem(object, DAMAGE_POISON) energy = properties.fromitem(object, DAMAGE_ENERGY) # This must always total 100 physical = 100 - (fire + cold + poison + energy) if (physical + fire + cold + poison + energy) != 100: physical = 100 fire = 0 cold = 0 poison = 0 energy = 0 if physical: tooltip.add(1060403, str(physical)) if fire: tooltip.add(1060405, str(fire)) if cold: tooltip.add(1060404, str(cold)) if poison: tooltip.add(1060406, str(poison)) if energy: tooltip.add(1060407, str(energy)) # Spell Channeling spellchanneling = properties.fromitem(object, SPELLCHANNELING) if spellchanneling != 0: tooltip.add(1060482, "") physical = properties.fromitem(object, RESISTANCE_PHYSICAL) fire = properties.fromitem(object, RESISTANCE_FIRE) cold = properties.fromitem(object, RESISTANCE_COLD) poison = properties.fromitem(object, RESISTANCE_POISON) energy = properties.fromitem(object, RESISTANCE_ENERGY) if physical: tooltip.add(1060448, str(physical)) if fire: tooltip.add(1060447, str(fire)) if cold: tooltip.add(1060445, str(cold)) if poison: tooltip.add(1060449, str(poison)) if energy: tooltip.add(1060446, str(energy)) modifiers(object, tooltip) lower = properties.fromitem(object, LOWERREQS) if lower: tooltip.add(1060435, str(lower)) lower /= 100.0 # Tag will override. req_str = object.getintproperty( 'req_strength', 0 ) if object.hastag( 'req_strength' ): req_str = int( object.gettag( 'req_strength' ) ) if lower: req_str = int(ceil(req_str) * (1.0 - lower)) if req_str: tooltip.add(1061170, str(req_str)) | 5931d62171b824065aa4b8de92b42244a83c9f99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/5931d62171b824065aa4b8de92b42244a83c9f99/equipment.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
5706,
22444,
12,
25256,
16,
733,
16,
11915,
4672,
23563,
280,
273,
1790,
18,
1726,
1893,
12,
1612,
16,
25504,
67,
26120,
916,
13,
732,
28629,
273,
1790,
18,
1726,
1893,
12,
1612,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5706,
22444,
12,
25256,
16,
733,
16,
11915,
4672,
23563,
280,
273,
1790,
18,
1726,
1893,
12,
1612,
16,
25504,
67,
26120,
916,
13,
732,
28629,
273,
1790,
18,
1726,
1893,
12,
1612,
... |
region1 = self.p.createNode('<div id="region" x="30" y="30" width="300" height="30"><words id="text1" x="" y="" font="arial" text="Layout ID 1" /></div>') | region1 = self.p.createNode('<div id="region' + self.l.layoutID + '" x="30" y="30" width="300" height="30" opacity="1"><words id="text' + self.l.layoutID + '" font="arial" text="Layout ID ' + self.l.layoutID + '" /></div>') | def run(self): log.log(2,"info",_("XiboLayoutManager instance running.")) | 5f526683f56c77d0491d7d9d29de6120c728c3f8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5464/5f526683f56c77d0491d7d9d29de6120c728c3f8/XiboClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
613,
18,
1330,
12,
22,
10837,
1376,
3113,
67,
2932,
60,
495,
83,
3744,
1318,
791,
3549,
1199,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
613,
18,
1330,
12,
22,
10837,
1376,
3113,
67,
2932,
60,
495,
83,
3744,
1318,
791,
3549,
1199,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return run_command(['git', 'diff', '--binary', "--no-ext-diff", "--full-index", "-M", self._merge_base(git_commit, squash)], decode_output=False) | return self.run(['git', 'diff', '--binary', "--no-ext-diff", "--full-index", "-M", self._merge_base(git_commit, squash)], decode_output=False) | def create_patch(self, git_commit=None, squash=None): """Returns a byte array (str()) representing the patch file. Patch files are effectively binary since they may contain files of multiple different encodings.""" # FIXME: This should probably use cwd=self.checkout_root return run_command(['git', 'diff', '--binary', "--no-ext-diff", "--full-index", "-M", self._merge_base(git_commit, squash)], decode_output=False) | 85996a2e77defe11a90714e19a7eb1523a0e8092 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/85996a2e77defe11a90714e19a7eb1523a0e8092/scm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2272,
12,
2890,
16,
5071,
67,
7371,
33,
7036,
16,
17715,
961,
33,
7036,
4672,
3536,
1356,
279,
1160,
526,
261,
701,
10756,
5123,
326,
4729,
585,
18,
12042,
1390,
854,
23500,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2272,
12,
2890,
16,
5071,
67,
7371,
33,
7036,
16,
17715,
961,
33,
7036,
4672,
3536,
1356,
279,
1160,
526,
261,
701,
10756,
5123,
326,
4729,
585,
18,
12042,
1390,
854,
23500,
3... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.