rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
log.error('Error while parsing JSON data from server:', e
log.error('Error while parsing JSON data from server:', e)
def send_request(self, method, auth=False, **kw): """ Send a request to the server. The given method is called with any keyword parameters in **kw. If auth is True, then the request is made with an authenticated session cookie. """ url = self.baseURL + method + "/?tg_format=json"
5e29ca6e9083c2f95438d1a9f2ef1857134aee53 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9952/5e29ca6e9083c2f95438d1a9f2ef1857134aee53/client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 2293, 12, 2890, 16, 707, 16, 1357, 33, 8381, 16, 2826, 9987, 4672, 3536, 2479, 279, 590, 358, 326, 1438, 18, 225, 1021, 864, 707, 353, 2566, 598, 1281, 4932, 1472, 316, 2826,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 2293, 12, 2890, 16, 707, 16, 1357, 33, 8381, 16, 2826, 9987, 4672, 3536, 2479, 279, 590, 358, 326, 1438, 18, 225, 1021, 864, 707, 353, 2566, 598, 1281, 4932, 1472, 316, 2826,...
phenixout = phenixout, phenixout_url = phenixout_url)
phenixout = phenixout, phenixout_url = phenixout_url)
def Refmac5RefinementPrep(webtlsmdd, job_id, chain_ntls): """Called with a list of tuples (chain_id, ntls). Generates PDB and TLSIN files for refinement with REFMAC5. Returns a single string if there is an error, otherwise a dictionary of results is returned. """ struct_id = webtlsmdd.job_get_structure_id(job_id) analysis_dir = webtlsmdd.job_get_analysis_dir(job_id) analysis_base_url = webtlsmdd.job_get_analysis_base_url(job_id) if not os.path.isdir(analysis_dir): return "Job analysis directory does not exist" old_dir = os.getcwd() os.chdir(analysis_dir) ## input structure pdbin = "%s.pdb" % (struct_id) if not os.path.isfile(pdbin): pdbin = None for pdbx in glob.glob("*.pdb"): if len(pdbx) == 8: struct_id = pdbx[:4] pdbin = pdbx break if pdbin is None: os.chdir(old_dir) return "Input PDB File %s Not Found" % (pdbin) ## the per-chain TLSOUT files from TLSMD must be merged tlsins = [] for chain_id, ntls in chain_ntls: tlsin = "%s_CHAIN%s_NTLS%d.tlsout" % (struct_id, chain_id, ntls) if not os.path.isfile(tlsin): os.chdir(old_dir) return "Input TLSIN File %s Not Found" % (tlsin) tlsins.append(tlsin) ## form unique pdbout/tlsout filenames listx = [struct_id] #for chain_id, ntls in chain_ntls: # ## FIXME: Filename lengths must be less than 255 characters. # listx.append("CHAIN%s" % (chain_id)) # listx.append("NTLS%d" % (ntls)) # #listx.append("%s%d" % (chain_id, ntls)) #outbase ="_".join(listx) outbase = job_id pdbout = "%s.pdb" % (outbase) ## the tlsout from this program is going to be the tlsin ## for refinement, so it's important for the filename to have ## the tlsin extension so the user is not confused tlsout = "%s.tlsin" % (outbase) phenixout = "%s.phenix" % (outbase) ## PHENIX, Christoph Champ, 2007-11-06 ## make urls for linking pdbout_url = "%s/%s" % (analysis_base_url, pdbout) tlsout_url = "%s/%s" % (analysis_base_url, tlsout) phenixout_url = "%s/%s" % (analysis_base_url, phenixout) ## PHENIX, Christoph Champ, 2007-11-06 ## create the files tls_calcs.refmac5_prep(pdbin, tlsins, pdbout, tlsout) tls_calcs.phenix_prep(pdbin, tlsins, phenixout) ## PHENIX, Christoph Champ, 2007-11-06 os.chdir(old_dir) return dict(pdbout = pdbout, pdbout_url = pdbout_url, tlsout = tlsout, tlsout_url = tlsout_url, phenixout = phenixout, phenixout_url = phenixout_url)
0049fea0a8babe00b08f3932abf09fa0bc010db6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10674/0049fea0a8babe00b08f3932abf09fa0bc010db6/webtlsmdd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3941, 5821, 25, 426, 926, 820, 15543, 12, 4875, 17116, 81, 449, 16, 1719, 67, 350, 16, 2687, 67, 496, 3251, 4672, 3536, 8185, 598, 279, 666, 434, 10384, 261, 5639, 67, 350, 16, 9513, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3941, 5821, 25, 426, 926, 820, 15543, 12, 4875, 17116, 81, 449, 16, 1719, 67, 350, 16, 2687, 67, 496, 3251, 4672, 3536, 8185, 598, 279, 666, 434, 10384, 261, 5639, 67, 350, 16, 9513, ...
self.d.BringToFront() self.d.HideWindow()
self.w.BringToFront() self.w.HideWindow() del self.w
def __del__( self ): self.d.BringToFront() self.d.HideWindow() del self.d
784c61105343c2d4180128c382b65f48028dd8a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/784c61105343c2d4180128c382b65f48028dd8a3/EasyDialogs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 3771, 972, 12, 365, 262, 30, 365, 18, 91, 18, 38, 8022, 774, 9580, 1435, 365, 18, 91, 18, 15690, 3829, 1435, 1464, 365, 18, 91, 1464, 365, 18, 72, 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, 1001, 3771, 972, 12, 365, 262, 30, 365, 18, 91, 18, 38, 8022, 774, 9580, 1435, 365, 18, 91, 18, 15690, 3829, 1435, 1464, 365, 18, 91, 1464, 365, 18, 72, 225, 2, -100, -100, -100, -...
return xmldoc
return xmldoc
def populate_coinc_tables(xmldoc, UID, coinc_event_id_base, event_id_dict,\ CoincDef, detectors, \ process_id = 'process:process_id:0', \ coinc_def_id ='coinc_definer:coinc_def_id:0', \ time_slide_id = None, likelihood = None, \ nevents = 3): """ populate a set of coinc tables xmldoc: xml file to append the tables to CoincDef: pre-initialized CoincDef table row detectors: detectors participating in the coinc """ #make sure there's actually a coinc there to write if len(detectors) < 2: return xmldoc else: #CoincTable coinc_event_id = coinc_event_id_base + str(UID) coinc_table = lsctables.New(lsctables.CoincTable) xmldoc.childNodes[0].appendChild(coinc_table) row = coinc_table.RowType() row.process_id = process_id row.coinc_event_id = coinc_event_id #'coinc_inspiral:coinc_event_id:0' row.coinc_def_id = coinc_def_id row.time_slide_id = time_slide_id row.set_instruments(detectors) row.nevents = nevents row.likelihood = likelihood coinc_table.append(row) #CoincMapTable coinc_map_table = lsctables.New(lsctables.CoincMapTable) xmldoc.childNodes[0].appendChild(coinc_map_table) for ifo in detectors: row = coinc_map_table.RowType() row.coinc_event_id = coinc_event_id if 'inspiral' in CoincDef.search: row.table_name = lsctables.SnglInspiralTable.tableName.split(':')[0] elif 'burst' in CoincDef.search: row.table_name = lsctables.MultiBurstTable.tableName.split(':')[0] else: raise ValueError, "Unrecognize CoincDef.search" if event_id_dict: row.event_id = event_id_dict[ifo] coinc_map_table.append(row) if not event_id_dict: row.event_id = event_id_dict coinc_map_table.append(row) #CoincDefTable coinc_def_table = lsctables.New(lsctables.CoincDefTable) xmldoc.childNodes[0].appendChild(coinc_def_table) row = coinc_def_table.RowType() row.coinc_def_id = coinc_def_id row.search = CoincDef.search row.search_coinc_type = CoincDef.search_coinc_type row.description = CoincDef.description coinc_def_table.append(row) return xmldoc
eef4ba73b78b2df6877b14e65982a2b0927a899b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3589/eef4ba73b78b2df6877b14e65982a2b0927a899b/utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6490, 67, 12645, 71, 67, 9373, 12, 2902, 2434, 16, 10034, 16, 13170, 71, 67, 2575, 67, 350, 67, 1969, 16, 871, 67, 350, 67, 1576, 17211, 28932, 71, 3262, 16, 13826, 87, 16, 521, 1207...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6490, 67, 12645, 71, 67, 9373, 12, 2902, 2434, 16, 10034, 16, 13170, 71, 67, 2575, 67, 350, 67, 1969, 16, 871, 67, 350, 67, 1576, 17211, 28932, 71, 3262, 16, 13826, 87, 16, 521, 1207...
out, outshp = convolve2(kernvals, kshp, nkern, imgs, imshp, bsize, mode=mode, step=ss, unroll_batch=un_b, unroll_kern=un_k) return out
convop = ConvOp(imshp, kshp, nkern, bsize, ss[0], ss[1], output_mode=mode, unroll_batch=un_b, unroll_kern=un_k) return convop(imgs, kernvals)
def test_i(imgs): out, outshp = convolve2(kernvals, kshp, nkern, imgs, imshp, bsize, mode=mode, step=ss, unroll_batch=un_b, unroll_kern=un_k) return out
3b57cbf3352ec3d2563aadf39b06aaf959e8ad49 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/3b57cbf3352ec3d2563aadf39b06aaf959e8ad49/test_conv.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 77, 12, 381, 564, 4672, 596, 16, 596, 674, 84, 273, 6292, 5390, 22, 12, 79, 8865, 4524, 16, 417, 674, 84, 16, 29402, 8865, 16, 25646, 16, 709, 674, 84, 16, 324, 1467, 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, 1842, 67, 77, 12, 381, 564, 4672, 596, 16, 596, 674, 84, 273, 6292, 5390, 22, 12, 79, 8865, 4524, 16, 417, 674, 84, 16, 29402, 8865, 16, 25646, 16, 709, 674, 84, 16, 324, 1467, 16,...
self.__clean_previous_installs() self.__get_packages() self.__install_packages() self.__check_installed_binaries()
self._clean_previous_installs() self._get_packages() self._install_packages() self._check_installed_binaries()
def install(self): self.__clean_previous_installs() self.__get_packages() self.__install_packages() self.__check_installed_binaries() create_symlinks(test_bindir=self.test_bindir, bin_list=self.qemu_bin_paths) if self.load_modules: load_kvm_modules(load_stock=True, extra_modules=self.extra_modules)
af1538fa0992fc47a0e974597fc4ce7c48f4d4a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12268/af1538fa0992fc47a0e974597fc4ce7c48f4d4a8/build.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 12, 2890, 4672, 365, 6315, 6200, 67, 11515, 67, 5425, 87, 1435, 365, 6315, 588, 67, 10308, 1435, 365, 6315, 5425, 67, 10308, 1435, 365, 6315, 1893, 67, 13435, 67, 4757, 5646, 1435,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 12, 2890, 4672, 365, 6315, 6200, 67, 11515, 67, 5425, 87, 1435, 365, 6315, 588, 67, 10308, 1435, 365, 6315, 5425, 67, 10308, 1435, 365, 6315, 1893, 67, 13435, 67, 4757, 5646, 1435,...
weight, pkg1 = w, p
(weight, pkg1) = (w, p)
def breakUp(self, order): hard_requirements = [] for pkg in self.pkgs: for (p, req) in self.relations[pkg].pre.iteritems(): if req: hard_requirements.append((pkg, p)) # pick requirement to delete weights = {} # calculate minimal distance to a pre req for (pkg, nextpkg) in hard_requirements: # dijkstra edge = [nextpkg] weights[nextpkg] = 0 while edge: node = edge.pop() weight = weights[node] + 1 for (next_node, ishard) in self.relations[node].pre.iteritems(): if ishard: continue w = weights.get(next_node, None) if w is not None and w < weight: continue weights[next_node] = weight edge.append(next_node) edge.sort() edge.reverse() if weights: # get pkg with largest minimal distance weight = -1 for (p, w) in weights.iteritems(): if w > weight: weight, pkg2 = w, p # get the predesessor with largest minimal distance weight = -1 for p in self.relations[pkg2].post: w = weights[p] if w > weight: weight, pkg1 = w, p else: # search the relation that will most likely set a pkg free: # relations that are the last post (pre) of the start (end) pkg # are good, if there are lots of pre/post at the side # where the relation is the last it is even better # to make less relations better we use the negative values weight = None for p1 in self.pkgs: pre = len(self.relations[p1].pre) post = len(self.relations[p1].post) for p2 in self.relations[p1].pre.iterkeys(): pre2 = len(self.relations[p2].pre) post2 = len(self.relations[p2].post) if pre < post2: # start is more interesting w = (-pre, post, -post2, pre) elif pre > post2: # end is more interesting w = (-post2, pre2, -pre, post2) else: # == both same, add the numbers of per and post w = (-pre, post+pre2) if w > weight: # python handles comparison of tuples from left to # right (like strings) weight = w pkg1, pkg2 = p1, p2 if self.relations[pkg1].pre[pkg2]: print "Breaking pre requirement for %s: %s" % (pkg1.getNEVRA(), pkg2.getNEVRA()) # remove this requirement self.relations.removeRelation(pkg1, pkg2) # rebuild components components = ConnectedComponentsDetector(self.relations).detect(self.pkgs) for component in components: self.removeSubComponent(component) self.pkgs[component] = component # collect nodes self.processLeafNodes(order)
e88bd7c78ae123c185f17919515d68d29510e836 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1143/e88bd7c78ae123c185f17919515d68d29510e836/oldpyrpm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 898, 1211, 12, 2890, 16, 1353, 4672, 7877, 67, 16175, 273, 5378, 364, 3475, 316, 365, 18, 25376, 30, 364, 261, 84, 16, 1111, 13, 316, 365, 18, 15018, 63, 10657, 8009, 1484, 18, 2165, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 898, 1211, 12, 2890, 16, 1353, 4672, 7877, 67, 16175, 273, 5378, 364, 3475, 316, 365, 18, 25376, 30, 364, 261, 84, 16, 1111, 13, 316, 365, 18, 15018, 63, 10657, 8009, 1484, 18, 2165, ...
return CCompiler.get_version(force=force, ok_status=ok_status)
return CCompiler.get_version(self, force=force, ok_status=ok_status)
def get_version(self, force=False, ok_status=[0]): assert self._is_customised return CCompiler.get_version(force=force, ok_status=ok_status)
827bc405c59d98251055ea93e0a6392925d713a6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14925/827bc405c59d98251055ea93e0a6392925d713a6/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1589, 12, 2890, 16, 2944, 33, 8381, 16, 1529, 67, 2327, 22850, 20, 65, 4672, 1815, 365, 6315, 291, 67, 3662, 5918, 327, 385, 9213, 18, 588, 67, 1589, 12, 5734, 33, 5734, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1589, 12, 2890, 16, 2944, 33, 8381, 16, 1529, 67, 2327, 22850, 20, 65, 4672, 1815, 365, 6315, 291, 67, 3662, 5918, 327, 385, 9213, 18, 588, 67, 1589, 12, 5734, 33, 5734, 16,...
' width="100%" border="0">\n'
' width="100%%" border="0">\n'
def fixfile(inpath, input_lines, outfile): from email.Utils import parseaddr basename = os.path.basename(inpath) infile = iter(input_lines) # convert plain text pep to minimal XHTML markup print >> outfile, DTD print >> outfile, '<html>' print >> outfile, '<head>' # head header = [] pep = "" title = "" for line in infile: if not line.strip(): break if line[0].strip(): if ":" not in line: break key, value = line.split(":", 1) value = value.strip() header.append((key, value)) else: # continuation line key, value = header[-1] value = value + line header[-1] = key, value if key.lower() == "title": title = value elif key.lower() == "pep": pep = value if pep: title = "PEP " + pep + " -- " + title if title: print >> outfile, ' <title>%s</title>' % cgi.escape(title) r = random.choice(range(64)) print >> outfile, ( ' <link rel="STYLESHEET" href="style.css" type="text/css">\n' '</head>\n' '<body bgcolor="white" marginwidth="0" marginheight="0">\n' '<table class="navigation" cellpadding="0" cellspacing="0"\n' ' width="100%" border="0">\n' '<tr><td class="navicon" width="150" height="35">\n' '<a href="../" title="Python Home Page">\n' '<img src="../pics/PyBanner%03d.gif" alt="[Python]"\n' ' border="0" width="150" height="35" /></a></td>\n' '<td class="textlinks" align="left">\n' '[<b><a href="../">Python Home</a></b>]' % r) if basename <> 'pep-0000.txt': print >> outfile, '[<b><a href=".">PEP Index</a></b>]' if pep: print >> outfile, '[<b><a href="pep-%04d.txt">PEP Source</a></b>]' \ % int(pep) print >> outfile, '</td></tr></table>' print >> outfile, '<div class="header">\n<table border="0">' for k, v in header: if k.lower() in ('author', 'discussions-to'): mailtos = [] for part in re.split(',\s*', v): if '@' in part: realname, addr = parseaddr(part) if k.lower() == 'discussions-to': m = linkemail(addr, pep) else: m = fixemail(addr, pep) mailtos.append('%s &lt;%s&gt;' % (realname, m)) elif part.startswith('http:'): mailtos.append( '<a href="%s">%s</a>' % (part, part)) else: mailtos.append(part) v = COMMASPACE.join(mailtos) elif k.lower() in ('replaces', 'replaced-by', 'requires'): otherpeps = '' for otherpep in re.split(',?\s+', v): otherpep = int(otherpep) otherpeps += '<a href="pep-%04d.html">%i</a> ' % (otherpep, otherpep) v = otherpeps elif k.lower() in ('last-modified',): url = PEPCVSURL % int(pep) date = v or time.strftime('%d-%b-%Y', time.localtime(os.stat(inpath)[8])) v = '<a href="%s">%s</a> ' % (url, cgi.escape(date)) elif k.lower() in ('content-type',): url = PEPURL % 9 pep_type = v or 'text/plain' v = '<a href="%s">%s</a> ' % (url, cgi.escape(pep_type)) else: v = cgi.escape(v) print >> outfile, ' <tr><th>%s:&nbsp;</th><td>%s</td></tr>' \ % (cgi.escape(k), v) print >> outfile, '</table>' print >> outfile, '</div>' print >> outfile, '<hr />' print >> outfile, '<div class="content">' need_pre = 1 for line in infile: if line[0] == '\f': continue if line.strip() == LOCALVARS: break if line[0].strip(): if line.strip() == LOCALVARS: break if not need_pre: print >> outfile, '</pre>' print >> outfile, '<h3>%s</h3>' % line.strip() need_pre = 1 elif not line.strip() and need_pre: continue else: # PEP 0 has some special treatment if basename == 'pep-0000.txt': parts = line.split() if len(parts) > 1 and re.match(r'\s*\d{1,4}', parts[1]): # This is a PEP summary line, which we need to hyperlink url = PEPURL % int(parts[1]) if need_pre: print >> outfile, '<pre>' need_pre = 0 print >> outfile, re.sub( parts[1], '<a href="%s">%s</a>' % (url, parts[1]), line, 1), continue elif parts and '@' in parts[-1]: # This is a pep email address line, so filter it. url = fixemail(parts[-1], pep) if need_pre: print >> outfile, '<pre>' need_pre = 0 print >> outfile, re.sub( parts[-1], url, line, 1), continue line = fixpat.sub(lambda x, c=inpath: fixanchor(c, x), line) if need_pre: print >> outfile, '<pre>' need_pre = 0 outfile.write(line) if not need_pre: print >> outfile, '</pre>' print >> outfile, '</div>' print >> outfile, '</body>' print >> outfile, '</html>'
b4d326701e10e16ada7e3f9899dc5aa6c7be6380 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1532/b4d326701e10e16ada7e3f9899dc5aa6c7be6380/pep2html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2917, 768, 12, 267, 803, 16, 810, 67, 3548, 16, 8756, 4672, 628, 2699, 18, 1989, 1930, 1109, 4793, 4882, 273, 1140, 18, 803, 18, 13909, 12, 267, 803, 13, 14568, 273, 1400, 12, 2630, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2917, 768, 12, 267, 803, 16, 810, 67, 3548, 16, 8756, 4672, 628, 2699, 18, 1989, 1930, 1109, 4793, 4882, 273, 1140, 18, 803, 18, 13909, 12, 267, 803, 13, 14568, 273, 1400, 12, 2630, ...
if not executable(scriptfile): self.send_error(403, "CGI script is not executable (%s)" % `scriptname`) return nobody = nobody_uid()
ispy = self.is_python(scriptname) if not ispy: if not (self.have_fork or self.have_popen2): self.send_error(403, "CGI script is not a Python script (%s)" % `scriptname`) return if not self.is_executable(scriptfile): self.send_error(403, "CGI script is not executable (%s)" % `scriptname`) return env = {} env['SERVER_SOFTWARE'] = self.version_string() env['SERVER_NAME'] = self.server.server_name env['GATEWAY_INTERFACE'] = 'CGI/1.1' env['SERVER_PROTOCOL'] = self.protocol_version env['SERVER_PORT'] = str(self.server.server_port) env['REQUEST_METHOD'] = self.command uqrest = urllib.unquote(rest) env['PATH_INFO'] = uqrest env['PATH_TRANSLATED'] = self.translate_path(uqrest) env['SCRIPT_NAME'] = scriptname if query: env['QUERY_STRING'] = query host = self.address_string() if host != self.client_address[0]: env['REMOTE_HOST'] = host env['REMOTE_ADDR'] = self.client_address[0] if self.headers.typeheader is None: env['CONTENT_TYPE'] = self.headers.type else: env['CONTENT_TYPE'] = self.headers.typeheader length = self.headers.getheader('content-length') if length: env['CONTENT_LENGTH'] = length accept = [] for line in self.headers.getallmatchingheaders('accept'): if line[:1] in string.whitespace: accept.append(string.strip(line)) else: accept = accept + string.split(line[7:], ',') env['HTTP_ACCEPT'] = string.joinfields(accept, ',') ua = self.headers.getheader('user-agent') if ua: env['HTTP_USER_AGENT'] = ua co = filter(None, self.headers.getheaders('cookie')) if co: env['HTTP_COOKIE'] = string.join(co, ', ') if not self.have_fork: for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH', 'HTTP_USER_AGENT', 'HTTP_COOKIE'): env.setdefault(k, "")
def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = string.rfind(rest, '?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = string.find(rest, '/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.translate_path(scriptname) if not os.path.exists(scriptfile): self.send_error(404, "No such CGI script (%s)" % `scriptname`) return if not os.path.isfile(scriptfile): self.send_error(403, "CGI script is not a plain file (%s)" % `scriptname`) return if not executable(scriptfile): self.send_error(403, "CGI script is not executable (%s)" % `scriptname`) return nobody = nobody_uid() self.send_response(200, "Script output follows") self.wfile.flush() # Always flush before forking pid = os.fork() if pid != 0: # Parent pid, sts = os.waitpid(pid, 0) if sts: self.log_error("CGI script exit status x%x" % sts) return # Child try: # Reference: http://hoohoo.ncsa.uiuc.edu/cgi/env.html # XXX Much of the following could be prepared ahead of time! env = {} env['SERVER_SOFTWARE'] = self.version_string() env['SERVER_NAME'] = self.server.server_name env['GATEWAY_INTERFACE'] = 'CGI/1.1' env['SERVER_PROTOCOL'] = self.protocol_version env['SERVER_PORT'] = str(self.server.server_port) env['REQUEST_METHOD'] = self.command uqrest = urllib.unquote(rest) env['PATH_INFO'] = uqrest env['PATH_TRANSLATED'] = self.translate_path(uqrest) env['SCRIPT_NAME'] = scriptname if query: env['QUERY_STRING'] = query host = self.address_string() if host != self.client_address[0]: env['REMOTE_HOST'] = host env['REMOTE_ADDR'] = self.client_address[0] # AUTH_TYPE # REMOTE_USER # REMOTE_IDENT if self.headers.typeheader is None: env['CONTENT_TYPE'] = self.headers.type else: env['CONTENT_TYPE'] = self.headers.typeheader length = self.headers.getheader('content-length') if length: env['CONTENT_LENGTH'] = length accept = [] for line in self.headers.getallmatchingheaders('accept'): if line[:1] in string.whitespace: accept.append(string.strip(line)) else: accept = accept + string.split(line[7:], ',') env['HTTP_ACCEPT'] = string.joinfields(accept, ',') ua = self.headers.getheader('user-agent') if ua: env['HTTP_USER_AGENT'] = ua co = filter(None, self.headers.getheaders('cookie')) if co: env['HTTP_COOKIE'] = string.join(co, ', ') # XXX Other HTTP_* headers decoded_query = string.replace(query, '+', ' ') try: os.setuid(nobody) except os.error: pass os.dup2(self.rfile.fileno(), 0) os.dup2(self.wfile.fileno(), 1) print scriptfile, script, decoded_query os.execve(scriptfile, [script, decoded_query], env) except: self.server.handle_error(self.request, self.client_address) os._exit(127)
a7951a78f088ca07278088e12e6477ba11998848 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a7951a78f088ca07278088e12e6477ba11998848/CGIHTTPServer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 19062, 12, 2890, 4672, 3536, 5289, 279, 385, 13797, 2728, 12123, 1577, 16, 3127, 273, 365, 18, 19062, 67, 1376, 277, 273, 533, 18, 86, 4720, 12, 8792, 16, 6787, 13, 309, 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, 1086, 67, 19062, 12, 2890, 4672, 3536, 5289, 279, 385, 13797, 2728, 12123, 1577, 16, 3127, 273, 365, 18, 19062, 67, 1376, 277, 273, 533, 18, 86, 4720, 12, 8792, 16, 6787, 13, 309, 277,...
def __init__(self, **kwargs): self.title = "default" self.branch = "" self.currentDate = "" if 'build' in kwargs: self.title = kwargs['build'].slavename self.changes = kwargs['build'].source.changes self.buildid = strftime("%Y%m%d%H%M", localtime(self.changes[-1].when)) if 'branch' in kwargs: self.branch = kwargs['branch'] assert 'configPath' in kwargs
def __init__(self, **kwargs): self.addOptions = [] assert 'build' in kwargs
def evaluateCommand(self, cmd): superResult = ShellCommand.evaluateCommand(self, cmd) if SUCCESS != superResult: return FAILURE if None != re.search('ERROR', cmd.logs['stdio'].getText()): return FAILURE if None != re.search('Usage:', cmd.logs['stdio'].getText()): return FAILURE return SUCCESS
89803d5eaff0f75cee1a4b76480c5468a10f40d3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13067/89803d5eaff0f75cee1a4b76480c5468a10f40d3/perfrunner.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5956, 2189, 12, 2890, 16, 1797, 4672, 2240, 1253, 273, 19433, 2189, 18, 21024, 2189, 12, 2890, 16, 1797, 13, 309, 16561, 480, 2240, 1253, 30, 327, 24077, 309, 599, 480, 283, 18, 3072, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5956, 2189, 12, 2890, 16, 1797, 4672, 2240, 1253, 273, 19433, 2189, 18, 21024, 2189, 12, 2890, 16, 1797, 13, 309, 16561, 480, 2240, 1253, 30, 327, 24077, 309, 599, 480, 283, 18, 3072, ...
gLogger.error(errStr,lfn) return S_ERROR(errStr)
gLogger.error( errStr, lfn ) return S_ERROR( errStr )
def putAndRegister(self,lfn,file,diracSE,guid=None,path=None,checksum=None,catalog=None): """ Put a local file to a Storage Element and register in the File Catalogues
9fabceb719d19d46d8b75011d2932552dbe360f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9fabceb719d19d46d8b75011d2932552dbe360f9/ReplicaManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1378, 1876, 3996, 12, 2890, 16, 80, 4293, 16, 768, 16, 3211, 8836, 1090, 16, 14066, 33, 7036, 16, 803, 33, 7036, 16, 15149, 33, 7036, 16, 7199, 33, 7036, 4672, 3536, 4399, 279, 1191, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1378, 1876, 3996, 12, 2890, 16, 80, 4293, 16, 768, 16, 3211, 8836, 1090, 16, 14066, 33, 7036, 16, 803, 33, 7036, 16, 15149, 33, 7036, 16, 7199, 33, 7036, 4672, 3536, 4399, 279, 1191, ...
patterns = {r'(.*)_([0-9]*)\.(.*)':'%s_%s.%s', r'([^\.]*)\.([0-9]+)':'%s.%s%s',
patterns = {r'([^\.]*)\.([0-9]+)':'%s.%s%s', r'(.*)_([0-9]*)\.(.*)':'%s_%s.%s',
def image2template(filename): '''Return a template to match this filename.''' # check that the file name doesn't contain anything mysterious if filename.count('#'): raise RuntimeError, '# characters in filename' # the patterns in the order I want to test them pattern_keys = [r'(.*)_([0-9]*)\.(.*)', r'([^\.]*)\.([0-9]+)', r'(.*?)([0-9]*)\.(.*)'] # patterns is a dictionary of possible regular expressions with # the format strings to put the file name back together patterns = {r'(.*)_([0-9]*)\.(.*)':'%s_%s.%s', r'([^\.]*)\.([0-9]+)':'%s.%s%s', r'(.*?)([0-9]*)\.(.*)':'%s%s.%s'} for pattern in pattern_keys: match = re.compile(pattern).match(filename) if match: prefix = match.group(1) number = match.group(2) try: exten = match.group(3) except: exten = '' for digit in string.digits: number = number.replace(digit, '#') return patterns[pattern] % (prefix, number, exten) raise RuntimeError, 'filename %s not understood as a template' % \ filename
1c4943d902d9054aa693637949c54b1cb8ca8dda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3290/1c4943d902d9054aa693637949c54b1cb8ca8dda/FindImages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1316, 22, 3202, 12, 3459, 4672, 9163, 990, 279, 1542, 358, 845, 333, 1544, 1093, 6309, 225, 468, 866, 716, 326, 585, 508, 3302, 1404, 912, 6967, 312, 1094, 264, 22774, 309, 1544, 18, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1316, 22, 3202, 12, 3459, 4672, 9163, 990, 279, 1542, 358, 845, 333, 1544, 1093, 6309, 225, 468, 866, 716, 326, 585, 508, 3302, 1404, 912, 6967, 312, 1094, 264, 22774, 309, 1544, 18, 1...
if dc is 'dmd': env.Append(LIBS = ['phobos']) elif dc is 'gdmd': env.Append(LIBS = ['gphobos'])
if dc is 'dmd': env.Append(LIBS = ['phobos']) elif dc is 'gdmd': env.Append(LIBS = ['gphobos'])
def _smartLink(source, target, env, for_signature, defaultLinker=linkcom): if isD(source): try: libs = env['LIBS'] except KeyError: libs = [] if 'phobos' not in libs:
1b995caec70d7bf4ede2ebaee5e9af65350f61ec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12817/1b995caec70d7bf4ede2ebaee5e9af65350f61ec/dmd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 26416, 2098, 12, 3168, 16, 1018, 16, 1550, 16, 364, 67, 8195, 16, 805, 2098, 264, 33, 1232, 832, 4672, 309, 353, 40, 12, 3168, 4672, 775, 30, 15042, 273, 1550, 3292, 2053, 12692, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 26416, 2098, 12, 3168, 16, 1018, 16, 1550, 16, 364, 67, 8195, 16, 805, 2098, 264, 33, 1232, 832, 4672, 309, 353, 40, 12, 3168, 4672, 775, 30, 15042, 273, 1550, 3292, 2053, 12692, ...
languages = util.getLanguageListing()
languages = util.getLanguageListing(combined=use_combined)
def languages(self): """Vocabulary method for the language field """ util = None # Try the utility first if HAS_PLONE_I18N: util = queryUtility(IMetadataLanguageAvailability) # Fall back to acquiring availableLanguages if util is None: languages = getattr(self, 'availableLanguages', None) if callable(languages): languages = languages() # Fall back to static definition if languages is None: return DisplayList( (('en','English'), ('fr','French'), ('es','Spanish'), ('pt','Portuguese'), ('ru','Russian'))) else: languages = util.getLanguageListing() languages.sort(key=lambda x:x[1]) # Put language neutral at the top. languages.insert(0,(u'',_(u'Language neutral'))) return DisplayList(languages)
570a7d28e6278bf2baedca13b95dcb26bb185a77 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12165/570a7d28e6278bf2baedca13b95dcb26bb185a77/ExtensibleMetadata.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8191, 12, 2890, 4672, 3536, 30747, 707, 364, 326, 2653, 652, 3536, 1709, 273, 599, 468, 6161, 326, 12788, 1122, 309, 21641, 67, 6253, 5998, 67, 45, 2643, 50, 30, 1709, 273, 843, 6497, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8191, 12, 2890, 4672, 3536, 30747, 707, 364, 326, 2653, 652, 3536, 1709, 273, 599, 468, 6161, 326, 12788, 1122, 309, 21641, 67, 6253, 5998, 67, 45, 2643, 50, 30, 1709, 273, 843, 6497, ...
self._filenode = node elif self._fileid:
self._filenode = self._changectx.filenode(self._path) else:
def __init__(self, repo, path, changeid=None, fileid=None): """changeid can be a changeset revision, node, or tag. fileid can be a file revision or node.""" self._repo = repo self._path = path self._id = changeid self._fileid = fileid
5fde7534a11ea9e7fff05a74aed2f6ace16f849e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/5fde7534a11ea9e7fff05a74aed2f6ace16f849e/context.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 3538, 16, 589, 16, 2549, 350, 33, 7036, 16, 585, 350, 33, 7036, 4672, 3536, 3427, 350, 848, 506, 279, 22463, 6350, 16, 756, 16, 578, 1047, 18, 585, 350...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3538, 16, 589, 16, 2549, 350, 33, 7036, 16, 585, 350, 33, 7036, 4672, 3536, 3427, 350, 848, 506, 279, 22463, 6350, 16, 756, 16, 578, 1047, 18, 585, 350...
for char in ( ':', '?', '<', '>', '|', '*', '\\', '/', '"', '\'', ' ', '%'):
for char in ( ':', '?', '<', '>', '|', '*', '\\', '/', '"', '\'', '%'):
def cleanFilename(filename): """Given either a filename or a unicode "filename" return a valid clean version of it """ for char in ( ':', '?', '<', '>', '|', '*', '\\', '/', '"', '\'', ' ', '%'): filename = filename.replace(char, '') if len(filename) == 0: return unicodeToFilename(u'_') if len(filename) > MAX_FILENAME_LENGTH: base, ext = os.path.splitext(filename) ext = ext[:MAX_FILENAME_EXTENSION_LENGTH] base = base[:MAX_FILENAME_LENGTH-len(ext)] filename = base + ext if type(filename) == str: return unicodeToFilename(filename.decode('ascii', 'replace')) else: return unicodeToFilename(filename)
084887ee06e7969be354be56e18c1601c1844b77 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/084887ee06e7969be354be56e18c1601c1844b77/download_utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2721, 5359, 12, 3459, 4672, 3536, 6083, 3344, 279, 1544, 578, 279, 5252, 315, 3459, 6, 327, 279, 923, 2721, 1177, 434, 518, 3536, 364, 1149, 316, 261, 4290, 2187, 13023, 2187, 2368, 2187...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2721, 5359, 12, 3459, 4672, 3536, 6083, 3344, 279, 1544, 578, 279, 5252, 315, 3459, 6, 327, 279, 923, 2721, 1177, 434, 518, 3536, 364, 1149, 316, 261, 4290, 2187, 13023, 2187, 2368, 2187...
quantity = quantity,
quantity = str(quantity),
def setTotal(self, startdate, enddate, quantity): ''' Update the forecast quantity. The logic followed is three-fold: - If one or more forecast entries already exist in the daterange, the quantities of those entries are proportionally rescaled to fit the new quantity. - If no forecast entries exist yet, we create a new set of entries based on the bucket definition of the forecast calendar. This respects the weight ratios as defined in the calendar buckets. - In case no calendar or no calendar buckets can be identified, we simply create a single forecast entry for the specified daterange. ''' # Assure the end date is later than the start date. if startdate > enddate: tmp = startdate startdate = enddate enddate = tmp # Assure the type of the quantity if not isinstance(quantity,Decimal): quantity = Decimal(str(quantity)) # Round the quantity, if discrete flag is on if self.discrete: quantity = quantity.to_integral() # Step 0: Check for forecast entries intersecting with the current daterange startdate = startdate.date() enddate = enddate.date() entries = self.entries.filter(enddate__gt=startdate).filter(startdate__lt=enddate) if entries: # Case 1: Entries already exist in this daterange, which will be rescaled # Case 1, step 1: calculate current quantity and "clip" the existing entries # if required. current = 0 for i in entries: # Calculate the length of this bucket in seconds duration = i.enddate - i.startdate duration = duration.days+86400*duration.seconds if i.startdate == startdate and i.enddate == enddate: # This entry has exactly the same daterange: update the quantity and exit i.quantity = quantity i.save() return elif i.startdate < startdate and i.enddate > enddate: # This bucket starts before the daterange and also ends later. # We need to split the entry in three. # Part one: after our daterange, create a new entry p = i.enddate - enddate q = i.quantity * (p.days+86400*p.seconds) / duration if self.discrete: q = round(q) self.entries.create( \ startdate = enddate, enddate = i.enddate, quantity = q, ).save() # Part two: our date range, create a new entry self.entries.create( \ startdate = startdate, enddate = enddate, quantity = quantity, ).save() # Part three: before our daterange, update the existing entry p = startdate - i.startdate i.enddate = startdate i.quantity = i.quantity * (p.days+86400*p.seconds) / duration if self.discrete: i.quantity = round(i.quantity) i.save() # Done with this case... return elif i.startdate >= startdate and i.enddate <= enddate: # Entry falls completely in the range current += i.quantity elif i.startdate < enddate and i.enddate >= enddate: # This entry starts in the range and ends later. # Split the entry in two. p = i.enddate - enddate fraction = Decimal(i.quantity * (p.days+86400*p.seconds) / duration) current += i.quantity - fraction self.entries.create( \ startdate = i.startdate, enddate = enddate, quantity = i.quantity - fraction, ).save() i.startdate = enddate if self.discrete: i.quantity = round(fraction) else: i.quantity = fraction i.save() elif i.enddate > startdate and i.startdate <= startdate: # This entry ends in the range and starts earlier. # Split the entry in two. p = startdate - i.startdate fraction = Decimal(i.quantity * (p.days+86400*p.seconds) / duration) current += i.quantity - fraction self.entries.create( \ startdate = startdate, enddate = i.enddate, quantity = i.quantity - fraction, ).save() i.enddate = startdate if self.discrete: i.quantity = round(fraction) else: i.quantity = fraction i.save() # Case 1, step 2: Rescale the existing entries # Note that we retrieve an updated set of buckets from the database here... entries = self.entries.filter(enddate__gt=startdate).filter(startdate__lt=enddate) factor = quantity / current if factor == 0: for i in entries: i.delete() elif self.discrete: # Only put integers remainder = 0 for i in entries: q = Decimal(i.quantity * factor + remainder) i.quantity = q.to_integral() remainder = q - i.quantity i.save() else: # No rounding required for i in entries: i.quantity *= factor i.save() else: # Case 2: No intersecting forecast entries exist yet. We use the # calendar buckets to create a new set of forecast entries, respecting # the weight of each bucket. # Note: if the calendar values are updated later on, such changes are # obviously not reflected any more in the forecast entries. cal = self.calendar if cal: entries = cal.buckets.filter(enddate__gt=startdate).filter(startdate__lte=enddate) if entries: # Case 2a: We found calendar buckets # Case 2a, step 1: compute total sum of weight values weights = 0 for i in entries: p = min(i.enddate.date(),enddate) - max(i.startdate.date(),startdate) q = i.enddate.date() - i.startdate.date() weights += i.value * (p.days+86400*p.seconds) / (q.days+86400*q.seconds) # Case 2a, step 2: create a forecast entry for each calendar bucket remainder = Decimal(0) if weights == 0: # No non-zero weight buckets found: the update is infeasible return for i in entries: p = min(i.enddate.date(),enddate) - max(i.startdate.date(),startdate) q = i.enddate.date() - i.startdate.date() q = Decimal(quantity * i.value * (p.days+86400*p.seconds) / (q.days+86400*q.seconds) / weights) if self.discrete: q += remainder k = q.to_integral() remainder = q - k q = k if q > 0: self.entries.create( \ startdate=max(i.startdate.date(),startdate), enddate=min(i.enddate.date(),enddate), quantity=q, ).save() else: # Case 2b: No calendar buckets found at all # Create a new entry for the daterange self.entries.create(startdate=startdate,enddate=enddate,quantity=quantity).save()
be185fc1f8e444a57ca49b9420207c749e3d2f5f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8604/be185fc1f8e444a57ca49b9420207c749e3d2f5f/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25015, 12, 2890, 16, 787, 712, 16, 679, 712, 16, 10457, 4672, 9163, 2315, 326, 18763, 10457, 18, 1021, 4058, 10860, 353, 8925, 17, 16007, 30, 300, 971, 1245, 578, 1898, 18763, 3222, 1818...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25015, 12, 2890, 16, 787, 712, 16, 679, 712, 16, 10457, 4672, 9163, 2315, 326, 18763, 10457, 18, 1021, 4058, 10860, 353, 8925, 17, 16007, 30, 300, 971, 1245, 578, 1898, 18763, 3222, 1818...
flag = None if os.path.isdir(path): for dirs in os.listdir(path): if os.path.isdir(os.path.join(path, dirs)) and len(os.listdir(os.path.join(path, dirs))) < 4000: flag = dirs break flag = flag or create_directory(path) filename = random_name() fname = os.path.join(path, flag, filename)
store_fname = self.__get_random_fname(path) fname = os.path.join(path, store_fname)
def set_data(self, cr, uid, id, file_node, data, context=None, fil_obj=None): """ store the data. This function MUST be used from an ir.attachment. It wouldn't make sense to store things persistently for other types (dynamic). """ if not context: context = {} boo = self.browse(cr, uid, id, context) if fil_obj: ira = fil_obj else: ira = self.pool.get('ir.attachment').browse(cr, uid, file_node.file_id, context=context)
31d45716ca29df2809d98d6aed3e9a5eb64d20d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/31d45716ca29df2809d98d6aed3e9a5eb64d20d9/document_storage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 892, 12, 2890, 16, 4422, 16, 4555, 16, 612, 16, 585, 67, 2159, 16, 501, 16, 819, 33, 7036, 16, 661, 67, 2603, 33, 7036, 4672, 3536, 1707, 326, 501, 18, 1220, 445, 10685, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 892, 12, 2890, 16, 4422, 16, 4555, 16, 612, 16, 585, 67, 2159, 16, 501, 16, 819, 33, 7036, 16, 661, 67, 2603, 33, 7036, 4672, 3536, 1707, 326, 501, 18, 1220, 445, 10685, 5...
t.lineno += t.value.count('\n')
t.lexer.lineno += t.value.count('\n')
def t_CODELIT(t): r"(?m)\{\{([^\}]|}(?!\}))+\}\}" # strip off {{ & }} t.value = t.value[2:-2] t.lineno += t.value.count('\n') return t
afeef4c0622dd3b0d90a8446c97b6671679c1a82 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7385/afeef4c0622dd3b0d90a8446c97b6671679c1a82/isa_parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 268, 67, 9086, 2247, 1285, 12, 88, 4672, 436, 6, 3680, 81, 5153, 23241, 95, 19042, 11839, 96, 97, 19306, 64, 31700, 16971, 6280, 1532, 468, 2569, 3397, 10179, 473, 10523, 268, 18, 1132, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 9086, 2247, 1285, 12, 88, 4672, 436, 6, 3680, 81, 5153, 23241, 95, 19042, 11839, 96, 97, 19306, 64, 31700, 16971, 6280, 1532, 468, 2569, 3397, 10179, 473, 10523, 268, 18, 1132, ...
user_permissions = UserPermission.objects.filter(username = request.session.get('user_id')) blocks = Block.objects.none() for user_permission in user_permissions: if(user_permission.role=='A'): blocks = blocks | Block.objects.all() if(user_permission.role=='D'): states = State.objects.filter(region = user_permission.region_operated) districts = District.objects.filter(state__in = states) blocks = blocks | Block.objects.filter(district__in = districts) if(user_permission.role=='F'): blocks = blocks | Block.objects.filter(district = user_permission.district_operated) return blocks
user_permissions = UserPermission.objects.filter(username = request.session.get('user_id')) blocks = Block.objects.none() for user_permission in user_permissions: if(user_permission.role=='A'): blocks = blocks | Block.objects.all() if(user_permission.role=='D'): states = State.objects.filter(region = user_permission.region_operated) districts = District.objects.filter(state__in = states) blocks = blocks | Block.objects.filter(district__in = districts) if(user_permission.role=='F'): blocks = blocks | Block.objects.filter(district = user_permission.district_operated) return blocks
def get_user_blocks(request): user_permissions = UserPermission.objects.filter(username = request.session.get('user_id')) blocks = Block.objects.none() for user_permission in user_permissions: if(user_permission.role=='A'): blocks = blocks | Block.objects.all() if(user_permission.role=='D'): states = State.objects.filter(region = user_permission.region_operated) districts = District.objects.filter(state__in = states) blocks = blocks | Block.objects.filter(district__in = districts) if(user_permission.role=='F'): blocks = blocks | Block.objects.filter(district = user_permission.district_operated) return blocks
7759d6eb08a7e6568691e648ed314450c8afa48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11995/7759d6eb08a7e6568691e648ed314450c8afa48e/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1355, 67, 7996, 12, 2293, 4672, 729, 67, 9612, 273, 2177, 5041, 18, 6911, 18, 2188, 12, 5053, 273, 590, 18, 3184, 18, 588, 2668, 1355, 67, 350, 26112, 4398, 273, 3914, 18, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1355, 67, 7996, 12, 2293, 4672, 729, 67, 9612, 273, 2177, 5041, 18, 6911, 18, 2188, 12, 5053, 273, 590, 18, 3184, 18, 588, 2668, 1355, 67, 350, 26112, 4398, 273, 3914, 18, 6...
self.add_var_arg(p_nodes[1].name_output_file)
self.add_var_arg(p_nodes[1].outputFileName)
def __init__(self, dag, job, cp, opts, ifo, time, p_nodes=[], type=""):
fa29fb8697f622f96f2f3ca23d02e05a7a9c116b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/fa29fb8697f622f96f2f3ca23d02e05a7a9c116b/stfu_pipe.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 22940, 16, 1719, 16, 3283, 16, 1500, 16, 21479, 16, 813, 16, 293, 67, 4690, 22850, 6487, 618, 1546, 6, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 22940, 16, 1719, 16, 3283, 16, 1500, 16, 21479, 16, 813, 16, 293, 67, 4690, 22850, 6487, 618, 1546, 6, 4672, 2, -100, -100, -100, -100, -100, -100, -100,...
locals = {'Var': lambda _: ''}
locals = {'Var': lambda _: locals["vars"][_]}
def GetWebKitRev(): """Extract the 'webkit_revision' variable out of DEPS.""" locals = {'Var': lambda _: ''} execfile('DEPS', {}, locals) return locals['vars']['webkit_revision']
ee72a56ba8374352d80e8c6208eabd0f438fc9f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ee72a56ba8374352d80e8c6208eabd0f438fc9f0/sync-webkit-git.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 4079, 14102, 10070, 13332, 3536, 4976, 326, 296, 29319, 67, 13057, 11, 2190, 596, 434, 2030, 5857, 12123, 8985, 273, 13666, 1537, 4278, 3195, 389, 30, 8985, 9614, 4699, 6, 6362, 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 4079, 14102, 10070, 13332, 3536, 4976, 326, 296, 29319, 67, 13057, 11, 2190, 596, 434, 2030, 5857, 12123, 8985, 273, 13666, 1537, 4278, 3195, 389, 30, 8985, 9614, 4699, 6, 6362, 67, ...
locations_from_filters = connector.execute( ('select distinct locationid from filters' 'where id=\'%s\' order by location') % filter_id, ['id'])
q = ('select distinct locationid from filters ' + \ 'where id=\'%s\' order by location') % filter_id locations_from_filters = connector.execute(q, ['id'])
def service_get_locations(request, configuration_id, filter_id): """get locations given configuration_id and filter_id return id, name (from filters) x, y, parentid (from locations) """ configuration = get_object_or_404(Configuration, pk=configuration_id) connector = configuration.getConnector() if configuration.datasourcetype == Configuration.DATASOURCE_TYPE_EI: #some 'hacking' is needed to get the desired result from Jdbc... #first get the locations from filters locations_from_filters = connector.execute( ('select distinct locationid from filters' 'where id=\'%s\' order by location') % filter_id, ['id']) #then join the the locations from locations, to get all location data location_array = [] parent_dict = {} location_all_dict = cache.get('all_locations' + str(configuration_id)) if location_all_dict == None: query = ('select id, name, parentid, longitude, latitude from ' 'locations order by name') all_locations = connector.execute( query, ['id', 'name', 'parentid', 'longitude', 'latitude'], debug=settings.DEBUG) location_all_dict = {} for row in all_locations: location_all_dict[row['id']] = row cache.set('all_locations' + str(configuration_id), location_all_dict, 300) for row in locations_from_filters: id = row['id'] result = location_all_dict[id] result['in_filter'] = 1 location_array.append(result) parent_dict[result['id']] = True # loop again to find missing parents, and again, and again until all # parents are found added = True # Unused for row in location_array: id = row['parentid'] if not(id is None or id in parent_dict): result = location_all_dict[id] result['in_filter'] = 0 location_array.append(result) parent_dict[id] = True elif configuration.datasourcetype == Configuration.DATASOURCE_TYPE_DUMMY: location_array = connector.execute('get_locations') #print location_dict return render_to_response('base/location.json', {'data': location_array})
edab032ab32c7e9ec17dde17cf3de0154a786e3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11035/edab032ab32c7e9ec17dde17cf3de0154a786e3b/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1156, 67, 588, 67, 12352, 12, 2293, 16, 1664, 67, 350, 16, 1034, 67, 350, 4672, 3536, 588, 7838, 864, 1664, 67, 350, 471, 1034, 67, 350, 225, 327, 612, 16, 508, 261, 2080, 3415, 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, 1156, 67, 588, 67, 12352, 12, 2293, 16, 1664, 67, 350, 16, 1034, 67, 350, 4672, 3536, 588, 7838, 864, 1664, 67, 350, 471, 1034, 67, 350, 225, 327, 612, 16, 508, 261, 2080, 3415, 13, ...
self.proc.communicate("q")
self.proc.communicate()
def wait(self): self.trace("wait") self.proc.communicate("q")
577eab86984c8d90debf790e867a18706ac70414 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1549/577eab86984c8d90debf790e867a18706ac70414/run.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2529, 12, 2890, 4672, 365, 18, 5129, 2932, 7048, 7923, 365, 18, 9381, 18, 5702, 318, 2659, 2932, 85, 7923, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 2529, 12, 2890, 4672, 365, 18, 5129, 2932, 7048, 7923, 365, 18, 9381, 18, 5702, 318, 2659, 2932, 85, 7923, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
"""
'''
def testProtectedPageViews(self): ztapi.provideUtility(IPermission, Permission('p', 'P'), 'p')
1cfc7ddd1cac0110cca3e909215477e1c59bbca3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9523/1cfc7ddd1cac0110cca3e909215477e1c59bbca3/test_directives.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 15933, 1964, 9959, 12, 2890, 4672, 998, 88, 2425, 18, 685, 6768, 6497, 12, 2579, 2635, 16, 8509, 2668, 84, 2187, 296, 52, 19899, 296, 84, 6134, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 15933, 1964, 9959, 12, 2890, 4672, 998, 88, 2425, 18, 685, 6768, 6497, 12, 2579, 2635, 16, 8509, 2668, 84, 2187, 296, 52, 19899, 296, 84, 6134, 2, -100, -100, -100, -100, -100, -...
if pos_sec % 10 == 0:
if int(pos_sec) % 10 == 0:
def notify_playing(self, pos_sec, dur_sec, bean): self.seek_bar.update_seek_status(pos_sec, dur_sec) if pos_sec % 10 == 0: self.lastfm.report_now_playting(bean) if not self.start_time: self.start_time = str(int(time.time())) print "Start time", self.start_time
553e07bb63655692d1b90de5c984c7e162710ad8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14563/553e07bb63655692d1b90de5c984c7e162710ad8/base_controls.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5066, 67, 1601, 310, 12, 2890, 16, 949, 67, 3321, 16, 15929, 67, 3321, 16, 3931, 4672, 365, 18, 16508, 67, 3215, 18, 2725, 67, 16508, 67, 2327, 12, 917, 67, 3321, 16, 15929, 67, 3321...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5066, 67, 1601, 310, 12, 2890, 16, 949, 67, 3321, 16, 15929, 67, 3321, 16, 3931, 4672, 365, 18, 16508, 67, 3215, 18, 2725, 67, 16508, 67, 2327, 12, 917, 67, 3321, 16, 15929, 67, 3321...
makedirs(target_path)
os.makedirs(target_path)
def new_name(name): if name.startswith('brushes/'): target_name = name[8:] else: target_name = name if '/' in target_name: dir = dirname(target_name) target_path = join(self.user_brushpath, dir) if not isdir(target_path): makedirs(target_path) target_path = join(target_path, target_name) else: target_path = join(self.user_brushpath, target_name) return target_path
072150012003a816be40f89df03bfb797491bc8a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7129/072150012003a816be40f89df03bfb797491bc8a/brushmanager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 67, 529, 12, 529, 4672, 309, 508, 18, 17514, 1918, 2668, 2848, 1218, 281, 2473, 4672, 1018, 67, 529, 273, 508, 63, 28, 26894, 469, 30, 1018, 67, 529, 273, 508, 309, 2023, 316, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 67, 529, 12, 529, 4672, 309, 508, 18, 17514, 1918, 2668, 2848, 1218, 281, 2473, 4672, 1018, 67, 529, 273, 508, 63, 28, 26894, 469, 30, 1018, 67, 529, 273, 508, 309, 2023, 316, 1...
downloads = self.GetDownloadsInfo().Downloads() self.assertEqual(len(downloads), len(filenames))
def _CreateFile(name): """Create and fill the given file with some junk.""" fp = open(name, 'w') print >>fp, 'This is a junk file named %s. ' % name * 100 fp.close()
def testCrazyFilenames(self): """Test downloading with filenames containing special chars.""" download_dir = self.GetDownloadDirectory().value() test_dir = os.path.join(os.path.abspath(self.DataDir()), 'downloads', 'crazy_filenames') data_file = os.path.join(test_dir, 'download_filenames') filenames = filter(os.path.isfile, os.listdir(test_dir)) logging.info('Testing with %d crazy filenames' % len(filenames)) for filename in filenames: downloaded_file = os.path.join(download_dir, filename) os.path.exists(downloaded_file) and os.remove(downloaded_file) file_url = self.GetFileURLForPath(os.path.join(test_dir, filename)) self._DownloadAndWaitForStart(file_url) self.WaitForAllDownloadsToComplete()
e1b8e33cb6c10d0cf6ee2e6f2d1c76e388c613b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e1b8e33cb6c10d0cf6ee2e6f2d1c76e388c613b4/downloads.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 39, 354, 21832, 25579, 6809, 12, 2890, 4672, 3536, 4709, 23742, 598, 9066, 4191, 4582, 5230, 12123, 4224, 67, 1214, 273, 365, 18, 967, 7109, 2853, 7675, 1132, 1435, 1842, 67, 1214, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 39, 354, 21832, 25579, 6809, 12, 2890, 4672, 3536, 4709, 23742, 598, 9066, 4191, 4582, 5230, 12123, 4224, 67, 1214, 273, 365, 18, 967, 7109, 2853, 7675, 1132, 1435, 1842, 67, 1214, ...
failures.add(test)
image_plus_text_failures.add(test)
def _CalculateRegressions(self): """Calculate regressions from this run through the layout tests.""" worklist = self._test_files.copy()
eb87b772677cbd4d72d1f53820249c6194c8d75b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/eb87b772677cbd4d72d1f53820249c6194c8d75b/compare_failures.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8695, 1617, 663, 1115, 12, 2890, 4672, 3536, 8695, 960, 663, 1115, 628, 333, 1086, 3059, 326, 3511, 7434, 12123, 1440, 1098, 273, 365, 6315, 3813, 67, 2354, 18, 3530, 1435, 2, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8695, 1617, 663, 1115, 12, 2890, 4672, 3536, 8695, 960, 663, 1115, 628, 333, 1086, 3059, 326, 3511, 7434, 12123, 1440, 1098, 273, 365, 6315, 3813, 67, 2354, 18, 3530, 1435, 2, -100,...
tally = Tally(None, len(result_voters.get(Vote.YES, [])), len(result_voters.get(Vote.NO, [])), len(result_voters.get(Vote.ABSTAIN, [])) return tally
return Tally(None, len(result_voters.get(Vote.YES, [])), len(result_voters.get(Vote.NO, [])), len(result_voters.get(Vote.ABSTAIN, [])))
def combine_polls(cls, polls, at_time=None): from adhocracy.lib.democracy import Decision from vote import Vote if at_time is None: at_time = datetime.utcnow() result_voters = {} undecided = [] for poll in polls: for decision in Decision.for_poll(poll, at_time=at_time): if not decision.is_decided(): continue for option in [Vote.YES, Vote.NO, Vote.ABSTAIN]: voters = result_voters.get(option, []) if option == result and decision.user not in voters: voters = voters.append(decision.user) if option != result and decision.user in voters: undecided.append(decision.user) result_voters[option] = voters for option in [Vote.YES, Vote.NO, Vote.ABSTAIN]: users = result_voters.get(option, []) for user in undecided: if user in users: users = users.remove(user) result_voters[option] = users tally = Tally(None, len(result_voters.get(Vote.YES, [])), len(result_voters.get(Vote.NO, [])), len(result_voters.get(Vote.ABSTAIN, [])) return tally
b25c366e0e7f2b360dcbe4eb715f66cc03f28303 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10360/b25c366e0e7f2b360dcbe4eb715f66cc03f28303/tally.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8661, 67, 3915, 3251, 12, 6429, 16, 2952, 3251, 16, 622, 67, 957, 33, 7036, 4672, 628, 1261, 76, 504, 354, 2431, 18, 2941, 18, 19117, 504, 354, 2431, 1930, 23193, 628, 12501, 1930, 275...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8661, 67, 3915, 3251, 12, 6429, 16, 2952, 3251, 16, 622, 67, 957, 33, 7036, 4672, 628, 1261, 76, 504, 354, 2431, 18, 2941, 18, 19117, 504, 354, 2431, 1930, 23193, 628, 12501, 1930, 275...
missing = []
def get_dependency_solvers(self, block, arch, distribution): packages = [] missing = []
8ba92ccadbccf77c9f6caed00cf5cbb298dc57be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2784/8ba92ccadbccf77c9f6caed00cf5cbb298dc57be/britney.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 15896, 67, 18281, 2496, 12, 2890, 16, 1203, 16, 6637, 16, 7006, 4672, 5907, 273, 5378, 3315, 273, 5378, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 15896, 67, 18281, 2496, 12, 2890, 16, 1203, 16, 6637, 16, 7006, 4672, 5907, 273, 5378, 3315, 273, 5378, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
good = arg
good.append(arg)
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, ...
timeouts = (timeout*1000, 0, timeout*1000, 0, 0)
timeouts = (0, 0, timeout*1000, 0, timeout*1000)
def __init__(self, port, #number of device, numbering starts at #zero. if everything fails, the user #can specify a device string, note #that this isn't portable anymore baudrate=9600, #baudrate bytesize=EIGHTBITS, #number of databits parity=PARITY_NONE, #enable parity checking stopbits=STOPBITS_ONE, #number of stopbits timeout=None, #set a timeout value, None for waiting forever xonxoff=0, #enable software flow control rtscts=0, #enable RTS/CTS flow control ): """initialize comm port"""
62d2d56235500bca15c0ac0d680c5a9d6e4b710d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2937/62d2d56235500bca15c0ac0d680c5a9d6e4b710d/serialwin32.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1756, 16, 5375, 468, 2696, 434, 2346, 16, 1300, 310, 2542, 622, 468, 7124, 18, 309, 7756, 6684, 16, 326, 729, 468, 4169, 4800, 279, 2346, 533, 16, 4721, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1756, 16, 5375, 468, 2696, 434, 2346, 16, 1300, 310, 2542, 622, 468, 7124, 18, 309, 7756, 6684, 16, 326, 729, 468, 4169, 4800, 279, 2346, 533, 16, 4721, ...
flags['relro'] = '2'
flags['relro'] = 2
def get_binary_flags(self, file): """ Function to get binary flags from a file """ flags = {}
db3e09aa0517efc638ded0f40524a2b41dc13d44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11154/db3e09aa0517efc638ded0f40524a2b41dc13d44/binary.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 8578, 67, 7133, 12, 2890, 16, 585, 4672, 3536, 4284, 358, 336, 3112, 2943, 628, 279, 585, 3536, 2943, 273, 2618, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 8578, 67, 7133, 12, 2890, 16, 585, 4672, 3536, 4284, 358, 336, 3112, 2943, 628, 279, 585, 3536, 2943, 273, 2618, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
print 'waiting for all tasks to complete' done.acquire() print 'all tasks done'
class BasicThreadTest(unittest.TestCase):
def newtask(): global next_ident, running mutex.acquire() next_ident = next_ident + 1 if verbose: print 'creating task', next_ident thread.start_new_thread(task, (next_ident,)) running = running + 1 mutex.release()
157f92e2b29d073ecbc5a79ea012f85cd0478331 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/157f92e2b29d073ecbc5a79ea012f85cd0478331/test_thread.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 4146, 13332, 2552, 1024, 67, 6392, 16, 3549, 9020, 18, 1077, 1039, 1435, 1024, 67, 6392, 273, 1024, 67, 6392, 397, 404, 309, 3988, 30, 1172, 296, 23799, 1562, 2187, 1024, 67, 6392, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 4146, 13332, 2552, 1024, 67, 6392, 16, 3549, 9020, 18, 1077, 1039, 1435, 1024, 67, 6392, 273, 1024, 67, 6392, 397, 404, 309, 3988, 30, 1172, 296, 23799, 1562, 2187, 1024, 67, 6392, ...
if not hostname:
if scheme!='file' and not hostname:
def __init__ (self, client, request, headers, content, nofilter, compress, mime=None): self.client = client self.request = request self.headers = headers self.compress = compress self.content = content self.nofilter = nofilter self.mime = mime debug(BRING_IT_ON, "Proxy:", `self.request`) self.method, self.url, protocol = self.request.split() scheme, hostname, port, document = spliturl(self.url) # some clients send partial URI's without scheme, hostname # and port to clients, so we have to handle this if not (scheme and hostname and port): print >>sys.stderr, "Warning: partial request uri:", self.request if not scheme: # default scheme is http scheme = "http" if not hostname: # the 'Host' header has to be there hostname = self.headers.get('Host') if not hostname: # we cannot handle the request self.client.error(400, i18n._("Incomplete Proxy Request")) return if not port: port = 80 # fix missing trailing / if not document: document = '/' # fix missing host headers for HTTP/1.1 if protocol=='HTTP/1.1' and not self.headers.has_key('Host'): self.headers['Host'] = hostname if port!=80: self.headers['Host'] += ":%d"%port debug(HURT_ME_PLENTY, "Proxy: splitted url", scheme, hostname, port, document) if scheme=='file': # a blocked url is a local file:// link # this means we should _not_ use this proxy for local # file links :) mtype = mimetypes.guess_type(self.url)[0] config['requests']['valid'] += 1 config['requests']['blocked'] += 1 ServerHandleDirectly(self.client, 'HTTP/1.0 200 OK\r\n', 'Content-Type: %s\r\n\r\n'%(mtype or 'application/octet-stream'), open(document, 'rb').read()) return
c781e1f42485024a59ee5e27b169bfce026aa971 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/c781e1f42485024a59ee5e27b169bfce026aa971/ClientServerMatchmaker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 1004, 16, 590, 16, 1607, 16, 913, 16, 290, 792, 1088, 16, 8099, 16, 4892, 33, 7036, 4672, 365, 18, 2625, 273, 1004, 365, 18, 2293, 273, 590, 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, 1001, 2738, 972, 261, 2890, 16, 1004, 16, 590, 16, 1607, 16, 913, 16, 290, 792, 1088, 16, 8099, 16, 4892, 33, 7036, 4672, 365, 18, 2625, 273, 1004, 365, 18, 2293, 273, 590, 365, 18, ...
self.js_filter = opts['javascript'] and jslib
self.javascript = opts['javascript'] and jslib
def __init__ (self, opts): self.js_filter = opts['javascript'] and jslib self.js_html = None self.js_src = False self.js_script = '' if self.js_filter: self.js_env = jslib.new_jsenv() self.js_output = 0 self.js_popup = 0
9d308cf36c9925fe55e611168b12175184ce8c08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/9d308cf36c9925fe55e611168b12175184ce8c08/HtmlParser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 1500, 4672, 365, 18, 11242, 273, 1500, 3292, 11242, 3546, 471, 525, 24760, 365, 18, 2924, 67, 2620, 273, 599, 365, 18, 2924, 67, 4816, 273, 1083, 365, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 1500, 4672, 365, 18, 11242, 273, 1500, 3292, 11242, 3546, 471, 525, 24760, 365, 18, 2924, 67, 2620, 273, 599, 365, 18, 2924, 67, 4816, 273, 1083, 365, 1...
def longtitude(self):
def longitude(self):
def longtitude(self): "(float) Get the longtitude value of the geo-tag. See also .location()" lat, lon = self.location() return lon
4dbb36dc75928a1b22d8fac51aed8584a4f252eb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6580/4dbb36dc75928a1b22d8fac51aed8584a4f252eb/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9192, 12, 2890, 4672, 7751, 5659, 13, 968, 326, 1525, 88, 3540, 460, 434, 326, 7856, 17, 2692, 18, 2164, 2546, 263, 3562, 10031, 2516, 16, 4281, 273, 365, 18, 3562, 1435, 327, 4281, 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, 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, 9192, 12, 2890, 4672, 7751, 5659, 13, 968, 326, 1525, 88, 3540, 460, 434, 326, 7856, 17, 2692, 18, 2164, 2546, 263, 3562, 10031, 2516, 16, 4281, 273, 365, 18, 3562, 1435, 327, 4281, 2,...
def makeconfig(infp, outfp, modules):
def makeconfig(infp, outfp, modules, with_ifdef=0):
def makeconfig(infp, outfp, modules): m1 = regex.compile('-- ADDMODULE MARKER 1 --') m2 = regex.compile('-- ADDMODULE MARKER 2 --') while 1: line = infp.readline() if not line: break outfp.write(line) if m1 and m1.search(line) >= 0: m1 = None for mod in modules: if mod in never: continue outfp.write('extern void init%s();\n' % mod) elif m2 and m2.search(line) >= 0: m2 = None for mod in modules: if mod in never: continue outfp.write('\t{"%s", init%s},\n' % (mod, mod)) if m1: sys.stderr.write('MARKER 1 never found\n') elif m2: sys.stderr.write('MARKER 2 never found\n')
f853191c716dcce72e1e3ae2ed9be97ea18e3f64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/f853191c716dcce72e1e3ae2ed9be97ea18e3f64/makeconfig.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29796, 22703, 12, 267, 7944, 16, 596, 7944, 16, 4381, 16, 598, 67, 430, 536, 33, 20, 4672, 312, 21, 273, 3936, 18, 11100, 2668, 413, 11689, 12194, 20503, 654, 404, 1493, 6134, 312, 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, 29796, 22703, 12, 267, 7944, 16, 596, 7944, 16, 4381, 16, 598, 67, 430, 536, 33, 20, 4672, 312, 21, 273, 3936, 18, 11100, 2668, 413, 11689, 12194, 20503, 654, 404, 1493, 6134, 312, 22,...
def CtrlAnchored(self, ctrl): result = (ctrl == self)
def CtrlAnchored(self, ctrl): result = (ctrl == self)
2409984574299440bdc4e3c954b3574ca35f84c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/2409984574299440bdc4e3c954b3574ca35f84c5/Designer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 30715, 979, 343, 7653, 12, 2890, 16, 6414, 4672, 563, 273, 261, 16277, 422, 365, 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, ...
[ 1, 1, 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, 30715, 979, 343, 7653, 12, 2890, 16, 6414, 4672, 563, 273, 261, 16277, 422, 365, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
</P> </TD></TR> </TABLE>""")
</p> </td></tr> </table>""")
def _error_html(self,title,body): # XXX could this try to use standard_error_message somehow? return ("""\
929a4dc23f3500225553752577d184e8b0dfb13c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/929a4dc23f3500225553752577d184e8b0dfb13c/HTTPResponse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1636, 67, 2620, 12, 2890, 16, 2649, 16, 3432, 4672, 468, 11329, 3377, 333, 775, 358, 999, 4529, 67, 1636, 67, 2150, 28578, 35, 327, 261, 8395, 64, 2, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1636, 67, 2620, 12, 2890, 16, 2649, 16, 3432, 4672, 468, 11329, 3377, 333, 775, 358, 999, 4529, 67, 1636, 67, 2150, 28578, 35, 327, 261, 8395, 64, 2, -100, -100, -100, -100, -100,...
_write_if_nonempty(public, private, properties, '<br />\n\n') def _property_details_entry(self, property, container): """ @return: The HTML code for an entry in the property details section. Each entry gives a complete description of a documented property.
footer = '<br />\n\n' private.write(footer) if show_public: public.write(footer) def _write_property_details_entry(self, public, private, property, container): """ Write HTML code for an individual property in the properties details section. This is used by L{_write_property_details}. @param public: The output stream for the public version of the page. @param private: The output stream for the private version of the page.
def _write_property_details(self, public, private, container, properties, heading='Variable Details'): """ Write HTML code for a properties details dection. This is used by L{_write_class} to describe the properties in a class. @param public: The output stream for the public version of the page. @param private: The output stream for the private version of the page. @param container: The or class that contains the properties. C{container} is used to group the functions. @param properties: The properties that should be included in the section. """ # Filter out properties that we have no docs for; these are # just listed in the summary table. docmap = self._docmap properties = [p for p in properties if docmap.has_key(p.target())]
e2f2ffda54ea5387b5fe2078f8cbed5ce386c6ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/e2f2ffda54ea5387b5fe2078f8cbed5ce386c6ae/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 67, 4468, 67, 6395, 12, 2890, 16, 1071, 16, 3238, 16, 1478, 16, 1790, 16, 11053, 2218, 3092, 21897, 11, 4672, 3536, 2598, 3982, 981, 364, 279, 1790, 3189, 443, 349, 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, 389, 2626, 67, 4468, 67, 6395, 12, 2890, 16, 1071, 16, 3238, 16, 1478, 16, 1790, 16, 11053, 2218, 3092, 21897, 11, 4672, 3536, 2598, 3982, 981, 364, 279, 1790, 3189, 443, 349, 18, 225,...
if self.state['k'][0]: text = c.upper() else: text = c
text = c
def parse_pml(self, pml, file_name=''): pml = self.prepare_pml(pml) output = []
f09e8984885dbeb2c2c4df42cfab61c911656ff8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/f09e8984885dbeb2c2c4df42cfab61c911656ff8/pmlconverter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 84, 781, 12, 2890, 16, 293, 781, 16, 585, 67, 529, 2218, 11, 4672, 293, 781, 273, 365, 18, 9366, 67, 84, 781, 12, 84, 781, 13, 876, 273, 5378, 2, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1109, 67, 84, 781, 12, 2890, 16, 293, 781, 16, 585, 67, 529, 2218, 11, 4672, 293, 781, 273, 365, 18, 9366, 67, 84, 781, 12, 84, 781, 13, 876, 273, 5378, 2, -100, -100, -100, -100, ...
Product(category_id='5', active=True, description="Child (0-3 years old)", cost="0", auth=None, validate="PPChildrenAdult(current_field='product_Partners Programme_Child (0_5 years old)_qty',adult_field='product_Partners Programme_Adult_qty')"),
Product(category_id='5', active=True, description="Child (0-3 years old)", cost="0", auth=None, validate="PPChildrenAdult(current_field='product_Partners Programme_Child (0_3 years old)_qty',adult_field='product_Partners Programme_Adult_qty')"),
def setup(meta): ceiling_conference = Ceiling.find_by_name('conference') ceiling_all_conference = Ceiling.find_by_name('all-conference') ceiling_earlybird = Ceiling.find_by_name('earlybird') ceiling_nonearlybird = Ceiling.find_by_name('non-earlybird') ceiling_uniaccom = Ceiling.find_by_name('uniaccom') # Tickets product = Product(category_id='1', active=True, description="Concession/Student Ticket", cost="16000", auth=None, validate=None) product.ceilings.append(ceiling_conference) product.ceilings.append(ceiling_all_conference) meta.Session.add(product); product = Product(category_id='1', active=True, description="Earlybird Hobbyist Ticket", cost="29000", auth=None, validate=None) product.ceilings.append(ceiling_conference) product.ceilings.append(ceiling_all_conference) product.ceilings.append(ceiling_earlybird) meta.Session.add(product); product = Product(category_id='1', active=True, description="Hobbyist Ticket", cost="36500", auth=None, validate=None) product.ceilings.append(ceiling_conference) product.ceilings.append(ceiling_all_conference) product.ceilings.append(ceiling_nonearlybird) meta.Session.add(product); product = Product(category_id='1', active=True, description="Earlybird Professional Ticket", cost="63500", auth=None, validate=None) product.ceilings.append(ceiling_conference) product.ceilings.append(ceiling_all_conference) product.ceilings.append(ceiling_earlybird) meta.Session.add(product); product = Product(category_id='1', active=True, description="Professional Ticket", cost="78500", auth=None, validate=None) product.ceilings.append(ceiling_conference) product.ceilings.append(ceiling_all_conference) product.ceilings.append(ceiling_nonearlybird) meta.Session.add(product); product = Product(category_id='1', active=True, description="Fairy Penguin Sponsorship", cost="150000", auth=None, validate=None) product.ceilings.append(ceiling_conference) product.ceilings.append(ceiling_all_conference) meta.Session.add(product); product = Product(category_id='1', active=True, description="Speaker Ticket", cost="0", auth="self.is_speaker()", validate=None) product.ceilings.append(ceiling_all_conference) meta.Session.add(product); product = Product(category_id='1', active=True, description="Miniconf Organiser Ticket", cost="0", auth="self.is_miniconf_org()", validate=None) product.ceilings.append(ceiling_all_conference) meta.Session.add(product); product = Product(category_id='1', active=True, description="Volunteer Ticket", cost="0", auth="self.is_volunteer()", validate=None) product.ceilings.append(ceiling_all_conference) meta.Session.add(product); meta.Session.add_all( [ # Shirts Product(category_id='2', active=True, description="Men's Small Shirt", cost="2000", auth=None, validate=None), Product(category_id='2', active=True, description="Men's Medium Shirt", cost="2000", auth=None, validate=None), Product(category_id='2', active=True, description="Men's Large Shirt", cost="2000", auth=None, validate=None), Product(category_id='2', active=True, description="Men's X Large Shirt", cost="2000", auth=None, validate=None), Product(category_id='2', active=True, description="Men's XX Large Shirt", cost="2200", auth=None, validate=None), Product(category_id='2', active=True, description="Men's XXX Large Shirt", cost="2200", auth=None, validate=None), Product(category_id='2', active=True, description="Men's XXXX Large Shirt", cost="2200", auth=None, validate=None), Product(category_id='2', active=True, description="Men's XXXXX Large Shirt", cost="2200", auth=None, validate=None), Product(category_id='2', active=True, description="Women's Small Shirt", cost="2000", auth=None, validate=None), Product(category_id='2', active=True, description="Women's Medium Shirt", cost="2000", auth=None, validate=None), Product(category_id='2', active=True, description="Women's Large Shirt", cost="2000", auth=None, validate=None), Product(category_id='2', active=True, description="Women's X Large Shirt", cost="2000", auth=None, validate=None), Product(category_id='2', active=True, description="Women's XX Large Shirt", cost="2200", auth=None, validate=None), Product(category_id='2', active=True, description="Women's XXX Large Shirt", cost="2200", auth=None, validate=None), Product(category_id='2', active=True, description="Women's XXXX Large Shirt", cost="2200", auth=None, validate=None), Product(category_id='2', active=True, description="Women's XXXXX Large Shirt", cost="2200", auth=None, validate=None), # Dinner Product(category_id='3', active=True, description="Adult", cost="8000", auth=None, validate="ProDinner(dinner_field='product_Dinner_Adult_qty',ticket_category='category_1',ticket_id=[5,4])"), Product(category_id='3', active=True, description="Infant (0-1 years)", cost="4000", auth=None, validate="ProDinner(dinner_field='product_Dinner_Adult_qty',ticket_category='category_1',ticket_id=[5,4])"), Product(category_id='3', active=True, description="Child (1-5 years)", cost="4000", auth=None, validate="ProDinner(dinner_field='product_Dinner_Adult26_qty',ticket_category='category_1',ticket_id=[5,4])"), ] ) # Accommodation product = Product(category_id='4', active=True, description="I will organise my own", cost="0", auth=None, validate=None) meta.Session.add(product); product = Product(category_id='4', active=True, description="Wrest Point (Visit Accommodation page)", cost="0", auth=None, validate=None) meta.Session.add(product); product = Product(category_id='4', active=True, description="University Accommodation - Includes Breakfast! (price per night)", cost="6000", auth=None, validate=None) product.ceilings.append(ceiling_uniaccom) meta.Session.add(product); # Partner's Programme meta.Session.add_all( [ Product(category_id='5', active=True, description="Adult", cost="20000", auth=None, validate="PPEmail(adult_field='product_Partners Programme_Adult_qty',email_field='partner_email')"), Product(category_id='5', active=True, description="Child (0-3 years old)", cost="0", auth=None, validate="PPChildrenAdult(current_field='product_Partners Programme_Child (0_5 years old)_qty',adult_field='product_Partners Programme_Adult_qty')"), Product(category_id='5', active=True, description="Child (4-6 years old)", cost="14000", auth=None, validate="PPChildrenAdult(current_field='product_Partners Programme_Child (4_6 years old)_qty',adult_field='product_Partners Programme_Adult_qty')"), Product(category_id='5', active=True, description="Child (7-9 years old)", cost="14000", auth=None, validate="PPChildrenAdult(current_field='product_Partners Programme_Child (7_9 years old)_qty',adult_field='product_Partners Programme_Adult_qty')"), Product(category_id='5', active=True, description="Child (10-12 years old)", cost="14000", auth=None, validate="PPChildrenAdult(current_field='product_Partners Programme_Child (10_12 years old)_qty',adult_field='product_Partners Programme_Adult_qty')"), Product(category_id='5', active=True, description="Child (13-17 years old)", cost="14000", auth=None, validate="PPChildrenAdult(current_field='product_Partners Programme_Child (13_17 years old)_qty',adult_field='product_Partners Programme_Adult_qty')"), ] ) # Product includes meta.Session.add_all( [ # Include 1 Shirt in all registration types ProductInclude(product_id='1', include_category_id='2', include_qty='1'), ProductInclude(product_id='2', include_category_id='2', include_qty='1'), ProductInclude(product_id='3', include_category_id='2', include_qty='1'), ProductInclude(product_id='4', include_category_id='2', include_qty='1'), ProductInclude(product_id='5', include_category_id='2', include_qty='1'), ProductInclude(product_id='6', include_category_id='2', include_qty='1'), ProductInclude(product_id='7', include_category_id='2', include_qty='1'), ProductInclude(product_id='8', include_category_id='2', include_qty='1'), ProductInclude(product_id='9', include_category_id='2', include_qty='2'), # Include 1 Dinner for Professional+miniconf and 2 for Speaker registrations ProductInclude(product_id='4', include_category_id='3', include_qty='1'), # pro EB ProductInclude(product_id='5', include_category_id='3', include_qty='1'), # pro ProductInclude(product_id='6', include_category_id='3', include_qty='1'), # fairy ProductInclude(product_id='7', include_category_id='3', include_qty='2'), # speaker ProductInclude(product_id='8', include_category_id='3', include_qty='1'), # miniconf # Include 5 partners in the partners program for speakers ProductInclude(product_id='7', include_category_id='5', include_qty='5'), ] )
6c5964ad2c2fddbe212bee85dcc43bab1cdad0e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12856/6c5964ad2c2fddbe212bee85dcc43bab1cdad0e3/product.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 12, 3901, 4672, 5898, 4973, 67, 591, 1134, 273, 29898, 4973, 18, 4720, 67, 1637, 67, 529, 2668, 591, 1134, 6134, 5898, 4973, 67, 454, 67, 591, 1134, 273, 29898, 4973, 18, 4720, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 12, 3901, 4672, 5898, 4973, 67, 591, 1134, 273, 29898, 4973, 18, 4720, 67, 1637, 67, 529, 2668, 591, 1134, 6134, 5898, 4973, 67, 454, 67, 591, 1134, 273, 29898, 4973, 18, 4720, 6...
options["typein"])
self["typein"])
def postOptions(self): if self['in'] is None: self.opt_help() raise usage.UsageError("You must specify the input filename.") if self["typein"] == "guess": try: self["typein"] = app.guessType(self["in"]) except KeyError: raise usage.UsageError("Could not guess type for '%s'" % options["typein"])
b2200cba2258cb2fc41b8c370a3129ac7b6dd206 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b2200cba2258cb2fc41b8c370a3129ac7b6dd206/tapconvert.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1603, 1320, 12, 2890, 4672, 309, 365, 3292, 267, 3546, 353, 599, 30, 365, 18, 3838, 67, 5201, 1435, 1002, 4084, 18, 5357, 668, 2932, 6225, 1297, 4800, 326, 810, 1544, 1199, 13, 309, 36...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1603, 1320, 12, 2890, 4672, 309, 365, 3292, 267, 3546, 353, 599, 30, 365, 18, 3838, 67, 5201, 1435, 1002, 4084, 18, 5357, 668, 2932, 6225, 1297, 4800, 326, 810, 1544, 1199, 13, 309, 36...
source.close()
def test_checkcache(self): getline = linecache.getline try: # Create a source file and cache its contents source_name = support.TESTFN + '.py' with open(source_name, 'w') as source: source.write(SOURCE_1) source.close() getline(source_name, 1)
9958c56eb0e2b71c1bea5abcc627899d0bed17dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/9958c56eb0e2b71c1bea5abcc627899d0bed17dc/test_linecache.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1893, 2493, 12, 2890, 4672, 336, 1369, 273, 4739, 557, 807, 18, 588, 1369, 775, 30, 468, 1788, 279, 1084, 585, 471, 1247, 2097, 2939, 1084, 67, 529, 273, 2865, 18, 16961, 197...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1893, 2493, 12, 2890, 4672, 336, 1369, 273, 4739, 557, 807, 18, 588, 1369, 775, 30, 468, 1788, 279, 1084, 585, 471, 1247, 2097, 2939, 1084, 67, 529, 273, 2865, 18, 16961, 197...
if self.setup['debug']: print entry.get('name'), self.states[entry]
def VerifyEntry(self, entry, modlist = []): '''Dispatch call to Verify<tagname> and save state in self.states''' try: method = getattr(self, "Verify%s"%(entry.tag)) # verify state and stash value in state if entry.tag == 'Package': self.states[entry] = method(entry, modlist) else: self.states[entry] = method(entry)
a1e655a987bee4dde768f3b0974bb77cb5c5b723 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/a1e655a987bee4dde768f3b0974bb77cb5c5b723/Toolset.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8553, 1622, 12, 2890, 16, 1241, 16, 681, 1098, 273, 5378, 4672, 9163, 5325, 745, 358, 8553, 32, 2692, 529, 34, 471, 1923, 919, 316, 365, 18, 7992, 26418, 775, 30, 707, 273, 3869, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8553, 1622, 12, 2890, 16, 1241, 16, 681, 1098, 273, 5378, 4672, 9163, 5325, 745, 358, 8553, 32, 2692, 529, 34, 471, 1923, 919, 316, 365, 18, 7992, 26418, 775, 30, 707, 273, 3869, 12, ...
Description: Return the histogrm of the image as a list of floats
Description: Return the histogram of the image as a list of floats
def get_histogram(image): """ Created: 06.08.2006, KP Description: Return the histogrm of the image as a list of floats """ accu = vtk.vtkImageAccumulate() accu.SetInputConnection(image.GetProducerPort()) x0, x1 = image.GetScalarRange() x1 = int(math.floor(x1)) accu.SetComponentExtent(0, x1, 0, 0, 0, 0) accu.Update() data = accu.GetOutput() values = [] x0, x1, y0, y1, z0, z1 = data.GetWholeExtent() for i in range(0, x1 + 1): c = data.GetScalarComponentAsDouble(i, 0, 0, 0) values.append(c) return values
59f8acdb5416aea79a1089de01da2db3415f72dc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2877/59f8acdb5416aea79a1089de01da2db3415f72dc/ImageOperations.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 22702, 12, 2730, 4672, 3536, 12953, 30, 13026, 18, 6840, 18, 6976, 26, 16, 1475, 52, 6507, 30, 2000, 326, 8892, 434, 326, 1316, 487, 279, 666, 434, 19172, 3536, 4078, 89, 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, 336, 67, 22702, 12, 2730, 4672, 3536, 12953, 30, 13026, 18, 6840, 18, 6976, 26, 16, 1475, 52, 6507, 30, 2000, 326, 8892, 434, 326, 1316, 487, 279, 666, 434, 19172, 3536, 4078, 89, 273,...
def _cmd_remove(self, index): del self.phonebook[int(index)]
def _cmd_table(self, options, *args): """Print a table""" if args: entries = self.parse_indices(*args) else: entries = self.phonebook self.print_table(entries) def _cmd_list(self, options, *args): """Print a list""" if args: entries = self.parse_indices(*args) else: entries = self.phonebook self.print_short_list(entries) def _cmd_show(self, options, *args): """Show a single entry""" if args: entries = self.parse_indices(*args) else: entries = self.phonebook self.print_long_list(entries) def _cmd_search(self, options, *args): """Search the phone book for `pattern`""" found = [] for pattern in args: entries = self.phonebook.search(pattern) new = filter(lambda entry: entry not in found, entries) found += new self.print_table(found) def _cmd_create(self, options, *args): """Interactivly create a new entry""" number = 1 if len(args) == 1: try: number = int(args[0]) except ValueError: sys._exit(_('--create needs a number')) if len(args) > 1: sys.exit(_('--create accepts only one argument')) for func in itertools.repeat(self.edit_entry, 2): func() def _cmd_edit(self, options, *args): """Interactivly edit entries""" entries = self.parse_indices(*args) for entry in entries: self.edit_entry(entry) def _cmd_remove(self, options, *args): for entry in self.parse_indices(*args): resp = raw_input(_('Really delete entry %s? ') % repr(entry)) if resp.lower() == 'y': self.phonebook.remove(entry)
def _cmd_remove(self, index): del self.phonebook[int(index)] self.phonebook.save()
500a390f053c916fbb5e449916c39bcc41901f78 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2215/500a390f053c916fbb5e449916c39bcc41901f78/tel.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4172, 67, 2121, 12, 2890, 16, 702, 16, 380, 1968, 4672, 3536, 5108, 279, 1014, 8395, 309, 833, 30, 3222, 273, 365, 18, 2670, 67, 6836, 30857, 1968, 13, 469, 30, 3222, 273, 365, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4172, 67, 2121, 12, 2890, 16, 702, 16, 380, 1968, 4672, 3536, 5108, 279, 1014, 8395, 309, 833, 30, 3222, 273, 365, 18, 2670, 67, 6836, 30857, 1968, 13, 469, 30, 3222, 273, 365, ...
def rowsAboutToBeInserted(self, parent, start, end):
def rowsAboutToBeInserted(self, parent, start, dummyEnd):
def rowsAboutToBeInserted(self, parent, start, end): """ Store what is about to be inserted to make sure it actually happens """ c = {} c['parent'] = parent c['oldSize'] = self.model.rowCount(parent) c['last'] = self.model.data(self.model.index(start-1, 0, parent)) c['next'] = self.model.data(self.model.index(start, 0, parent)) self.insert.append(c)
ed4ea4fec39587cca2aeb18d36a0fa5f722ca150 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1679/ed4ea4fec39587cca2aeb18d36a0fa5f722ca150/modeltest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2595, 24813, 15360, 27329, 12, 2890, 16, 982, 16, 787, 16, 9609, 1638, 4672, 3536, 4994, 4121, 353, 2973, 358, 506, 9564, 358, 1221, 3071, 518, 6013, 10555, 3536, 276, 273, 2618, 276, 32...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2595, 24813, 15360, 27329, 12, 2890, 16, 982, 16, 787, 16, 9609, 1638, 4672, 3536, 4994, 4121, 353, 2973, 358, 506, 9564, 358, 1221, 3071, 518, 6013, 10555, 3536, 276, 273, 2618, 276, 32...
assert "Content-Type: application/octet-stream" in meta['headers'] assert "Content-Length: %d" % len(data) in meta['headers']
assert ("Content-Type", "application/octet-stream") in meta['headers'] assert ("Content-Length", len(data)) in meta['headers']
def test_put_cache_file_like_data(self): """Test if put_cache() works when we give it a file like object for the content""" request = self.request key = 'nooneknowsit' filename = "test.png" data = "dontcareatall" data_file = StringIO.StringIO(data) cache.put(request, key, data_file) url = cache.url(request, key)
05b0e285b1c029b47f61a84e4eafc3dc8031fe62 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/888/05b0e285b1c029b47f61a84e4eafc3dc8031fe62/test_cache.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 458, 67, 2493, 67, 768, 67, 5625, 67, 892, 12, 2890, 4672, 3536, 4709, 309, 1378, 67, 2493, 1435, 6330, 1347, 732, 8492, 518, 279, 585, 3007, 733, 364, 326, 913, 8395, 590, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 458, 67, 2493, 67, 768, 67, 5625, 67, 892, 12, 2890, 4672, 3536, 4709, 309, 1378, 67, 2493, 1435, 6330, 1347, 732, 8492, 518, 279, 585, 3007, 733, 364, 326, 913, 8395, 590, ...
version='grind %s' % __version__,
def get_grind_arg_parser(parser=None): """ Create the command-line parser for the find-like companion program. """ if parser is None: parser = argparse.ArgumentParser( description="Find text and binary files using similar rules as grin.", epilog="Bug reports to <enthought-dev@mail.enthought.com>.", version='grind %s' % __version__, ) parser.add_argument('-s', '--no-skip-hidden-files', dest='skip_hidden_files', action='store_false', help="do not skip .hidden files") parser.add_argument('--skip-hidden-files', dest='skip_hidden_files', action='store_true', default=True, help="do skip .hidden files") parser.add_argument('-b', '--no-skip-backup-files', dest='skip_backup_files', action='store_false', help="do not skip backup~ files [deprecated; edit --skip-exts]") parser.add_argument('--skip-backup-files', dest='skip_backup_files', action='store_true', default=True, help="do skip backup~ files [default] [deprecated; edit --skip-exts]") parser.add_argument('-S', '--no-skip-hidden-dirs', dest='skip_hidden_dirs', action='store_false', help="do not skip .hidden directories") parser.add_argument('--skip-hidden-dirs', dest='skip_hidden_dirs', default=True, action='store_true', help="do skip .hidden directories") parser.add_argument('-d', '--skip-dirs', default='CVS,RCS,.svn,.hg,.bzr,build,dist', help="comma-separated list of directory names to skip [default=%(default)r]") parser.add_argument('-D', '--no-skip-dirs', dest='skip_dirs', action='store_const', const='', help="do not skip any directories") parser.add_argument('-e', '--skip-exts', default='.pyc,.pyo,.so,.o,.a,.tgz,.tar.gz,.rar,.zip,~,#,.bak,.png,.jpg,.gif,.bmp,.tif,.tiff,.pyd,.dll,.exe,.obj,.lib', help="comma-separated list of file extensions to skip [default=%(default)r]") parser.add_argument('-E', '--no-skip-exts', dest='skip_exts', action='store_const', const='', help="do not skip any file extensions") parser.add_argument('--no-follow', action='store_false', dest='follow_symlinks', default=False, help="do not follow symlinks to directories and files [default]") parser.add_argument('--follow', action='store_true', dest='follow_symlinks', help="follow symlinks to directories and files") parser.add_argument('-0', '--null-separated', action='store_true', help="print the filenames separated by NULs") parser.add_argument('--dirs', nargs='+', default=["."], help="the directories to start from") parser.add_argument('--sys-path', action='store_true', help="search the directories on sys.path") parser.add_argument('glob', default='*', nargs='?', help="the glob pattern to match; you may need to quote this to prevent " "the shell from trying to expand it [default=%(default)r]") return parser
148fefeeb963c5a4a3991c7fe1e4b61c9b0a2b87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10903/148fefeeb963c5a4a3991c7fe1e4b61c9b0a2b87/grin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 3197, 728, 67, 3175, 67, 4288, 12, 4288, 33, 7036, 4672, 3536, 1788, 326, 1296, 17, 1369, 2082, 364, 326, 1104, 17, 5625, 1161, 304, 285, 5402, 18, 3536, 309, 2082, 353, 599, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3197, 728, 67, 3175, 67, 4288, 12, 4288, 33, 7036, 4672, 3536, 1788, 326, 1296, 17, 1369, 2082, 364, 326, 1104, 17, 5625, 1161, 304, 285, 5402, 18, 3536, 309, 2082, 353, 599, ...
if stdout == None:
if stdout is None:
def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ p2cread, p2cwrite = None, None c2pread, c2pwrite = None, None errread, errwrite = None, None
95702de0f98da1d3b802ca9a49a105d914f43a51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/95702de0f98da1d3b802ca9a49a105d914f43a51/subprocess.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 24111, 12, 2890, 16, 8801, 16, 3909, 16, 4514, 4672, 3536, 7249, 471, 327, 15822, 292, 598, 1665, 2184, 30, 293, 22, 71, 896, 16, 293, 22, 71, 2626, 16, 276, 22, 84, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 24111, 12, 2890, 16, 8801, 16, 3909, 16, 4514, 4672, 3536, 7249, 471, 327, 15822, 292, 598, 1665, 2184, 30, 293, 22, 71, 896, 16, 293, 22, 71, 2626, 16, 276, 22, 84, ...
command = "matlab -nodisplay",
command = "sage-native-execute matlab -nodisplay",
def __init__(self, maxread=100, script_subdirectory="", logfile=None, server=None,server_tmpdir=None): Expect.__init__(self, name = 'matlab', prompt = '>> ', command = "matlab -nodisplay", maxread = maxread, server = server, server_tmpdir = server_tmpdir, script_subdirectory = script_subdirectory, restart_on_ctrlc = False, verbose_start = False, logfile = logfile, eval_using_file_cutoff=100)
6495e6e7eec1890cc329efe3ca0d11742ac3248c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/6495e6e7eec1890cc329efe3ca0d11742ac3248c/matlab.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 943, 896, 33, 6625, 16, 2728, 67, 1717, 5149, 1546, 3113, 15204, 33, 7036, 16, 1438, 33, 7036, 16, 3567, 67, 5645, 1214, 33, 7036, 4672, 15510, 16186, 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, 1001, 2738, 972, 12, 2890, 16, 943, 896, 33, 6625, 16, 2728, 67, 1717, 5149, 1546, 3113, 15204, 33, 7036, 16, 1438, 33, 7036, 16, 3567, 67, 5645, 1214, 33, 7036, 4672, 15510, 16186, 27...
doc = self.small(doc and '<tt>%s<br>&nbsp;</tt>' % doc or '<tt>&nbsp;</tt>') return self.section(title, '
doc = self.small(doc and '<tt>%s<br>&nbsp;</tt>' % doc or self.small('&nbsp;')) return self.section(title, '
def docclass(self, object, name=None, funcs={}, classes={}): """Produce HTML documentation for a class object.""" realname = object.__name__ name = name or realname bases = object.__bases__ contents = ''
5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 997, 1106, 12, 2890, 16, 733, 16, 508, 33, 7036, 16, 15630, 28793, 3318, 12938, 4672, 3536, 25884, 3982, 7323, 364, 279, 667, 733, 12123, 2863, 529, 273, 733, 16186, 529, 972, 508, 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, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 997, 1106, 12, 2890, 16, 733, 16, 508, 33, 7036, 16, 15630, 28793, 3318, 12938, 4672, 3536, 25884, 3982, 7323, 364, 279, 667, 733, 12123, 2863, 529, 273, 733, 16186, 529, 972, 508, 273, ...
other = self._convert_other(other) ans = self._check_nans(other, context) if ans: return ans if self and not other: return context._raise_error(InvalidOperation, 'x % 0') return self._divide(other, 3, context)[1] def __rmod__(self, other, context=None): """Swaps self/other and returns __mod__.""" other = self._convert_other(other) return other.__mod__(self, context=context) def remainder_near(self, other, context=None): """ Remainder nearest to 0- abs(remainder-near) <= other/2 """ if context is None: context = getcontext() other = self._convert_other(other) ans = self._check_nans(other, context) if ans: return ans if self and not other: return context._raise_error(InvalidOperation, 'x % 0')
def __mod__(self, other, context=None): """ self % other """ if context is None: context = getcontext() other = self._convert_other(other)
1a63da64df2af26e1f050749c19281f1de9084fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1a63da64df2af26e1f050749c19281f1de9084fa/decimal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1711, 972, 12, 2890, 16, 1308, 16, 819, 33, 7036, 4672, 3536, 365, 738, 1308, 3536, 309, 819, 353, 599, 30, 819, 273, 336, 2472, 1435, 1308, 273, 365, 6315, 6283, 67, 3011, 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, 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, 1711, 972, 12, 2890, 16, 1308, 16, 819, 33, 7036, 4672, 3536, 365, 738, 1308, 3536, 309, 819, 353, 599, 30, 819, 273, 336, 2472, 1435, 1308, 273, 365, 6315, 6283, 67, 3011, 12, ...
write_message("Stage 3 : Start (Update bibfmt).", verbose=2)
write_message("Stage 3: Start (Update bibfmt).", verbose=2)
def bibupload(record): """Main function: process a record and fit it in the tables bibfmt, bibrec, bibrec_bibxxx, bibxxx with proper record metadata. Return (error_code, recID) of the processed record. """ error = None #If there are special tags to proceed check if it exists in the record if options['tag'] != None and not(record.has_key(options['tag'])): write_message(" Failed: Tag not found, enter a valid tag to update.", verbose=1, stream=sys.stderr) return (1, -1) #Extraction of the Record Id rec_id = retrieve_rec_id(record) if rec_id == -1: return (1, -1) else: write_message(" -Retrieve record Id (found %s) : DONE." % rec_id, verbose=2) write_message(" -Check if the xml marc file is already in the database : DONE" , verbose=2) # Reference mode check if there are reference tag if options['mode'] == 'reference': error = extract_tag_from_record(record, cfg_bibupload_reference_tag) if error == None: write_message(" Failed : No reference tags has been found...", verbose=1, stream=sys.stderr) return (1, -1) else: error = None write_message(" -Check if reference tags exist : DONE", verbose=2) if options['mode'] == 'insert': # Insert the record into the bibrec databases to have a recordId rec_id = create_new_record() write_message(" -Creation of a new record id (%d) : DONE" % rec_id, verbose=2) # we add the record Id control field to the record error = record_add_field(record, '001', '', '', rec_id) if error == None: write_message(" Failed: " \ "Error during adding the 001 controlfield " \ "to the record", verbose=1, stream=sys.stderr) return (1, rec_id) else: error = None elif options['mode'] != 'insert' and options['mode'] != 'format' and options['stage_to_start_from'] != 5: # Update Mode #Retrieve the old record to update rec_old = create_record(print_record(int(rec_id),'xm'), 2)[0] if rec_old == None: write_message(" Failed during the creation of the old record!", verbose=1, stream=sys.stderr) return (1, rec_id) else: write_message(" -Retrieve the old record to update : DONE", verbose=2) #Delete tags to correct in the record if options['mode'] == 'correct' or options['mode'] == 'reference': delete_tags_to_correct(record, rec_old) write_message(" -Delete the old tags to correct in the old record: DONE", verbose=2) # Append new tag to the old record and update the new record with the old_record modified if options['mode'] == 'append' or options['mode'] == 'correct' or options['mode'] == 'reference': record = append_new_tag_to_old_record(record, rec_old) write_message(" -Append new tags to the old record: DONE", verbose=2) # now we clear all the rows from bibrec_bibxxx from the old record delete_bibrec_bibxxx(rec_old, rec_id) write_message(" -Clean bibrec_bibxxx: DONE", verbose=2) write_message(" -Stage COMPLETED", verbose=2) #Have a look if we have FMT tags write_message("Stage 1: Start (Insert of FMT tags if exist).", verbose=2) if options['stage_to_start_from'] <= 1 and extract_tag_from_record(record,'FMT') != None: record = insert_fmt_tags(record, rec_id) if record == None: write_message(" Stage 1 failed: Error while inserting FMT tags", verbose=1, stream=sys.stderr) return (1, rec_id) elif record == 0: #Mode format finished stat['nb_records_updated'] += 1 return (0, rec_id) write_message(" -Stage COMPLETED", verbose=2) else: write_message(" -Stage NOT NEEDED", verbose=2) #Have a look if we have FFT tags write_message("Stage 2: Start (Process FFT tags if exist).", verbose=2) if options['stage_to_start_from'] <= 2 and extract_tag_from_record(record,'FFT') != None: if options['mode'] == 'insert' or options['mode'] == 'append': record = insert_fft_tags(record, rec_id) else: record = update_fft_tag(record, rec_id) write_message(" -Stage COMPLETED", verbose=2) else: write_message(" -Stage NOT NEEDED", verbose=2) # Update of the BibFmt write_message("Stage 3 : Start (Update bibfmt).", verbose=2) if options['stage_to_start_from'] <= 3: # format the single record as xml rec_xml_new = record_xml_output(record) #Update bibfmt with the format xm of this record error = update_bibfmt_format(rec_id, rec_xml_new, 'xm') if error == 1: write_message(" Failed: error during update_bibfmt_format", verbose=1, stream=sys.stderr) return (1, rec_id) write_message(" -Stage COMPLETED", verbose=2) # Update the database MetaData write_message("Stage 4 : Start (Update the database with the metadata).", verbose=2) if options['stage_to_start_from'] <= 4: update_database_with_metadata(record, rec_id) write_message(" -Stage COMPLETED", verbose=2) else: write_message(" -Stage NOT NEEDED", verbose=2) # Finally we update the bibrec table with the current date write_message("Stage 5 : Start (Update bibrec table with current date).", verbose=2) if options['stage_to_start_from'] <= 5 and options['mode'] != 'insert' and options['notimechange'] == 0: now = convert_datestruct_to_datetext(time.localtime()) write_message(" -Retrieve current localtime : DONE", verbose=2) update_bibrec_modif_date(now, rec_id) write_message(" -Stage COMPLETED", verbose=2) else: write_message(" -Stage NOT NEEDED", verbose=2) #Increase statistics if options['mode'] == 'insert': stat['nb_records_inserted'] += 1 else: stat['nb_records_updated'] += 1 #Upload of this record finish write_message("Record "+str(rec_id)+" DONE", verbose=1) return (0, rec_id)
c01e7675eac4ac02844b96fe38be4646d43de28c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/c01e7675eac4ac02844b96fe38be4646d43de28c/bibupload.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25581, 6327, 12, 3366, 4672, 3536, 6376, 445, 30, 1207, 279, 1409, 471, 4845, 518, 316, 326, 4606, 25581, 8666, 16, 25581, 3927, 16, 25581, 3927, 67, 70, 495, 18310, 16, 25581, 18310, 59...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25581, 6327, 12, 3366, 4672, 3536, 6376, 445, 30, 1207, 279, 1409, 471, 4845, 518, 316, 326, 4606, 25581, 8666, 16, 25581, 3927, 16, 25581, 3927, 67, 70, 495, 18310, 16, 25581, 18310, 59...
self.tree.apply2all( func_selmols)
self.topnode.apply2all( func_selmols)
def func_selmols(nn): "run this exactly once on all molecules (or other nodes) in this part (in any order)" if isinstance(nn, molecule) and nn.picked: res.append(nn) return # from func_selmols only
0abde4f5ce347d2e9de87cb0501caffd0127e8c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/0abde4f5ce347d2e9de87cb0501caffd0127e8c2/part.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1326, 67, 1786, 81, 3528, 12, 9074, 4672, 315, 2681, 333, 8950, 3647, 603, 777, 312, 29466, 261, 280, 1308, 2199, 13, 316, 333, 1087, 261, 267, 1281, 1353, 2225, 309, 1549, 12, 9074, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1326, 67, 1786, 81, 3528, 12, 9074, 4672, 315, 2681, 333, 8950, 3647, 603, 777, 312, 29466, 261, 280, 1308, 2199, 13, 316, 333, 1087, 261, 267, 1281, 1353, 2225, 309, 1549, 12, 9074, 1...
debug=0,
debug=logging.WARN,
def __init__(self, nc='out.nc', outnc=None, debug=0, stay_alive=False, **kwargs): ''' Initialize the Jacapo calculator
e111e7f7da49e775bf6f578ffb8369e435e7a68c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5735/e111e7f7da49e775bf6f578ffb8369e435e7a68c/jacapo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 8194, 2218, 659, 18, 14202, 2187, 596, 14202, 33, 7036, 16, 1198, 33, 11167, 18, 27999, 16, 23449, 67, 11462, 33, 8381, 16, 2826, 4333, 4672, 9163, 9190, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 8194, 2218, 659, 18, 14202, 2187, 596, 14202, 33, 7036, 16, 1198, 33, 11167, 18, 27999, 16, 23449, 67, 11462, 33, 8381, 16, 2826, 4333, 4672, 9163, 9190, ...
self.dbusObj.RequestResource(self.resource)
self.dbusObj.SetResourcePolicy(self.resource, "auto")
def toggleChanged(self, obj, *args, **kargs): """ Toggle the resource to opposite the toggle changed-to state Update the toggles to match current system settings """ if not(obj.state_get()): self.dbusObj.RequestResource(self.resource) else: self.dbusObj.ReleaseResource(self.resource) self.update()
288b28b5a57a8cc797a6e177ae7aa397d28a18c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11428/288b28b5a57a8cc797a6e177ae7aa397d28a18c3/shr_pm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10486, 5033, 12, 2890, 16, 1081, 16, 380, 1968, 16, 2826, 79, 1968, 4672, 3536, 399, 9891, 326, 1058, 358, 20759, 326, 10486, 3550, 17, 869, 919, 2315, 326, 6316, 75, 1040, 358, 845, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10486, 5033, 12, 2890, 16, 1081, 16, 380, 1968, 16, 2826, 79, 1968, 4672, 3536, 399, 9891, 326, 1058, 358, 20759, 326, 10486, 3550, 17, 869, 919, 2315, 326, 6316, 75, 1040, 358, 845, 7...
classes.append(value)
classes.append((key, value))
def docmodule(self, object): """Produce text documentation for a given module object.""" result = ''
a8b37d1a3238fb85be760a30db03672525e8f591 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/a8b37d1a3238fb85be760a30db03672525e8f591/pydoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 997, 2978, 12, 2890, 16, 733, 4672, 3536, 25884, 977, 7323, 364, 279, 864, 1605, 733, 12123, 563, 273, 875, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 997, 2978, 12, 2890, 16, 733, 4672, 3536, 25884, 977, 7323, 364, 279, 864, 1605, 733, 12123, 563, 273, 875, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
for flickr_url, chronam_url in flickr_chronam_links():
for flickr_url, chronam_url in flickr_chronam_links(flickr_key):
def handle(self, flickr_key, **options): _log.debug("looking for chronam page content on flickr") for flickr_url, chronam_url in flickr_chronam_links(): _log.info("found flickr/chronam link: %s, %s" % (flickr_url, chronam_url)) path = urlparse(chronam_url).path page = Page.lookup(path) if page: f, created = FlickrUrl.objects.get_or_create(value=flickr_url, page=page) if created: f.save() _log.info("updated page (%s) with flickr url (%s)" % (page, flickr_url)) else: _log.info("already knew about %s" % flickr_url) else: _log.error("Page for %s not found" % chronam_url)
6e42313b8137ef5d63ca92582bf4dc7d98a6f3ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6299/6e42313b8137ef5d63ca92582bf4dc7d98a6f3ce/flickr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 12, 2890, 16, 1183, 16254, 67, 856, 16, 2826, 2116, 4672, 389, 1330, 18, 4148, 2932, 7330, 310, 364, 12227, 301, 1363, 913, 603, 1183, 16254, 7923, 364, 1183, 16254, 67, 718, 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, 1640, 12, 2890, 16, 1183, 16254, 67, 856, 16, 2826, 2116, 4672, 389, 1330, 18, 4148, 2932, 7330, 310, 364, 12227, 301, 1363, 913, 603, 1183, 16254, 7923, 364, 1183, 16254, 67, 718, 16, ...
__memory_insert_row = ( "INSERT INTO Memory VALUES " "(null, ?, ?, ?, ?, ?, ?, ?, ?)"
_memory_insert_row = ( "INSERT INTO Memory VALUES (null, %s)" % ','.join(['?'] * (len(_memory_table_definition.split(',')) - 1))
def get(self, key): """ Retrieves a crash from the container.
9a9ad459c3708948326e6a88c2e71486063105f6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7261/9a9ad459c3708948326e6a88c2e71486063105f6/crash.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 2890, 16, 498, 4672, 3536, 20507, 279, 17053, 628, 326, 1478, 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, ...
[ 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, 336, 12, 2890, 16, 498, 4672, 3536, 20507, 279, 17053, 628, 326, 1478, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
def handle_connection(sumo_command, conn, addr, keep_temp):
def handle_connection(sumo_command, shlex, conn, addr, keep_temp):
def handle_connection(sumo_command, conn, addr, keep_temp): """ Handle incoming connection. """ logging.debug("Handling connection from %s on port %d" % addr) try: data = read_launch_config(conn) handle_launch_configuration(sumo_command, data, conn, keep_temp) except Exception, e: logging.error("Aborting on error: %s" % e) finally: logging.debug("Closing connection from %s on port %d" % addr) conn.close()
6b13c373057a765e123909544eca271ecae92757 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3656/6b13c373057a765e123909544eca271ecae92757/sumo-launchd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 4071, 12, 1364, 83, 67, 3076, 16, 27180, 16, 1487, 16, 3091, 16, 3455, 67, 5814, 4672, 3536, 5004, 6935, 1459, 18, 3536, 225, 2907, 18, 4148, 2932, 14701, 1459, 628, 738, 87,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 4071, 12, 1364, 83, 67, 3076, 16, 27180, 16, 1487, 16, 3091, 16, 3455, 67, 5814, 4672, 3536, 5004, 6935, 1459, 18, 3536, 225, 2907, 18, 4148, 2932, 14701, 1459, 628, 738, 87,...
except:
except MIPSolverException:
def edge_coloring(g, value_only=False, vizing=False, hex_colors=False, log=0): r""" Properly colors the edges of a graph. See the URL http://en.wikipedia.org/wiki/Edge_coloring for further details on edge coloring. INPUT: - ``g`` -- a graph. - ``value_only`` -- (default: ``False``): - When set to ``True``, only the chromatic index is returned. - When set to ``False``, a partition of the edge set into matchings is returned if possible. - ``vizing`` -- (default: ``False``): - When set to ``True``, tries to find a `\Delta + 1`-edge-coloring, where `\Delta` is equal to the maximum degree in the graph. - When set to ``False``, tries to find a `\Delta`-edge-coloring, where `\Delta` is equal to the maximum degree in the graph. If impossible, tries to find and returns a `\Delta + 1`-edge-coloring. This implies that ``value_only=False``. - ``hex_colors`` -- (default: ``False``) when set to ``True``, the partition returned is a dictionary whose keys are colors and whose values are the color classes (ideal for plotting). - ``log`` -- (default: ``0``) as edge-coloring is an `NP`-complete problem, this function may take some time depending on the graph. Use ``log`` to define the level of verbosity you wantfrom the linear program solver. By default ``log=0``, meaning that there will be no message printed by the solver. OUTPUT: In the following, `\Delta` is equal to the maximum degree in the graph ``g``. - If ``vizing=True`` and ``value_only=False``, return a partition of the edge set into `\Delta + 1` matchings. - If ``vizing=False`` and ``value_only=True``, return the chromatic index. - If ``vizing=False`` and ``value_only=False``, return a partition of the edge set into the minimum number of matchings. - If ``vizing=True`` and ``value_only=True``, should return something, but mainly you are just trying to compute the maximum degree of the graph, and this is not the easiest way. By Vizing's theorem, a graph has a chromatic index equal to `\Delta` or to `\Delta + 1`. .. NOTE:: In a few cases, it is possible to find very quickly the chromatic index of a graph, while it remains a tedious job to compute a corresponding coloring. For this reason, ``value_only = True`` can sometimes be much faster, and it is a bad idea to compute the whole coloring if you do not need it ! EXAMPLE:: sage: from sage.graphs.graph_coloring import edge_coloring sage: g = graphs.PetersenGraph() sage: edge_coloring(g, value_only=True) # optional - requires GLPK or CBC 4 Complete graphs are colored using the linear-time round-robin coloring:: sage: from sage.graphs.graph_coloring import edge_coloring sage: len(edge_coloring(graphs.CompleteGraph(20))) 19 """ from sage.numerical.mip import MixedIntegerLinearProgram from sage.plot.colors import rainbow from sage.numerical.mip import MIPSolverException if g.is_clique(): if value_only: return g.order()-1 if g.order() % 2 == 0 else g.order() vertices = g.vertices() r = round_robin(g.order()) classes = [[] for v in g] if g.order() % 2 == 0 and not vizing: classes.pop() for (u, v, c) in r.edge_iterator(): classes[c].append((vertices[u], vertices[v])) if hex_colors: return dict(zip(rainbow(len(classes)), classes)) else: return classes if value_only and g.is_overfull(): return max(g.degree())+1 p = MixedIntegerLinearProgram(maximization=True) color = p.new_variable(dim=2) obj = {} k = max(g.degree()) # reorders the edge if necessary... R = lambda x: x if (x[0] <= x[1]) else (x[1], x[0]) # Vizing's coloring uses Delta + 1 colors if vizing: value_only = False k += 1 # A vertex can not have two incident edges with the same color. [p.add_constraint( sum([color[R(e)][i] for e in g.edges_incident(v, labels=False)]), max=1) for v in g.vertex_iterator() for i in xrange(k)] # an edge must have a color [p.add_constraint(sum([color[R(e)][i] for i in xrange(k)]), max=1, min=1) for e in g.edge_iterator(labels=False)] # anything is good as an objective value as long as it is satisfiable e = g.edge_iterator(labels=False).next() p.set_objective(color[R(e)][0]) p.set_binary(color) try: if value_only: p.solve(objective_only=True, log=log) else: chi = p.solve(log=log) except: if value_only: return k + 1 else: # if the coloring with Delta colors fails, tries Delta + 1 return edge_coloring(g, vizing=True, hex_colors=hex_colors, log=log) if value_only: return k # Builds the color classes color = p.get_values(color) classes = [[] for i in xrange(k)] [classes[i].append(e) for e in g.edge_iterator(labels=False) for i in xrange(k) if color[R(e)][i] == 1] # if needed, builds a dictionary from the color classes adding colors if hex_colors: return dict(zip(rainbow(len(classes)), classes)) else: return classes
f8a4840b981a88293ff407d02e2b06df77e6383d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f8a4840b981a88293ff407d02e2b06df77e6383d/graph_coloring.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3591, 67, 3266, 310, 12, 75, 16, 460, 67, 3700, 33, 8381, 16, 331, 6894, 33, 8381, 16, 3827, 67, 9724, 33, 8381, 16, 613, 33, 20, 4672, 436, 8395, 1186, 457, 715, 5740, 326, 5231, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3591, 67, 3266, 310, 12, 75, 16, 460, 67, 3700, 33, 8381, 16, 331, 6894, 33, 8381, 16, 3827, 67, 9724, 33, 8381, 16, 613, 33, 20, 4672, 436, 8395, 1186, 457, 715, 5740, 326, 5231, ...
return 'account_bob_import.res_partner_destroyed'
return 'res_partner_destroyed'
def _get_partner_id(char): if bob_conv_matching.has_key(char): return bob_conv_matching[char] return 'account_bob_import.res_partner_destroyed' #or char ?
91b57e9ff0689ab8391b1982eae39a23d58f6d10 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7339/91b57e9ff0689ab8391b1982eae39a23d58f6d10/bob_import_step_2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 31993, 67, 350, 12, 3001, 4672, 309, 800, 70, 67, 4896, 67, 16271, 18, 5332, 67, 856, 12, 3001, 4672, 327, 800, 70, 67, 4896, 67, 16271, 63, 3001, 65, 327, 296, 455, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 31993, 67, 350, 12, 3001, 4672, 309, 800, 70, 67, 4896, 67, 16271, 18, 5332, 67, 856, 12, 3001, 4672, 327, 800, 70, 67, 4896, 67, 16271, 63, 3001, 65, 327, 296, 455, ...
orig = p def func(m): return string.lower (m.group(1))
orig = p def func (m): return string.lower (m.group (1))
def find_file (nm): for d in include_dirs: p = os.path.join (d, nm) try: f = open (p) return p except IOError: pass p = popen ('kpsewhich %s' % nm).read ()[:-1] # urg. Did I do this ? if dos_kpath_p: orig = p def func(m): return string.lower (m.group(1)) p = string.lower (p) p = re.sub ('^([a-z]):', '/cygdrive/\\1', p) p = re.sub ('\\\\', '/', p) sys.stderr.write ("Got `%s' from kpsewhich, using `%s'\n" % (orig, p)) return p
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 768, 261, 15094, 4672, 364, 302, 316, 2341, 67, 8291, 30, 293, 273, 1140, 18, 803, 18, 5701, 261, 72, 16, 8442, 13, 775, 30, 284, 273, 1696, 261, 84, 13, 327, 293, 1335, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 768, 261, 15094, 4672, 364, 302, 316, 2341, 67, 8291, 30, 293, 273, 1140, 18, 803, 18, 5701, 261, 72, 16, 8442, 13, 775, 30, 284, 273, 1696, 261, 84, 13, 327, 293, 1335, ...
'module':'base_external_referentials'
'module':'base_external_referentials_keep'
def ext_import(self, cr, uid, data, external_referential_id, defaults={}, context={}): #Inward data has to be list of dictionary #This function will import a given set of data as list of dictionary into Open ERP write_ids = [] #Will record ids of records modified, not sure if will be used create_ids = [] #Will record ids of newly created records, not sure if will be used logger = netsvc.Logger() if data: mapping_id = self.pool.get('external.mapping').search(cr, uid, [('model', '=', self._name), ('referential_id', '=', external_referential_id)]) if mapping_id: #If a mapping exists for current model, search for mapping lines mapping_line_ids = self.pool.get('external.mapping.line').search(cr, uid, [('mapping_id', '=', mapping_id), ('type', 'in', ['in_out', 'in'])]) mapping_lines = self.pool.get('external.mapping.line').read(cr, uid, mapping_line_ids, ['external_field', 'external_type', 'in_function']) if mapping_lines: #if mapping lines exist find the data conversion for each row in inward data for_key_field = self.pool.get('external.mapping').read(cr, uid, mapping_id[0], ['external_key_name'])['external_key_name'] for each_row in data: vals = self.oevals_from_extdata(cr, uid, external_referential_id, each_row, for_key_field, mapping_lines, defaults, context) #perform a record check, for that we need foreign field external_id = vals.get(for_key_field, False) or each_row.get(for_key_field, False) or each_row.get('external_id', False) #del vals[for_key_field] looks like it is affecting the import :( #Check if record exists existing_ir_model_data_id = self.pool.get('ir.model.data').search(cr, uid, [('model', '=', self._name), ('name', '=', self.prefixed_id(external_id))]) record_test_id = False if existing_ir_model_data_id: existing_rec_id = self.pool.get('ir.model.data').read(cr, uid, existing_ir_model_data_id, ['res_id'])[0]['res_id'] #Note: OpenERP cleans up ir_model_data which res_id records have been deleted only at server update because that would be a perf penalty, #so we take care of it here: record_test_id = self.search(cr, uid, [('id', '=', existing_rec_id)]) if not record_test_id: self.pool.get('ir.model.data').unlink(cr, uid, existing_ir_model_data_id)
0f01bee6284da5a7152fcf8140972e4f148b4f59 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/0f01bee6284da5a7152fcf8140972e4f148b4f59/external_osv.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1110, 67, 5666, 12, 2890, 16, 4422, 16, 4555, 16, 501, 16, 3903, 67, 266, 586, 2001, 67, 350, 16, 3467, 28793, 819, 12938, 4672, 468, 382, 2913, 501, 711, 358, 506, 666, 434, 3880, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1110, 67, 5666, 12, 2890, 16, 4422, 16, 4555, 16, 501, 16, 3903, 67, 266, 586, 2001, 67, 350, 16, 3467, 28793, 819, 12938, 4672, 468, 382, 2913, 501, 711, 358, 506, 666, 434, 3880, 4...
u"Romanian localization"),
u"Romanian localization and support for the frletter document class"),
def main(argv, contributers): if len(argv) != 4: error(usage(argv[0])) txt_credits_data = unicode(as_txt_credits(contributers)).encode("utf-8") txt_credits = open(argv[1], "w") txt_credits.write(txt_credits_data) php_credits_data = unicode(as_php_credits(contributers, argv[2])).encode("utf-8") php_credits = open(argv[2], "w") php_credits.write(php_credits_data) php_blanket_data = unicode(as_php_blanket(contributers, argv[3])).encode("utf-8") php_blanket = open(argv[3], "w") php_blanket.write(php_blanket_data) warning_data = unicode(collate_incomplete(contributers) + '\n').encode("utf-8") sys.stderr.write(warning_data)
df57334081beee1fd5c05ae5c2b9b98622a23cb5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7514/df57334081beee1fd5c05ae5c2b9b98622a23cb5/generate_contributions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 16, 13608, 322, 414, 4672, 309, 562, 12, 19485, 13, 480, 1059, 30, 555, 12, 9167, 12, 19485, 63, 20, 22643, 225, 6463, 67, 20610, 1282, 67, 892, 273, 5252, 12, 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, 2774, 12, 19485, 16, 13608, 322, 414, 4672, 309, 562, 12, 19485, 13, 480, 1059, 30, 555, 12, 9167, 12, 19485, 63, 20, 22643, 225, 6463, 67, 20610, 1282, 67, 892, 273, 5252, 12, 345, ...
cell.set_property('stock-size', gtk.ICON_SIZE_MENU)
if gpodder.interface == gpodder.MAEMO: cell.set_property('stock-size', gtk.ICON_SIZE_DIALOG) else: cell.set_property('stock-size', gtk.ICON_SIZE_MENU)
def new(self): if gpodder.interface == gpodder.MAEMO: # Maemo-specific changes to the UI global scalable_dir scalable_dir = scalable_dir.replace('.svg', '.png') self.app = hildon.Program() gtk.set_application_name('gPodder') self.window = hildon.Window() self.window.connect('delete-event', self.on_gPodder_delete_event) self.window.connect('window-state-event', self.window_state_event) self.itemUpdateChannel.show() self.UpdateChannelSeparator.show() # Remove old toolbar from its parent widget self.toolbar.get_parent().remove(self.toolbar)
510c784e2954344f295cb7cfc7e22925148e180f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12778/510c784e2954344f295cb7cfc7e22925148e180f/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 12, 2890, 4672, 309, 4178, 369, 765, 18, 5831, 422, 4178, 369, 765, 18, 5535, 3375, 51, 30, 468, 490, 69, 351, 83, 17, 12524, 3478, 358, 326, 6484, 2552, 8292, 429, 67, 1214, 82...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 12, 2890, 4672, 309, 4178, 369, 765, 18, 5831, 422, 4178, 369, 765, 18, 5535, 3375, 51, 30, 468, 490, 69, 351, 83, 17, 12524, 3478, 358, 326, 6484, 2552, 8292, 429, 67, 1214, 82...
tx = os.path.join(getdefaultribpath(scene), texture.name+framepadding(scene)+".bake").replace('\\', '/')
tx = os.path.join(getdefaultribpath(scene), texture.name+framepadding(scene)+".bake").replace('\\', '\\\\')
def writeshaderparameter(parameterlist, write, scene): for parm in parameterlist: if parm.parametertype == 'string': if parm.texture: if parm.texture != "" and parm.textparameter in bpy.data.textures: texture = bpy.data.textures[parm.textparameter] if texture.renderman.type == "file": image = texture.image if image.source == 'GENERATED': image.filepath = os.path.join(getdefaultribpath(scene), image.name) image.save() if texture.renderman.process: prepare_texture(texture.image.filepath, "", scene) tx = prepared_texture_file(texture.image.filepath, scene).replace('\\', '/') elif texture.renderman.type =="envmap": file = scene.renderman_settings.passes[texture.renderman.envpass].displaydrivers[0].file tx = file.replace("[dir]", "").replace("[frame]", framepadding(scene)) elif texture.renderman.type == "bake": tx = os.path.join(getdefaultribpath(scene), texture.name+framepadding(scene)+".bake").replace('\\', '/') write('"'+parm.name+'"'+' ["'+tx+'"] ') else: write('"'+parm.name+'"' + ' ["' + parm.textparameter + '"] ') if parm.parametertype == 'float' and parm.vector_size == 1: write('"'+parm.name+'"' + " [" + str(parm.float_one[0]) + '] ') if parm.parametertype == 'color': colR = parm.colorparameter[0] colG = parm.colorparameter[1] colB = parm.colorparameter[2] write('"'+parm.name+'"' + " [" + str(colR) + " " + str(colG) + " " + str(colB) + "] ") if parm.parametertype == 'float' and parm.vector_size == 3: x = str(parm.float_three[0]) y = str(parm.float_three[1]) z = str(parm.float_three[2]) write('"'+parm.name+'"' + " [" + x + " " + y + " " + z + "] ")
b10f4abbb5360412c3b365c442c9ca1bcf9933b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14285/b10f4abbb5360412c3b365c442c9ca1bcf9933b5/export_renderman.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2518, 4607, 1143, 6775, 12, 6775, 1098, 16, 1045, 16, 9065, 4672, 364, 19924, 316, 1569, 1098, 30, 309, 19924, 18, 6775, 723, 422, 296, 1080, 4278, 309, 19924, 18, 955, 594, 30, 309, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2518, 4607, 1143, 6775, 12, 6775, 1098, 16, 1045, 16, 9065, 4672, 364, 19924, 316, 1569, 1098, 30, 309, 19924, 18, 6775, 723, 422, 296, 1080, 4278, 309, 19924, 18, 955, 594, 30, 309, 1...
If the genre does not exist, insert it and return its id.
If the category does not exist, insert it and return its id. This function should have been called getCategoryId
def getGenreId(self, genre_name): """ Find the id of the given genre from MythDB.
5b53e77a87b7ea5cec0896e51918eaa1c68ff306 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/5b53e77a87b7ea5cec0896e51918eaa1c68ff306/MythVideo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7162, 275, 266, 548, 12, 2890, 16, 3157, 266, 67, 529, 4672, 3536, 4163, 326, 612, 434, 326, 864, 3157, 266, 628, 8005, 451, 2290, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7162, 275, 266, 548, 12, 2890, 16, 3157, 266, 67, 529, 4672, 3536, 4163, 326, 612, 434, 326, 864, 3157, 266, 628, 8005, 451, 2290, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100...
gen = UserContributionsGenerator(arg[14:])
args = arg[14:].split(';') number = None try: number = int(args[1]) except: number = 250 gen = UserContributionsGenerator(args[0], number)
def handleArg(self, arg): """Parse one argument at a time.
52581b0ea7f86481838cec1b98eee11b8bc0dd90 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/52581b0ea7f86481838cec1b98eee11b8bc0dd90/pagegenerators.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 4117, 12, 2890, 16, 1501, 4672, 3536, 3201, 1245, 1237, 622, 279, 813, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 4117, 12, 2890, 16, 1501, 4672, 3536, 3201, 1245, 1237, 622, 279, 813, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
process_file(module_doc)
try: process_file(module_doc) except tokenize.TokenError, e: msg, (srow, scol) = e.args raise ParseError('Error during parsing: %s ' '(%s, line %d, char %d)' % (msg, module_doc.filename, srow, scol))
def parse_docs(filename=None, name=None, context=None, is_script=False): """ Generate the API documentation for a specified object by parsing Python source files, and return it as a L{ValueDoc}. The object to generate documentation for may be specified using the C{filename} parameter I{or} the C{name} parameter. (It is an error to specify both a filename and a name; or to specify neither a filename nor a name). @param filename: The name of the file that contains the python source code for a package, module, or script. If C{filename} is specified, then C{parse} will return a C{ModuleDoc} describing its contents. @param name: The fully-qualified python dotted name of any value (including packages, modules, classes, and functions). C{DocParser} will automatically figure out which module(s) it needs to parse in order to find the documentation for the specified object. @param context: The API documentation for the package that contains C{filename}. If no context is given, then C{filename} is assumed to contain a top-level module or package. It is an error to specify a C{context} if the C{name} argument is used. @rtype: L{ValueDoc} """ # If our input is a python object name, then delegate to # _find(). if filename is None and name is not None: if context: raise ValueError("context should only be specified together " "with filename, not with name.") name = DottedName(name) val_doc = _find(name) if val_doc.canonical_name == UNKNOWN: val_doc.canonical_name = name return val_doc # If our input is a filename, then create a ModuleDoc for it, # and use process_file() to populate its attributes. elif filename is not None and name is None: # Use a python source version, if possible. if not is_script: try: filename = py_src_filename(filename) except ValueError, e: raise ImportError('%s' % e) # Check the cache, first. if _moduledoc_cache.has_key(filename): return _moduledoc_cache[filename] log.info("Parsing %s" % filename) # If the context wasn't provided, then check if the file is in # a package directory. If so, then update basedir & name to # contain the topmost package's directory and the fully # qualified name for this file. (This update assume the # default value of __path__ for the parent packages; if the # parent packages override their __path__s, then this can # cause us not to find the value.) if context is None and not is_script: basedir = os.path.split(filename)[0] name = os.path.splitext(os.path.split(filename)[1])[0] if name == '__init__': basedir, name = os.path.split(basedir) context = _parse_package(basedir) # Figure out the canonical name of the module we're parsing. module_name, is_pkg = _get_module_name(filename, context) # Mark scripts if is_script: module_name = DottedName(munge_script_name(str(module_name))) # Create a new ModuleDoc for the module, & add it to the cache. module_doc = ModuleDoc(canonical_name=module_name, variables={}, sort_spec=[], imports=[], filename=filename, package=context, is_package=is_pkg, submodules=[]) _moduledoc_cache[filename] = module_doc # Set the module's __path__ to its default value. if is_pkg: module_doc.path = [os.path.split(module_doc.filename)[0]] # Add this module to the parent package's list of submodules. if context is not None: context.submodules.append(module_doc) # Tokenize & process the contents of the module's source file. process_file(module_doc) # Handle any special variables (__path__, __docformat__, etc.) handle_special_module_vars(module_doc) # Return the completed ModuleDoc return module_doc else: raise ValueError("Expected exactly one of the following " "arguments: name, filename")
76aa87c4f3f84f87b6c947e3387d535503259a2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/76aa87c4f3f84f87b6c947e3387d535503259a2a/docparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 8532, 12, 3459, 33, 7036, 16, 508, 33, 7036, 16, 819, 33, 7036, 16, 353, 67, 4263, 33, 8381, 4672, 3536, 6654, 326, 1491, 7323, 364, 279, 1269, 733, 635, 5811, 6600, 1084, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8532, 12, 3459, 33, 7036, 16, 508, 33, 7036, 16, 819, 33, 7036, 16, 353, 67, 4263, 33, 8381, 4672, 3536, 6654, 326, 1491, 7323, 364, 279, 1269, 733, 635, 5811, 6600, 1084, ...
self.base_fields['id'] = forms.IntegerField(widget=forms.HiddenInput())
self.base_fields['id'] = forms.IntegerField(widget=forms.HiddenInput(), required=False)
def __init__(self, bit = None, *args, **kwargs):
79942e52916e15ce46cc8c58fabf2655c2b28d02 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12041/79942e52916e15ce46cc8c58fabf2655c2b28d02/admincore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2831, 273, 599, 16, 380, 1968, 16, 2826, 4333, 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, 1001, 2738, 972, 12, 2890, 16, 2831, 273, 599, 16, 380, 1968, 16, 2826, 4333, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
title=_(u'&First Day Week'),
title=_(u'&First Day of Week'),
def addMnemonic(title, used): for index, character in enumerate(title): if (character.isalpha() and not character.lower() in usedMnemonics): usedMnemonics.add(character.lower()) return u"%s&%s" % (title[:index], title[index:]) return title
37c202daf4f4c0de4f17e224903233b50bdac62c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9228/37c202daf4f4c0de4f17e224903233b50bdac62c/menus.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 29668, 20918, 12, 2649, 16, 1399, 4672, 364, 770, 16, 3351, 316, 4241, 12, 2649, 4672, 309, 261, 11560, 18, 291, 5429, 1435, 471, 486, 3351, 18, 8167, 1435, 316, 1399, 29668, 4758, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 29668, 20918, 12, 2649, 16, 1399, 4672, 364, 770, 16, 3351, 316, 4241, 12, 2649, 4672, 309, 261, 11560, 18, 291, 5429, 1435, 471, 486, 3351, 18, 8167, 1435, 316, 1399, 29668, 4758, ...
for rr in r: if rr.type!="A": continue ret.append((socket.AF_INET,socktype,proto,cname,(rr.ip,port)))
if r: for rr in r: if rr.type!="A": continue ret.append((socket.AF_INET,socktype,proto,cname,(rr.ip,port)))
def getaddrinfo(host,port,family=0,socktype=socket.SOCK_STREAM,proto=0): ret=[] if proto==0: proto=socket.getprotobyname("tcp") if ip_re.match(host): return [(socket.AF_INET,socktype,proto,host,(host,port))] r=query(host,"A") if r and r[0].type=="CNAME": cname=r[0].target r=query(cname,"A") else: cname=host for rr in r: if rr.type!="A": continue ret.append((socket.AF_INET,socktype,proto,cname,(rr.ip,port))) return ret
9e6b3c3d30ddbe72fc0b133c6249616952b1d341 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12769/9e6b3c3d30ddbe72fc0b133c6249616952b1d341/resolver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 4793, 1376, 12, 2564, 16, 655, 16, 9309, 33, 20, 16, 15031, 723, 33, 7814, 18, 3584, 3507, 67, 13693, 16, 9393, 33, 20, 4672, 325, 33, 8526, 309, 3760, 631, 20, 30, 3760, 33, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 4793, 1376, 12, 2564, 16, 655, 16, 9309, 33, 20, 16, 15031, 723, 33, 7814, 18, 3584, 3507, 67, 13693, 16, 9393, 33, 20, 4672, 325, 33, 8526, 309, 3760, 631, 20, 30, 3760, 33, ...
return self.evaluateNoCall (expr[7:].lstrip())
res = self.evaluateNoCall (expr[7:].lstrip())
def evaluate (self, expr, originalAtts = None): # Returns a ContextVariable self.log.debug ("Evaluating %s" % expr) if (originalAtts is not None): # Call from outside self.globals['attrs'] = ContextVariable(originalAtts) # Supports path, exists, nocall, not, and string expr = expr.strip () if expr.startswith ('path:'): return self.evaluatePath (expr[5:].lstrip ()) elif expr.startswith ('exists:'): return self.evaluateExists (expr[7:].lstrip()) elif expr.startswith ('nocall:'): return self.evaluateNoCall (expr[7:].lstrip()) elif expr.startswith ('not:'): return self.evaluateNot (expr[4:].lstrip()) elif expr.startswith ('string:'): return self.evaluateString (expr[7:].lstrip()) elif expr.startswith ('python:'): return self.evaluatePython (expr[7:].lstrip()) else: # Not specified - so it's a path return self.evaluatePath (expr)
0edb6e3f2306e15c10eb82adbad02c9b014afe28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/0edb6e3f2306e15c10eb82adbad02c9b014afe28/simpleTALES.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5956, 261, 2890, 16, 3065, 16, 2282, 3075, 87, 273, 599, 4672, 468, 2860, 279, 1772, 3092, 365, 18, 1330, 18, 4148, 7566, 6644, 1776, 738, 87, 6, 738, 3065, 13, 309, 261, 8830, 3075, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5956, 261, 2890, 16, 3065, 16, 2282, 3075, 87, 273, 599, 4672, 468, 2860, 279, 1772, 3092, 365, 18, 1330, 18, 4148, 7566, 6644, 1776, 738, 87, 6, 738, 3065, 13, 309, 261, 8830, 3075, ...
print w, h
def fitSquare(self): w=max([t.boundingRect().width() for t in self.textObj]+[2]) h=self.textOffset+2 GraphicsTextContainer.setRect(self, 0, 0, w+2, h) print w, h
2db098e71431a8a32d84813543e9f34bc14235ba /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/2db098e71431a8a32d84813543e9f34bc14235ba/OWTreeViewer2D.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4845, 22255, 12, 2890, 4672, 341, 33, 1896, 3816, 88, 18, 3653, 310, 6120, 7675, 2819, 1435, 364, 268, 316, 365, 18, 955, 2675, 3737, 63, 22, 5717, 366, 33, 2890, 18, 955, 2335, 15, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4845, 22255, 12, 2890, 4672, 341, 33, 1896, 3816, 88, 18, 3653, 310, 6120, 7675, 2819, 1435, 364, 268, 316, 365, 18, 955, 2675, 3737, 63, 22, 5717, 366, 33, 2890, 18, 955, 2335, 15, ...
result.add_option("--crankshaft", help="Run with the --crankshaft flag", default=False, action="store_true")
def BuildOptions(): result = optparse.OptionParser() result.add_option("-m", "--mode", help="The test modes in which to run (comma-separated)", default='release') result.add_option("-v", "--verbose", help="Verbose output", default=False, action="store_true") result.add_option("-S", dest="scons_flags", help="Flag to pass through to scons", default=[], action="append") result.add_option("-p", "--progress", help="The style of progress indicator (verbose, dots, color, mono)", choices=PROGRESS_INDICATORS.keys(), default="mono") result.add_option("--no-build", help="Don't build requirements", default=False, action="store_true") result.add_option("--build-only", help="Only build requirements, don't run the tests", default=False, action="store_true") result.add_option("--report", help="Print a summary of the tests to be run", default=False, action="store_true") result.add_option("-s", "--suite", help="A test suite", default=[], action="append") result.add_option("-t", "--timeout", help="Timeout in seconds", default=60, type="int") result.add_option("--arch", help='The architecture to run tests for', default='none') result.add_option("--snapshot", help="Run the tests with snapshot turned on", default=False, action="store_true") result.add_option("--simulator", help="Run tests with architecture simulator", default='none') result.add_option("--special-command", default=None) result.add_option("--valgrind", help="Run tests through valgrind", default=False, action="store_true") result.add_option("--cat", help="Print the source of the tests", default=False, action="store_true") result.add_option("--warn-unused", help="Report unused rules", default=False, action="store_true") result.add_option("-j", help="The number of parallel tasks to run", default=1, type="int") result.add_option("--time", help="Print timing information after running", default=False, action="store_true") result.add_option("--suppress-dialogs", help="Suppress Windows dialogs for crashing tests", dest="suppress_dialogs", default=True, action="store_true") result.add_option("--no-suppress-dialogs", help="Display Windows dialogs for crashing tests", dest="suppress_dialogs", action="store_false") result.add_option("--shell", help="Path to V8 shell", default="shell") result.add_option("--store-unexpected-output", help="Store the temporary JS files from tests that fails", dest="store_unexpected_output", default=True, action="store_true") result.add_option("--no-store-unexpected-output", help="Deletes the temporary JS files from tests that fails", dest="store_unexpected_output", action="store_false") result.add_option("--stress-only", help="Only run tests with --always-opt --stress-opt", default=False, action="store_true") result.add_option("--nostress", help="Don't run crankshaft --always-opt --stress-op test", default=False, action="store_true") result.add_option("--crankshaft", help="Run with the --crankshaft flag", default=False, action="store_true") return result
7f1dbbd240296ba8c50f37c1acfba329dc43f9ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6651/7f1dbbd240296ba8c50f37c1acfba329dc43f9ab/test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3998, 1320, 13332, 563, 273, 2153, 2670, 18, 1895, 2678, 1435, 563, 18, 1289, 67, 3482, 2932, 17, 81, 3113, 5238, 3188, 3113, 2809, 1546, 1986, 1842, 12382, 316, 1492, 358, 1086, 261, 25...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3998, 1320, 13332, 563, 273, 2153, 2670, 18, 1895, 2678, 1435, 563, 18, 1289, 67, 3482, 2932, 17, 81, 3113, 5238, 3188, 3113, 2809, 1546, 1986, 1842, 12382, 316, 1492, 358, 1086, 261, 25...
self.queue.append((pkg, OPER_REMOVE))
self.queue.append((pkg, OPER_REMOVE, len(self.backtrack)))
def _remove(self, pkg, reason, pkg1, pkg2): """ Remove package including upgrade/downgrade as an alternative. """ # Look for packages obsoleting the removed # package (upgrade) as an alternative. for prv in pkg.provides: for obs, obspkgs in prv.getObsoletedBy(): for obspkg in obspkgs: if obspkg in self.touched or self.getInstalled(obspkg): continue self.backtrack.append((obspkg, OPER_INSTALL, reason, pkg1, pkg2, self.getState())) # Look for packages obsoleted by the removed # package (downgrade) as an alternative. for obs in pkg.obsoletes: for prv, prvpkgs in obs.getProvidedBy(): for prvpkg in prvpkgs: if prvpkg in self.touched or self.getInstalled(prvpkg): continue self.backtrack.append((prvpkg, OPER_INSTALL, reason, pkg1, pkg2, self.getState()))
e9831a12235fcae7ab1b6189a4d00b2b6f1634cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8317/e9831a12235fcae7ab1b6189a4d00b2b6f1634cf/transaction.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4479, 12, 2890, 16, 3475, 16, 3971, 16, 3475, 21, 16, 3475, 22, 4672, 3536, 3581, 2181, 6508, 8400, 19, 2378, 3994, 487, 392, 10355, 18, 3536, 468, 10176, 364, 5907, 7160, 355, 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, 389, 4479, 12, 2890, 16, 3475, 16, 3971, 16, 3475, 21, 16, 3475, 22, 4672, 3536, 3581, 2181, 6508, 8400, 19, 2378, 3994, 487, 392, 10355, 18, 3536, 468, 10176, 364, 5907, 7160, 355, 21...
self.name = os.path.basename(directory)
def __init__(self, directory, parent, name = '', display_type = None, add_args = None): Playlist.__init__(self, parent=parent) self.type = 'dir' self.menuw = None self.menu = None self.name = os.path.basename(directory)
6ff66596c21713c3a79d46766f6c833d9afb9adb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/6ff66596c21713c3a79d46766f6c833d9afb9adb/directory.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1867, 16, 982, 16, 508, 273, 10226, 2562, 67, 723, 273, 599, 16, 527, 67, 1968, 273, 599, 4672, 19592, 1098, 16186, 2738, 972, 12, 2890, 16, 982, 33, 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, 1001, 2738, 972, 12, 2890, 16, 1867, 16, 982, 16, 508, 273, 10226, 2562, 67, 723, 273, 599, 16, 527, 67, 1968, 273, 599, 4672, 19592, 1098, 16186, 2738, 972, 12, 2890, 16, 982, 33, 2...
"""Waits until the specified keyword succeeds or the given timeout expires.
"""Waits until the specified keyword succeeds or the given timeout expires.
def wait_until_keyword_succeeds(self, timeout, retry_interval, name, *args): """Waits until the specified keyword succeeds or the given timeout expires. 'name' and 'args' define the keyword that is executed. If the specified keyword does not succeed within 'timeout', this keyword fails. 'retry_interval' is the time to wait before trying to run the keyword again after the previous run has failed. Both 'timeout' and 'retry_interval' must be given in Robot Framework's time format (e.g. '1 minute', '2 min 3 s', '4.5'). Example: | Wait Until Keyword Succeeds | 2 min | 5 sec | My keyword | arg1 | arg2 | New in Robot Framework version 1.8.1. """ timeout = utils.timestr_to_secs(timeout) retry_interval = utils.timestr_to_secs(retry_interval) starttime = _time.time() while _time.time() - starttime < timeout: try: return self.run_keyword(name, *args) except: _time.sleep(retry_interval) raise Exception("Timeout %s exceeded" % utils.secs_to_timestr(timeout))
ef8b3c513c2fbfbe39dbbc410ee472d3b6ab88a2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7408/ef8b3c513c2fbfbe39dbbc410ee472d3b6ab88a2/BuiltIn.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2529, 67, 12198, 67, 11041, 67, 87, 5286, 5288, 87, 12, 2890, 16, 2021, 16, 3300, 67, 6624, 16, 508, 16, 380, 1968, 4672, 3536, 26153, 3180, 326, 1269, 4932, 21933, 578, 326, 864, 2021...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2529, 67, 12198, 67, 11041, 67, 87, 5286, 5288, 87, 12, 2890, 16, 2021, 16, 3300, 67, 6624, 16, 508, 16, 380, 1968, 4672, 3536, 26153, 3180, 326, 1269, 4932, 21933, 578, 326, 864, 2021...
if drawer.textsize(' '.join(thistext),font)[0] > containerWidth:
if drawer.textsize(' '.join(thistext),font.getFont())[0] > containerWidth:
def intelliDraw(drawer,text,font,containerWidth): """Based on http://mail.python.org/pipermail/image-sig/2004-December/003064.html""" #Args: # drawer: Instance of "ImageDraw.Draw()" # text: string of long text to be wrapped # font: instance of ImageFont (I use .truetype) # containerWidth: number of pixels text lines have to fit into. #write("containerWidth: %s" % containerWidth) words = text.split() lines = [] # prepare a return argument lines.append(words) finished = False line = 0 while not finished: thistext = lines[line] newline = [] innerFinished = False while not innerFinished: #write( 'thistext: '+str(thistext)) #write("textWidth: %s" % drawer.textsize(' '.join(thistext),font)[0]) if drawer.textsize(' '.join(thistext),font)[0] > containerWidth: # this is the heart of the algorithm: we pop words off the current # sentence until the width is ok, then in the next outer loop # we move on to the next sentence. if str(thistext).find(' ') != -1: newline.insert(0,thistext.pop(-1)) else: # FIXME should truncate the string here innerFinished = True else: innerFinished = True if len(newline) > 0: lines.append(newline) line = line + 1 else: finished = True tmp = [] for i in lines: tmp.append( ' '.join(i) ) lines = tmp (width,height) = drawer.textsize(lines[0],font) return (lines,width,height)
c82d8a0c4a33fc669861191621297cdbb83d3d9b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13713/c82d8a0c4a33fc669861191621297cdbb83d3d9b/mythburn.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 509, 292, 549, 6493, 12, 9446, 264, 16, 955, 16, 5776, 16, 3782, 2384, 4672, 3536, 9802, 603, 1062, 2207, 4408, 18, 8103, 18, 3341, 19, 7259, 457, 4408, 19, 2730, 17, 7340, 19, 6976, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 509, 292, 549, 6493, 12, 9446, 264, 16, 955, 16, 5776, 16, 3782, 2384, 4672, 3536, 9802, 603, 1062, 2207, 4408, 18, 8103, 18, 3341, 19, 7259, 457, 4408, 19, 2730, 17, 7340, 19, 6976, ...
"""
"""
def fl_create_box(type, x, y, w, h, label): """ fl_create_box(type, x, y, w, h, label) -> object """ retval = _fl_create_box(type, x, y, w, h, label) return retval
9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 2640, 67, 2147, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 4672, 3536, 1183, 67, 2640, 67, 2147, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 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, 1183, 67, 2640, 67, 2147, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 4672, 3536, 1183, 67, 2640, 67, 2147, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 13, ...
print coords
print coords
def set_datapath(path): global _finder_callback_set if not _finder_callback_set: libproj.pj_set_finder(finder_func) _finder_callback_set = True search_path.set_searchpath(path)
caea3c25c8bbb62580b2abae845a3b6e9c49a5df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11249/caea3c25c8bbb62580b2abae845a3b6e9c49a5df/proj.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 892, 803, 12, 803, 4672, 2552, 389, 15356, 67, 3394, 67, 542, 309, 486, 389, 15356, 67, 3394, 67, 542, 30, 2561, 17995, 18, 84, 78, 67, 542, 67, 15356, 12, 15356, 67, 644, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 892, 803, 12, 803, 4672, 2552, 389, 15356, 67, 3394, 67, 542, 309, 486, 389, 15356, 67, 3394, 67, 542, 30, 2561, 17995, 18, 84, 78, 67, 542, 67, 15356, 12, 15356, 67, 644, ...
rv = unpacker.unpack(self.archiveFilename, output=output)
rv = unpacker.unpack(self.archiveFilename, output=output, package=self)
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" if self._dict.has_key('Install-command'): return "%s: Binary package cannot have Install-command" % self.fullname() if self._dict.has_key('Pre-install-command'): if _cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Pre-install-command']) self.beforeInstall()
b8bc1787f4d2ad5bafcd19ae7aee7c0bf279e0f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b8bc1787f4d2ad5bafcd19ae7aee7c0bf279e0f5/pimp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 2261, 3386, 12, 2890, 16, 876, 33, 7036, 4672, 3536, 6410, 279, 2202, 1084, 2181, 18, 225, 971, 876, 353, 864, 518, 1410, 506, 279, 585, 17, 5625, 733, 471, 518, 903, 6798, 279, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 2261, 3386, 12, 2890, 16, 876, 33, 7036, 4672, 3536, 6410, 279, 2202, 1084, 2181, 18, 225, 971, 876, 353, 864, 518, 1410, 506, 279, 585, 17, 5625, 733, 471, 518, 903, 6798, 279, ...
dtype=numpy.dtype('i%d' % self.indsize))
dtype=numpy.dtype('u%d' % self.indsize))
def reorder_slices(self, tmp): """Reorder completely the index at slice level.
cac7fa90baf2dcde2a5f445c16751dcb191a15ae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12687/cac7fa90baf2dcde2a5f445c16751dcb191a15ae/index.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19427, 67, 21562, 12, 2890, 16, 1853, 4672, 3536, 426, 1019, 14416, 326, 770, 622, 2788, 1801, 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,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19427, 67, 21562, 12, 2890, 16, 1853, 4672, 3536, 426, 1019, 14416, 326, 770, 622, 2788, 1801, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
def _update_dependencies(self, cr, uid, id, depends=[]):
def _update_dependencies(self, cr, uid, id, depends=None): if depends is None: depends = []
def _update_dependencies(self, cr, uid, id, depends=[]): for d in depends: cr.execute('INSERT INTO ir_module_module_dependency (module_id, name) values (%s, %s)', (id, d))
d4c36de1e04f70d7a0ae8479f77b8a6d38aed4c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/d4c36de1e04f70d7a0ae8479f77b8a6d38aed4c1/module.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2725, 67, 11037, 12, 2890, 16, 4422, 16, 4555, 16, 612, 16, 10935, 33, 7036, 4672, 309, 10935, 353, 599, 30, 10935, 273, 5378, 364, 302, 316, 10935, 30, 4422, 18, 8837, 2668, 1135...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2725, 67, 11037, 12, 2890, 16, 4422, 16, 4555, 16, 612, 16, 10935, 33, 7036, 4672, 309, 10935, 353, 599, 30, 10935, 273, 5378, 364, 302, 316, 10935, 30, 4422, 18, 8837, 2668, 1135...
ameaning = Meaning(u'een ding',aword)
ameaning = Meaning(u'een persoon',aword)
def wikiwrap(self,wikilang): return()
3857c33ffc3beac922d870b30b2d14cc5143c3c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/3857c33ffc3beac922d870b30b2d14cc5143c3c3/wiktionary.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9050, 4113, 12, 2890, 16, 11999, 330, 539, 4672, 327, 1435, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 9050, 4113, 12, 2890, 16, 11999, 330, 539, 4672, 327, 1435, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
meta = MetaData(testbase.db) users = Table('users', meta,
meta = MetaData(testbase.db) users = Table('users', meta,
def test_override_create_fkcols(self): """test that you can override columns and create new foreign keys to other reflected tables. this is common with MySQL MyISAM tables.""" meta = MetaData(testbase.db) users = Table('users', meta, Column('id', Integer, primary_key=True), Column('name', String(30))) addresses = Table('addresses', meta, Column('id', Integer, primary_key=True), Column('street', String(30)), Column('user_id', Integer)) meta.create_all() try: meta2 = MetaData(testbase.db) a2 = Table('addresses', meta2, Column('user_id', Integer, ForeignKey('users.id')), autoload=True) u2 = Table('users', meta2, autoload=True) assert len(a2.c.user_id.foreign_keys) == 1 assert len(a2.foreign_keys) == 1 assert [c.parent for c in a2.foreign_keys] == [a2.c.user_id] assert [c.parent for c in a2.c.user_id.foreign_keys] == [a2.c.user_id] assert list(a2.c.user_id.foreign_keys)[0].parent is a2.c.user_id assert u2.join(a2).onclause == u2.c.id==a2.c.user_id
35ff8ed25e8a03b36461fbe09d0530bb1164ce82 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1074/35ff8ed25e8a03b36461fbe09d0530bb1164ce82/reflection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 10601, 67, 2640, 67, 23120, 6842, 12, 2890, 4672, 3536, 3813, 716, 1846, 848, 3849, 2168, 471, 752, 394, 5523, 1311, 358, 1308, 21591, 4606, 18, 333, 353, 2975, 598, 13485, 800...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10601, 67, 2640, 67, 23120, 6842, 12, 2890, 4672, 3536, 3813, 716, 1846, 848, 3849, 2168, 471, 752, 394, 5523, 1311, 358, 1308, 21591, 4606, 18, 333, 353, 2975, 598, 13485, 800...
nodes = [] nodes.extend(flatten_nodes(self.defaults)) nodes.append(self.code) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.defaults)) nodelist.append(self.code) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.defaults)) nodes.append(self.code) return tuple(nodes)
101b9307b0d9de62f324ef9ffa6e83f8040af642 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/101b9307b0d9de62f324ef9ffa6e83f8040af642/ast.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23895, 12, 2890, 4672, 2199, 273, 5378, 2199, 18, 14313, 12, 16940, 67, 4690, 12, 2890, 18, 7606, 3719, 2199, 18, 6923, 12, 2890, 18, 710, 13, 327, 3193, 12, 4690, 13, 2, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23895, 12, 2890, 4672, 2199, 273, 5378, 2199, 18, 14313, 12, 16940, 67, 4690, 12, 2890, 18, 7606, 3719, 2199, 18, 6923, 12, 2890, 18, 710, 13, 327, 3193, 12, 4690, 13, 2, -100, -100, ...
pass
def __init__(self, suffix=None): self.suffix = suffix
def __init__(self, offset=None): self.offset = offset
08966e33a63aeb5e305c57b77efd0697dc6d511d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2063/08966e33a63aeb5e305c57b77efd0697dc6d511d/prettyprinter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1384, 33, 7036, 4672, 365, 18, 3348, 273, 1384, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1384, 33, 7036, 4672, 365, 18, 3348, 273, 1384, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
return -1
raise SMTPDataError(code,repl)
def data(self,msg): """SMTP 'DATA' command -- sends message data to server. Automatically quotes lines beginning with a period per rfc821. """ self.putcmd("data") (code,repl)=self.getreply() if self.debuglevel >0 : print "data:", (code,repl) if code <> 354: return -1 else: self.send(quotedata(msg)) self.send("%s.%s" % (CRLF, CRLF)) (code,msg)=self.getreply() if self.debuglevel >0 : print "data:", (code,msg) return code
296e14301a7aa23a5ee2bfaa1210af54e594cbbf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/296e14301a7aa23a5ee2bfaa1210af54e594cbbf/smtplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 501, 12, 2890, 16, 3576, 4672, 3536, 55, 14636, 296, 4883, 11, 1296, 1493, 9573, 883, 501, 358, 1438, 18, 11809, 20271, 10681, 2362, 8435, 598, 279, 3879, 1534, 16590, 28, 5340, 18, 3536...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 501, 12, 2890, 16, 3576, 4672, 3536, 55, 14636, 296, 4883, 11, 1296, 1493, 9573, 883, 501, 358, 1438, 18, 11809, 20271, 10681, 2362, 8435, 598, 279, 3879, 1534, 16590, 28, 5340, 18, 3536...
if len(combine_paths(d,['fftc8.h','fftfreq.h']))==2:
if len(self.combine_paths(d,['fftc8.h','fftfreq.h']))==2:
def calc_info(self): lib_dirs = self.get_lib_dirs() incl_dirs = self.get_include_dirs() info = None for d in lib_dirs: p = combine_paths (d,['djbfft.a']) if p: info = {'extra_objects':p} break if info is None: return for d in incl_dirs: if len(combine_paths(d,['fftc8.h','fftfreq.h']))==2: dict_append(info,include_dirs=[d], define_macros=[('SCIPY_DJBFFT_H',None)]) self.set_info(**info) return
11cffa55fceeda7a779a5a596b22fb98270f22b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/11cffa55fceeda7a779a5a596b22fb98270f22b8/system_info.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7029, 67, 1376, 12, 2890, 4672, 2561, 67, 8291, 273, 365, 18, 588, 67, 2941, 67, 8291, 1435, 2823, 67, 8291, 273, 365, 18, 588, 67, 6702, 67, 8291, 1435, 1123, 273, 599, 364, 302, 31...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7029, 67, 1376, 12, 2890, 4672, 2561, 67, 8291, 273, 365, 18, 588, 67, 2941, 67, 8291, 1435, 2823, 67, 8291, 273, 365, 18, 588, 67, 6702, 67, 8291, 1435, 1123, 273, 599, 364, 302, 31...
colorspace = 'RGB'
colorSpace = 'RGB'
def PIL_imagedata(self): image = self.image if image.format=='JPEG': fp=image.fp fp.seek(0) return self._jpg_imagedata(fp) self.source = 'PIL' zlib = import_zlib() if not zlib: return myimage = image.convert('RGB')
ff8d514d698be36ad12398bfcadb863633f0c043 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3878/ff8d514d698be36ad12398bfcadb863633f0c043/pdfimages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29407, 67, 381, 11349, 396, 12, 2890, 4672, 1316, 273, 365, 18, 2730, 309, 1316, 18, 2139, 18920, 28698, 4278, 4253, 33, 2730, 18, 7944, 4253, 18, 16508, 12, 20, 13, 327, 365, 6315, 14...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29407, 67, 381, 11349, 396, 12, 2890, 4672, 1316, 273, 365, 18, 2730, 309, 1316, 18, 2139, 18920, 28698, 4278, 4253, 33, 2730, 18, 7944, 4253, 18, 16508, 12, 20, 13, 327, 365, 6315, 14...
self.default_expiration_period, self.defaut_purge_period)
self.default_expiration_period, self.default_purge_period)
def register_fetcher(self, object_class, fetcher_class): """Register a fetcher class for an object class.
0625ab496d1fe6d23ab9ca760f7e37a85e77fa3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12769/0625ab496d1fe6d23ab9ca760f7e37a85e77fa3b/cache.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1744, 67, 5754, 264, 12, 2890, 16, 733, 67, 1106, 16, 20521, 67, 1106, 4672, 3536, 3996, 279, 20521, 667, 364, 392, 733, 667, 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, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1744, 67, 5754, 264, 12, 2890, 16, 733, 67, 1106, 16, 20521, 67, 1106, 4672, 3536, 3996, 279, 20521, 667, 364, 392, 733, 667, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -10...
return '\n'.join(lines)
return '\n'.join(lines)
def strip_comments(self, sql): lines = [l for l in sql.splitlines() if not l.strip().startswith('--')] return '\n'.join(lines)
d8039ade77c5266fda2e6d6c28067691a0b9b22a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6718/d8039ade77c5266fda2e6d6c28067691a0b9b22a/command.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2569, 67, 9231, 12, 2890, 16, 1847, 4672, 2362, 273, 306, 80, 364, 328, 316, 1847, 18, 4939, 3548, 1435, 309, 486, 328, 18, 6406, 7675, 17514, 1918, 2668, 413, 6134, 65, 327, 2337, 82,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2569, 67, 9231, 12, 2890, 16, 1847, 4672, 2362, 273, 306, 80, 364, 328, 316, 1847, 18, 4939, 3548, 1435, 309, 486, 328, 18, 6406, 7675, 17514, 1918, 2668, 413, 6134, 65, 327, 2337, 82,...
self.previousSelectionParams = newSelectionParams selectedSegments = newSelectionParams self.segmentListWidget.updateSelection(selectedSegments) if len(selectedSegments) == 1: self.editSegmentPropertiesButton.setEnabled(True) else: self.editSegmentPropertiesButton.setEnabled(False)
if not selection_params_unchanged and structure_params_unchanged: self._previousSelectionParams = currentSelectionParams selectedSegments = currentSelectionParams self.segmentListWidget.updateSelection(selectedSegments) if len(selectedSegments) == 1: self.editSegmentPropertiesButton.setEnabled(True) else: self.editSegmentPropertiesButton.setEnabled(False) if not structure_params_unchanged: self._previousStructureParams = currentStructParams self.updateListWidgets()
def model_changed(self): """ When the command is treated as a 'command' by the commandSequencer, this method will override basicCommand.model_changed. For more info, see BuildAtomsPropertyManager.model_changed docstring. """ newSelectionParams = self._currentSelectionParams() if same_vals(newSelectionParams, self.previousSelectionParams): return self.previousSelectionParams = newSelectionParams selectedSegments = newSelectionParams
1235b6715ff62eb812d26f2083809e1d3b430cb8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/1235b6715ff62eb812d26f2083809e1d3b430cb8/BuildNanotube_PropertyManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 938, 67, 6703, 12, 2890, 4672, 3536, 5203, 326, 1296, 353, 13974, 487, 279, 296, 3076, 11, 635, 326, 1296, 1761, 372, 23568, 16, 333, 707, 903, 3849, 5337, 2189, 18, 2284, 67, 6703, 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, 938, 67, 6703, 12, 2890, 4672, 3536, 5203, 326, 1296, 353, 13974, 487, 279, 296, 3076, 11, 635, 326, 1296, 1761, 372, 23568, 16, 333, 707, 903, 3849, 5337, 2189, 18, 2284, 67, 6703, 18...