rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
response = urllib.urlopen(request_url) | response = urllib2.urlopen(request_url) | def geocode(self, query): | 35de0d04f56447cd3aaa6884c39b3ef766e2d280 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14173/35de0d04f56447cd3aaa6884c39b3ef766e2d280/cloudmade.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8244,
19373,
12,
2890,
16,
843,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8244,
19373,
12,
2890,
16,
843,
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,
-10... |
def _view_look_dom_arch(self, cursor, user, tree, context=None): | def _view_look_dom_arch(self, cursor, user, tree, type, context=None): | def _view_look_dom_arch(self, cursor, user, tree, context=None): analytic_account_obj = self.pool.get('analytic_account.account') analytic_account_obj.convert_view(cursor, user, tree, context=context) arch, fields = super(InvoiceLine, self)._view_look_dom_arch(cursor, user, tree, context=context) return arch, fields | e7db471ab9e6f1927dc89a8fbc0f1f8ab58d5db2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9278/e7db471ab9e6f1927dc89a8fbc0f1f8ab58d5db2/invoice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1945,
67,
7330,
67,
9859,
67,
991,
12,
2890,
16,
3347,
16,
729,
16,
2151,
16,
618,
16,
819,
33,
7036,
4672,
392,
7834,
335,
67,
4631,
67,
2603,
273,
365,
18,
6011,
18,
588,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1945,
67,
7330,
67,
9859,
67,
991,
12,
2890,
16,
3347,
16,
729,
16,
2151,
16,
618,
16,
819,
33,
7036,
4672,
392,
7834,
335,
67,
4631,
67,
2603,
273,
365,
18,
6011,
18,
588,
26... |
task = self.find_task(id) | task = self.find_task(action_id) | def DELETE(self, id, action_name, action_id): """ Cancel an action """ task = self.find_task(id) if task is None: return self.not_found('No %s with id %s found' % (action_name, action_id)) if self.cancel_task(id): return self.accepted({'status_uri': http.uri_path()}) # action is complete and, therfore, not cancelled # a no-content return means the client should *not* adjust its view of # the resource return self.no_content() | 82933900fadb781bfc529a0117eec2390f4e21a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10692/82933900fadb781bfc529a0117eec2390f4e21a2/repositories.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8568,
12,
2890,
16,
612,
16,
1301,
67,
529,
16,
1301,
67,
350,
4672,
3536,
10347,
392,
1301,
3536,
1562,
273,
365,
18,
4720,
67,
4146,
12,
1128,
67,
350,
13,
309,
1562,
353,
599,
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,
8568,
12,
2890,
16,
612,
16,
1301,
67,
529,
16,
1301,
67,
350,
4672,
3536,
10347,
392,
1301,
3536,
1562,
273,
365,
18,
4720,
67,
4146,
12,
1128,
67,
350,
13,
309,
1562,
353,
599,
30,... |
flags = 0 | flags = select.POLLERR | select.POLLHUP | select.POLLNVAL | def poll2(timeout=0.0, map=None): # Use the poll() support added to the select module in Python 2.0 if map is None: map = socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) pollster = select.poll() if map: for fd, obj in map.items(): flags = 0 if obj.readable(): flags = select.POLLIN if obj.writable(): flags = flags | select.POLLOUT if flags: pollster.register(fd, flags) try: r = pollster.poll(timeout) except select.error, err: if err[0] != EINTR: raise r = [] for fd, flags in r: obj = map.get(fd) if obj is None: continue readwrite(obj, flags) | 6967de7844c4815a1a20ecad6d7f92caef399eeb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6967de7844c4815a1a20ecad6d7f92caef399eeb/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
22,
12,
4538,
33,
20,
18,
20,
16,
852,
33,
7036,
4672,
468,
2672,
326,
7672,
1435,
2865,
3096,
358,
326,
2027,
1605,
316,
6600,
576,
18,
20,
309,
852,
353,
599,
30,
852,
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,
7672,
22,
12,
4538,
33,
20,
18,
20,
16,
852,
33,
7036,
4672,
468,
2672,
326,
7672,
1435,
2865,
3096,
358,
326,
2027,
1605,
316,
6600,
576,
18,
20,
309,
852,
353,
599,
30,
852,
273,
... |
l_f = hlr_utils.get_special(lambda_f, map_so) | def energy_transfer(obj, itype, lambda_const, **kwargs): """ This function takes a SOM with a wavelength axis (initial for IGS and final for DGS) and calculates the energy transfer. @param obj: The object containing the wavelength axis @type obj: C{SOM.SOM} @param itype: The instrument class type. The choices are either I{IGS} or I{DGS}. @type itype: C{string} @param lambda_const: The attribute name for the wavelength constant (final for IGS and initial for DGS). @type lambda_const: C{string} @param kwargs: A list of keyword arguments that the function accepts: @keyword units: The units for the incoming axis. The default is I{Angstroms}. @type units: C{string} @keyword change_units: A flag that signals the function to convert from I{meV} to I{ueV}. The default is I{False}. @type change_units: C{boolean} @keyword scale: A flag to scale the y-axis by lambda_f/lambda_i for I{IGS} and lambda_i/lambda_f for I{DGS}. The default is I{False}. @type scale: C{boolean} @return: Object with the energy transfer calculated in units of I{meV} or I{ueV}. The default is I{meV}. @rtype: C{SOM.SOM} @raise RuntimeError: The instrument class type is not recognized @raise RuntimeError: The x-axis units are not Angstroms @raise RuntimeError: A SOM is not given to the function """ # Check the instrument class type to make sure its allowed allowed_types = ["DGS", "IGS"] if itype not in allowed_types: raise RuntimeError("The instrument class type %s is not known. "\ +"Please use DGS or IGS" % itype) # import the helper functions import hlr_utils # set up for working through data (result, res_descr) = hlr_utils.empty_result(obj) o_descr = hlr_utils.get_descr(obj) if o_descr != "SOM": raise RuntimeError("Must provide a SOM to the function.") # Go on else: pass # Setup keyword arguments try: units = kwargs["units"] except KeyError: units = "Angstroms" try: change_units = kwargs["change_units"] except KeyError: change_units = False try: scale = kwargs["scale"] except KeyError: scale = False # Primary axis for transformation. axis = hlr_utils.one_d_units(obj, units) # Get the subtraction constant try: lambda_c = obj.attr_list[lambda_const] except KeyError: raise RuntimeError("Must provide a final wavelength (IGS) or initial "\ +"energy (DGS) via the incoming SOM") result = hlr_utils.copy_som_attr(result, res_descr, obj, o_descr) if change_units: unit_str = "ueV" else: unit_str = "meV" result = hlr_utils.force_units(result, unit_str, axis) result.setAxisLabel(axis, "energy_transfer") result.setYUnits("Counts/" + unit_str) result.setYLabel("Intensity") # iterate through the values import array_manip import axis_manip import utils for i in xrange(hlr_utils.get_length(obj)): val = hlr_utils.get_value(obj, i, o_descr, "x", axis) err2 = hlr_utils.get_err2(obj, i, o_descr, "x", axis) y_val = hlr_utils.get_value(obj, i, o_descr, "y", axis) y_err2 = hlr_utils.get_err2(obj, i, o_descr, "y", axis) map_so = hlr_utils.get_map_so(obj, None, i) l_f = hlr_utils.get_special(lambda_f, map_so) (E_f, E_f_err2) = axis_manip.wavelength_to_energy(l_f[0], l_f[1]) # Scale counts by lambda_f / lambda_i if scale: l_i = axis_manip.energy_to_wavelength(val, err2) l_i_bc = utils.calc_bin_centers(l_i[0], l_i[1]) ratio = array_manip.div_ncerr(l_f[0], l_f[1], l_i_bc[0], l_i_bc[1]) scale_y = array_manip.mult_ncerr(y_val, y_err2, ratio[0], ratio[1]) else: scale_y = (y_val, y_err2) value = array_manip.sub_ncerr(val, err2, E_f[0], E_f[1]) if change_units: # Convert from meV to ueV value2 = array_manip.mult_ncerr(value[0], value[1], 1000.0, 0.0) value3 = array_manip.mult_ncerr(scale_y[0], scale_y[1], 1.0/1000.0, 0.0) else: value2 = value value3 = scale_y hlr_utils.result_insert(result, res_descr, value3, map_so, "all", 0, [value2[0]]) return result | f3b31036ec2a8750acec1d87133daa1bfe05b35d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/763/f3b31036ec2a8750acec1d87133daa1bfe05b35d/hlr_energy_transfer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12929,
67,
13866,
12,
2603,
16,
518,
388,
16,
3195,
67,
10248,
16,
2826,
4333,
4672,
3536,
1220,
445,
5530,
279,
348,
1872,
598,
279,
21410,
2654,
261,
6769,
364,
13102,
55,
471,
727,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12929,
67,
13866,
12,
2603,
16,
518,
388,
16,
3195,
67,
10248,
16,
2826,
4333,
4672,
3536,
1220,
445,
5530,
279,
348,
1872,
598,
279,
21410,
2654,
261,
6769,
364,
13102,
55,
471,
727,
... | |
print " * You must define the tree output directory!" | print " * You must define the tree output directory!" | def execute(fileDb, moduleDb, options, pkgid="", names=[]): additionalOutput = [] ###################################################################### # SORT OF INCLUDE LIST ###################################################################### print print " SORT OF INCLUDE LIST:" print "----------------------------------------------------------------------------" if options.verbose: print " * Include (with dependencies): %s" % options.includeWithDeps print " * Include (without dependencies): %s" % options.includeWithoutDeps print " * Exclude (with dependencies): %s" % options.excludeWithDeps print " * Exclude (without dependencies): %s" % options.excludeWithoutDeps print " * Sorting classes..." sortedIncludeList = loader.getSortedList(options, fileDb, moduleDb) if len(sortedIncludeList) == len(fileDb): print " * Including all classes" print " * Arranged %s classes" % len(sortedIncludeList) if options.printIncludes: print print " PRINT OF INCLUDE ORDER:" print "----------------------------------------------------------------------------" print " * The files will be included in this order:" for fileId in sortedIncludeList: print " - %s" % fileId if options.printDeps: print print " OUTPUT OF DEPENDENCIES:" print "----------------------------------------------------------------------------" print " * These are all included files with their dependencies:" for fileId in sortedIncludeList: print " - %s" % fileId if len(fileDb[fileId]["loadtimeDeps"]) > 0: print " - Loadtime: " for depEntry in fileDb[fileId]["loadtimeDeps"]: print " - %s" % depEntry if len(fileDb[fileId]["afterDeps"]) > 0: print " - After: " for depEntry in fileDb[fileId]["afterDeps"]: print " - %s" % depEntry if len(fileDb[fileId]["runtimeDeps"]) > 0: print " - Runtime: " for depEntry in fileDb[fileId]["runtimeDeps"]: print " - %s" % depEntry if len(fileDb[fileId]["beforeDeps"]) > 0: print " - Before: " for depEntry in fileDb[fileId]["beforeDeps"]: print " - %s" % depEntry if len(fileDb[fileId]["optionalDeps"]) > 0: print " - Optional: " for depEntry in fileDb[fileId]["optionalDeps"]: print " - %s" % depEntry ###################################################################### # GENERATION OF COMPILED VERSION ###################################################################### if options.prettyPrint: print print " GENERATION OF PRETTY PRINTED CODE:" print "----------------------------------------------------------------------------" if options.compiledScriptFile == None: print " * You must define the compiled script file!" sys.exit(1) prettyOutput = "" if options.verbose: print " * Pretty printing..." else: print " * Pretty printing: ", for fileId in sortedIncludeList: if options.verbose: print " - Compiling %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() prettyFileContent = compiler.compile(loader.getTree(fileDb, fileId, options), True) filetool.save(fileDb[fileId]["path"], prettyFileContent) if not options.verbose: print # ignore other jobs return ###################################################################### # STRING OPTIMIZATION ###################################################################### if options.optimizeStrings: print print " STRING OPTIMIZATION:" print "----------------------------------------------------------------------------" if options.verbose: print " * Searching strings..." else: print " * Searching strings: ", stringMap = {} for fileId in sortedIncludeList: if options.verbose: print " - %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() localMap = loader.getStrings(fileDb, fileId, options) for value in localMap: if value in stringMap: stringMap[value] += localMap[value] else: stringMap[value] = localMap[value] if not options.verbose: print counter = 0 for value in stringMap: counter += stringMap[value] stringList = stringoptimizer.sort(stringMap) print " * Found %s strings (used %s times)" % (len(stringMap), counter) if options.verbose: print " * Replacing strings..." else: print " * Replacing strings: ", for fileId in sortedIncludeList: if options.verbose: print " - %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() stringoptimizer.replace(loader.getTree(fileDb, fileId, options), stringList, "$" + pkgid, options.verbose) if not options.verbose: print print " * Generating replacement..." additionalOutput.append(stringoptimizer.replacement(stringList, "$" + pkgid)) ###################################################################### # LOCAL VARIABLE OPTIMIZATION ###################################################################### if options.optimizeVariables: print print " LOCAL VARIABLE OPTIMIZATION:" print "----------------------------------------------------------------------------" if options.verbose: print " * Optimizing variables..." else: print " * Optimizing variables: ", for fileId in sortedIncludeList: if options.verbose: print " - %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() variableoptimizer.search(loader.getTree(fileDb, fileId, options), [], 0, "$") if not options.verbose: print ###################################################################### # NAME OBFUSCATION ###################################################################### if options.obfuscateIdentifiers: print print " OBFUSCATE IDENTIFIERS:" print "----------------------------------------------------------------------------" if options.verbose: print " * Obfuscating identifiers..." else: print " * Obfuscating identifiers: ", counter = 0 for fileId in sortedIncludeList: if options.verbose: print " - %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() counter += obfuscator.update(loader.getTree(fileDb, fileId, options), names, "$$") if not options.verbose: print print " * Updated %s names" % counter ###################################################################### # TOKEN STORAGE ###################################################################### if options.storeTokens: print print " TOKEN STORAGE:" print "----------------------------------------------------------------------------" if options.tokenOutputDirectory == None: print " * You must define the token output directory!" sys.exit(1) if options.verbose: print " * Storing tokens..." else: print " * Storing tokens: ", for fileId in sortedIncludeList: tokenString = tokenizer.convertTokensToString(loader.getTokens(fileDb, fileId, options)) if options.verbose: print " * writing tokens for %s (%s KB)..." % (fileIdm, len(tokenString) / 1000.0) else: sys.stdout.write(".") sys.stdout.flush() filetool.save(os.path.join(filetool.normalize(options.tokenOutputDirectory), fileId + config.TOKENEXT), tokenString) if not options.verbose: print ###################################################################### # TREE STORAGE ###################################################################### if options.storeTree: print print " TREE STORAGE:" print "----------------------------------------------------------------------------" if options.treeOutputDirectory == None: print " * You must define the tree output directory!" sys.exit(1) if options.verbose: print " * Storing tree..." else: print " * Storing tree: ", for fileId in sortedIncludeList: treeString = "<?xml version=\"1.0\" encoding=\"" + options.xmlOutputEncoding + "\"?>\n" + tree.nodeToXmlString(loader.getTree(fileDb, fileId, options)) if options.verbose: print " * writing tree for %s (%s KB)..." % (fileId, len(treeString) / 1000.0) else: sys.stdout.write(".") sys.stdout.flush() filetool.save(os.path.join(filetool.normalize(options.treeOutputDirectory), fileId + config.XMLEXT), treeString) if not options.verbose: print ###################################################################### # GENERATION OF API ###################################################################### if options.generateApiDocumentation: print print " GENERATION OF API:" print "----------------------------------------------------------------------------" if options.apiDocumentationJsonFile == None and options.apiDocumentationXmlFile == None: print " * You must define one of JSON or XML API documentation file!" docTree = None if options.verbose: print " * Generating API tree..." else: print " * Generating API tree: ", for fileId in sortedIncludeList: if options.verbose: print " - %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() docTree = api.createDoc(loader.getTree(fileDb, fileId, options), docTree) if not options.verbose: print if docTree: print " * Finalising tree..." api.postWorkPackage(docTree, docTree) if options.apiDocumentationXmlFile != None: print " * Writing XML API file to %s" % options.apiDocumentationXmlFile xmlContent = "<?xml version=\"1.0\" encoding=\"" + options.xmlOutputEncoding + "\"?>\n" if options.addNewLines: xmlContent += "\n" + tree.nodeToXmlString(docTree) else: xmlContent += tree.nodeToXmlString(docTree, "", "", "") filetool.save(options.apiDocumentationXmlFile, xmlContent, options.xmlOutputEncoding) if options.apiDocumentationJsonFile != None: print " * Writing JSON API file to %s" % options.apiDocumentationJsonFile if options.addNewLines: jsonContent = tree.nodeToJsonString(docTree) else: jsonContent = tree.nodeToJsonString(docTree, "", "", "") filetool.save(options.apiDocumentationJsonFile, jsonContent, options.scriptOutputEncoding) ###################################################################### # CREATE COPY OF RESOURCES ###################################################################### if options.copyResources: print print " CREATE COPY OF RESOURCES:" print "----------------------------------------------------------------------------" resources.copy(options, sortedIncludeList, fileDb) ###################################################################### # GENERATION OF SETTINGS ###################################################################### if options.generateSourceScript or options.generateCompiledScript: settingsStr = "" if len(options.defineRuntimeSetting) != 0: print print " GENERATION OF SETTINGS:" print "----------------------------------------------------------------------------" print " * Processing input data..." settingsStr = settings.generate(options) if options.settingsScriptFile: print " * Storing result to %s" % options.settingsScriptFile filetool.save(options.settingsScriptFile, settingsStr) # clear settings for build and source settingsStr = "" ###################################################################### # GENERATION OF SOURCE VERSION ###################################################################### if options.generateSourceScript: print print " GENERATION OF SOURCE SCRIPT:" print "----------------------------------------------------------------------------" if options.sourceScriptFile == None: print " * You must define the source script file!" sys.exit(1) else: options.sourceScriptFile = os.path.normpath(options.sourceScriptFile) print " * Generating includer..." sourceOutput = settingsStr if sourceOutput != "" and options.addNewLines: settingsStr += "\n" if options.addNewLines: for fileId in sortedIncludeList: if fileDb[fileId]["sourceScriptPath"] == None: print " * Missing source path definition for script input %s. Could not create source script file!" % fileDb[fileId]["scriptInput"] sys.exit(1) sourceOutput += 'document.write(\'<script type="text/javascript" src="%s%s"></script>\');\n' % (os.path.join(fileDb[fileId]["sourceScriptPath"], fileDb[fileId]["pathId"].replace(".", os.sep)), config.JSEXT) else: includeCode = "" for fileId in sortedIncludeList: if fileDb[fileId]["sourceScriptPath"] == None: print " * Missing source path definition for script input %s. Could not create source script file!" % fileDb[fileId]["scriptInput"] sys.exit(1) includeCode += '<script type="text/javascript" src="%s%s"></script>' % (os.path.join(fileDb[fileId]["sourceScriptPath"], fileDb[fileId]["pathId"].replace(".", os.sep)), config.JSEXT) sourceOutput += "document.write('%s');" % includeCode print " * Storing output as %s..." % options.sourceScriptFile filetool.save(options.sourceScriptFile, sourceOutput, options.scriptOutputEncoding) ###################################################################### # GENERATION OF COMPILED VERSION ###################################################################### if options.generateCompiledScript: print print " GENERATION OF COMPILED SCRIPT:" print "----------------------------------------------------------------------------" compiledOutput = settingsStr + "".join(additionalOutput) if options.compiledScriptFile == None: print " * You must define the compiled script file!" sys.exit(1) if options.useTokenCompiler: if options.verbose: print " * Compiling tokens..." else: print " * Compiling tokens: ", elif options.useTreeCompiler: if options.verbose: print " * Compiling tree..." else: print " * Compiling tree: ", else: if options.verbose: print " * Compiling..." else: print " * Compiling: ", for fileId in sortedIncludeList: if options.verbose: print " - Compiling %s" % fileId else: sys.stdout.write(".") sys.stdout.flush() if options.useTokenCompiler: compiledFileContent = tokencompiler.compile(loader.getTokens(fileDb, fileId, options), options.addNewLines, options.enableDebug) elif options.useTreeCompiler: compiledFileContent = treecompiler.compile(loader.getTree(fileDb, fileId, options), options.addNewLines, options.enableDebug) else: compiledFileContent = compiler.compile(loader.getTree(fileDb, fileId, options), False, options.addNewLines, options.enableDebug) if options.addFileIds: compiledOutput += "\n\n\n/* ID: " + fileId + " */\n" + compiledFileContent + "\n" else: compiledOutput += compiledFileContent if not compiledOutput.endswith(";") and not compiledOutput.endswith("\n"): compiledOutput += ";" if not options.verbose: print print " * Storing output as %s..." % options.compiledScriptFile filetool.save(options.compiledScriptFile, compiledOutput, options.scriptOutputEncoding) | 6c1908ad2a31f4820927a510ec3e7f5bc56c30cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5718/6c1908ad2a31f4820927a510ec3e7f5bc56c30cf/generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
768,
4331,
16,
1605,
4331,
16,
702,
16,
3475,
350,
1546,
3113,
1257,
33,
8526,
4672,
225,
3312,
1447,
273,
5378,
282,
28256,
1970,
7,
468,
225,
11530,
15932,
28062,
15130,
2825... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
768,
4331,
16,
1605,
4331,
16,
702,
16,
3475,
350,
1546,
3113,
1257,
33,
8526,
4672,
225,
3312,
1447,
273,
5378,
282,
28256,
1970,
7,
468,
225,
11530,
15932,
28062,
15130,
2825... |
print ">>> View content:" for viewId in viewPackages: print " - view '%s' uses these packages %s" % (viewId, viewPackages[viewId]) | print ">>> View content:" for viewId in viewPackages: print " - view '%s' uses these packages %s" % (viewId, viewPackages[viewId]) | def processViews(viewDefs, loadDeps, runDeps, collapseViews, outputFile): global classes # Build bitmask ids for views viewBits = {} viewPos = 0 for viewId in viewDefs: viewBits[viewId] = 1<<viewPos viewPos += 1 # Find all used classes # Used to reduce loop size for further iterations (not using huge 'classes') print ">>> Analysing %s views..." % len(viewDefs) combinedDefs = [] for viewId in viewDefs: combinedDefs.extend(viewDefs[viewId]) combinedClasses = resolveDependencies(combinedDefs, [], loadDeps, runDeps) print " - Number of classes: %s" % len(combinedClasses) # Caching dependencies of each view viewDeps = {} for viewId in viewDefs: # Exclude all features of other views # and handle dependencies the smart way => # also exclude classes only needed by the # already excluded features viewExcludes = [] for subViewId in viewDefs: if subViewId != viewId: viewExcludes.extend(viewDefs[subViewId]) # Finally resolve the dependencies viewDeps[viewId] = resolveDependencies(viewDefs[viewId], viewExcludes, loadDeps, runDeps) print " - %s[#%s] needs %s classes" % (viewId, viewBits[viewId], len(viewDeps[viewId])) # Assign classes to packages packageClasses = {} for classId in combinedClasses: packageId = 0 # Iterate through the views use needs this class for viewId in viewDefs: if classId in viewDeps[viewId]: packageId += viewBits[viewId] # Create missing data structure if not packageClasses.has_key(packageId): packageClasses[packageId] = [] # Finally store the class to the package packageClasses[packageId].append(classId) # Assign packages to views viewPackages = {} for viewId in viewDefs: viewBit = viewBits[viewId] for packageId in packageClasses: if packageId&viewBit: if not viewPackages.has_key(viewId): viewPackages[viewId] = [] viewPackages[viewId].insert(0, packageId) print ">>> Package content:" for packageId in packageClasses: print " - package #%s contains %s classes" % (packageId, len(packageClasses[packageId])) print ">>> View content:" for viewId in viewPackages: print " - view '%s' uses these packages %s" % (viewId, viewPackages[viewId]) for viewId in collapseViews: print ">>> Collapsing view '%s'..." % viewId collapsePackage = viewPackages[viewId][0] replacePackages = viewPackages[viewId][1:] print " - Modifying other views..." # Replace other package content for subViewId in viewDefs: subViewContent = viewPackages[subViewId] for package in replacePackages: if package in subViewContent: toIndex = subViewContent.index(package) subViewContent[toIndex] = collapsePackage # Remove duplicate if subViewContent.count(collapsePackage) > 1: subViewContent.reverse() subViewContent.remove(collapsePackage) subViewContent.reverse() print " - Merging collapsed packages..." for packageId in replacePackages: packageClasses[collapsePackage].extend(packageClasses[packageId]) del packageClasses[packageId] print ">>> Package content:" for packageId in packageClasses: print " - package #%s contains %s classes" % (packageId, len(packageClasses[packageId])) print ">>> View content:" for viewId in viewPackages: print " - view '%s' uses these packages %s" % (viewId, viewPackages[viewId]) # Compile files... revertedPackages = [] for packageId in packageClasses: revertedPackages.insert(0, packageId) packageLoaderContent = "" for packageId in revertedPackages: packageFile = outputFile.replace(".js", "_%s.js" % packageId) print ">>> Compiling classes of package #%s..." % packageId compiledContent = compileClasses(sortClasses(packageClasses[packageId], loadDeps, runDeps)) print " - Storing result (%s KB) to %s" % ((len(compiledContent) / 1024), packageFile) filetool.save(packageFile, compiledContent) # TODO: Make configurable prefix = "script/" packageLoaderContent += "document.write('<script type=\"text/javascript\" src=\"%s\"></script>');\n" % (prefix + packageFile) print ">>> Creating package loader..." filetool.save(outputFile, packageLoaderContent) | 978820638d4273f641ce423ff1160600bf29af2f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/978820638d4273f641ce423ff1160600bf29af2f/generator2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
9959,
12,
1945,
14554,
16,
1262,
14430,
16,
1086,
14430,
16,
13627,
9959,
16,
15047,
4672,
2552,
3318,
282,
468,
3998,
24941,
3258,
364,
7361,
1476,
6495,
273,
2618,
1476,
1616,
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,
1207,
9959,
12,
1945,
14554,
16,
1262,
14430,
16,
1086,
14430,
16,
13627,
9959,
16,
15047,
4672,
2552,
3318,
282,
468,
3998,
24941,
3258,
364,
7361,
1476,
6495,
273,
2618,
1476,
1616,
273,... |
elif gdata.config.defaults.mapgatemode == 2: | elif gdata.config.defaults.mapgatemode == '2': | def onOK(self, widget, action, data): #set display flags flags = '' if self.win.vHWSurface.checked: flags += 'hwsurface ' | c4befd839b96378e57efe09d6e83994086580b62 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10927/c4befd839b96378e57efe09d6e83994086580b62/OptionsDlg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3141,
12,
2890,
16,
3604,
16,
1301,
16,
501,
4672,
468,
542,
2562,
2943,
2943,
273,
875,
309,
365,
18,
8082,
18,
90,
44,
2651,
295,
865,
18,
4532,
30,
2943,
1011,
296,
76,
4749,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
603,
3141,
12,
2890,
16,
3604,
16,
1301,
16,
501,
4672,
468,
542,
2562,
2943,
2943,
273,
875,
309,
365,
18,
8082,
18,
90,
44,
2651,
295,
865,
18,
4532,
30,
2943,
1011,
296,
76,
4749,... |
padding = '\x00' * (newpos - len(self._buffer) - n) | padding = b'\x00' * (newpos - len(self._buffer) - n) | def write(self, b): if self.closed: raise ValueError("write to closed file") n = len(b) newpos = self._pos + n if newpos > len(self._buffer): # Inserts null bytes between the current end of the file # and the new write position. padding = '\x00' * (newpos - len(self._buffer) - n) self._buffer[self._pos:newpos - n] = padding self._buffer[self._pos:newpos] = b self._pos = newpos return n | 9ea3af067ac107624142686fe9d715899ac0be93 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/9ea3af067ac107624142686fe9d715899ac0be93/io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
324,
4672,
309,
365,
18,
12204,
30,
1002,
2068,
2932,
2626,
358,
4375,
585,
7923,
290,
273,
562,
12,
70,
13,
394,
917,
273,
365,
6315,
917,
397,
290,
309,
394,
91... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
324,
4672,
309,
365,
18,
12204,
30,
1002,
2068,
2932,
2626,
358,
4375,
585,
7923,
290,
273,
562,
12,
70,
13,
394,
917,
273,
365,
6315,
917,
397,
290,
309,
394,
91... |
sage: number_of_partitions(5, algorithm='bobber') | sage: number_of_partitions(5, algorithm='bober') | def number_of_partitions(n,k=None, algorithm='gap'): r""" Returns the size of partitions_list(n,k). INPUT: n -- an integer k -- (default: None); if specified, instead returns the cardinality of the set of all (unordered) partitions of the positive integer n into sums with k summands. algorithm -- (default: 'gap') 'gap' -- use GAP (VERY *slow*) 'bobber' -- use Jonathon Bobber's implementation (*very* fast, but new and not well tested yet). 'pari' -- use PARI. Speed seems the same as GAP until $n$ is in the thousands, in which case PARI is faster. *But* PARI has a bug, e.g., on 64-bit Linux PARI-2.3.2 outputs numbpart(147007)%1000 as 536, but it should be 533!. So do not use this option. IMPLEMENTATION: Wraps GAP's NrPartitions or PARI's numbpart function. Use the function \code{partitions(n)} to return a generator over all partitions of $n$. It is possible to associate with every partition of the integer n a conjugacy class of permutations in the symmetric group on n points and vice versa. Therefore p(n) = NrPartitions(n) is the number of conjugacy classes of the symmetric group on n points. EXAMPLES: sage: v = list(partitions(5)); v [(1, 1, 1, 1, 1), (1, 1, 1, 2), (1, 2, 2), (1, 1, 3), (2, 3), (1, 4), (5,)] sage: len(v) 7 sage: number_of_partitions(5) 7 sage: number_of_partitions(5, algorithm='pari') 7 sage: number_of_partitions(5, algorithm='bobber') 7 The input must be a nonnegative integer or a ValueError is raised. sage: number_of_partitions(-5) Traceback (most recent call last): ... ValueError: n (=-5) must be a nonnegative integer sage: number_of_partitions(10,2) 5 sage: number_of_partitions(10) 42 sage: number_of_partitions(3) 3 sage: number_of_partitions(10) 42 sage: number_of_partitions(3, algorithm='pari') 3 sage: number_of_partitions(10, algorithm='pari') 42 sage: number_of_partitions(40) 37338 sage: number_of_partitions(100) 190569292 A generating function for p(n) is given by the reciprocal of Euler's function: \[ \sum_{n=0}^\infty p(n)x^n = \prod_{k=1}^\infty \left(\frac {1}{1-x^k} \right). \] We use SAGE to verify that the first several coefficients do instead agree: sage: q = PowerSeriesRing(QQ, 'q', default_prec=9).gen() sage: prod([(1-q^k)^(-1) for k in range(1,9)]) ## partial product of 1 + q + 2*q^2 + 3*q^3 + 5*q^4 + 7*q^5 + 11*q^6 + 15*q^7 + 22*q^8 + O(q^9) sage: [number_of_partitions(k) for k in range(2,10)] [2, 3, 5, 7, 11, 15, 22, 30] REFERENCES: http://en.wikipedia.org/wiki/Partition_%28number_theory%29 """ n = ZZ(n) if n < 0: raise ValueError, "n (=%s) must be a nonnegative integer"%n elif n == 0: return ZZ(1) if algorithm == 'gap': if k==None: ans=gap.eval("NrPartitions(%s)"%(ZZ(n))) else: ans=gap.eval("NrPartitions(%s,%s)"%(ZZ(n),ZZ(k))) return ZZ(ans) elif algorithm == 'bobber': return partitions_ext.number_of_partitions(n) elif algorithm == 'pari': if not k is None: raise ValueError, "cannot specify second argument k if the algorithm is PARI" return ZZ(pari(ZZ(n)).numbpart()) raise ValueError, "unknown algorithm '%s'"%algorithm | 81aa418699074d2250c57ad0e5c56e99e27733be /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/81aa418699074d2250c57ad0e5c56e99e27733be/combinat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
67,
792,
67,
21275,
12,
82,
16,
79,
33,
7036,
16,
4886,
2218,
14048,
11,
4672,
436,
8395,
2860,
326,
963,
434,
10060,
67,
1098,
12,
82,
16,
79,
2934,
225,
12943,
30,
290,
1493,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
67,
792,
67,
21275,
12,
82,
16,
79,
33,
7036,
16,
4886,
2218,
14048,
11,
4672,
436,
8395,
2860,
326,
963,
434,
10060,
67,
1098,
12,
82,
16,
79,
2934,
225,
12943,
30,
290,
1493,... |
self.objectstore.save(c) | self.objectstore.save(p) | def test_forgotten_password(self): p = model.Person(email_address='testguy@example.org') self.objectstore.save(c) self.objectstore.flush() | ba4523a683163f8bffde09be14ee67afd78f0cd8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12856/ba4523a683163f8bffde09be14ee67afd78f0cd8/test_account.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1884,
13212,
2253,
67,
3664,
12,
2890,
4672,
293,
273,
938,
18,
8346,
12,
3652,
67,
2867,
2218,
3813,
6891,
93,
36,
8236,
18,
3341,
6134,
365,
18,
1612,
2233,
18,
5688,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1884,
13212,
2253,
67,
3664,
12,
2890,
4672,
293,
273,
938,
18,
8346,
12,
3652,
67,
2867,
2218,
3813,
6891,
93,
36,
8236,
18,
3341,
6134,
365,
18,
1612,
2233,
18,
5688,
12,
... |
list.append(self.satList[config.Nims[slotid].diseqcC.index]) list.append(self.satList[config.Nims[slotid].diseqcD.index]) | list.append(self.satList[nim.diseqcC.index]) list.append(self.satList[nim.diseqcD.index]) | def getSatListForNim(self, slotid): list = [] if self.nim_slots[slotid].isCompatible("DVB-S"): #print "slotid:", slotid | c811a6c46840ab5901d08849eb2fc19acdf1baae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6652/c811a6c46840ab5901d08849eb2fc19acdf1baae/NimManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1322,
270,
682,
1290,
50,
381,
12,
2890,
16,
4694,
350,
4672,
666,
273,
5378,
309,
365,
18,
82,
381,
67,
18875,
63,
14194,
350,
8009,
291,
14599,
2932,
30199,
38,
17,
55,
6,
4672,
46... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1322,
270,
682,
1290,
50,
381,
12,
2890,
16,
4694,
350,
4672,
666,
273,
5378,
309,
365,
18,
82,
381,
67,
18875,
63,
14194,
350,
8009,
291,
14599,
2932,
30199,
38,
17,
55,
6,
4672,
46... |
self.write(cr , uid, ids ,{'state' : 'to install'}) | self.write(cr , uid, ids ,{'state' : 'to install'}) | def action_install(self,cr,uid,ids,context=None): self.write(cr , uid, ids ,{'state' : 'to install'}) self.download(cr, uid, ids, context=context) for id in ids: cr.execute("select m.id as id from ir_module_module_dependency d inner join ir_module_module m on (m.name=d.name) where d.module_id=%d and m.state='uninstalled'",(id,)) dep_ids = map(lambda x:x[0],cr.fetchall()) if len(dep_ids): self.action_install(cr,uid,dep_ids,context=context) | 8f91b2b0346145907e81b42dd26084d04a626881 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/8f91b2b0346145907e81b42dd26084d04a626881/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
5425,
12,
2890,
16,
3353,
16,
1911,
16,
2232,
16,
2472,
33,
7036,
4672,
365,
18,
2626,
12,
3353,
269,
4555,
16,
3258,
269,
27828,
2019,
11,
294,
296,
869,
3799,
11,
6792,
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,
1301,
67,
5425,
12,
2890,
16,
3353,
16,
1911,
16,
2232,
16,
2472,
33,
7036,
4672,
365,
18,
2626,
12,
3353,
269,
4555,
16,
3258,
269,
27828,
2019,
11,
294,
296,
869,
3799,
11,
6792,
3... |
s = shelve.open(self.fn, protocol=0) | def test_ascii_file_shelf(self): try: s = shelve.open(self.fn, protocol=0) s['key1'] = (1,2,3,4) self.assertEqual(s['key1'], (1,2,3,4)) s.close() finally: for f in glob.glob(self.fn+"*"): os.unlink(f) | 14a8e7a7fe3a4a66a304d68e5c92fc4050743034 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/14a8e7a7fe3a4a66a304d68e5c92fc4050743034/test_shelve.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9184,
67,
768,
67,
674,
19079,
12,
2890,
4672,
775,
30,
272,
3292,
856,
21,
3546,
273,
261,
21,
16,
22,
16,
23,
16,
24,
13,
365,
18,
11231,
5812,
12,
87,
3292,
856,
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,
1842,
67,
9184,
67,
768,
67,
674,
19079,
12,
2890,
4672,
775,
30,
272,
3292,
856,
21,
3546,
273,
261,
21,
16,
22,
16,
23,
16,
24,
13,
365,
18,
11231,
5812,
12,
87,
3292,
856,
21,
... | |
assert re.search(r"(?s)<html>.*Spambayes proxy.*</html>", response) | assert re.search(r"(?s)<html>.*SpamBayes proxy.*</html>", response) | def runUIAndProxy(): httpServer = UserInterfaceServer(8881) proxyUI = ProxyUserInterface(state, _recreateState) httpServer.register(proxyUI) BayesProxyListener('localhost', 8110, ('', 8111)) state.bayes.learn(tokenizer.tokenize(spam1), True) state.bayes.learn(tokenizer.tokenize(good1), False) proxyReady.set() Dibbler.run() | 605bb97f27af05c4b5dcbfcc98b619b9d9428d32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/605bb97f27af05c4b5dcbfcc98b619b9d9428d32/test_sb-server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
5370,
1876,
3886,
13332,
1062,
2081,
273,
21369,
2081,
12,
5482,
11861,
13,
2889,
5370,
273,
7659,
1299,
1358,
12,
2019,
16,
389,
266,
2640,
1119,
13,
1062,
2081,
18,
4861,
12,
565... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5370,
1876,
3886,
13332,
1062,
2081,
273,
21369,
2081,
12,
5482,
11861,
13,
2889,
5370,
273,
7659,
1299,
1358,
12,
2019,
16,
389,
266,
2640,
1119,
13,
1062,
2081,
18,
4861,
12,
565... |
if sys.argv[1] in ['--help','help'] or len(sys.argv) < 4: usage() iter = 1 while iter < len(sys.argv): if sys.argv[iter] in ['--db'] and iter+1 < len(sys.argv): BZ_DB = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['-h', '--host'] and iter+1 < len(sys.argv): BZ_HOST = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['-u', '--user'] and iter+1 < len(sys.argv): BZ_USER = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['-p', '--passwd'] and iter+1 < len(sys.argv): BZ_PASSWORD = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['--tracenv'] and iter+1 < len(sys.argv): TRAC_ENV = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['-c', '--clean']: TRAC_CLEAN = 1 else: print "Error: unknown parameter: " + sys.argv[iter] sys.exit(0) iter = iter + 1 else: usage() | if sys.argv[1] in ['--help','help'] or len(sys.argv) < 4: usage() iter = 1 while iter < len(sys.argv): if sys.argv[iter] in ['--db'] and iter+1 < len(sys.argv): BZ_DB = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['-h', '--host'] and iter+1 < len(sys.argv): BZ_HOST = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['-u', '--user'] and iter+1 < len(sys.argv): BZ_USER = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['-p', '--passwd'] and iter+1 < len(sys.argv): BZ_PASSWORD = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['--tracenv'] and iter+1 < len(sys.argv): TRAC_ENV = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['-c', '--clean']: TRAC_CLEAN = 1 else: print "Error: unknown parameter: " + sys.argv[iter] sys.exit(0) iter = iter + 1 | def main(): global BZ_DB, BZ_HOST, BZ_USER, BZ_PASSWORD, TRAC_ENV, TRAC_CLEAN if len (sys.argv) > 1: if sys.argv[1] in ['--help','help'] or len(sys.argv) < 4: usage() iter = 1 while iter < len(sys.argv): if sys.argv[iter] in ['--db'] and iter+1 < len(sys.argv): BZ_DB = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['-h', '--host'] and iter+1 < len(sys.argv): BZ_HOST = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['-u', '--user'] and iter+1 < len(sys.argv): BZ_USER = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['-p', '--passwd'] and iter+1 < len(sys.argv): BZ_PASSWORD = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['--tracenv'] and iter+1 < len(sys.argv): TRAC_ENV = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['-c', '--clean']: TRAC_CLEAN = 1 else: print "Error: unknown parameter: " + sys.argv[iter] sys.exit(0) iter = iter + 1 else: usage() convert(BZ_DB, BZ_HOST, BZ_USER, BZ_PASSWORD, TRAC_ENV, TRAC_CLEAN) | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2552,
605,
62,
67,
2290,
16,
605,
62,
67,
8908,
16,
605,
62,
67,
4714,
16,
605,
62,
67,
13784,
16,
4235,
2226,
67,
11986,
16,
4235,
2226,
67,
39,
10439,
309,
562,
261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2552,
605,
62,
67,
2290,
16,
605,
62,
67,
8908,
16,
605,
62,
67,
4714,
16,
605,
62,
67,
13784,
16,
4235,
2226,
67,
11986,
16,
4235,
2226,
67,
39,
10439,
309,
562,
261,
... |
if os.path.exists(bak): os.remove(bak) os.rename(file, bak) if verbose: print "renamed", file, "to", bak | if makebackup: shutil.copyfile(file, bak) if verbose: print "backed up", file, "to", bak | def check(file): if os.path.isdir(file) and not os.path.islink(file): if verbose: print "listing directory", file names = os.listdir(file) for name in names: fullname = os.path.join(file, name) if ((recurse and os.path.isdir(fullname) and not os.path.islink(fullname)) or name.lower().endswith(".py")): check(fullname) return if verbose: print "checking", file, "...", try: f = open(file) except IOError, msg: errprint("%s: I/O Error: %s" % (file, str(msg))) return r = Reindenter(f) f.close() if r.run(): if verbose: print "changed." if dryrun: print "But this is a dry run, so leaving it alone." if not dryrun: bak = file + ".bak" if os.path.exists(bak): os.remove(bak) os.rename(file, bak) if verbose: print "renamed", file, "to", bak f = open(file, "w") r.write(f) f.close() if verbose: print "wrote new", file else: if verbose: print "unchanged." | 7a5d465f94d8ceb0e4b3ca5101ae8298a1563d4c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/7a5d465f94d8ceb0e4b3ca5101ae8298a1563d4c/reindent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
768,
4672,
309,
1140,
18,
803,
18,
291,
1214,
12,
768,
13,
471,
486,
1140,
18,
803,
18,
291,
1232,
12,
768,
4672,
309,
3988,
30,
1172,
315,
21228,
1867,
3113,
585,
1257,
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,
866,
12,
768,
4672,
309,
1140,
18,
803,
18,
291,
1214,
12,
768,
13,
471,
486,
1140,
18,
803,
18,
291,
1232,
12,
768,
4672,
309,
3988,
30,
1172,
315,
21228,
1867,
3113,
585,
1257,
273... |
TRUE = _micropolisengine.TRUE FALSE = _micropolisengine.FALSE | def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) | 042efdbc14576987266b02bd652be3f94dec4046 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12485/042efdbc14576987266b02bd652be3f94dec4046/micropolisengine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5328,
360,
67,
12715,
12,
2890,
4672,
775,
30,
609,
2211,
273,
315,
5656,
434,
315,
397,
365,
18,
2211,
16186,
12715,
972,
1435,
1335,
30,
609,
2211,
273,
1408,
327,
3532,
9,
87,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5328,
360,
67,
12715,
12,
2890,
4672,
775,
30,
609,
2211,
273,
315,
5656,
434,
315,
397,
365,
18,
2211,
16186,
12715,
972,
1435,
1335,
30,
609,
2211,
273,
1408,
327,
3532,
9,
87,
... | |
if re.search(pattern, value) and not xmlutils.is_xml_fragment(value) and not already_escaped: | if re.search(pattern, value) and \ not xmlutils.is_xml_fragment(value) and \ not already_escaped: | def post_process_comments(self, value): """Runs a set of regular expression patterns and replacements over the input value to, e.g., wrap every URL in a <url> tag.""" | 20eab91c91a9f72ec790d8c5d1fb9261b7b89028 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4025/20eab91c91a9f72ec790d8c5d1fb9261b7b89028/formatters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
67,
2567,
67,
9231,
12,
2890,
16,
460,
4672,
3536,
9361,
279,
444,
434,
6736,
2652,
6884,
471,
11413,
1879,
326,
810,
460,
358,
16,
425,
18,
75,
12990,
2193,
3614,
1976,
316,
279... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
67,
2567,
67,
9231,
12,
2890,
16,
460,
4672,
3536,
9361,
279,
444,
434,
6736,
2652,
6884,
471,
11413,
1879,
326,
810,
460,
358,
16,
425,
18,
75,
12990,
2193,
3614,
1976,
316,
279... |
elif line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'func': | elif line.category_id.contribute and line.category_id.amount_type == 'func': | def compute_sheet(self, cr, uid, ids, context={}): emp_pool = self.pool.get('hr.employee') slip_pool = self.pool.get('hr.payslip') func_pool = self.pool.get('hr.employee.grade') slip_line_pool = self.pool.get('hr.payslip.line') holiday_pool = self.pool.get('hr.holidays') vals = self.read(cr, uid, ids)[0] emp_ids = ids for slip in self.browse(cr, uid, ids): allow = 0.0 #for emp in emp_pool.browse(cr, uid, [vals['employee_id'][0]]): emp = slip.employee_id sql_req= ''' SELECT c.id as id, c.wage as wage, function as function FROM hr_contract c LEFT JOIN hr_employee emp on (c.employee_id=emp.id) LEFT JOIN hr_contract_wage_type cwt on (cwt.id = c.wage_type_id) LEFT JOIN hr_contract_wage_type_period p on (cwt.period_id = p.id) WHERE (emp.id=%s) AND (date_start <= %s) AND (date_end IS NULL OR date_end >= %s) LIMIT 1 ''' cr.execute(sql_req, (emp.id, vals['date'], vals['date'])) contract_id = cr.dictfetchone() if not contract_id: continue contract = self.pool.get('hr.contract').browse(cr, uid, contract_id['id']) sal_type = contract.wage_type_id.type function = contract.function.id lines = [] if function: func = func_pool.read(cr, uid, function, ['line_ids']) lines = slip_line_pool.browse(cr, uid, func['line_ids']) | 9cefb7520803ded7f648633ccca30e623a0dd192 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/9cefb7520803ded7f648633ccca30e623a0dd192/hr_payroll.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
67,
8118,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
801,
84,
67,
6011,
273,
365,
18,
6011,
18,
588,
2668,
7256,
18,
351,
2817,
1340,
6134,
272,
3169,
67,
60... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
67,
8118,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
801,
84,
67,
6011,
273,
365,
18,
6011,
18,
588,
2668,
7256,
18,
351,
2817,
1340,
6134,
272,
3169,
67,
60... |
if hasattr(controller, '_dispatch'): | dispatcher = getattr(controller, '_dispatch', None) if dispatcher: | def _dispatch_controller(self, current_path, controller, state, remainder): """ Essentially, this method defines what to do when we move to the next layer in the url chain, if a new controller is needed. If the new controller has a _dispatch method, dispatch proceeds to the new controller's mechanism. | 4e2498669759f1e9cffe6a0f0eec770ce158bf60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/47/4e2498669759f1e9cffe6a0f0eec770ce158bf60/objectdispatcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10739,
67,
5723,
12,
2890,
16,
783,
67,
803,
16,
2596,
16,
919,
16,
10022,
4672,
3536,
512,
1049,
11220,
16,
333,
707,
11164,
4121,
358,
741,
1347,
732,
3635,
358,
326,
1024,
3018... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10739,
67,
5723,
12,
2890,
16,
783,
67,
803,
16,
2596,
16,
919,
16,
10022,
4672,
3536,
512,
1049,
11220,
16,
333,
707,
11164,
4121,
358,
741,
1347,
732,
3635,
358,
326,
1024,
3018... |
self.bytes_remaining = None | self.bytes_remaining = None | def process_headers (self): i = self.recv_buffer.find('\r\n\r\n') if i >= 0: # Two newlines ends headers i += 4 # Skip over newline terminator # the first 2 chars are the newline of request data = self.read(i)[2:] self.headers = rfc822.Message(StringIO(data)) #debug(HURT_ME_PLENTY, "Proxy: C/Headers", `self.headers.headers`) # set via header via = self.headers.get('Via', "").strip() if via: via += " " via += "1.1 unknown\r" self.headers['Via'] = via self.headers = applyfilter(FILTER_REQUEST_HEADER, self.headers, fun="finish", attrs=self.nofilter) # remember if client understands gzip self.compress = 'identity' encodings = self.headers.get('Accept-Encoding', '') for accept in encodings.split(','): if ';' in accept: accept, q = accept.split(';', 1) if accept.strip().lower() in ('gzip', 'x-gzip'): self.compress = 'gzip' break # we understand gzip, deflate and identity self.headers['Accept-Encoding'] = \ 'gzip;q=1.0, deflate;q=0.9, identity;q=0.5\r' # add decoders self.decoders = [] # Chunked encoded if self.headers.get('Transfer-Encoding') is not None: debug(BRING_IT_ON, 'Proxy: C/Transfer-encoding:', `self.headers['transfer-encoding']`) self.decoders.append(UnchunkStream()) # remove encoding header to_remove = ["Transfer-Encoding"] if self.headers.get("Content-Length") is not None: print >>sys.stderr, 'Warning: chunked encoding should not have Content-Length' to_remove.append("Content-Length") self.bytes_remaining = None remove_headers(self.headers, to_remove) # add warning self.headers['Warning'] = "214 Transformation applied\r" debug(HURT_ME_PLENTY, "Proxy: C/Headers", `str(self.headers)`) if self.headers.has_key('Content-Length'): self.bytes_remaining = int(self.headers['Content-Length']) if config["proxyuser"] and not self.check_proxy_auth(): return self.error(407, i18n._("Proxy Authentication Required")) if self.method=='OPTIONS': mf = int(self.headers.get('Max-Forwards', -1)) if mf==0: # XXX display options ? self.state = 'done' ServerHandleDirectly(self, 'HTTP/1.0 200 OK\r\n', 'Content-Type: text/plain\r\n\r\n', '') return if mf>0: self.headers['Max-Forwards'] = mf-1 self.state = 'content' | 0accda360aac2c05b19fbe08e96c9374607f7155 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/0accda360aac2c05b19fbe08e96c9374607f7155/HttpClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2485,
261,
2890,
4672,
277,
273,
365,
18,
18334,
67,
4106,
18,
4720,
2668,
64,
86,
64,
82,
64,
86,
64,
82,
6134,
309,
277,
1545,
374,
30,
468,
16896,
19181,
3930,
1607,
277... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2485,
261,
2890,
4672,
277,
273,
365,
18,
18334,
67,
4106,
18,
4720,
2668,
64,
86,
64,
82,
64,
86,
64,
82,
6134,
309,
277,
1545,
374,
30,
468,
16896,
19181,
3930,
1607,
277... |
""" | """ | def fl_show_command_log(p1): """ fl_show_command_log(p1) """ _fl_show_command_log(p1) | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
4500,
67,
3076,
67,
1330,
12,
84,
21,
4672,
3536,
1183,
67,
4500,
67,
3076,
67,
1330,
12,
84,
21,
13,
3536,
225,
389,
2242,
67,
4500,
67,
3076,
67,
1330,
12,
84,
21,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
4500,
67,
3076,
67,
1330,
12,
84,
21,
4672,
3536,
1183,
67,
4500,
67,
3076,
67,
1330,
12,
84,
21,
13,
3536,
225,
389,
2242,
67,
4500,
67,
3076,
67,
1330,
12,
84,
21,
13,
... |
http://github.com/ask/celery/tree/djangofree/Changelog | http://celeryproject.org/docs/changelog.html | def _display_help(): import sys sys.stderr.write(""" | e4d8a01e90c0058d63baefd16be5fb1c89121a48 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2024/e4d8a01e90c0058d63baefd16be5fb1c89121a48/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5417,
67,
5201,
13332,
1930,
2589,
225,
2589,
18,
11241,
18,
2626,
2932,
3660,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5417,
67,
5201,
13332,
1930,
2589,
225,
2589,
18,
11241,
18,
2626,
2932,
3660,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print "String: " + string print "Prefix: " + prefix print "Prefix len: " + str(len(prefix)) print "Context: " + self.prsg.context() print "Prediction: " + suggestions | print "String: " + string print "Prefix: " + prefix print "Prefix len: " + str(len(prefix)) print "Context: " + self.prsg.context() print "Context change: " + str(self.prsg.context_change()) print "Prediction: " + suggestions | def __ShowPrediction(self, string = ''): print "------------ __ShowPrediction()" prediction = self.prsg.predict(string) suggestions = " ".join(prediction); prefix = self.prsg.prefix() | 5b6b7a69f5fc125493b94638182febb05c81248b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2145/5b6b7a69f5fc125493b94638182febb05c81248b/prompter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
5706,
20766,
12,
2890,
16,
533,
273,
875,
4672,
1172,
315,
7620,
1001,
5706,
20766,
10031,
8239,
273,
365,
18,
683,
1055,
18,
14491,
12,
1080,
13,
17969,
273,
315,
3552,
5701,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
5706,
20766,
12,
2890,
16,
533,
273,
875,
4672,
1172,
315,
7620,
1001,
5706,
20766,
10031,
8239,
273,
365,
18,
683,
1055,
18,
14491,
12,
1080,
13,
17969,
273,
315,
3552,
5701,
12,
... |
'5.19.1' | '5.20.1' | def version(self): """ Return the version of Maxima that Sage includes. EXAMPLES:: sage: maxima.version() '5.19.1' """ return maxima_version() | 356ba7b7f47017b445a8ee4df5371e4016f1372d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/356ba7b7f47017b445a8ee4df5371e4016f1372d/maxima.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1177,
12,
2890,
4672,
3536,
2000,
326,
1177,
434,
4238,
13888,
716,
348,
410,
6104,
18,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
943,
13888,
18,
1589,
1435,
296,
25,
18,
3462,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1177,
12,
2890,
4672,
3536,
2000,
326,
1177,
434,
4238,
13888,
716,
348,
410,
6104,
18,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
943,
13888,
18,
1589,
1435,
296,
25,
18,
3462,
... |
def get_mass(self): return self._get('mass') | def get_mass(self): return self._get('mass') | c24f6a9a99c12cb248167ec2c181e20cb76d3fe2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5572/c24f6a9a99c12cb248167ec2c181e20cb76d3fe2/atom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
10424,
12,
2890,
4672,
327,
365,
6315,
588,
2668,
10424,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
10424,
12,
2890,
4672,
327,
365,
6315,
588,
2668,
10424,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
return 1 | if limit == 1: return 1 return [1] | def search(self, cursor, user, domain, offset=0, limit=None, order=None, context=None, count=False): res = super(ModelSingleton, self).search(cursor, user, domain, offset=0, limit=None, order=None, context=None, count=False) if not res: return 1 return res | bf937bcd300b678781cd141c4a178f013cd3aeb9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9266/bf937bcd300b678781cd141c4a178f013cd3aeb9/modelsingleton.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
3347,
16,
729,
16,
2461,
16,
1384,
33,
20,
16,
1800,
33,
7036,
16,
1353,
33,
7036,
16,
819,
33,
7036,
16,
1056,
33,
8381,
4672,
400,
273,
2240,
12,
1488,
19571,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
3347,
16,
729,
16,
2461,
16,
1384,
33,
20,
16,
1800,
33,
7036,
16,
1353,
33,
7036,
16,
819,
33,
7036,
16,
1056,
33,
8381,
4672,
400,
273,
2240,
12,
1488,
19571,
... |
if subob and subob.portal_type == 'Folder': translate_folder(path + [item], language, path_trans + [item], lang_trans) | def translate_folder(path, language, path_trans, lang_trans): ob = portal.unrestrictedTraverse(path, None) ob_trans = portal.unrestrictedTraverse(path_trans, None) for item in ob.objectIds(): subob = ob.unrestrictedTraverse(item, None) subob_trans = ob_trans.unrestrictedTraverse(item, None) if not subob_trans: log.warning('Object %s not found. No translation for %s will be set' % ("/".join(path_trans + [item]), lang_trans)) else: if not subob.hasTranslation(lang_trans): linkTranslations(portal, [[(path + [item], language), (path_trans + [item], lang_trans)]]) log.debug('Setting translation for %s (%s): %s (%s)' % (path + [item], language, path_trans + [item], lang_trans)) if subob and subob.portal_type == 'Folder': translate_folder(path + [item], language, path_trans + [item], lang_trans) else: log.warning('%s is already translated into %s!' % path,lang_trans) | 445c640b1b0bca473c2354f6a1a8ca81dba5efa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/445c640b1b0bca473c2354f6a1a8ca81dba5efa1/setuphandlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4204,
67,
5609,
12,
803,
16,
2653,
16,
589,
67,
2338,
16,
3303,
67,
2338,
4672,
3768,
273,
11899,
18,
318,
29306,
29654,
12,
803,
16,
599,
13,
3768,
67,
2338,
273,
11899,
18,
318,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4204,
67,
5609,
12,
803,
16,
2653,
16,
589,
67,
2338,
16,
3303,
67,
2338,
4672,
3768,
273,
11899,
18,
318,
29306,
29654,
12,
803,
16,
599,
13,
3768,
67,
2338,
273,
11899,
18,
318,
29... | |
TestResults(failed=0, attempted=2) | TestResults(failed=0, attempted=3) | def test_pdb_set_trace(): """Using pdb.set_trace from a doctest. You can use pdb.set_trace from a doctest. To do so, you must retrieve the set_trace function from the pdb module at the time you use it. The doctest module changes sys.stdout so that it can capture program output. It also temporarily replaces pdb.set_trace with a version that restores stdout. This is necessary for you to see debugger output. >>> doc = ''' ... >>> x = 42 ... >>> import pdb; pdb.set_trace() ... ''' >>> parser = doctest.DocTestParser() >>> test = parser.get_doctest(doc, {}, "foo-bär@baz", "foo-bär@baz.py", 0) >>> runner = doctest.DocTestRunner(verbose=False) To demonstrate this, we'll create a fake standard input that captures our debugger input: >>> import tempfile >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput([ ... 'print(x)', # print data defined by the example ... 'continue', # stop debugging ... '']) >>> try: runner.run(test) ... finally: sys.stdin = real_stdin --Return-- > <doctest foo-bär@baz[1]>(1)<module>()->None -> import pdb; pdb.set_trace() (Pdb) print(x) 42 (Pdb) continue TestResults(failed=0, attempted=2) You can also put pdb.set_trace in a function called from a test: >>> def calls_set_trace(): ... y=2 ... import pdb; pdb.set_trace() >>> doc = ''' ... >>> x=1 ... >>> calls_set_trace() ... ''' >>> test = parser.get_doctest(doc, globals(), "foo-bär@baz", "foo-bär@baz.py", 0) >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput([ ... 'print(y)', # print data defined in the function ... 'up', # out of function ... 'print(x)', # print data defined by the example ... 'continue', # stop debugging ... '']) >>> try: ... runner.run(test) ... finally: ... sys.stdin = real_stdin --Return-- > <doctest test.test_doctest.test_pdb_set_trace[8]>(3)calls_set_trace()->None -> import pdb; pdb.set_trace() (Pdb) print(y) 2 (Pdb) up > <doctest foo-bär@baz[1]>(1)<module>() -> calls_set_trace() (Pdb) print(x) 1 (Pdb) continue TestResults(failed=0, attempted=2) During interactive debugging, source code is shown, even for doctest examples: >>> doc = ''' ... >>> def f(x): ... ... g(x*2) ... >>> def g(x): ... ... print(x+3) ... ... import pdb; pdb.set_trace() ... >>> f(3) ... ''' >>> test = parser.get_doctest(doc, globals(), "foo-bär@baz", "foo-bär@baz.py", 0) >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput([ ... 'list', # list source from example 2 ... 'next', # return from g() ... 'list', # list source from example 1 ... 'next', # return from f() ... 'list', # list source from example 3 ... 'continue', # stop debugging ... '']) >>> try: runner.run(test) ... finally: sys.stdin = real_stdin ... # doctest: +NORMALIZE_WHITESPACE --Return-- > <doctest foo-bär@baz[1]>(3)g()->None -> import pdb; pdb.set_trace() (Pdb) list 1 def g(x): 2 print(x+3) 3 -> import pdb; pdb.set_trace() [EOF] (Pdb) next --Return-- > <doctest foo-bär@baz[0]>(2)f()->None -> g(x*2) (Pdb) list 1 def f(x): 2 -> g(x*2) [EOF] (Pdb) next --Return-- > <doctest foo-bär@baz[2]>(1)<module>()->None -> f(3) (Pdb) list 1 -> f(3) [EOF] (Pdb) continue ********************************************************************** File "foo-bär@baz.py", line 7, in foo-bär@baz Failed example: f(3) Expected nothing Got: 9 TestResults(failed=1, attempted=3) """ | 39b14e8f1a3d1360dce1b2dfe3aa2c96ad0c1ae1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/39b14e8f1a3d1360dce1b2dfe3aa2c96ad0c1ae1/test_doctest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
17414,
67,
542,
67,
5129,
13332,
3536,
7736,
10892,
18,
542,
67,
5129,
628,
279,
31263,
395,
18,
225,
4554,
848,
999,
10892,
18,
542,
67,
5129,
628,
279,
31263,
395,
18,
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,
1842,
67,
17414,
67,
542,
67,
5129,
13332,
3536,
7736,
10892,
18,
542,
67,
5129,
628,
279,
31263,
395,
18,
225,
4554,
848,
999,
10892,
18,
542,
67,
5129,
628,
279,
31263,
395,
18,
225,... |
if (origsuffix==".dll" and "NOVERSION" not in OPTS and not sys.platform.startswith("win") and not RTDIST): | if (origsuffix==".dll" and "MODULE" not in OPTS and not sys.platform.startswith("win") and not RTDIST): | ProgressOutput(progress, "Building package from pdef file", infile) | 887a0daf013e7534275435efa59da5f00db28cc7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8543/887a0daf013e7534275435efa59da5f00db28cc7/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
10980,
1447,
12,
8298,
16,
315,
16713,
2181,
628,
293,
536,
585,
3113,
14568,
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,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
10980,
1447,
12,
8298,
16,
315,
16713,
2181,
628,
293,
536,
585,
3113,
14568,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
load_kvm_modules(self.srcdir) | load_kvm_modules(module_dir=self.srcdir, extra_modules=self.extra_modules) | def __load_modules(self): load_kvm_modules(self.srcdir) | ded2f2870602ded49e8aa3d2370d632cd56ed3ad /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10349/ded2f2870602ded49e8aa3d2370d632cd56ed3ad/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
945,
67,
6400,
12,
2890,
4672,
1262,
67,
79,
3489,
67,
6400,
12,
2890,
18,
4816,
1214,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
945,
67,
6400,
12,
2890,
4672,
1262,
67,
79,
3489,
67,
6400,
12,
2890,
18,
4816,
1214,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if self.document.active_page < len(self.document.pages)-1: self.document.GoToPage(self.document.active_page+1) | if self.document.active_page < len(self.document.pages) - 1: self.document.GoToPage(self.document.active_page + 1) | def NextPage(self): from dialogs.insertpagedlg import insertpgDialog if self.document.active_page < len(self.document.pages)-1: self.document.GoToPage(self.document.active_page+1) else: insertpgDialog(self.root) self.document.SelectNone() self.canvas.ForceRedraw() | 5bd05aab08ecc99debb8be46af1003105e4183ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3123/5bd05aab08ecc99debb8be46af1003105e4183ab/mainwindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4804,
1964,
12,
2890,
4672,
628,
7609,
14072,
18,
6387,
9095,
329,
23623,
1930,
2243,
8365,
6353,
309,
365,
18,
5457,
18,
3535,
67,
2433,
411,
562,
12,
2890,
18,
5457,
18,
7267,
13,
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,
4804,
1964,
12,
2890,
4672,
628,
7609,
14072,
18,
6387,
9095,
329,
23623,
1930,
2243,
8365,
6353,
309,
365,
18,
5457,
18,
3535,
67,
2433,
411,
562,
12,
2890,
18,
5457,
18,
7267,
13,
30... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.DoubleField.__init__(self, 84) else quickfix.DoubleField.__init__(self, 84, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
5265,
974,
16186,
2738,
972,
12,
2890,
16,
23421,
13,
469,
9549,
904,
18,
5265,
974,
16186,
2738,
972,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
5265,
974,
16186,
2738,
972,
12,
2890,
16,
23421,
13,
469,
9549,
904,
18,
5265,
974,
16186,
2738,
972,
... |
if not self.workerThread: self.workerThread = MediaMonkeyWorkerThread(self) self.workerThread.Start(100.0) return self.workerThread.CallWait(partial(self.workerThread.GetValue, command),1000) | if self.checkWorkerThread(): return self.workerThread.CallWait(partial(self.workerThread.GetValue, command),1000) | def GetValue(self, command): if not self.workerThread: self.workerThread = MediaMonkeyWorkerThread(self) self.workerThread.Start(100.0) return self.workerThread.CallWait(partial(self.workerThread.GetValue, command),1000) | d5260163cbd4fbc67849ace2ade2149e354e4a3f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8076/d5260163cbd4fbc67849ace2ade2149e354e4a3f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16250,
12,
2890,
16,
1296,
4672,
309,
365,
18,
1893,
6671,
3830,
13332,
327,
365,
18,
10124,
3830,
18,
1477,
5480,
12,
11601,
12,
2890,
18,
10124,
3830,
18,
967,
620,
16,
1296,
3631,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16250,
12,
2890,
16,
1296,
4672,
309,
365,
18,
1893,
6671,
3830,
13332,
327,
365,
18,
10124,
3830,
18,
1477,
5480,
12,
11601,
12,
2890,
18,
10124,
3830,
18,
967,
620,
16,
1296,
3631,
1... |
child = self.endColumn() | self.endColumn() | def endElement(self, name): if name == AdcData.tagName: child = self.endAdcData() elif name == AdcInterval.tagName: child = self.endAdcInterval() elif name == Array.tagName: child = self.endArray() elif name == Column.tagName: child = self.endColumn() elif name == Comment.tagName: child = self.endComment() elif name == Detector.tagName: child = self.endDetector() elif name == Dim.tagName: child = self.endDim() elif name == IGWDFrame.tagName: child = self.endIGWDFrame() elif name == LIGO_LW.tagName: child = self.endLIGO_LW() elif name == Param.tagName: child = self.endParam() elif name == Stream.tagName: child = self.endStream() elif name == Table.tagName: child = self.endTable() elif name == Time.tagName: child = self.endTime() else: raise ElementError, "unknown element tag %s" % name self.current = self.current.parentNode | 19c70d9d2433f3385423e26af544f557b0c477a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/19c70d9d2433f3385423e26af544f557b0c477a4/ligolw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14840,
12,
2890,
16,
508,
4672,
309,
508,
422,
4052,
71,
751,
18,
2692,
461,
30,
1151,
273,
365,
18,
409,
1871,
71,
751,
1435,
1327,
508,
422,
4052,
71,
4006,
18,
2692,
461,
30,
1151... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14840,
12,
2890,
16,
508,
4672,
309,
508,
422,
4052,
71,
751,
18,
2692,
461,
30,
1151,
273,
365,
18,
409,
1871,
71,
751,
1435,
1327,
508,
422,
4052,
71,
4006,
18,
2692,
461,
30,
1151... |
elif f in ("TYPE", "TERRAIN", "TEXT"): | elif f in ("STRING", "TYPE", "TERRAIN", "TEXT"): | def formaltype(f): # Deduce the expected type of the formal if f in ("SIDE", "X", "Y", "TO_X", "TO_Y", "AMOUNT", "RED", "GREEN", "BLUE", "TURN", "RADIUS") or f.endswith("NUMBER"): ftype = "numeric" elif f in ("POSITION",): ftype = "position" elif f in ("XSPAN", "YSPAN"): ftype = "span" elif f in ("RANGE",): ftype = "range" elif f in ("NAME", "VAR", "IMAGESTEM", "ID"): ftype = "name" elif f in ("TYPE", "TERRAIN", "TEXT"): ftype = "string" elif f in ("DESCRIPTION", "USER_DESCRIPTION",): ftype = "optional_string" elif f.endswith("IMAGE") or f == "PROFILE": ftype = "image" elif f in ("MUSIC", "SOUND"): ftype = "sound" elif f in ("FILTER", "ACTION"): ftype = "filter" elif f in ("WML_FRAGMENT",): ftype = "wml" elif f in ("VALUE",): ftype = "any" else: ftype = None return ftype | 0ee463c8cfe90abbd9021720a7a3bab36329c00a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9355/0ee463c8cfe90abbd9021720a7a3bab36329c00a/wmltools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25739,
723,
12,
74,
4672,
468,
463,
329,
3965,
326,
2665,
618,
434,
326,
25739,
309,
284,
316,
7566,
26498,
3113,
315,
60,
3113,
315,
61,
3113,
315,
4296,
67,
60,
3113,
315,
4296,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25739,
723,
12,
74,
4672,
468,
463,
329,
3965,
326,
2665,
618,
434,
326,
25739,
309,
284,
316,
7566,
26498,
3113,
315,
60,
3113,
315,
61,
3113,
315,
4296,
67,
60,
3113,
315,
4296,
67,
... |
print binary + " XXX3\n"; | def main(argv): try: opts, args = getopt.getopt(argv, "hb:p:cd", ["help", "binary=", "profileName=", "clobber"]) except getopt.GetoptError: usage() sys.exit(2) binary = "" profileName = "default" clobber=0 for o,a in opts: if o in ("-h", "--help"): usage() sys.exit() if o in ("-b","--binary"): binary=a if o in ("-p","--profileName"): profileName=a if o in ("-c","--clobber"): clobber=1 if binary=="" or not os.path.exists(binary): print binary + " XXX3\n"; usage() sys.exit(2) profileLocation = runCreateProfile(binary,profileName) if not profileLocation or not os.path.exists(profileLocation): print "Couldn't find profile location" sys.exit(2) # Delete the existing profile directory if clobber is requested. # -CreateProfile will re-create it in the right place. if clobber: dirname = os.path.dirname(profileLocation) shutil.rmtree(dirname) profileLocation = runCreateProfile(binary,profileName) if not profileLocation or not os.path.exists(profileLocation): print "Couldn't find profile location on second pass" sys.exit(2) populatePrefs(profileLocation) | 75fc8a4cea2b5c2b9d638beb8020e97590fbefb8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13067/75fc8a4cea2b5c2b9d638beb8020e97590fbefb8/createTestingProfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
19485,
16,
315,
76,
70,
30,
84,
30,
4315,
3113,
8247,
5201,
3113,
315,
8578,
1546,
16,
315,
5040,
46... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
19485,
16,
315,
76,
70,
30,
84,
30,
4315,
3113,
8247,
5201,
3113,
315,
8578,
1546,
16,
315,
5040,
46... | |
href = node['refuri'] | href = node['refuri'].replace(' | def visit_reference(self, node): # BUG: hash_char "#" is trouble some in LaTeX. # mbox and other environment do not like the '#'. hash_char = '\\#' | 68bc078131d281803d89fa1d878a9167eb63fabe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/68bc078131d281803d89fa1d878a9167eb63fabe/latex2e.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
6180,
12,
2890,
16,
756,
4672,
468,
10937,
43,
30,
1651,
67,
3001,
13092,
353,
23432,
1255,
2690,
316,
21072,
21575,
60,
18,
468,
312,
2147,
471,
1308,
3330,
741,
486,
3007,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
6180,
12,
2890,
16,
756,
4672,
468,
10937,
43,
30,
1651,
67,
3001,
13092,
353,
23432,
1255,
2690,
316,
21072,
21575,
60,
18,
468,
312,
2147,
471,
1308,
3330,
741,
486,
3007,
... |
escape_newlines=self._get_preserve_newlines()) | escape_newlines=self.must_preserve_newlines) | def category(m): return m.is_completed and 1 or m.due and 2 or 3 | 20d87d0d98b12b2aefa4d6fefe0fa37f73e5e7f4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9317/20d87d0d98b12b2aefa4d6fefe0fa37f73e5e7f4/web_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3150,
12,
81,
4672,
327,
312,
18,
291,
67,
13615,
471,
404,
578,
312,
18,
24334,
471,
576,
578,
890,
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,
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,
3150,
12,
81,
4672,
327,
312,
18,
291,
67,
13615,
471,
404,
578,
312,
18,
24334,
471,
576,
578,
890,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
PangoItem = struct__PangoItem | PangoItem = struct__PangoItem | def load_lib(name): libname = ctypes.util.find_library(name) if not libname: raise OSError("Could not find library '%s'" % name) else: return CDLL(libname) | 92bb4862df49194567fad21ea00d921ffc62dd6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10761/92bb4862df49194567fad21ea00d921ffc62dd6a/pango.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
2941,
12,
529,
4672,
2561,
529,
273,
6983,
18,
1367,
18,
4720,
67,
12083,
12,
529,
13,
309,
486,
2561,
529,
30,
1002,
10002,
2932,
4445,
486,
1104,
5313,
1995,
87,
4970,
738,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
2941,
12,
529,
4672,
2561,
529,
273,
6983,
18,
1367,
18,
4720,
67,
12083,
12,
529,
13,
309,
486,
2561,
529,
30,
1002,
10002,
2932,
4445,
486,
1104,
5313,
1995,
87,
4970,
738,... |
def zope_request(self, method, headers={}, body=''): | def zopeRequest(self, method, headers={}, body=''): | def zope_request(self, method, headers={}, body=''): """Send a request back to Zope""" try: if self.ssl: h = HTTPSConnection(self.host) else: h = HTTPConnection(self.host) | 7170fc183935ab223dd0aeb8f257b350efa792d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/7170fc183935ab223dd0aeb8f257b350efa792d7/zopeedit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
998,
1306,
691,
12,
2890,
16,
707,
16,
1607,
28793,
1417,
2218,
11,
4672,
3536,
3826,
279,
590,
1473,
358,
2285,
1306,
8395,
775,
30,
309,
365,
18,
8157,
30,
366,
273,
18904,
1952,
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
998,
1306,
691,
12,
2890,
16,
707,
16,
1607,
28793,
1417,
2218,
11,
4672,
3536,
3826,
279,
590,
1473,
358,
2285,
1306,
8395,
775,
30,
309,
365,
18,
8157,
30,
366,
273,
18904,
1952,
12,... |
info = oe.mailbox.dbxFileInfo(dbxStream, | info = oe_mailbox.dbxFileInfo(dbxStream, | def _convertOutlookExpressToMbox(self, content): """Check if the uploaded mailbox file is an Outlook Express DBX one. | b939df774e8b09ad51d2d92670490e6b1622f831 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/b939df774e8b09ad51d2d92670490e6b1622f831/UserInterface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6283,
1182,
7330,
424,
1028,
774,
49,
2147,
12,
2890,
16,
913,
4672,
3536,
1564,
309,
326,
9140,
14187,
585,
353,
392,
2976,
7330,
18482,
2383,
60,
1245,
18,
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,
389,
6283,
1182,
7330,
424,
1028,
774,
49,
2147,
12,
2890,
16,
913,
4672,
3536,
1564,
309,
326,
9140,
14187,
585,
353,
392,
2976,
7330,
18482,
2383,
60,
1245,
18,
2,
-100,
-100,
-100,
... |
if self.distance(zipc) <= distance ] | if self.distance(zipc) <= distance_float ] | def close_zipcodes(self, distance): """ Get a list of zip codes less than or equal to distance from this zip code. """ from decimal import Decimal try: distance_decimal = Decimal(str(distance)) except: raise ESPError(), '%s should be a valid decimal number!' % distance | 37c7f990615704dd78fc755384b2bef0ad23b00d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12041/37c7f990615704dd78fc755384b2bef0ad23b00d/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
4450,
7000,
12,
2890,
16,
3888,
4672,
3536,
968,
279,
666,
434,
3144,
6198,
5242,
2353,
578,
3959,
358,
3888,
628,
333,
3144,
981,
18,
3536,
628,
6970,
1930,
11322,
775,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
4450,
7000,
12,
2890,
16,
3888,
4672,
3536,
968,
279,
666,
434,
3144,
6198,
5242,
2353,
578,
3959,
358,
3888,
628,
333,
3144,
981,
18,
3536,
628,
6970,
1930,
11322,
775,
30,
... |
R = cholinsert(R,X[:,j],X[:,act_set]) act_set.append(j) inact_set.remove(j) vs += 1 print "R shape after insert ", R.shape | R = cholinsert(R,X[:,jmax],X[:,act_set]) act_set.append(jmax) inact_set.remove(jmax) | def lars(X, y): # n is the number of variables, p is the number of "predictors" or # basis vectors # the predictors are assumed to be standardized and y is centered. # in the example of the prostate data n would be the number n,p = X.shape mu = zeros(n) act_set = [] inact_set = range(p) k = 0 vs = 0 nvs = min(n-1,p) beta = zeros((2*nvs,p)) maxiter = nvs * 8 # initial cholesky decomposition of the gram matrix R = zeros((0,0)) while vs < nvs and k < maxiter: print "new iteration: vs = ", vs, " nvs = ", nvs, " k = ", k print "mu.shape = ", mu.shape #print "mu = ", mu # compute correlation with inactive set # and element that has the maximum correlation c = dot(X.T, y - mu) #c = c.reshape(1,len(c)) jia = argmax(abs(c[inact_set])) j = inact_set[jia] C = c[j] print "predictor ", j, " max corr with w/ current residual: ", C print "adding ", j, " to active set" print "R shape before insert: ", R.shape # add the most correlated predictor to the active set R = cholinsert(R,X[:,j],X[:,act_set]) act_set.append(j) inact_set.remove(j) vs += 1 print "R shape after insert ", R.shape print "active set = ", act_set print "inactive set = ", inact_set # get the signs of the correlations s = sign(c[act_set]) s = s.reshape(len(s),1) #print "R.shape = ", R.shape #print "s.shape = ", s.shape # move in the direction of the least squares solution GA1 = solve(R,solve(R.T, s)) AA = 1/sqrt(sum(GA1 * s)) w = AA * GA1 # equiangular direction - this should be a unit vector print "X[:,act_set].shape = ",X[:,act_set].shape #print "w.shape = ",w.shape u = dot(X[:,act_set], w).reshape(-1) #print "norm of u = ", norm(u) #print "u.shape = ", u.shape # if this is the last iteration i.e. all variables are in the # active set, then set the step toward the full least squares # solution if vs == nvs: print "last variable going all the way to least squares solution" gamma = C / AA else: a = dot(X.T,u) a = a.reshape((len(a),)) tmp = r_[(C - c[inact_set])/(AA - a[inact_set]), (C + c[inact_set])/(AA + a[inact_set])] gamma = min(r_[tmp[tmp > 0], array([C/AA]).reshape(-1)]) mu = mu + gamma * u if beta.shape[0] < k: beta = c_[beta, zeros((beta.shape[0],))] beta[k+1,act_set] = beta[k,act_set] + gamma*w.T.reshape(-1) k += 1 return beta | 0db785b39c36b490ef6940e674e6c7ea9ebc6107 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14601/0db785b39c36b490ef6940e674e6c7ea9ebc6107/lars.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5604,
87,
12,
60,
16,
677,
4672,
468,
290,
353,
326,
1300,
434,
3152,
16,
293,
353,
326,
1300,
434,
315,
14491,
1383,
6,
578,
468,
10853,
10046,
225,
468,
326,
7810,
1383,
854,
12034,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5604,
87,
12,
60,
16,
677,
4672,
468,
290,
353,
326,
1300,
434,
3152,
16,
293,
353,
326,
1300,
434,
315,
14491,
1383,
6,
578,
468,
10853,
10046,
225,
468,
326,
7810,
1383,
854,
12034,
... |
temp = self.recursive self.recursive = False self.stop_now = False inputlist = self.expand_directory(itempath, False) self.recursive = temp inputlist = list(set(inputlist)) | temp = self.recursive self.recursive = False self.stop_now = False self.expand_directory(itempath, False) self.recursive = temp for item in self.image_list: duplicate_image = False for item2 in inputlist: if item == item2: duplicate_image = True if duplicate_image == False: inputlist.append(item) self.image_list = [] | def expand_filelist_and_load_image(self, inputlist): | 8af972c9a81f2687cab2b7b391c5943b3b45f1ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/8af972c9a81f2687cab2b7b391c5943b3b45f1ab/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
67,
7540,
5449,
67,
464,
67,
945,
67,
2730,
12,
2890,
16,
810,
1098,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
67,
7540,
5449,
67,
464,
67,
945,
67,
2730,
12,
2890,
16,
810,
1098,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
logger.error("Job %d is in an unsupported status and so the merge can not continue. '\ | logger.error("Job %d is in an unsupported status %s and so the merge can not continue. '\ | def merge(self, jobs, outputdir = None, ignorefailed = None, overwrite = None): """ Method to merge the output of jobs. jobs may be a single job instance or a sequence of Jobs outputdir is the name of the directry to put the merge results in. It will be created if needed. ignorefailed and overwrite have the same meaning as in the schema, but override the schema values. | 231d2f24ad6793ddf0d9cf7d239fe30ce12fb4d8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1488/231d2f24ad6793ddf0d9cf7d239fe30ce12fb4d8/Merger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2691,
12,
2890,
16,
6550,
16,
876,
1214,
273,
599,
16,
2305,
7307,
273,
599,
16,
6156,
273,
599,
4672,
3536,
2985,
358,
2691,
326,
876,
434,
6550,
18,
225,
6550,
2026,
506,
279,
2202,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2691,
12,
2890,
16,
6550,
16,
876,
1214,
273,
599,
16,
2305,
7307,
273,
599,
16,
6156,
273,
599,
4672,
3536,
2985,
358,
2691,
326,
876,
434,
6550,
18,
225,
6550,
2026,
506,
279,
2202,
... |
log.info("Album saved") | log.info("Album %s saved" % self.props.name) | def save(self): doc = xml.dom.minidom.Document() | 11389c4188f2eaefc8d10f1626492bcb264391a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/11389c4188f2eaefc8d10f1626492bcb264391a7/gofoto.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
4672,
997,
273,
2025,
18,
9859,
18,
1154,
350,
362,
18,
2519,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
4672,
997,
273,
2025,
18,
9859,
18,
1154,
350,
362,
18,
2519,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
def __init__(self,id,title=''): | _v_vocabulary = None def __init__(self, id, title='', vocab=0, vocab_id='', container=None): | def manage_addZCatalog(self,id,title,REQUEST=None): """Add a ZCatalog object """ c=ZCatalog(id,title) self._setObject(id,c) if REQUEST is not None: return self.manage_main(self,REQUEST) | e48881c65b01fd747d530825a792eaf8f9585960 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e48881c65b01fd747d530825a792eaf8f9585960/ZCatalog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
1289,
62,
9769,
12,
2890,
16,
350,
16,
2649,
16,
5519,
33,
7036,
4672,
3536,
986,
279,
2285,
9769,
733,
3536,
276,
33,
62,
9769,
12,
350,
16,
2649,
13,
365,
6315,
542,
921... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
1289,
62,
9769,
12,
2890,
16,
350,
16,
2649,
16,
5519,
33,
7036,
4672,
3536,
986,
279,
2285,
9769,
733,
3536,
276,
33,
62,
9769,
12,
350,
16,
2649,
13,
365,
6315,
542,
921... |
index = self.GetItemCount() + 1 else: | index = self.GetItemCount() - 1 elif insert: | def getDropIndex(self, x, y, index=None, flags=None): """Find the index to insert the new item, which could be before or after the index passed in. """ if index is None: index, flags = self.HitTest((x, y)) | 8c47e4b71b22a0c81ac2f37e325134786f0e8a41 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11522/8c47e4b71b22a0c81ac2f37e325134786f0e8a41/dropscroller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31900,
1016,
12,
2890,
16,
619,
16,
677,
16,
770,
33,
7036,
16,
2943,
33,
7036,
4672,
3536,
3125,
326,
770,
358,
2243,
326,
394,
761,
16,
1492,
3377,
506,
1865,
578,
1839,
326,
770,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31900,
1016,
12,
2890,
16,
619,
16,
677,
16,
770,
33,
7036,
16,
2943,
33,
7036,
4672,
3536,
3125,
326,
770,
358,
2243,
326,
394,
761,
16,
1492,
3377,
506,
1865,
578,
1839,
326,
770,
... |
zone=world.getRPZone("int_semos_tavern") | zone=world.getRPZone("int_semos_tavern_0") | def diogenesMethod(npc): global conf | 63c5b93af9d78f2ee5338c32637527009405220b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2938/63c5b93af9d78f2ee5338c32637527009405220b/stendhal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4314,
19409,
281,
1305,
12,
82,
2436,
4672,
2552,
2195,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4314,
19409,
281,
1305,
12,
82,
2436,
4672,
2552,
2195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
lang_grouping, thousands_sep, decimal_point = self._lang_data_get(cr, uid, ids[0]) | lang_grouping, thousands_sep, decimal_point = self._lang_data_get(cr, uid, ids[0], monetary) | def format(self, cr, uid, ids, percent, value, grouping=False, monetary=False): """ Format() will return the language-specific output for float values""" | 8e15fd52b369bc2f16739423d4db485bd6963653 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/8e15fd52b369bc2f16739423d4db485bd6963653/res_lang.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
5551,
16,
460,
16,
12116,
33,
8381,
16,
31198,
33,
8381,
4672,
3536,
4077,
1435,
903,
327,
326,
2653,
17,
12524,
876,
364,
1431,
924,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
5551,
16,
460,
16,
12116,
33,
8381,
16,
31198,
33,
8381,
4672,
3536,
4077,
1435,
903,
327,
326,
2653,
17,
12524,
876,
364,
1431,
924,
... |
if len(args) != 1: print 'You must provide only one argument: path to the test binary' | if not args: print 'You must provide path to the test binary' | def main(argv): parser = optparse.OptionParser() parser.add_option("--shards", type="int", dest="shards", default=10) options, args = parser.parse_args(argv) if len(args) != 1: print 'You must provide only one argument: path to the test binary' return 1 launchers = [] for shard in range(options.shards): launcher = TestLauncher(args[0], args[0], options.shards, shard) launcher.launch() launchers.append(launcher) return_code = 0 for launcher in launchers: if launcher.wait() != 0: return_code = 1 return return_code | 0fa4cd1ce04d5f4bd028063fa69444468d629a5c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/0fa4cd1ce04d5f4bd028063fa69444468d629a5c/parallel_launcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
2082,
273,
2153,
2670,
18,
1895,
2678,
1435,
2082,
18,
1289,
67,
3482,
2932,
413,
24633,
3113,
618,
1546,
474,
3113,
1570,
1546,
24633,
3113,
805,
33,
2163,
13,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
2082,
273,
2153,
2670,
18,
1895,
2678,
1435,
2082,
18,
1289,
67,
3482,
2932,
413,
24633,
3113,
618,
1546,
474,
3113,
1570,
1546,
24633,
3113,
805,
33,
2163,
13,
22... |
assert isinstance(subrefnode, nodes.substitution_reference) subreftext = subrefnode.astext() refname = normname(subreftext) subrefnode['refname'] = refname self.statemachine.memo.document.note_substitution_ref(subrefnode) if endstring[-1:] == '_': referencenode = nodes.reference('|%s%s' % (subreftext, endstring), '') if endstring[-2:] == '__': referencenode['anonymous'] = 1 self.statemachine.memo.document.note_anonymous_ref(referencenode) else: referencenode['refname'] = refname self.statemachine.memo.document.note_refname(referencenode) referencenode += subrefnode inlines = [referencenode] | if isinstance(subrefnode, nodes.substitution_reference): subreftext = subrefnode.astext() refname = normname(subreftext) subrefnode['refname'] = refname self.statemachine.memo.document.note_substitution_ref( subrefnode) if endstring[-1:] == '_': referencenode = nodes.reference( '|%s%s' % (subreftext, endstring), '') if endstring[-2:] == '__': referencenode['anonymous'] = 1 self.statemachine.memo.document.note_anonymous_ref( referencenode) else: referencenode['refname'] = refname self.statemachine.memo.document.note_refname( referencenode) referencenode += subrefnode inlines = [referencenode] | def substitution_reference(self, match, lineno): before, inlines, remaining, sysmessages, endstring = self.inlineobj( match, lineno, self.inline.patterns.substitution_ref, nodes.substitution_reference) if inlines: assert len(inlines) == 1 subrefnode = inlines[0] assert isinstance(subrefnode, nodes.substitution_reference) subreftext = subrefnode.astext() refname = normname(subreftext) subrefnode['refname'] = refname self.statemachine.memo.document.note_substitution_ref(subrefnode) if endstring[-1:] == '_': referencenode = nodes.reference('|%s%s' % (subreftext, endstring), '') if endstring[-2:] == '__': referencenode['anonymous'] = 1 self.statemachine.memo.document.note_anonymous_ref(referencenode) else: referencenode['refname'] = refname self.statemachine.memo.document.note_refname(referencenode) referencenode += subrefnode inlines = [referencenode] return before, inlines, remaining, sysmessages | f2890960d21e5fcadc089298dbc45b2f7931fc2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/f2890960d21e5fcadc089298dbc45b2f7931fc2f/states.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12785,
67,
6180,
12,
2890,
16,
845,
16,
7586,
4672,
1865,
16,
316,
3548,
16,
4463,
16,
2589,
6833,
16,
679,
1080,
273,
365,
18,
10047,
2603,
12,
845,
16,
7586,
16,
365,
18,
10047,
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,
12785,
67,
6180,
12,
2890,
16,
845,
16,
7586,
4672,
1865,
16,
316,
3548,
16,
4463,
16,
2589,
6833,
16,
679,
1080,
273,
365,
18,
10047,
2603,
12,
845,
16,
7586,
16,
365,
18,
10047,
18... |
"*/%s_RDS_*/%s/*.html"%(sngl.ifo,sngl.time)): if not myFile.upper().__contains__("PEM"): indexDict[sngl.ifo].append(myFile) | "*/%s_RDS_*/%s/*html"%(sngl.ifo,sngl.time)): indexDict[sngl.ifo].append(myFile) | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # # Check to see if wiki file with name already exists # maxCount=0 while os.path.exists(wikiFilename) and maxCount < 10: sys.stdout.write("File %s already exists.\n"%\ os.path.split(wikiFilename)[1]) wikiFilename=wikiFilename+".wiki" maxCount=maxCount+1 # #Create the wikipage object etc # wikiPage=wiki(wikiFilename) # # Create top two trigger params tables # cTable=wikiPage.wikiTable(2,8) cTable.data=[ ["Trigger Type", "Rank", "FAR", "SNR", "IFOS(Coinc)", "Instruments(Active)", "Coincidence Time (s)", "Total Mass (mSol)" ], ["%s"%(wikiCoinc.type), "%s"%(wikiCoinc.rank), "%s"%(wikiCoinc.far), "%s"%(wikiCoinc.snr), "%s"%(wikiCoinc.ifos), "%s"%(wikiCoinc.instruments), "%s"%(wikiCoinc.time), "%s"%(wikiCoinc.mass) ] ] pTable=wikiPage.wikiTable(len(wikiCoinc.sngls_in_coinc())+1,6) pTable.data[0]=[ "IFO", "GPS Time(s)", "SNR", "CHISQR", "Mass 1", "Mass 2" ] for row,cSngl in enumerate(wikiCoinc.sngls_in_coinc()): pTable.data[row+1]=[ "%s"%(cSngl.ifo), "%s"%(cSngl.time), "%s"%(cSngl.snr), "%s"%(cSngl.chisqr), "%s"%(cSngl.mass1), "%s"%(cSngl.mass2) ] #Write the tables into the Wiki object wikiPage.putText("Coincident Trigger Event Information: %s\n"\ %(stfu_pipe.gpsTimeToReadableDate(wikiCoinc.time))) wikiPage.insertTable(cTable) wikiPage.putText("Corresponding Coincident Single IFO Trigger Information\n") wikiPage.insertTable(pTable) #Generate a table of contents to appear after candidate params table wikiPage.tableOfContents(3) #Begin including each checklist item as section with subsections wikiPage.section("Follow-up Checklist") #Put each checklist item wikiPage.subsection("Checklist Summary") wikiPage.subsubsection("Does this candidate pass this checklist?") wikiPage.subsubsection("Answer") wikiPage.subsubsection("Relevant Information and Comments") wikiPage.insertHR() # #First real checklist item wikiPage.subsection("#0 False Alarm Probability") wikiPage.subsubsection("Question") wikiPage.putText("What is the false alarm rate associated with this candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") farTable=wikiPage.wikiTable(2,1) farTable.setTableStyle("background-color: yellow; text-align center;") farTable.data[0][0]="False Alarm Rate" farTable.data[1][0]="%s"%(wikiCoinc.far) wikiPage.insertTable(farTable) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#1 Data Quality Flags") wikiPage.subsubsection("Question") wikiPage.putText("Can the data quality flags coincident with this candidate be safely disregarded?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPath=os.path.split(wikiFilename)[0] dqFileList=wikiFileFinder.get_findFlags() if len(dqFileList) != 1: sys.stdout.write("Warning: DQ flags data product import problem.\n") print "Found %i files."%len(dqFileList) for mf in dqFileList: print mf for myFile in dqFileList: wikiPage.putText("%s\n"%(file(myFile).read())) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#2 Veto Investigations") wikiPage.subsubsection("Question") wikiPage.putText("Does the candidate survive the veto investigations performed at its time?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") vetoFileList=wikiFileFinder.get_findVetos() if len(vetoFileList) != 1: sys.stdout.write("Warning: Veto flags data product import problem.\n") for myFile in vetoFileList:print myFile for myFile in vetoFileList: wikiPage.putText("%s\n"%(file(myFile).read())) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#3 IFO Status") wikiPage.subsubsection("Question") wikiPage.putText("Are the interferometers operating normally with a reasonable level of sensitivity around the time of the candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") #Add link to Daily Stats if wikiCoinc.time > endOfS5: statsLink=wikiPage.makeExternalLink("http://blue.ligo-wa.caltech.edu/scirun/S5/DailyStatistics/",\ "S5 Daily Stats Page") else: statsLink="This should be a link to S6 Daily Stats!\n" wikiPage.putText(statsLink) #Link figures of merit #Get link for all members of wikiCoinc wikiPage.putText("Figures of Merit\n") if wikiCoinc.time > endOfS5: fomLinks=dict() elems=0 for wikiSngl in wikiCoinc.sngls: if not(wikiSngl.ifo.upper().rstrip().lstrip() == 'V1'): fomLinks[wikiSngl.ifo]=stfu_pipe.getFOMLinks(wikiCoinc.time,wikiSngl.ifo) elems=elems+len(fomLinks[wikiSngl.ifo]) else: for myLabel,myLink,myThumb in stfu_pipe.getFOMLinks(wikiCoinc.time,wikiSngl.ifo): wikiPage.putText("%s\n"%(wikiPage.makeExternalLink(myLink,myLabel))) if elems%3 != 0: sys.stdout.write("Generation of FOM links seems incomplete!\n") cols=4 rows=(elems/3)+1 fTable=wikiPage.wikiTable(rows,cols) fTable.data[0]=["IFO,Shift","FOM1","FOM2","FOM3"] currentIndex=0 for myIFOKey in fomLinks.keys(): for label,link,thumb in fomLinks[myIFOKey]: myRow=currentIndex/int(3)+1 myCol=currentIndex%int(3)+1 fTable.data[myRow][0]=label thumbURL=file2URL.convert(thumb) fTable.data[myRow][myCol]="%s"%(wikiPage.linkedRemoteImage(thumb,link)) currentIndex=currentIndex+1 wikiPage.insertTable(fTable) else: wikiPage.putText("Can not automatically fetch S5 FOM links.") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#4 Candidate Appearance") wikiPage.subsubsection("Question") wikiPage.putText("Do the Qscan figures show what we would expect for a gravitational-wave event?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") imageDict=dict() indexDict=dict() thumbDict=dict() for sngl in wikiCoinc.sngls: frametype,channelName=stfu_pipe.figure_out_type(sngl.time,sngl.ifo,'hoft') indexDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_hoft_frame(),\ "*/%s/*/%s/*index.html"%(frametype,sngl.time)) imageDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_hoft_frame(),\ "*%s*_%s_16.00_spectrogram_whitened.png"\ %(sngl.time,channelName)) thumbDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_hoft_frame(),\ "*%s*_%s_16.00_spectrogram_whitened?thumb.png"\ %(sngl.time,channelName)) # #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("GW data channel scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >= 1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >= 1 if enoughImage and enoughIndex: wikiPage.insertQscanTable(imageDict,\ thumbDict,\ indexDict) else: sys.stdout.write("Warning: Candidate appearance plot import problem.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#5 Seismic Plots") wikiPage.subsubsection("Question") wikiPage.putText("Is the seismic activity insignificant around the time of the candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") imageDict=dict() indexDict=dict() thumbDict=dict() for sngl in wikiCoinc.sngls: indexDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/index.html"%(sngl.ifo,sngl.time)) imageDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*SEIS?_512.00_spectrogram_whitened.png"%\ (sngl.ifo,sngl.time)) thumbDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*SEIS?_512.00_spectrogram_whitened?thumb.png"%\ (sngl.ifo,sngl.time)) #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("Seismic scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >=1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >=1 if enoughImage and enoughIndex: wikiPage.insertQscanTable(imageDict,\ thumbDict,\ indexDict) else: sys.stdout.write("Warning: Seismic plots product import problem.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#6 Other environmental causes") wikiPage.subsubsection("Question") wikiPage.putText("Were the environmental disturbances (other than seismic) insignificant at the time of the candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") imageDict=dict() indexDict=dict() thumbDict=dict() #Select only PEM channels for sngl in wikiCoinc.sngls: imageDict[sngl.ifo]=list() indexDict[sngl.ifo]=list() thumbDict[sngl.ifo]=list() for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*.html"%(sngl.ifo,sngl.time)): if myFile.upper().__contains__("PEM"): indexDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened.png"%\ (sngl.ifo,sngl.time)): if myFile.upper().__contains__("PEM"): imageDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened?thumb.png"%\ (sngl.ifo,sngl.time)): if myFile.upper().__contains__("PEM"): thumbDict[sngl.ifo].append(myFile) #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("PEM scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >=1 enoughIndex=[len(imageDict[key])>0 for key in indexDict.keys()].count(True) >=1 if enoughImage and enoughIndex: wikiPage.insertQscanTable(imageDict,\ thumbDict,\ indexDict) else: sys.stdout.write("Warning: PEM plots import trouble.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#7 Auxiliary degree of freedom") wikiPage.subsubsection("Question") wikiPage.putText("Were the auxiliary channel transients coincident with the candidate insignificant?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") imageDict=dict() indexDict=dict() thumbDict=dict() #Select only AUX channels for sngl in wikiCoinc.sngls: imageDict[sngl.ifo]=list() indexDict[sngl.ifo]=list() thumbDict[sngl.ifo]=list() for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*.html"%(sngl.ifo,sngl.time)): if not myFile.upper().__contains__("PEM"): indexDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened.png"%\ (sngl.ifo,sngl.time)): if not myFile.upper().__contains__("PEM"): imageDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened?thumb.png"%\ (sngl.ifo,sngl.time)): if not myFile.upper().__contains__("PEM"): thumbDict[sngl.ifo].append(myFile) #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("PEM scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >=1 enoughIndex=[len(imageDict[key])>0 for key in indexDict.keys()].count(True) >=1 if enoughImage and enoughIndex: wikiPage.insertQscanTable(imageDict,\ thumbDict,\ indexDict) else: sys.stdout.write("Warning: AUX plots import trouble.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#8 Electronic Log Book") wikiPage.subsubsection("Question") wikiPage.putText("Were the instruments behaving normally according to the comments posted by the sci-mons or the operators in the e-log?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiLinkLHOlog=wikiPage.makeExternalLink(stfu_pipe.getiLogURL(myCoinc.time,"H1"), "Hanford eLog") wikiLinkLLOlog=wikiPage.makeExternalLink(stfu_pipe.getiLogURL(myCoinc.time,"L1"), "Livingston eLog") wikiPage.putText("%s\n\n%s\n\n"%(wikiLinkLHOlog,wikiLinkLLOlog)) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#9 Glitch Report") wikiPage.subsubsection("Question") wikiPage.putText("Were the instruments behaving normally according to the weekly glitch report?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") if int(wikiCoinc.time) >= endOfS5: wikiLinkGlitch=wikiPage.makeExternalLink( "https://www.lsc-group.phys.uwm.edu/twiki/bin/view/DetChar/GlitchStudies", "Glitch Reports for S6" ) else: wikiLinkGlitch=wikiPage.makeExternalLink( "http://www.lsc-group.phys.uwm.edu/glitch/investigations/s5index.html#shift", "Glitch Reports for S5" ) wikiPage.putText("%s\n"%(wikiLinkGlitch)) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#10 Snr versus time") wikiPage.subsubsection("Question") wikiPage.putText("Is this trigger significant in a SNR versus time plot of all triggers in its analysis chunk?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#11 Parameters of the candidate") wikiPage.subsubsection("Question") wikiPage.putText("Does the candidate have a high likelihood of being a gravitational-wave according to its parameters?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Effective Distance Ratio Test\n") effDList=wikiFileFinder.get_effDRatio() if len(effDList) != 1: sys.stdout.write("Warning: Effective Distance Test import problem.\n") for myFile in effDList: wikiPage.putText("%s\n"%(file(myFile).read())) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#12 Snr and Chisq") wikiPage.subsubsection("Question") wikiPage.putText("Are the SNR and CHISQ time series consistent with our expectations for a gravitational wave?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") # #Put plots SNR and Chi sqr # indexList=fnmatch.filter(wikiFileFinder.get_plotsnrchisq(),"*.html") thumbList=fnmatch.filter(wikiFileFinder.get_plotsnrchisq(),"*_snr-*thumb.png") thumbList.extend(fnmatch.filter(wikiFileFinder.get_plotsnrchisq(),"*_chisq-*thumb.png")) thumbList.sort() indexList=[file2URL.convert(x) for x in indexList] thumbList=[file2URL.convert(x) for x in thumbList] #Two thumb types possible "_thumb.png" or ".thumb.png" imageList=[x.replace("_thumb.png",".png").replace(".thumb.png",".png") for x in thumbList] ifoCount=len(wikiCoinc.sngls) rowLabel={"SNR":1,"CHISQ":2} rowCount=len(rowLabel) colCount=ifoCount if len(indexList) >= 1: snrTable=wikiPage.wikiTable(rowCount+1,colCount+1) for i,sngl in enumerate(wikiCoinc.sngls): myIndex="" for indexFile in indexList: if indexFile.__contains__("_pipe_%s_FOLLOWUP_"%sngl.ifo): myIndex=indexFile if myIndex=="": snrTable.data[0][i+1]=" %s "%sngl.ifo else: snrTable.data[0][i+1]=wikiPage.makeExternalLink(myIndex,sngl.ifo) for col,sngl in enumerate(wikiCoinc.sngls): for row,label in enumerate(rowLabel.keys()): snrTable.data[row+1][0]=label for k,image in enumerate(imageList): if (image.__contains__("_%s-"%label.lower()) \ and image.__contains__("pipe_%s_FOLLOWUP"%sngl.ifo)): snrTable.data[row+1][col+1]=" %s "%(thumbList[k]) wikiPage.insertTable(snrTable) else: sys.stdout.write("Warning: SNR and CHISQ plots not found.\n") wikiPage.putText("SNR and CHISQ plots not found.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#13 Template bank veto") wikiPage.subsubsection("Question") wikiPage.putText("Is the bank veto value consistent with our expectations for a gravitational wave?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#14 Coherent studies") wikiPage.subsubsection("Question") wikiPage.putText("Are the triggers found in multiple interferometers coherent with each other?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") indexList=fnmatch.filter(wikiFileFinder.get_plotchiatimeseries(),"*.html") if len(indexList) > 1: myIndex=file2URL.convert(indexList[0]) wikiPage.putText(wikiPage.makeExternalLink(myIndex,\ "%s Coherence Study Results"%(wikiCoinc.ifos))) thumbList=fnmatch.filter(wikiFileFinder.get_plotchiatimeseries(),\ "PLOT_CHIA_%s_snr-squared*thumb.png"%(wikiCoinc.time)) imageList=[x.replace("_thumb.png",".png").replace(".thumb.png",".png") for x in thumbList] rowCount=len(imageList) colCount=1 cohSnrTimeTable=wikiPage.wikiTable(rowCount+1,colCount) cohSnrTimeTable.data[0][0]="%s Coherent SNR Squared Times Series"%(wikiCoinc.ifos) for i,image in enumerate(imageList): cohSnrTimeTable.data[i+1][0]=wikiPage.linkedRemoteImaage(image,thumbList[i]) wikiPage.insertTable(cohSnrTimeTable) else: sys.stdout.write("Warning: Coherent plotting jobs not found.\n") wikiPage.putText("Coherent Studies plots not found.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#15 Segmentation Stability") wikiPage.subsubsection("Question") wikiPage.putText("Is the candidate stable against changes in segmentation?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#16 Calibration Stability") wikiPage.subsubsection("Question") wikiPage.putText("Is the candidate stable against changes in calibration that are consistent with systematic uncertainties?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # | 6b407d0c7ee058a6d6c1ea143d461b46e2ea8c0f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/6b407d0c7ee058a6d6c1ea143d461b46e2ea8c0f/makeCheckListWiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1564,
1098,
12,
13044,
5359,
33,
7036,
16,
13044,
27055,
71,
33,
7036,
16,
13044,
2471,
33,
7036,
16,
768,
22,
1785,
33,
7036,
4672,
3536,
2985,
358,
2911,
279,
866,
1098,
1625,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1564,
1098,
12,
13044,
5359,
33,
7036,
16,
13044,
27055,
71,
33,
7036,
16,
13044,
2471,
33,
7036,
16,
768,
22,
1785,
33,
7036,
4672,
3536,
2985,
358,
2911,
279,
866,
1098,
1625,
... |
good = spam = unknown = None | good = [] spam = [] unknown = [] | def main(): """Main program; parse options and go.""" try: opts, args = getopt.getopt(sys.argv[1:], 'hdfg:s:p:u:') except getopt.error, msg: usage(2, msg) if not opts: usage(2, "No options given") pck = DEFAULTDB good = spam = unknown = None do_filter = usedb = False for opt, arg in opts: if opt == '-h': usage(0) elif opt == '-g': good = arg elif opt == '-s': spam = arg elif opt == '-p': pck = arg elif opt == "-d": usedb = True elif opt == "-f": do_filter = True elif opt == '-u': unknown = arg if args: usage(2, "Positional arguments not allowed") save = False bayes = createbayes(pck, usedb) if good: print "Training ham:" train(bayes, good, False) save = True if spam: print "Training spam:" train(bayes, spam, True) save = True if save: bayes.update_probabilities() if not usedb and pck: fp = open(pck, 'wb') pickle.dump(bayes, fp, 1) fp.close() if do_filter: filter(bayes, sys.stdin, sys.stdout) if unknown: score(bayes, unknown) | 1820777a870d1d95c91535ea940c14660d922882 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/1820777a870d1d95c91535ea940c14660d922882/hammie.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3536,
6376,
5402,
31,
1109,
702,
471,
1960,
12123,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
296,
22057,
2137,
30,
87,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3536,
6376,
5402,
31,
1109,
702,
471,
1960,
12123,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
296,
22057,
2137,
30,
87,
... |
Sub(lon, "value").text = "12.243500" Sub(lon, "uncertainty").text = "2.240000" | Sub(lon, "value").text = '%s' % self.threeDlocEventLon Sub(lon, "uncertainty").text = '%s' % self.threeDlocEventErrX | def threeDLoc2XML(self): """ Returns output of 3dloc as xml file """ xml = Element("event") Sub(Sub(xml, "event_id"), "value").text = self.xmlEventID Sub(Sub(xml, "event_type"), "value").text = "manual" # we save P picks on Z-component and S picks on N-component # XXX standard values for unset keys!!!???!!!??? for i in range(len(self.streams)): if self.dicts[i].has_key('P'): pick = Sub(xml, "pick") wave = Sub(pick, "waveform") wave.set("networkCode", self.streams[i][0].stats.network) wave.set("stationCode", self.streams[i][0].stats.station) wave.set("channelCode", self.streams[i][0].stats.channel) wave.set("locationCode", "") date = Sub(pick, "time") # prepare time of pick picktime = self.streams[i][0].stats.starttime picktime += (self.dicts[i]['P'] / self.streams[i][0].stats.sampling_rate) Sub(date, "value").text = (picktime.isoformat() + '.%06i' % picktime.microsecond) if self.dicts[i].has_key('PErr1') and self.dicts[i].has_key('PErr2'): temp = float(self.dicts[i].has_key('PErr2') - self.dicts[i].has_key('PErr1')) temp /= self.streams[i][0].stats.sampling_rate Sub(date, "uncertainty").text = str(temp) else: Sub(date, "uncertainty") Sub(pick, "phaseHint").text = "P" if self.dicts[i].has_key('POnset'): if self.dicts[i]['POnset'] == 'impulsive': Sub(pick, "onset").text = 'impulsive' elif self.dicts[i]['POnset'] == 'emergent': Sub(pick, "onset").text = 'emergent' else: Sub(pick, "onset") if self.dicts[i].has_key('PPol'): if self.dicts[i]['PPol'] == 'Up' or self.dicts[i]['PPol'] == 'PoorUp': Sub(pick, "polarity").text = 'positive' elif self.dicts[i]['PPol'] == 'Down' or self.dicts[i]['PPol'] == 'PoorDown': Sub(pick, "polarity").text = 'negative' else: Sub(pick, "polarity") if self.dicts[i].has_key('PWeight'): Sub(pick, "weight").text = '%i' % self.dicts[i]['PWeight'] else: Sub(pick, "weight") Sub(Sub(pick, "min_amp"), "value").text = "0.00000" #XXX what is min_amp??? Sub(pick, "phase_compu").text = "IPU0" Sub(Sub(pick, "phase_res"), "value").text = "0.17000" Sub(Sub(pick, "phase_weight"), "value").text = "1.00000" Sub(Sub(pick, "phase_delay"), "value").text = "0.00000" Sub(Sub(pick, "azimuth"), "value").text = "1.922043" Sub(Sub(pick, "incident"), "value").text = "96.00000" Sub(Sub(pick, "epi_dist"), "value").text = "44.938843" Sub(Sub(pick, "hyp_dist"), "value").text = "45.30929" | 58ecfe19bef44aacd9e7b0124f02593f5139b455 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/58ecfe19bef44aacd9e7b0124f02593f5139b455/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8925,
40,
1333,
22,
4201,
12,
2890,
4672,
3536,
2860,
876,
434,
890,
72,
1829,
487,
2025,
585,
3536,
2025,
273,
225,
3010,
2932,
2575,
7923,
2592,
12,
1676,
12,
2902,
16,
315,
2575,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8925,
40,
1333,
22,
4201,
12,
2890,
4672,
3536,
2860,
876,
434,
890,
72,
1829,
487,
2025,
585,
3536,
2025,
273,
225,
3010,
2932,
2575,
7923,
2592,
12,
1676,
12,
2902,
16,
315,
2575,
67... |
return indent indentstr = y.get_base_indent_string() indent = len(indentstr.expandtabs(tabwidth)) extra_data = None if y.is_block_opener(): self.dprint("block opener") indent += indentwidth extra_data = "block opener" elif indent and y.is_block_closer(): self.dprint("block dedent") indent = ((indent-1)//indentwidth) * indentwidth extra_data = "block dedent" | else: indentstr = y.get_base_indent_string() indent = len(indentstr.expandtabs(tabwidth)) if y.is_block_opener(): self.dprint("block opener") indent += indentwidth extra_data = "block opener" elif indent and y.is_block_closer(): self.dprint("block dedent") indent = ((indent-1)//indentwidth) * indentwidth extra_data = "block dedent" | def findIndent(self, linenum, extra=None): """Find what indentation of the line should be based on previous lines Gets indentation of what the line containing pos should be, not taking into account any dedenting as a result of compound blocks like else, finally, etc. linenum: line number to find indentation extra: include extra syntactic info as a result of the parsing; whether the previous block included a return and was dedented, for instance. """ indentwidth = self.GetIndent() tabwidth = 87 indent = self.GetLineIndentation(linenum) y = PyParse.Parser(indentwidth, tabwidth) # FIXME: context line hack straight from IDLE for context in [50, 500, 5000000]: firstline = linenum - context if firstline < 0: firstline = 0 start = self.PositionFromLine(firstline) end = self.PositionFromLine(linenum) rawtext = self.GetTextRange(start, end)+"\n" y.set_str(rawtext) bod = y.find_good_parse_start(build_char_in_string_func(self, start)) if bod is not None or firstline == 0: break #dprint(rawtext) self.dprint("bod = %s" % bod) y.set_lo(bod or 0) | 82047ee8e5afb084bc4747739b8ad5b35d536e90 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11522/82047ee8e5afb084bc4747739b8ad5b35d536e90/python_mode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
7790,
12,
2890,
16,
4739,
7924,
16,
2870,
33,
7036,
4672,
3536,
3125,
4121,
12018,
434,
326,
980,
1410,
506,
2511,
603,
2416,
2362,
225,
11881,
12018,
434,
4121,
326,
980,
4191,
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,
1104,
7790,
12,
2890,
16,
4739,
7924,
16,
2870,
33,
7036,
4672,
3536,
3125,
4121,
12018,
434,
326,
980,
1410,
506,
2511,
603,
2416,
2362,
225,
11881,
12018,
434,
4121,
326,
980,
4191,
94... |
def get_version(self, force=0, ok_status=[256,0]): | def get_library_dirs(self): opt = ['/usr/lib/hpux64'] return opt def get_version(self, force=0, ok_status=[256,0,1]): | def get_version(self, force=0, ok_status=[256,0]): # XXX status==256 may indicate 'unrecognized option' or # 'no input file'. So, version_cmd needs more work. return FCompiler.get_version(self,force,ok_status) | 56d156240e0d7d65c443c01fff931aaa27b3cca4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14925/56d156240e0d7d65c443c01fff931aaa27b3cca4/hpux.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
12083,
67,
8291,
12,
2890,
4672,
2153,
273,
10228,
19,
13640,
19,
2941,
19,
15373,
2616,
1105,
3546,
327,
2153,
1652,
336,
67,
1589,
12,
2890,
16,
2944,
33,
20,
16,
1529,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
12083,
67,
8291,
12,
2890,
4672,
2153,
273,
10228,
19,
13640,
19,
2941,
19,
15373,
2616,
1105,
3546,
327,
2153,
1652,
336,
67,
1589,
12,
2890,
16,
2944,
33,
20,
16,
1529,
67,
... |
self.assertEquals(read_val, "sub_key", "Read subkey value wrong") | self.assertEquals(read_val, subkeystr, "Read subkey value wrong") | def ReadTestData(self, root_key): # Check we can get default value for this key. val = QueryValue(root_key, test_key_name) self.assertEquals(val, "Default value", "Registry didn't give back the correct value") | 27c230b00f34c7b812823e0eb8f7f9a484a40253 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/27c230b00f34c7b812823e0eb8f7f9a484a40253/test_winreg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2720,
4709,
751,
12,
2890,
16,
1365,
67,
856,
4672,
468,
2073,
732,
848,
336,
805,
460,
364,
333,
498,
18,
1244,
273,
2770,
620,
12,
3085,
67,
856,
16,
1842,
67,
856,
67,
529,
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,
2720,
4709,
751,
12,
2890,
16,
1365,
67,
856,
4672,
468,
2073,
732,
848,
336,
805,
460,
364,
333,
498,
18,
1244,
273,
2770,
620,
12,
3085,
67,
856,
16,
1842,
67,
856,
67,
529,
13,
... |
from copy import copy | def copy(self): """ Creates a copy of the graph. | 03718a00c191f63a2c80beffd2355020edae15d8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/03718a00c191f63a2c80beffd2355020edae15d8/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
4672,
3536,
10210,
279,
1610,
434,
326,
2667,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
4672,
3536,
10210,
279,
1610,
434,
326,
2667,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
'persistent', | def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() | e1701856be7d4ac40bdfa2f3f71b73ad7038e1ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9752/e1701856be7d4ac40bdfa2f3f71b73ad7038e1ca/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
30857,
86,
1973,
4672,
327,
1696,
12,
538,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
972,
768,
972,
3631,
380,
86,
1973,
13,
2934,
896,
1435,
225,
2,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
30857,
86,
1973,
4672,
327,
1696,
12,
538,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
972,
768,
972,
3631,
380,
86,
1973,
13,
2934,
896,
1435,
225,
2,
-100,
-100,
-100,... | |
self.preloadimg_next_pixbuf_original = None | self.preloadimg_next_in_list = -1 | def parse_action_command(self, command, batchmode): self.running_custom_actions = True self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) while gtk.events_pending(): gtk.main_iteration() self.curr_custom_action = 0 if batchmode == True: self.num_custom_actions = len(self.image_list) for i in range(self.num_custom_actions): self.curr_custom_action += 1 self.update_statusbar() while gtk.events_pending(): gtk.main_iteration() imagename = self.image_list[i] self.parse_action_command2(command, imagename) else: self.num_custom_actions = 1 self.curr_custom_action = 1 self.update_statusbar() while gtk.events_pending(): gtk.main_iteration() self.parse_action_command2(command, self.currimg_name) gc.collect() self.change_cursor(None) # Refresh the current image or any preloaded needed if they have changed: if os.path.exists(self.currimg_name) == False: self.currimg_pixbuf_original = None self.image_load_failed(False) else: animtest = gtk.gdk.PixbufAnimation(self.currimg_name) if animtest.is_static_image() == True: if self.images_are_different(animtest.get_static_image(), self.currimg_pixbuf_original): self.load_new_image(False, False, False, True, False) else: if self.images_are_different(animtest, self.currimg_pixbuf_original): self.load_new_image(False, False, False, True, False) self.running_custom_actions = False self.update_statusbar() while gtk.events_pending(): gtk.main_iteration() if os.path.exists(self.preloadimg_prev_name) == False: self.preloadimg_prev_pixbuf_original = None else: animtest = gtk.gdk.PixbufAnimation(self.preloadimg_prev_name) if animtest.is_static_image() == True: if self.images_are_different(animtest.get_static_image(), self.preloadimg_prev_pixbuf_original): self.preloadimg_prev_pixbuf_original = None self.preload_when_idle = gobject.idle_add(self.preload_prev_image, False) else: if self.images_are_different(animtest, self.preloadimg_prev_pixbuf_original): self.preloadimg_prev_pixbuf_original = None self.preload_when_idle = gobject.idle_add(self.preload_prev_image, False) if os.path.exists(self.preloadimg_next_name) == False: self.preloadimg_next_pixbuf_original = None else: animtest = gtk.gdk.PixbufAnimation(self.preloadimg_next_name) if animtest.is_static_image() == True: if self.images_are_different(animtest.get_static_image(), self.preloadimg_next_pixbuf_original): self.preloadimg_next_pixbuf_original = None self.preload_when_idle = gobject.idle_add(self.preload_next_image, False) else: if self.images_are_different(animtest, self.preloadimg_next_pixbuf_original): self.preloadimg_next_pixbuf_original = None self.preload_when_idle = gobject.idle_add(self.preload_next_image, False) | b2e5967bb60ec75f61407fa81eb48dca2dcd947b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/b2e5967bb60ec75f61407fa81eb48dca2dcd947b/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1128,
67,
3076,
12,
2890,
16,
1296,
16,
2581,
3188,
4672,
365,
18,
8704,
67,
3662,
67,
4905,
273,
1053,
365,
18,
3427,
67,
9216,
12,
4521,
79,
18,
75,
2883,
18,
6688,
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,
1109,
67,
1128,
67,
3076,
12,
2890,
16,
1296,
16,
2581,
3188,
4672,
365,
18,
8704,
67,
3662,
67,
4905,
273,
1053,
365,
18,
3427,
67,
9216,
12,
4521,
79,
18,
75,
2883,
18,
6688,
12,
... |
mov t2, t2, rsi, flags=(nCECF,), dataSize=1 | mov t2, t2, ah, flags=(nCECF,), dataSize=1 | def macroop IDIV_B_M | b0c5ff528b648321bf95ee8d50f126e7c0b4f8d0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7385/b0c5ff528b648321bf95ee8d50f126e7c0b4f8d0/multiply_and_divide.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
556,
1599,
8188,
67,
38,
67,
49,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11522,
556,
1599,
8188,
67,
38,
67,
49,
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,
... |
print 'yarr', os | print 'objects of type %s in the db: %r' % (self.model.__name__, os) | def create(self): #"""Test create action on controller""" | e2189e6688953a3fa55b840ab8d99c8bf3cd186c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12856/e2189e6688953a3fa55b840ab8d99c8bf3cd186c/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
4672,
468,
8395,
4709,
752,
1301,
603,
2596,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
4672,
468,
8395,
4709,
752,
1301,
603,
2596,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
line_to_write = "resource events " + tokenlist[2] + "0\n" | num_events = (tokenlist[2].split('.'))[0] line_to_write = "resource events " + str(num_events) + "0\n" | def main(): global configuration # Initialize the service logger. servicelogger.init('nodemanager') # ensure that only one instance is running at a time... gotlock = runonce.getprocesslock("seattlenodemanager") if gotlock == True: # I got the lock. All is well... pass else: if gotlock: servicelogger.log("[ERROR]:Another node manager process (pid: " + str(gotlock) + ") is running") else: servicelogger.log("[ERROR]:Another node manager process is running") return # I'll grab the necessary information first... servicelogger.log("[INFO]:Loading config") # BUG: Do this better? Is this the right way to engineer this? configuration = persist.restore_object("nodeman.cfg") ##BUG FIX: insuficient events. We patch each resource file once when node manager is started the first time. if not("patch_number_events" in configuration.keys()): #add the key and commit the change configuration["patch_number_events"] = "true" persist.commit_object(configuration, "nodeman.cfg") #modifcy the number of events in each resource file files_to_modify=glob.glob("resource.v*") for file_to_modify in files_to_modify: try: #write to this buffer file_write_buffer = "" for line in open(file_to_modify): tokenlist = line.split() if len(tokenlist) > 2 and tokenlist[0] == "resource" and tokenlist[1] == "events": line_to_write = "resource events " + tokenlist[2] + "0\n" #append a 0 to the number of events if len(tokenlist[2]) > 2: #if number of events is 3 digits or larger #use original line instead, do not change number of events line_to_write = line file_write_buffer = file_write_buffer + line_to_write else: file_write_buffer = file_write_buffer + line #now write the file outfo = open(file_to_modify,"w") print >> outfo, file_write_buffer outfo.close() except OSError, e: servicelogger.log("[ERROR]:Unable to patch events limit in resource file "+ file_to_modify + ", exception " + str(e)) # get the external IP address... # BUG: What if my external IP changes? (A problem throughout) vesseldict = nmrequesthandler.initialize(misc.getmyip(),configuration['publickey'],version) # Start accepter... myname = start_accepter() # Start worker thread... start_worker_thread(configuration['pollfrequency']) # Start advert thread... start_advert_thread(vesseldict, myname) # Start status thread... start_status_thread(vesseldict,configuration['pollfrequency']) # we should be all set up now. servicelogger.log("[INFO]:Started") # BUG: Need to exit all when we're being upgraded while True: if not is_accepter_started(): servicelogger.log("[WARN]:At " + str(time.time()) + " restarting accepter...") newname = start_accepter(vesseldict) # I have just updated the name for the advert thread... nmadvertise.myname = newname if not is_worker_thread_started(): servicelogger.log("[WARN]:At " + str(time.time()) + " restarting worker...") start_worker_thread(configuration['pollfrequency']) if should_start_waitable_thread('advert','Advertisement Thread'): servicelogger.log("[WARN]:At " + str(time.time()) + " restarting advert...") start_advert_thread(vesseldict,myname) if should_start_waitable_thread('status','Status Monitoring Thread'): servicelogger.log("[WARN]:At " + str(time.time()) + " restarting status...") start_status_thread(vesseldict,configuration['pollfrequency']) if not runonce.stillhaveprocesslock("seattlenodemanager"): servicelogger.log("[ERROR]:The node manager lost the process lock...") nonportable.harshexit(55) time.sleep(configuration['pollfrequency']) | eb5c645c5bd9e3637b41691626a3b9ceeb63a59c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/eb5c645c5bd9e3637b41691626a3b9ceeb63a59c/nmmain.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
225,
2552,
1664,
225,
468,
9190,
326,
1156,
1194,
18,
24658,
12970,
693,
18,
2738,
2668,
2159,
4181,
6134,
225,
468,
3387,
716,
1338,
1245,
791,
353,
3549,
622,
279,
813,
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,
2774,
13332,
225,
2552,
1664,
225,
468,
9190,
326,
1156,
1194,
18,
24658,
12970,
693,
18,
2738,
2668,
2159,
4181,
6134,
225,
468,
3387,
716,
1338,
1245,
791,
353,
3549,
622,
279,
813,
27... |
layout = pcs.Layout() | _layout = pcs.Layout() | def bounds(self, value): """Check the bounds of this field.""" | 090b0abb744f3b25c67db68d530c30f00d81fe64 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5910/090b0abb744f3b25c67db68d530c30f00d81fe64/igmpv3.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4972,
12,
2890,
16,
460,
4672,
3536,
1564,
326,
4972,
434,
333,
652,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4972,
12,
2890,
16,
460,
4672,
3536,
1564,
326,
4972,
434,
333,
652,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
replicaTupleList.append((lfn,pfn,se)) | replicaTupleList.append((lfn,pfn,se,'IGNORE')) | def addFile(self,fileTuple): """ A tuple should be supplied to this method which contains: (lfn,pfn,size,se,guid) A list of tuples may also be supplied. """ | a12efd16be85587de6b4ed08a71672d4890ceb0e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/a12efd16be85587de6b4ed08a71672d4890ceb0e/BookkeepingDBOldClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18671,
12,
2890,
16,
768,
9038,
4672,
3536,
432,
3193,
1410,
506,
4580,
358,
333,
707,
1492,
1914,
30,
261,
80,
4293,
16,
84,
4293,
16,
1467,
16,
307,
16,
14066,
13,
432,
666,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18671,
12,
2890,
16,
768,
9038,
4672,
3536,
432,
3193,
1410,
506,
4580,
358,
333,
707,
1492,
1914,
30,
261,
80,
4293,
16,
84,
4293,
16,
1467,
16,
307,
16,
14066,
13,
432,
666,
434,
1... |
token = atoms[0] | def build_subscript(builder, nb): """'.' '.' '.' | [test] ':' [test] [':' [test]] | test""" atoms = get_atoms(builder, nb) if isinstance(atoms[0], TokenObject) and atoms[0].name == tok.DOT: # Ellipsis: builder.push(ast.Ellipsis()) elif len(atoms) == 1: token = atoms[0] if isinstance(token, TokenObject) and token.name == tok.COLON: sliceinfos = [None, None, None] builder.push(SlicelistObject('slice', sliceinfos, None)) else: # test builder.push(atoms[0]) else: # elif len(atoms) > 1: items = [] sliceinfos = [None, None, None] infosindex = 0 subscript_type = 'subscript' for token in atoms: if isinstance(token, TokenObject): if token.name == tok.COLON: infosindex += 1 subscript_type = 'slice' # elif token.name == tok.COMMA: # subscript_type = 'subscript' else: items.append(token) sliceinfos[infosindex] = token else: items.append(token) sliceinfos[infosindex] = token if subscript_type == 'slice': if infosindex == 2: sliceobj_infos = [] for value in sliceinfos: if value is None: sliceobj_infos.append(ast.Const(builder.wrap_none())) else: sliceobj_infos.append(value) builder.push(SlicelistObject('sliceobj', sliceobj_infos, None)) else: builder.push(SlicelistObject('slice', sliceinfos, None)) else: builder.push(SubscriptObject('subscript', items, None)) | e9b09762c21706bd72240d2078b80f33f96fbc08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/e9b09762c21706bd72240d2078b80f33f96fbc08/astbuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
1717,
4263,
12,
9574,
16,
4264,
4672,
3536,
11,
1093,
2611,
2611,
571,
306,
3813,
65,
3921,
306,
3813,
65,
10228,
2497,
306,
3813,
13563,
571,
1842,
8395,
9006,
273,
336,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
1717,
4263,
12,
9574,
16,
4264,
4672,
3536,
11,
1093,
2611,
2611,
571,
306,
3813,
65,
3921,
306,
3813,
65,
10228,
2497,
306,
3813,
13563,
571,
1842,
8395,
9006,
273,
336,
67,
... | |
if (params is not None) : | if (params is None) : | def run2 (args, log=sys.stdout, check_params=True, params=None) : import iotbx.pdb.fetch parameter_interpreter = libtbx.phil.command_line.argument_interpreter( master_phil=master_phil, home_scope="") pdb_file = None cif_file = None sources = [] for arg in args : if os.path.isfile(arg) : if iotbx.pdb.is_pdb_file(arg) : pdb_files = os.path.abspath(arg) elif arg.endswith(".cif") or arg.endswith(".cif.txt") : cif_file = os.path.abspath(arg) else : try : user_phil = iotbx.phil.parse(file_name=arg) except RuntimeError : print "Unrecognizable file format for %s" % arg else : sources.append(user_phil) else : if arg.startswith("--") : arg = arg[2:] + "=True" try : user_phil = parameter_interpreter.process(arg=arg) sources.append(user_phil) except RuntimeError : print "Unrecognizable parameter %s" % arg if (params is not None) : params = master_phil.fetch(sources=sources).extract() symm = None if params.input.pdb_id is not None : params.input.pdb_file = iotbx.pdb.fetch.run(args=[params.input.pdb_id], log=log) params.input.cif_file = iotbx.pdb.fetch.run( args=["-x", params.input.pdb_id], log=log) symm = crystal_symmetry_from_any.extract_from(params.input.pdb_file) params.crystal_symmetry.space_group = symm.space_group_info() params.crystal_symmetry.unit_cell = symm.unit_cell() params.input.pdb_id = None if check_params : validate_params(params) if params.output_file_name is None : base, ext = os.path.splitext(params.input.cif_file) params.output_file_name = os.path.join(os.getcwd(), base + ".mtz") if not params.options.use_model : params.input.pdb_file = None if symm is None : assert (type(params.crystal_symmetry.space_group).__name__ == "space_group_info") symm = crystal.symmetry( space_group_info=params.crystal_symmetry.space_group, unit_cell=params.crystal_symmetry.unit_cell) n_refl = process_files( file_name=params.input.cif_file, crystal_symmetry=symm, pdb_file_name=params.input.pdb_file, output_file_name=params.output_file_name, wavelength_id=params.input.wavelength_id, crystal_id=params.input.crystal_id, show_details_if_error=params.options.show_details_if_error) return (params.output_file_name, n_refl) | fa87f202868d8571980c88325183c48077b11292 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/fa87f202868d8571980c88325183c48077b11292/cif_as_mtz.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
22,
261,
1968,
16,
613,
33,
9499,
18,
10283,
16,
866,
67,
2010,
33,
5510,
16,
859,
33,
7036,
13,
294,
1930,
30956,
70,
92,
18,
17414,
18,
5754,
1569,
67,
2761,
11599,
273,
2561... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
22,
261,
1968,
16,
613,
33,
9499,
18,
10283,
16,
866,
67,
2010,
33,
5510,
16,
859,
33,
7036,
13,
294,
1930,
30956,
70,
92,
18,
17414,
18,
5754,
1569,
67,
2761,
11599,
273,
2561... |
"([oO% | "([oO% | def get_relative_path(filename): """Attempt to get the path relative to cwd If 'filename' refers to a file or directory below the current working directory (cwd) then this function returns the relative path to cwd. Otherwise it returns 'filename'.""" pwd = os.getcwd() common_prefix = os.path.commonprefix([pwd,filename]) if common_prefix == pwd: # File is relative to cwd - strip off cwd and return return str(filename).replace(common_prefix,'',1).lstrip(os.sep) else: # File is not relative to cwd - return as is return filename | e1340f1bff904e82fb6a1fdf58de2ed7622eee81 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3290/e1340f1bff904e82fb6a1fdf58de2ed7622eee81/Xia2html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
11626,
67,
803,
12,
3459,
4672,
3536,
7744,
358,
336,
326,
589,
3632,
358,
7239,
225,
971,
296,
3459,
11,
21368,
358,
279,
585,
578,
1867,
5712,
326,
783,
5960,
1867,
261,
110... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11626,
67,
803,
12,
3459,
4672,
3536,
7744,
358,
336,
326,
589,
3632,
358,
7239,
225,
971,
296,
3459,
11,
21368,
358,
279,
585,
578,
1867,
5712,
326,
783,
5960,
1867,
261,
110... |
if not self.create_file(): | if not self.create_file(name=name, filepath=filepath): | def write_file(self, name=None, filepath=None): ''' Create and write a new data file. ''' | 0e050e94ffbca309e32c9f58cb7513eceb6942bf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6471/0e050e94ffbca309e32c9f58cb7513eceb6942bf/data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
768,
12,
2890,
16,
508,
33,
7036,
16,
3608,
33,
7036,
4672,
9163,
1788,
471,
1045,
279,
394,
501,
585,
18,
9163,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
768,
12,
2890,
16,
508,
33,
7036,
16,
3608,
33,
7036,
4672,
9163,
1788,
471,
1045,
279,
394,
501,
585,
18,
9163,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ui.warn("this use of init is deprecated: use \"hg clone\" instead\n") opts['no-update'] = not opts['update'] clone(ui, source, None, **opts) else: repo = hg.repository(ui, ".", create=1) | ui.warn("no longer supported: use \"hg clone\" instead\n") sys.exit(1) repo = hg.repository(ui, ".", create=1) | def init(ui, source=None, **opts): """create a new repository or (deprecated, use clone) copy an existing one""" if source: ui.warn("this use of init is deprecated: use \"hg clone\" instead\n") opts['no-update'] = not opts['update'] clone(ui, source, None, **opts) else: repo = hg.repository(ui, ".", create=1) | 91ebd24ce981f3d788d15fafa5cc1749975b32d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/91ebd24ce981f3d788d15fafa5cc1749975b32d2/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
4881,
16,
1084,
33,
7036,
16,
2826,
4952,
4672,
3536,
2640,
279,
394,
3352,
578,
261,
14089,
16,
999,
3236,
13,
1610,
392,
2062,
1245,
8395,
225,
309,
1084,
30,
5915,
18,
893... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
4881,
16,
1084,
33,
7036,
16,
2826,
4952,
4672,
3536,
2640,
279,
394,
3352,
578,
261,
14089,
16,
999,
3236,
13,
1610,
392,
2062,
1245,
8395,
225,
309,
1084,
30,
5915,
18,
893... |
self.failUnless(abs(vol-tgtVol)<1) | self.failUnless(abs(vol-tgtVol)<1,"%s %s"%(vol,tgtVol)) tgtVol=3.5 | def test6Chirality(self): # turn on chirality and we should get chiral volume that is pretty consistent and # positive tgtVol=14.0 smiles = "Cl[C@](C)(F)Br" mol = Chem.MolFromSmiles(smiles) cids = rdDistGeom.EmbedMultipleConfs(mol, 10, maxAttempts=30, randomSeed=100) self.failUnless(len(cids)==10) for cid in cids: conf = mol.GetConformer(cid) vol = computeChiralVol(conf.GetAtomPosition(0), conf.GetAtomPosition(2), conf.GetAtomPosition(3), conf.GetAtomPosition(4)) self.failUnless(abs(vol-tgtVol)<1) | 63184e5dce8d795f4b028607b5d95ecbf471c0c5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9195/63184e5dce8d795f4b028607b5d95ecbf471c0c5/testDistGeom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
26,
782,
481,
7919,
12,
2890,
4672,
468,
7005,
603,
462,
481,
7919,
471,
732,
1410,
336,
462,
481,
287,
3940,
716,
353,
7517,
11071,
471,
468,
6895,
11680,
17431,
33,
3461,
18,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
26,
782,
481,
7919,
12,
2890,
4672,
468,
7005,
603,
462,
481,
7919,
471,
732,
1410,
336,
462,
481,
287,
3940,
716,
353,
7517,
11071,
471,
468,
6895,
11680,
17431,
33,
3461,
18,
2... |
print "messages",messages print "oldmessages",oldmessages | def remoteInquiry(call,userdir,curr_user,config): import time,fcntl,errno,os # acquire lock lockfile=open(userdir+"received/inquiry_lock","w") try: try: # read directory contents fcntl.lockf(lockfile,fcntl.LOCK_EX | fcntl.LOCK_NB) # only one inquiry at a time! messages=os.listdir(userdir+"received/") messages=filter (lambda s: re.match("voice-.*\.la",s),messages) # only use voice-* files messages=map(lambda s: int(re.match("voice-([0-9]+)\.la",s).group(1)),messages) # filter out numbers messages.sort() # read the number of the message heard last at the last inquiry lastinquiry=-1 if (os.access(userdir+"received/last_inquiry",os.W_OK)): lastfile=open(userdir+"received/last_inquiry","r") lastinquiry=int(lastfile.readline()) lastfile.close() print lastinquiry # sort out old messages oldmessages=[] i=0 while (i<len(messages)): oldmessages.append(messages[i]) if (messages[i]<=lastinquiry): del messages[i] else: i+=1 print "messages",messages print "oldmessages",oldmessages cs_helpers.sayNumber(call,str(len(messages)),curr_user,config) if (len(messages)==1): capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"neue-nachricht.la"),1) else: capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"neue-nachrichten.la"),1) # menu for record new announcement cmd="" while (cmd not in ("1","9")): if (len(oldmessages)): capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"zum-abhoeren-1.la"),1) capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"fuer-neue-ansage-9.la"),1) cmd=capisuite.read_DTMF(call,0,1) if (cmd=="9"): newAnnouncement(call,userdir,curr_user,config) return # start inquiry for curr_msgs in (messages,oldmessages): cs_helpers.sayNumber(call,str(len(curr_msgs)),curr_user,config) if (curr_msgs==messages): if (len(curr_msgs)==1): capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"neue-nachricht.la"),1) else: capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"neue-nachrichten.la"),1) else: if (len(curr_msgs)==1): capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"nachricht.la"),1) else: capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"nachrichten.la"),1) i=0 while (i<len(curr_msgs)): filename=userdir+"received/voice-"+str(curr_msgs[i])+".la" descr=cs_helpers.readConfig(filename[:-2]+"txt") capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"nachricht.la"),1) cs_helpers.sayNumber(call,str(i+1),curr_user,config) if (descr.get('GLOBAL','call_from')!="??"): capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"von.la"),1) cs_helpers.sayNumber(call,descr.get('GLOBAL','call_from'),curr_user,config) if (descr.get('GLOBAL','call_to')!="??"): capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"fuer.la"),1) cs_helpers.sayNumber(call,descr.get('GLOBAL','call_to'),curr_user,config) capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"am.la"),1) calltime=time.strptime(descr.get('GLOBAL','time')) cs_helpers.sayNumber(call,str(calltime[2]),curr_user,config) capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"..la"),1) cs_helpers.sayNumber(call,str(calltime[1]),curr_user,config) capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"..la"),1) capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"um.la"),1) cs_helpers.sayNumber(call,str(calltime[3]),curr_user,config) capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"uhr.la"),1) cs_helpers.sayNumber(call,str(calltime[4]),curr_user,config) capisuite.audio_send(call,filename,1) cmd="" while (cmd not in ("1","4","5","6")): capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"erklaerung.la"),1) cmd=capisuite.read_DTMF(call,0,1) if (cmd=="1"): os.remove(filename) os.remove(filename[:-2]+"txt") if (curr_msgs==messages): # if we are in new message mode... oldmessages.remove(curr_msgs[i]) # ... don't forget to delete it in both lists del curr_msgs[i] capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"nachricht-gelscht.la")) elif (cmd=="4"): if (curr_msgs[i]>lastinquiry): lastinquiry=curr_msgs[i] lastfile=open(userdir+"received/last_inquiry","w") lastfile.write(str(curr_msgs[i])+"\n") lastfile.close() i+=1 elif (cmd=="5"): i-=1 capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"keine-weiteren-nachrichten.la")) except IOError,err: if (err.errno in (errno.EACCES,errno.EAGAIN)): capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"fernabfrage-aktiv.la")) finally: # unlock fcntl.lockf(lockfile,fcntl.LOCK_UN) lockfile.close() os.unlink(userdir+"received/inquiry_lock") | 3e51b37348be2783e891c90f90fc303acac55fb5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3251/3e51b37348be2783e891c90f90fc303acac55fb5/incoming.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2632,
382,
372,
6913,
12,
1991,
16,
1355,
1214,
16,
17016,
67,
1355,
16,
1425,
4672,
1930,
813,
16,
7142,
16681,
16,
19088,
16,
538,
468,
10533,
2176,
2176,
768,
33,
3190,
12,
1355,
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,
2632,
382,
372,
6913,
12,
1991,
16,
1355,
1214,
16,
17016,
67,
1355,
16,
1425,
4672,
1930,
813,
16,
7142,
16681,
16,
19088,
16,
538,
468,
10533,
2176,
2176,
768,
33,
3190,
12,
1355,
12... | |
self.__finite_field = rings.FiniteField(prime**2) | self.__finite_field = rings.FiniteField(prime**2,'a') | def __init__(self, prime=2, level=1, base_ring=rings.IntegerRing()): if WARN: print "Supersingular Module -- work in progress; use at own risk. (2006-08-08)" self.__prime = prime self.__finite_field = rings.FiniteField(prime**2) self.__level = level self.__hecke_matrices = {} hecke.HeckeModule_free_module.__init__( self, base_ring, prime*level, weight=2) | e6e6626021ad58c5841ccd38f11181ced39c8182 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/e6e6626021ad58c5841ccd38f11181ced39c8182/ssmod.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
17014,
33,
22,
16,
1801,
33,
21,
16,
1026,
67,
8022,
33,
86,
899,
18,
4522,
10369,
1435,
4672,
309,
20440,
30,
1172,
315,
3088,
414,
17830,
5924,
1493,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
17014,
33,
22,
16,
1801,
33,
21,
16,
1026,
67,
8022,
33,
86,
899,
18,
4522,
10369,
1435,
4672,
309,
20440,
30,
1172,
315,
3088,
414,
17830,
5924,
1493,
... |
tester('ntpath.split("\\\\conky\\mountpoint\\")', ('\\\\conky\\mountpoint\\', '')) | tester('ntpath.split("\\\\conky\\mountpoint\\")', ('\\\\conky\\mountpoint', '')) | def tester(fn, wantResult): fn = string.replace(fn, "\\", "\\\\") gotResult = eval(fn) if wantResult != gotResult: print "error!" print "evaluated: " + str(fn) print "should be: " + str(wantResult) print " returned: " + str(gotResult) print "" global errors errors = errors + 1 | 754dfbd207e5f65cc11d757aae86f5b3d51a1ff9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/754dfbd207e5f65cc11d757aae86f5b3d51a1ff9/test_ntpath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
7654,
12,
4293,
16,
2545,
1253,
4672,
2295,
273,
533,
18,
2079,
12,
4293,
16,
14520,
16,
28040,
2412,
13,
2363,
1253,
273,
5302,
12,
4293,
13,
309,
2545,
1253,
480,
2363,
1253,
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,
268,
7654,
12,
4293,
16,
2545,
1253,
4672,
2295,
273,
533,
18,
2079,
12,
4293,
16,
14520,
16,
28040,
2412,
13,
2363,
1253,
273,
5302,
12,
4293,
13,
309,
2545,
1253,
480,
2363,
1253,
30... |
self.frame.text.AppendText(_(u'\nFeedback report saved locally at: %s' % feedbackFile)) | self.frame.text.AppendText(_(u'\nFeedback report saved locally at: %(feedbackFile)s') \ % {'feedbackFile': feedbackFile}) | def logReport(self, feedbackXML, serverResponse): try: # chandler.log import logging logger = logging.getLogger(__name__) logger.info(serverResponse) # Extract the actual report ID. Response looks like this: # desktop feedback submission #2006-09-07T13-25-10.279322 successful. import re feedbackId = re.compile('^.*(\d{4}\-\d{2}\-\d{2}T\d{2}\-\d{2}\-\d{2}\.\d{6}).*$').match(serverResponse).group(1) # Show the ID so that users can report it in bugs etc. self.frame.text.AppendText(_(u'\nFeedback report ID: %s' % feedbackId)) # Log each report to a new file feedbackFile = os.path.join(Globals.options.profileDir, 'feedback-%s.xml' % feedbackId) f = open(feedbackFile, 'w') f.write(feedbackXML) f.close() | ffd3d5133fb1b58e0539b78d1e4fcf342f24bfda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/ffd3d5133fb1b58e0539b78d1e4fcf342f24bfda/feedback.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
4820,
12,
2890,
16,
10762,
4201,
16,
1438,
1064,
4672,
775,
30,
468,
462,
464,
749,
18,
1330,
1930,
2907,
1194,
273,
2907,
18,
588,
3328,
12,
972,
529,
972,
13,
1194,
18,
1376,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
4820,
12,
2890,
16,
10762,
4201,
16,
1438,
1064,
4672,
775,
30,
468,
462,
464,
749,
18,
1330,
1930,
2907,
1194,
273,
2907,
18,
588,
3328,
12,
972,
529,
972,
13,
1194,
18,
1376,
... |
0x2423: ur'\textvisiblespace{}', | def encode(self, text): """Return text with 'problematic' characters escaped. | 07582ee98106b8411e25807041a90debff843155 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8194/07582ee98106b8411e25807041a90debff843155/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
2890,
16,
977,
4672,
3536,
990,
977,
598,
296,
18968,
2126,
11,
3949,
8345,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
2890,
16,
977,
4672,
3536,
990,
977,
598,
296,
18968,
2126,
11,
3949,
8345,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
The second form returns an array of shape (m, n, ..., cov.shape[0]). In this case, output[i,j,...,:] is a 1-D array containing a multivariate normal.""" mean = Numeric.array(mean) cov = Numeric.array(cov) if len(mean.shape) != 1: raise ArgumentError, "mean must be 1 dimensional." if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]): raise ArgumentError, "cov must be 2 dimensional and square." if mean.shape[0] != cov.shape[0]: raise ArgumentError, "mean and cov must have same length." if isinstance(shape, int): shape = [shape] final_shape = list(shape[:]) final_shape.append(mean.shape[0]) x = standard_normal(Numeric.multiply.reduce(final_shape)) x.shape = (Numeric.multiply.reduce(final_shape[0:len(final_shape)-1]), mean.shape[0]) (u,s,v) = LinearAlgebra.singular_value_decomposition(cov) x = Numeric.matrixmultiply(x*Numeric.sqrt(s),v) Numeric.add(mean,x,x) x.shape = tuple(final_shape) return x | The first form returns a single 1-D array containing a multivariate normal. The second form returns an array of shape (m, n, ..., cov.shape[0]). In this case, output[i,j,...,:] is a 1-D array containing a multivariate normal. """ mean = Numeric.array(mean) cov = Numeric.array(cov) if size is None: shape = [] else: shape = size if len(mean.shape) != 1: raise ArgumentError, "mean must be 1 dimensional." if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]): raise ArgumentError, "cov must be 2 dimensional and square." if mean.shape[0] != cov.shape[0]: raise ArgumentError, "mean and cov must have same length." if isinstance(shape, int): shape = [shape] final_shape = list(shape[:]) final_shape.append(mean.shape[0]) x = standard_normal(Numeric.multiply.reduce(final_shape)) x.shape = (Numeric.multiply.reduce(final_shape[0:len(final_shape)-1]), mean.shape[0]) (u,s,v) = LinearAlgebra.singular_value_decomposition(cov) x = Numeric.matrixmultiply(x*Numeric.sqrt(s),v) Numeric.add(mean,x,x) x.shape = tuple(final_shape) return x | def multivariate_normal(mean, cov, shape=[]): """multivariate_normal(mean, cov) or multivariate_normal(mean, cov, [m, n, ...]) returns an array containing multivariate normally distributed random numbers with specified mean and covariance. mean must be a 1 dimensional array. cov must be a square two dimensional array with the same number of rows and columns as mean has elements. The first form returns a single 1-D array containing a multivariate normal. The second form returns an array of shape (m, n, ..., cov.shape[0]). In this case, output[i,j,...,:] is a 1-D array containing a multivariate normal.""" # Check preconditions on arguments mean = Numeric.array(mean) cov = Numeric.array(cov) if len(mean.shape) != 1: raise ArgumentError, "mean must be 1 dimensional." if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]): raise ArgumentError, "cov must be 2 dimensional and square." if mean.shape[0] != cov.shape[0]: raise ArgumentError, "mean and cov must have same length." # Compute shape of output if isinstance(shape, int): shape = [shape] final_shape = list(shape[:]) final_shape.append(mean.shape[0]) # Create a matrix of independent standard normally distributed random # numbers. The matrix has rows with the same length as mean and as # many rows are necessary to form a matrix of shape final_shape. x = standard_normal(Numeric.multiply.reduce(final_shape)) x.shape = (Numeric.multiply.reduce(final_shape[0:len(final_shape)-1]), mean.shape[0]) # Transform matrix of standard normals into matrix where each row # contains multivariate normals with the desired covariance. # Compute A such that matrixmultiply(transpose(A),A) == cov. # Then the matrix products of the rows of x and A has the desired # covariance. Note that sqrt(s)*v where (u,s,v) is the singular value # decomposition of cov is such an A. (u,s,v) = LinearAlgebra.singular_value_decomposition(cov) x = Numeric.matrixmultiply(x*Numeric.sqrt(s),v) # The rows of x now have the correct covariance but mean 0. Add # mean to each row. Then each row will have mean mean. Numeric.add(mean,x,x) x.shape = tuple(final_shape) return x | 9bb983356b5dc2f19a389befc72da89fafe4fef8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/9bb983356b5dc2f19a389befc72da89fafe4fef8/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1778,
27693,
67,
6130,
12,
7079,
16,
10613,
16,
2179,
33,
8526,
4672,
3536,
5421,
27693,
67,
6130,
12,
7079,
16,
10613,
13,
578,
1778,
27693,
67,
6130,
12,
7079,
16,
10613,
16,
306,
81... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1778,
27693,
67,
6130,
12,
7079,
16,
10613,
16,
2179,
33,
8526,
4672,
3536,
5421,
27693,
67,
6130,
12,
7079,
16,
10613,
13,
578,
1778,
27693,
67,
6130,
12,
7079,
16,
10613,
16,
306,
81... |
def dbusxx_xml2cpp_emitter(target, source, env): env.Depends(target, " return (target, source) | def dbusxx_xml2cpp_emitter(target, source, env): env.Depends(target, "#/external/dbus/dbusxx-xml2cpp" ) return (target, source) | 86aa03dfe6c1450e08be019aa7d9ee8e656e1c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11526/86aa03dfe6c1450e08be019aa7d9ee8e656e1c73/dbus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21866,
5279,
67,
2902,
22,
4057,
84,
67,
27529,
12,
3299,
16,
1084,
16,
1550,
4672,
1550,
18,
4584,
87,
12,
3299,
16,
6619,
19,
9375,
19,
1966,
407,
19,
1966,
407,
5279,
17,
2902,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21866,
5279,
67,
2902,
22,
4057,
84,
67,
27529,
12,
3299,
16,
1084,
16,
1550,
4672,
1550,
18,
4584,
87,
12,
3299,
16,
6619,
19,
9375,
19,
1966,
407,
19,
1966,
407,
5279,
17,
2902,
22... | |
subprocess.call(["python","manage.py","syncdb","--noinput"], cwd=str(omero_web), env = os.environ) | def web(self, args): args = Arguments(args) sys.stderr.write("Starting django... \n") omero_web = self.ctx.dir / "lib" / "python" / "omeroweb" subprocess.call(["python","manage.py","syncdb","--noinput"], cwd=str(omero_web), env = os.environ) # Now exec os.chdir(str(omero_web)) django = ["python","manage.py","runserver","--noreload"]+list(args) os.execvpe("python", django, os.environ) | d565618d54fc959a53167172c453eee377a8fc6f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12409/d565618d54fc959a53167172c453eee377a8fc6f/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3311,
12,
2890,
16,
833,
4672,
833,
273,
13599,
12,
1968,
13,
2589,
18,
11241,
18,
2626,
2932,
11715,
13710,
2777,
521,
82,
7923,
8068,
2439,
67,
4875,
273,
365,
18,
5900,
18,
1214,
34... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3311,
12,
2890,
16,
833,
4672,
833,
273,
13599,
12,
1968,
13,
2589,
18,
11241,
18,
2626,
2932,
11715,
13710,
2777,
521,
82,
7923,
8068,
2439,
67,
4875,
273,
365,
18,
5900,
18,
1214,
34... | |
A = np.dot(J.T,J) val = np.dot(V2,np.dot(A,V2)) res1 = np.dot(np.outer(V2,V2)/val,A) mk = np.dot(np.eye(Np1)-res1,np.dot(Bd,b)) | A = dot(J.T,J) val = dot(V2,dot(A,V2)) res1 = dot(np.outer(V2,V2)/val,A) mk = dot(np.eye(Np1)-res1,dot(Bd,b)) | def _find_smoothest2(xk, yk): N = len(xk)-1 Np1 = N+1 # find pseudo-inverse of B directly. Bd = np.empty((Np1,N)) for k in range(-N,N): if (k<0): l = np.arange(-k,Np1) v = (l+k+1) if ((k+1) % 2): v = -v else: l = np.arange(k,N) v = N-l if ((k % 2)): v = -v _setdiag(Bd,k,v) Bd /= (Np1) V2 = np.ones((Np1,)) V2[1::2] = -1 V2 /= math.sqrt(Np1) dk = np.diff(xk) b = 2*np.diff(yk)/dk J = np.zeros((N-1,N+1)) idk = 1.0/dk _setdiag(J,0,idk[:-1]) _setdiag(J,1,-idk[1:]-idk[:-1]) _setdiag(J,2,idk[1:]) A = np.dot(J.T,J) val = np.dot(V2,np.dot(A,V2)) res1 = np.dot(np.outer(V2,V2)/val,A) mk = np.dot(np.eye(Np1)-res1,np.dot(Bd,b)) return mk | 8bc5f1be89a559ce7e2cf0390ae819158ba045a1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/8bc5f1be89a559ce7e2cf0390ae819158ba045a1/interpolate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
67,
26647,
395,
22,
12,
92,
79,
16,
677,
79,
4672,
423,
273,
562,
12,
92,
79,
24950,
21,
423,
84,
21,
273,
423,
15,
21,
468,
1104,
12454,
17,
22552,
434,
605,
5122,
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,
389,
4720,
67,
26647,
395,
22,
12,
92,
79,
16,
677,
79,
4672,
423,
273,
562,
12,
92,
79,
24950,
21,
423,
84,
21,
273,
423,
15,
21,
468,
1104,
12454,
17,
22552,
434,
605,
5122,
18,
... |
Returns the centralizer of g in self. | Returns the centralizer of ``g`` in ``self``. | def centralizer(self, g): """ Returns the centralizer of g in self. | 2d077a3331069892dd585070aa02c876686672d2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/2d077a3331069892dd585070aa02c876686672d2/permgroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18291,
1824,
12,
2890,
16,
314,
4672,
3536,
2860,
326,
18291,
1824,
434,
314,
316,
365,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18291,
1824,
12,
2890,
16,
314,
4672,
3536,
2860,
326,
18291,
1824,
434,
314,
316,
365,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
return Apply(self, [ten4, neib_shape], [ten4.type()]) | return Apply(self, [ten4, neib_shape], [T.matrix(dtype=ten4.type.dtype)]) | def make_node(self, ten4, neib_shape): ten4 = T.as_tensor_variable(ten4) neib_shape = T.as_tensor_variable(neib_shape) return Apply(self, [ten4, neib_shape], [ten4.type()]) | 5b976b3ed6c8af9e1671f310455dfacb4696667c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/5b976b3ed6c8af9e1671f310455dfacb4696667c/neighbours.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
2159,
12,
2890,
16,
19572,
24,
16,
1073,
495,
67,
4867,
4672,
19572,
24,
273,
399,
18,
345,
67,
13720,
67,
6105,
12,
2253,
24,
13,
1073,
495,
67,
4867,
273,
399,
18,
345,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
2159,
12,
2890,
16,
19572,
24,
16,
1073,
495,
67,
4867,
4672,
19572,
24,
273,
399,
18,
345,
67,
13720,
67,
6105,
12,
2253,
24,
13,
1073,
495,
67,
4867,
273,
399,
18,
345,
... |
extra_args = ext.extra_link_args | extra_args = ext.extra_link_args or [] | def build_extensions (self): | f60bef333ef8ad447c5473c4762d823cc8b8b159 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f60bef333ef8ad447c5473c4762d823cc8b8b159/build_ext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
9489,
261,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
9489,
261,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
assert type(valType) == types.TypeType | def add_metadata(self, key, valType, notify=True): """Creates a new entry in the meta data registry. The data to set will be of the given 'type' type.""" assert type(valType) == types.TypeType | 32182ef0ddf273b9a6767e2866166bde311fe575 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11338/32182ef0ddf273b9a6767e2866166bde311fe575/metadatadict.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
4165,
12,
2890,
16,
498,
16,
1244,
559,
16,
5066,
33,
5510,
4672,
3536,
2729,
279,
394,
1241,
316,
326,
2191,
501,
4023,
18,
1021,
501,
358,
444,
903,
506,
434,
326,
864,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
4165,
12,
2890,
16,
498,
16,
1244,
559,
16,
5066,
33,
5510,
4672,
3536,
2729,
279,
394,
1241,
316,
326,
2191,
501,
4023,
18,
1021,
501,
358,
444,
903,
506,
434,
326,
864,
29... | |
self.queue = list(chars) + self.queue | l = list(chars) l.reverse() self.queue.extendleft(l) | def unget(self, chars): if chars: self.queue = list(chars) + self.queue #Alter the current line, col position for c in chars[::-1]: if c == '\n': self.line -= 1 self.col = self.lineLengths[self.line] else: self.col -= 1 | e59f8e67926398c5e4b75acbcce4e9410bc02e00 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4487/e59f8e67926398c5e4b75acbcce4e9410bc02e00/inputstream.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
588,
12,
2890,
16,
5230,
4672,
309,
5230,
30,
328,
273,
666,
12,
7549,
13,
328,
18,
9845,
1435,
365,
18,
4000,
18,
14313,
4482,
12,
80,
13,
468,
18144,
326,
783,
980,
16,
645,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
588,
12,
2890,
16,
5230,
4672,
309,
5230,
30,
328,
273,
666,
12,
7549,
13,
328,
18,
9845,
1435,
365,
18,
4000,
18,
14313,
4482,
12,
80,
13,
468,
18144,
326,
783,
980,
16,
645,
... |
def standardize_apart(sentence, dic): """Replace all the variables in sentence with new variables.""" if not isinstance(sentence, Expr): | def standardize_apart(sentence, dic={}): """Replace all the variables in sentence with new variables. >>> standardize_apart(expr('F(a, b, c) & G(c, A, 23)')) (F(V_1, V_2, V_3) & G(V_3, A, 23)) """ if not isinstance(sentence, Expr): | def standardize_apart(sentence, dic): """Replace all the variables in sentence with new variables.""" if not isinstance(sentence, Expr): return sentence elif is_var_symbol(sentence.op): if sentence in dic: return dic[sentence] else: standardize_apart.counter += 1 dic[sentence] = Expr('V_%d' % standardize-apart.counter) return dic[sentence] else: return Expr(sentence.op, *[standardize-apart(a, dic) for a in sentence.args]) | de8ded4ad513240273f1c4225688c69db0f6f179 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/16/de8ded4ad513240273f1c4225688c69db0f6f179/logic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4529,
554,
67,
438,
485,
12,
19335,
16,
11681,
12938,
4672,
3536,
5729,
777,
326,
3152,
316,
7515,
598,
394,
3152,
18,
4080,
4529,
554,
67,
438,
485,
12,
8638,
2668,
42,
12,
69,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4529,
554,
67,
438,
485,
12,
19335,
16,
11681,
12938,
4672,
3536,
5729,
777,
326,
3152,
316,
7515,
598,
394,
3152,
18,
4080,
4529,
554,
67,
438,
485,
12,
8638,
2668,
42,
12,
69,
16,
... |
self.action.get('context', '{}'))) | self.action.get('pyson_context', '{}'))) | def __init__(self, window, attrs=None): self.act_id = int(attrs['name']) self._window = window self.screen = None self.tree = None | eeb0c8c8fb0f2e1e50e9efcf641ff30642e4e8fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9151/eeb0c8c8fb0f2e1e50e9efcf641ff30642e4e8fa/action.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2742,
16,
3422,
33,
7036,
4672,
365,
18,
621,
67,
350,
273,
509,
12,
7039,
3292,
529,
19486,
365,
6315,
5668,
273,
2742,
365,
18,
9252,
273,
599,
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,
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,
2742,
16,
3422,
33,
7036,
4672,
365,
18,
621,
67,
350,
273,
509,
12,
7039,
3292,
529,
19486,
365,
6315,
5668,
273,
2742,
365,
18,
9252,
273,
599,
365,
... |
perms = self.user.getPermissions( self.isNew and field_type.createPermissions or field_type.permissions) | if self.isNew: permissions = field_type.createPermissions else: permissions = field_type.permissions perms = self.user.getPermissions(permissions) | def allowedFields(self, item): # assume item.type=='item' itemFieldsOrder = [] for field_name, field_type in item.fields.iteritems(): perms = self.user.getPermissions( self.isNew and field_type.createPermissions or field_type.permissions) if ('w' in perms or 'r' in perms) and \ not (self.isNew and field_type.omitForNew): itemFieldsOrder.append(field_name) return itemFieldsOrder | 24d0f7d50bb1c4df675747fc9e20a7ca4422e312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1871/24d0f7d50bb1c4df675747fc9e20a7ca4422e312/qEdit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2935,
2314,
12,
2890,
16,
761,
4672,
468,
6750,
761,
18,
723,
18920,
1726,
11,
761,
2314,
2448,
273,
5378,
364,
652,
67,
529,
16,
652,
67,
723,
316,
761,
18,
2821,
18,
2165,
3319,
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,
2935,
2314,
12,
2890,
16,
761,
4672,
468,
6750,
761,
18,
723,
18920,
1726,
11,
761,
2314,
2448,
273,
5378,
364,
652,
67,
529,
16,
652,
67,
723,
316,
761,
18,
2821,
18,
2165,
3319,
13... |
license=info.get('license', 'GPL-2'), | license='GPL-3', | def add_defaults(self): sdist.sdist.add_defaults(self) if self.distribution.has_pure_modules(): build_py = self.get_finalized_command('build_py') data = [] for package in build_py.packages: src_dir = build_py.get_package_dir(package) data.extend(build_py.find_data_files(package, src_dir)) self.filelist.extend(data) | e962815a2df60274884794d421cc70d89b36519a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9299/e962815a2df60274884794d421cc70d89b36519a/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
7606,
12,
2890,
4672,
272,
4413,
18,
87,
4413,
18,
1289,
67,
7606,
12,
2890,
13,
309,
365,
18,
16279,
18,
5332,
67,
84,
594,
67,
6400,
13332,
1361,
67,
2074,
273,
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,
527,
67,
7606,
12,
2890,
4672,
272,
4413,
18,
87,
4413,
18,
1289,
67,
7606,
12,
2890,
13,
309,
365,
18,
16279,
18,
5332,
67,
84,
594,
67,
6400,
13332,
1361,
67,
2074,
273,
365,
18,
... |
def iter_allocation_table(self): self.seek_cluster(self.master_region_cluster_count) for index in xrange(self.data_region_cluster_count): yield struct.unpack("I", self.f.read(4))[0] def claim_free_cluster(self): self.seek_cluster(self.master_region_cluster_count) for index in xrange(self.data_region_cluster_count): cluster = struct.unpack("I", self.f.read(4))[0] if cluster == CLUSTER_FREE: self.f.seek(-4, os.SEEK_CUR) self.f.write(struct.pack("I", CLUSTER_END_OF_CHAIN)) return index + self.master_region_cluster_count + self.allocation_table_cluster_count else: assert False, "Filesystem is full?" def first_data_region_cluster_number(self): return self.master_region_cluster_count + self.allocation_table_cluster_count def valid_data_region_cluster_number(self, clno): return self.first_data_region_cluster_number() \ <= clno \ < self.filesystem_cluster_count def seek_cluster_number(self, clno): assert self.valid_data_region_cluster_number(clno), clno self.safe_seek(self.cluster_size * self.master_region_cluster_count + 4 * (clno - self.first_data_region_cluster_number())) def set_cluster_number(self, clno, value): self.seek_cluster_number(clno) logging.debug("Setting cluster number %i->%i", clno, value) self.f.write(struct.pack("I", value)) | dirent_for_path = get_dir_entry | def get_dir_entry(self, path): for name in path.split("/"): if not name: cur_dirent = self.get_root_dir_entry() else: # pdb.set_trace() for dirent in self.read_directory(cur_dirent["inode"]): if dirent["name"].rstrip("\0") == name: cur_dirent = dirent break else: raise ClfsError(ENOENT) return cur_dirent | a2d8f4bc0f5dd94eba8767e5d77b1beb78415227 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4811/a2d8f4bc0f5dd94eba8767e5d77b1beb78415227/clfs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1214,
67,
4099,
12,
2890,
16,
589,
4672,
364,
508,
316,
589,
18,
4939,
2932,
4898,
4672,
309,
486,
508,
30,
662,
67,
3211,
547,
273,
365,
18,
588,
67,
3085,
67,
1214,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1214,
67,
4099,
12,
2890,
16,
589,
4672,
364,
508,
316,
589,
18,
4939,
2932,
4898,
4672,
309,
486,
508,
30,
662,
67,
3211,
547,
273,
365,
18,
588,
67,
3085,
67,
1214,
67,
... |
jdl = os.path.join( self.workDir, '%s.jdl' % jobDict['JobID'] ) | jdl = os.path.join( self.workDir, '%s' % jobDict['JobID'], '%s.jdl' % jobDict['JobID'] ) | def _prepareJDL(self, jobDict, pilotOptions, ceMask ): """ Write JDL for Pilot Submission """ # RB = List.randomize( self.resourceBrokers )[0] LDs = [] NSs = [] LBs = [] for RB in self.resourceBrokers: LDs.append( '"%s:9002"' % RB ) | b15337ded2e1853f743d32d0a70f93e7354ce220 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/b15337ded2e1853f743d32d0a70f93e7354ce220/Director.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9366,
46,
8914,
12,
2890,
16,
1719,
5014,
16,
293,
22797,
1320,
16,
5898,
5796,
262,
30,
3536,
2598,
804,
8914,
364,
453,
22797,
2592,
3951,
3536,
468,
534,
38,
273,
987,
18,
9188... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9366,
46,
8914,
12,
2890,
16,
1719,
5014,
16,
293,
22797,
1320,
16,
5898,
5796,
262,
30,
3536,
2598,
804,
8914,
364,
453,
22797,
2592,
3951,
3536,
468,
534,
38,
273,
987,
18,
9188... |
('Don't report any system messages. (Same as "--report=none".)', | ('Do not report any system messages. (Same as "--report=none".)', | def make_paths_absolute(dictionary, base_path=None): """ Interpret filesystem path settings relative to the `base_path` given. """ if base_path is None: base_path = os.getcwd() for option in relative_path_options: if dictionary.has_key(option) and dictionary[option]: dictionary[option] = os.path.normpath( os.path.join(base_path, dictionary[option])) | c1eee91b044d64f6b1aa8e5d3734f217d09b1839 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1532/c1eee91b044d64f6b1aa8e5d3734f217d09b1839/frontend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
4481,
67,
12547,
12,
15556,
16,
1026,
67,
803,
33,
7036,
4672,
3536,
5294,
15089,
6496,
589,
1947,
3632,
358,
326,
1375,
1969,
67,
803,
68,
864,
18,
3536,
309,
1026,
67,
803,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
4481,
67,
12547,
12,
15556,
16,
1026,
67,
803,
33,
7036,
4672,
3536,
5294,
15089,
6496,
589,
1947,
3632,
358,
326,
1375,
1969,
67,
803,
68,
864,
18,
3536,
309,
1026,
67,
803,... |
L = preparse_numeric_literals(L) | if numeric_literals: L = preparse_numeric_literals(L) | def preparse(line, reset=True, do_time=False, ignore_prompts=False): r""" EXAMPLES: sage: preparse("ZZ.<x> = ZZ['x']") "ZZ = ZZ['x']; (x,) = ZZ._first_ngens(1)" sage: preparse("ZZ.<x> = ZZ['y']") "ZZ = ZZ['y']; (x,) = ZZ._first_ngens(1)" sage: preparse("ZZ.<x,y> = ZZ[]") "ZZ = ZZ['x, y']; (x, y,) = ZZ._first_ngens(2)" sage: preparse("ZZ.<x,y> = ZZ['u,v']") "ZZ = ZZ['u,v']; (x, y,) = ZZ._first_ngens(2)" sage: preparse("ZZ.<x> = QQ[2^(1/3)]") 'ZZ = QQ[Integer(2)**(Integer(1)/Integer(3))]; (x,) = ZZ._first_ngens(1)' sage: QQ[2^(1/3)] Number Field in a with defining polynomial x^3 - 2 sage: preparse("a^b") 'a**b' sage: preparse("a^^b") 'a^b' sage: 8^1 8 sage: 8^^1 9 sage: 9^^1 8 sage: preparse("A \ B") 'A * BackslashOperator() * B' sage: preparse("A^2 \ B + C") 'A**Integer(2) * BackslashOperator() * B + C' sage: preparse("a \\ b \\") # There is really only one backslash here, it's just being escaped. 'a * BackslashOperator() * b \\' sage: preparse("time R.<x> = ZZ[]", do_time=True) '__time__=misc.cputime(); __wall__=misc.walltime(); R = ZZ[\'x\']; print "Time: CPU %.2f s, Wall: %.2f s"%(misc.cputime(__time__), misc.walltime(__wall__)); (x,) = R._first_ngens(1)' """ global quote_state if reset: quote_state = None L = line.lstrip() if len(L) > 0 and L[0] in ['#', '!']: return line if L.startswith('...'): i = line.find('...') return line[:i+3] + preparse(line[i+3:], reset=reset, do_time=do_time, ignore_prompts=ignore_prompts) if ignore_prompts: # Get rid of leading sage: and >>> so that pasting of examples from # the documentation works. line = strip_prompts(line) # This part handles lines with semi-colons all at once # Then can also handle multiple lines more efficiently, but # that optimization can be done later. L, literals, quote_state = strip_string_literals(line, quote_state) # Ellipsis Range # [1..n] try: L = parse_ellipsis(L, preparse_step=False) except SyntaxError: pass if implicit_mul_level: # Implicit Multiplication # 2x -> 2*x L = implicit_mul(L, level = implicit_mul_level) # Wrapping # 1 + 0.5 -> Integer(1) + RealNumber('0.5') L = preparse_numeric_literals(L) # Generators # R.0 -> R.gen(0) L = re.sub(r'([_a-zA-Z]\w*|[)\]])\.(\d+)', r'\1.gen(\2)', L) # Use ^ for exponentiation and ^^ for xor # (A side effect is that **** becomes xor as well.) L = L.replace('^', '**').replace('****', '^') # Make it easy to match statement ends L = ';%s;' % L.replace('\n', ';\n;') if do_time: # Separate time statement L = re.sub(r';(\s*)time +(\w)', r';time;\1\2', L) # Construction with generators # R.<...> = obj() # R.<...> = R[] L = preparse_generators(L) # Calculus functions # f(x,y) = x^3 - sin(y) L = preparse_calculus(L) # Backslash L = re.sub(r'''\\\s*([^\t ;#])''', r' * BackslashOperator() * \1', L) if do_time: # Time keyword L = re.sub(r';time;(\s*)(\S[^;]*)', r';\1__time__=misc.cputime(); __wall__=misc.walltime(); \2; print ' + '"Time: CPU %%.2f s, Wall: %%.2f s"%%(misc.cputime(__time__), misc.walltime(__wall__))', L) # Remove extra ;'s L = L.replace(';\n;', '\n')[1:-1] line = L % literals return line | 73f389d766bac29187d68a0320056e4911e01d57 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/73f389d766bac29187d68a0320056e4911e01d57/preparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
675,
2670,
12,
1369,
16,
2715,
33,
5510,
16,
741,
67,
957,
33,
8381,
16,
2305,
67,
17401,
1092,
33,
8381,
4672,
436,
8395,
5675,
8900,
11386,
30,
272,
410,
30,
675,
2670,
2932,
27096,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
675,
2670,
12,
1369,
16,
2715,
33,
5510,
16,
741,
67,
957,
33,
8381,
16,
2305,
67,
17401,
1092,
33,
8381,
4672,
436,
8395,
5675,
8900,
11386,
30,
272,
410,
30,
675,
2670,
2932,
27096,
... |
if type(cnf) == StringType: x = self.tk.split(self.tk.call( self._w, 'tag', 'configure', tagName, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call( (self._w, 'tag', 'configure', tagName) + self._options(cnf, kw)) | return self._configure(('tag', 'configure', tagName), cnf, kw) | def tag_configure(self, tagName, cnf={}, **kw): """Configure a tag TAGNAME.""" if type(cnf) == StringType: x = self.tk.split(self.tk.call( self._w, 'tag', 'configure', tagName, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call( (self._w, 'tag', 'configure', tagName) + self._options(cnf, kw)) | de0de912af2cf06056f14da80b65af88192c45a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/de0de912af2cf06056f14da80b65af88192c45a8/Tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1047,
67,
14895,
12,
2890,
16,
7196,
16,
23118,
28793,
2826,
9987,
4672,
3536,
11207,
279,
1047,
8358,
1985,
12123,
309,
618,
12,
10305,
74,
13,
422,
31570,
30,
619,
273,
365,
18,
16099,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1047,
67,
14895,
12,
2890,
16,
7196,
16,
23118,
28793,
2826,
9987,
4672,
3536,
11207,
279,
1047,
8358,
1985,
12123,
309,
618,
12,
10305,
74,
13,
422,
31570,
30,
619,
273,
365,
18,
16099,... |
delattr(repo, attr) | delattr(self, attr) | def invalidate(self): super(bookmark_repo, self).invalidate() for attr in ('_bookmarks', '_bookmarkcurrent'): if attr in self.__dict__: delattr(repo, attr) | 3e9d4476e4afb054bc2812dbb59ff8112fc83daa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/3e9d4476e4afb054bc2812dbb59ff8112fc83daa/bookmarks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11587,
12,
2890,
4672,
2240,
12,
3618,
3355,
67,
7422,
16,
365,
2934,
5387,
340,
1435,
364,
1604,
316,
7707,
67,
3618,
17439,
2187,
2070,
3618,
3355,
2972,
11,
4672,
309,
1604,
316,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11587,
12,
2890,
4672,
2240,
12,
3618,
3355,
67,
7422,
16,
365,
2934,
5387,
340,
1435,
364,
1604,
316,
7707,
67,
3618,
17439,
2187,
2070,
3618,
3355,
2972,
11,
4672,
309,
1604,
316,
365,... |
polynomial = polynomial.lift() | polynomial = S(polynomial.lift()) | def is_homogeneous(self, polynomial): r""" Check if ``polynomial`` is homogeneous. | 644fe21760dee35aeb3eed2dc035465241845f68 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/644fe21760dee35aeb3eed2dc035465241845f68/toric_variety.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
17125,
30075,
1481,
12,
2890,
16,
16991,
4672,
436,
8395,
2073,
309,
12176,
3915,
13602,
10335,
353,
13995,
30075,
1481,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
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,
353,
67,
17125,
30075,
1481,
12,
2890,
16,
16991,
4672,
436,
8395,
2073,
309,
12176,
3915,
13602,
10335,
353,
13995,
30075,
1481,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
f_val = self.id_get(cr, f_model, f_ref) | f_val = self.id_get(cr, f_ref) | def _tag_record(self, cr, rec, data_node=None): rec_model = rec.get("model").encode('ascii') model = self.pool.get(rec_model) assert model, "The model %s does not exist !" % (rec_model,) rec_id = rec.get("id",'').encode('ascii') rec_context = rec.get("context", None) if rec_context: rec_context = unsafe_eval(rec_context) self._test_xml_id(rec_id) if self.isnoupdate(data_node) and self.mode != 'init': # check if the xml record has an id string if rec_id: if '.' in rec_id: module,rec_id2 = rec_id.split('.') else: module = self.module rec_id2 = rec_id id = self.pool.get('ir.model.data')._update_dummy(cr, self.uid, rec_model, module, rec_id2) # check if the resource already existed at the last update if id: # if it existed, we don't update the data, but we need to # know the id of the existing record anyway self.idref[rec_id] = int(id) return None else: # if the resource didn't exist if not self.nodeattr2bool(rec, 'forcecreate', True): # we don't want to create it, so we skip it return None # else, we let the record to be created | 07a4bc7f3fdbd5f93ba4a066290ae65a3016075c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/07a4bc7f3fdbd5f93ba4a066290ae65a3016075c/convert.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2692,
67,
3366,
12,
2890,
16,
4422,
16,
1950,
16,
501,
67,
2159,
33,
7036,
4672,
1950,
67,
2284,
273,
1950,
18,
588,
2932,
2284,
20387,
3015,
2668,
9184,
6134,
938,
273,
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,
389,
2692,
67,
3366,
12,
2890,
16,
4422,
16,
1950,
16,
501,
67,
2159,
33,
7036,
4672,
1950,
67,
2284,
273,
1950,
18,
588,
2932,
2284,
20387,
3015,
2668,
9184,
6134,
938,
273,
365,
18,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.