rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
ts = DataTree.objects.filter(id=extra)[0]
def clearslot(self, request, tl, one, two, module, extra, prog):
ece2b1e23a02e2382eb65061ea864f64c166edfc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12041/ece2b1e23a02e2382eb65061ea864f64c166edfc/studentclassregmodule.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2424, 14194, 12, 2890, 16, 590, 16, 8332, 16, 1245, 16, 2795, 16, 1605, 16, 2870, 16, 11243, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2424, 14194, 12, 2890, 16, 590, 16, 8332, 16, 1245, 16, 2795, 16, 1605, 16, 2870, 16, 11243, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.dctx.update({'active_id': self.context.context['dir_id']}) self.domain = safe_eval(dirr.domain,self.dctx)
self.domain = dirr.domain
def __init__(self,path, parent, context, dirr, dctx=None ): super(node_res_dir,self).__init__(path, parent,context) self.dir_id = dirr.id #todo: more info from dirr self.mimetype = 'application/x-directory' # 'httpd/unix-directory' self.create_date = dirr.create_date # TODO: the write date should be MAX(file.write).. self.write_date = dirr.write_date or dirr.create_date self.content_length = 0 self.res_model = dirr.ressource_type_id.model self.resm_id = dirr.ressource_id self.namefield = dirr.resource_field or 'name' self.displayname = dirr.name # Important: the domain is evaluated using the *parent* dctx! self.dctx.update({'active_id': self.context.context['dir_id']}) self.domain = safe_eval(dirr.domain,self.dctx) self.ressource_tree = dirr.ressource_tree # and then, we add our own vars in the dctx: if dctx: self.dctx.update(dctx) # and then, we prepare a dctx dict, for deferred evaluation: self.dctx_dict = {} for dfld in dirr.dctx_ids: self.dctx_dict['dctx_' + dfld.field] = dfld.expr
4a6d0a4a5112de7c89e8fe468f5ea0470ab01acf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/4a6d0a4a5112de7c89e8fe468f5ea0470ab01acf/nodes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 803, 16, 982, 16, 819, 16, 1577, 86, 16, 302, 5900, 33, 7036, 262, 30, 2240, 12, 2159, 67, 455, 67, 1214, 16, 2890, 2934, 972, 2738, 972, 12, 803, 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, 1001, 2738, 972, 12, 2890, 16, 803, 16, 982, 16, 819, 16, 1577, 86, 16, 302, 5900, 33, 7036, 262, 30, 2240, 12, 2159, 67, 455, 67, 1214, 16, 2890, 2934, 972, 2738, 972, 12, 803, 16...
document.reporter = docutils.utils.Reporter(
document.reporter = OptimizedReporter(
def __init__(self, document): """ @type document: L{docutils.nodes.document} """ self._document = document # The default document reporter and transformer are not # pickle-able; so replace them with stubs that are. document.reporter = docutils.utils.Reporter( document.reporter.source, 'SEVERE', 'SEVERE', '') document.transformer = docutils.transforms.Transformer(document)
3f16b7248f049c04190bbdc6bfca917c0b9caa2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/3f16b7248f049c04190bbdc6bfca917c0b9caa2e/restructuredtext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1668, 4672, 3536, 632, 723, 1668, 30, 511, 95, 2434, 5471, 18, 4690, 18, 5457, 97, 3536, 365, 6315, 5457, 273, 1668, 225, 468, 1021, 805, 1668, 11528, 47...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1668, 4672, 3536, 632, 723, 1668, 30, 511, 95, 2434, 5471, 18, 4690, 18, 5457, 97, 3536, 365, 6315, 5457, 273, 1668, 225, 468, 1021, 805, 1668, 11528, 47...
c = self.selCmp self.selCmp.updateZopeProps()
cmpn = self.selCmp cmpn.updateZopeProps()
def refreshZopeProps(self): c = self.selCmp self.selCmp.updateZopeProps() self.selCmp = None self.selectObject(c)
746f53548fb8bb54a235b1bfa31a4bdb769818e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/746f53548fb8bb54a235b1bfa31a4bdb769818e8/Inspector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4460, 62, 1306, 5047, 12, 2890, 4672, 9411, 82, 273, 365, 18, 1786, 31832, 9411, 82, 18, 2725, 62, 1306, 5047, 1435, 365, 18, 1786, 31832, 273, 599, 365, 18, 4025, 921, 12, 71, 13, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4460, 62, 1306, 5047, 12, 2890, 4672, 9411, 82, 273, 365, 18, 1786, 31832, 9411, 82, 18, 2725, 62, 1306, 5047, 1435, 365, 18, 1786, 31832, 273, 599, 365, 18, 4025, 921, 12, 71, 13, 2...
stemmer = Stemmer.Stemmer(languages[[methods[rnkMETHOD]["stem_lang"]]]) else:
stemmer = Stemmer.Stemmer(languages[methods[rnkMETHOD]["stem_lang"]]) else:
def get_config(rnkMETHOD): #needs some work """Load common data into memory""" global stopwords global stemmer global chars_alphanumericseparators global col_size global rnkWORD_table languages = {'fr': 'french', 'en': 'porter', 'no':'norwegian', 'se':'swedish', 'de': 'german', 'it':'italian', 'pt':'portugese'} try: if stemmer and stopwords: pass except StandardError, e: rnkWORD_table = methods[rnkMETHOD]["rnkWORD_table"] try: if methods[rnkMETHOD].has_key("stem_lang"): stemmer = Stemmer.Stemmer(languages[[methods[rnkMETHOD]["stem_lang"]]]) else: stemmer = None except Exception: stemmer = None if methods[rnkMETHOD].has_key("stopword"): stopwords = get_stopwords("%s" % methods[rnkMETHOD]["stopword"]) else: stopwords = {} chars_alphanumericseparators = r"[1234567890\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~]" col_size = run_sql("SELECT count(*) FROM %sR" % rnkWORD_table[:-1])[0][0]
8a040ea1c4e2ba68a120c489d438fc9222a0144d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/8a040ea1c4e2ba68a120c489d438fc9222a0144d/bibrank_record_sorter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1425, 12, 27639, 79, 5327, 4672, 468, 20600, 2690, 1440, 3536, 2563, 2975, 501, 1368, 3778, 8395, 2552, 2132, 3753, 2552, 13119, 6592, 2552, 5230, 67, 287, 21183, 11287, 87, 2552,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1425, 12, 27639, 79, 5327, 4672, 468, 20600, 2690, 1440, 3536, 2563, 2975, 501, 1368, 3778, 8395, 2552, 2132, 3753, 2552, 13119, 6592, 2552, 5230, 67, 287, 21183, 11287, 87, 2552,...
if t2.minute - t.minute < 0 and \ t2.hour - t.hour > 1: msg = "Writing a hypo2000 phase file with a S phase " + \ "over an hour later than the P phase. This case " + \ "is definitely not implemented correctly." warnings.warn(msg)
f.write("\n") continue
def doHyp2000(self): self.setXMLEventID() subprocess.call(self.hyp2000PreCall, shell = True) f = open(self.hyp2000Phasefile, 'w') f2 = open(self.hyp2000Stationsfile, 'w') network = "BW" #fmt = "RWMOIP?0 091229124412.22 13.99IS?0" fmtP = "%4s%1sP%1s%1i %15s" fmtS = "%12s%1sS%1s%1i\n" #fmt2 = " BGLD4739.14N01300.75E 930" fmt2 = "%6s%02i%05.2fN%03i%05.2fE%4i\n" #self.coords = [] for i in range(len(self.streams)): sta = self.dicts[i]['Station'] lon = self.dicts[i]['StaLon'] lon_deg = int(lon) lon_min = (lon - lon_deg) * 60. lat = self.dicts[i]['StaLat'] lat_deg = int(lat) lat_min = (lat - lat_deg) * 60. ele = self.dicts[i]['StaEle'] * 1000 f2.write(fmt2 % (sta, lat_deg, lat_min, lon_deg, lon_min, ele)) #self.coords.append([lon, lat]) if not self.dicts[i].has_key('P') and not self.dicts[i].has_key('S'): continue if self.dicts[i].has_key('P'): t = self.streams[i][0].stats.starttime t += self.dicts[i]['P'] date = t.strftime("%y%m%d%H%M%S") #print date date += ".%02d" % (t.microsecond / 1e4 + 0.5) #print t.microsecond #print date if self.dicts[i].has_key('POnset'): if self.dicts[i]['POnset'] == 'impulsive': onset = 'I' elif self.dicts[i]['POnset'] == 'emergent': onset = 'E' else: #XXX check for other names correctly!!! onset = '?' else: onset = '?' if self.dicts[i].has_key('PPol'): if self.dicts[i]['PPol'] == "up" or \ self.dicts[i]['PPol'] == "poorup": polarity = "U" elif self.dicts[i]['PPol'] == "down" or \ self.dicts[i]['PPol'] == "poordown": polarity = "D" else: #XXX check for other names correctly!!! polarity = "D" else: polarity = "?" if self.dicts[i].has_key('PWeight'): weight = int(self.dicts[i]['PWeight']) else: weight = 0 f.write(fmtP % (sta, onset, polarity, weight, date)) if self.dicts[i].has_key('S'): if not self.dicts[i].has_key('P'): msg = "Trying to print a hypo2000 phase file " + \ "with S phase without P phase.\n" + \ "This case might not be covered correctly and " + \ "could screw our file up!" warnings.warn(msg) t2 = self.streams[i][0].stats.starttime t2 += self.dicts[i]['S'] # if the S time's absolute minute is higher than that of the # P pick, we have to add 60 to the S second count for the # hypo 2000 output file # +60 %60 is necessary if t.min = 57, t2.min = 2 e.g. mindiff = (t2.minute - t.minute + 60) % 60 abs_sec = t2.second + (mindiff * 60) if abs_sec > 99: msg = "Writing a hypo2000 phase file with a S phase " + \ "seconds value greater than 99 seconds. This " + \ "case could be covered incorrectly. Check " + \ "location results carefully. (And give " + \ "feedback... =)" warnings.warn(msg) if t2.minute - t.minute < 0 and \ t2.hour - t.hour > 1: msg = "Writing a hypo2000 phase file with a S phase " + \ "over an hour later than the P phase. This case " + \ "is definitely not implemented correctly." warnings.warn(msg) date2 = str(abs_sec) date2 += ".%02d" % (t2.microsecond / 1e4 + 0.5) if self.dicts[i].has_key('SOnset'): if self.dicts[i]['SOnset'] == 'impulsive': onset2 = 'I' elif self.dicts[i]['SOnset'] == 'emergent': onset2 = 'E' else: #XXX check for other names correctly!!! onset2 = '?' else: onset2 = '?' if self.dicts[i].has_key('SPol'): if self.dicts[i]['SPol'] == "up" or \ self.dicts[i]['SPol'] == "poorup": polarity2 = "U" elif self.dicts[i]['SPol'] == "down" or \ self.dicts[i]['SPol'] == "poordown": polarity2 = "D" else: #XXX check for other names correctly!!! polarity2 = "D" else: polarity2 = "?" if self.dicts[i].has_key('SWeight'): weight2 = int(self.dicts[i]['SWeight']) else: weight2 = 0 f.write(fmtS % (date2, onset2, polarity2, weight2)) else: f.write("\n") f.close() f2.close() print 'Phases for Hypo2000:' self.catFile(self.hyp2000Phasefile) print 'Stations for Hypo2000:' self.catFile(self.hyp2000Stationsfile) subprocess.call(self.hyp2000Call, shell = True) print '--> hyp2000 finished' self.catFile(self.hyp2000Summary)
bb1bb2534cc7f6ed798bf1e4262523f7d4e72a5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/bb1bb2534cc7f6ed798bf1e4262523f7d4e72a5b/obspyck.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 44, 879, 17172, 12, 2890, 4672, 365, 18, 542, 60, 9687, 616, 734, 1435, 6652, 18, 1991, 12, 2890, 18, 76, 879, 17172, 1386, 1477, 16, 5972, 273, 1053, 13, 284, 273, 1696, 12, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 44, 879, 17172, 12, 2890, 4672, 365, 18, 542, 60, 9687, 616, 734, 1435, 6652, 18, 1991, 12, 2890, 18, 76, 879, 17172, 1386, 1477, 16, 5972, 273, 1053, 13, 284, 273, 1696, 12, 28...
tarball = releasedir() + '.tgz' os.system('tar cvf - %s | gzip -c > %s' % (releasedir(), tarball))
print 'Creating release dir', releasedir(tagname), '...' curdir = os.getcwd() try: os.chdir(tempfile.gettempdir()) checkout(tagname) print 'making tarball...' tarball = releasedir() + '.tgz' os.system('tar cvf - %s | gzip -c > %s' % ('mailman-' + tagname, tarball)) finally: os.chdir(curdir)
def make_pkg(tagname): tarball = releasedir() + '.tgz' os.system('tar cvf - %s | gzip -c > %s' % (releasedir(), tarball))
8da18e370425f757dae1fac00906511bcce0cd00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/8da18e370425f757dae1fac00906511bcce0cd00/Release.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 10657, 12, 2692, 529, 4672, 1172, 296, 11092, 3992, 1577, 2187, 3992, 1214, 12, 2692, 529, 3631, 20243, 225, 662, 1214, 273, 1140, 18, 588, 11089, 1435, 775, 30, 1140, 18, 343,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 10657, 12, 2692, 529, 4672, 1172, 296, 11092, 3992, 1577, 2187, 3992, 1214, 12, 2692, 529, 3631, 20243, 225, 662, 1214, 273, 1140, 18, 588, 11089, 1435, 775, 30, 1140, 18, 343,...
assert new.type == out.type return [new]
return False else: return [new]
def same(x, y): return len(x) == len(y) and all(N.all(xe == ye) for xe, ye in zip(x, y))
53c41019c3751b7e12fbb27abffe0a1ea918c5dd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/53c41019c3751b7e12fbb27abffe0a1ea918c5dd/opt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1967, 12, 92, 16, 677, 4672, 327, 562, 12, 92, 13, 422, 562, 12, 93, 13, 471, 777, 12, 50, 18, 454, 12, 6554, 422, 677, 73, 13, 364, 20517, 16, 677, 73, 316, 3144, 12, 92, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1967, 12, 92, 16, 677, 4672, 327, 562, 12, 92, 13, 422, 562, 12, 93, 13, 471, 777, 12, 50, 18, 454, 12, 6554, 422, 677, 73, 13, 364, 20517, 16, 677, 73, 316, 3144, 12, 92, 16, ...
run_sql("""INSERT INTO accROLE_accACTION_accARGUMENT values (%s, %s, %s, %s) """,
run_sql("""INSERT INTO accROLE_accACTION_accARGUMENT (id_accROLE, id_accACTION, id_accARGUMENT, argumentlistid) VALUES (%s, %s, %s, %s) """,
def acc_add_authorization(name_role='', name_action='', optional=0, **keyval): """ function inserts entries in accROLE_accACTION_accARGUMENT if all references are valid. this function is made specially for the webaccessadmin web interface. always inserting only one authorization. id_role, id_action - self explanatory, preferably used name_role, name_action - self explanatory, used if id not given optional - if this is set to 1, check that function can have optional arguments and add with arglistid -1 and id_argument -1 **keyval - dictionary of keyword=value pairs, used to find ids. """ inserted = [] # check that role and action exist id_role = run_sql("""SELECT id FROM accROLE where name = %s""", (name_role, )) action_details = run_sql("""SELECT * from accACTION where name = %s """, (name_action, )) if not id_role or not action_details: return [] # get role id and action id and details id_role, id_action = id_role[0][0], action_details[0][0] allowedkeywords_str = action_details[0][3] allowedkeywords_lst = acc_get_action_keywords(id_action=id_action) optional_action = action_details[0][4] == 'yes' and 1 or 0 optional = int(optional) # this action does not take arguments if not optional and not keyval: # can not add if user is doing a mistake if allowedkeywords_str: return [] # check if entry exists if not run_sql("""SELECT * FROM accROLE_accACTION_accARGUMENT WHERE id_accROLE = %s AND id_accACTION = %s AND argumentlistid = %s AND id_accARGUMENT = %s""", (id_role, id_action, 0, 0)): # insert new authorization run_sql("""INSERT INTO accROLE_accACTION_accARGUMENT values (%s, %s, %s, %s)""", (id_role, id_action, 0, 0)) return [[id_role, id_action, 0, 0], ] return [] # try to add authorization without the optional arguments elif optional: # optional not allowed for this action if not optional_action: return [] # check if authorization already exists if not run_sql("""SELECT * FROM accROLE_accACTION_accARGUMENT WHERE id_accROLE = %s AND id_accACTION = %s AND id_accARGUMENT = -1 AND argumentlistid = -1""" % (id_role, id_action, )): # insert new authorization run_sql("""INSERT INTO accROLE_accACTION_accARGUMENT (id_accROLE, id_accACTION, id_accARGUMENT, argumentlistid) VALUES (%s, %s, -1, -1) """, (id_role, id_action)) return [[id_role, id_action, -1, -1], ] return [] else: # regular authorization # get list of ids, if they don't exist, create arguments id_arguments = [] argstr = '' for key in keyval.keys(): if key not in allowedkeywords_lst: return [] id_argument = (acc_get_argument_id(key, keyval[key]) or run_sql("""INSERT INTO accARGUMENT (keyword, value) values (%s, %s) """, (key, keyval[key]))) id_arguments.append(id_argument) argstr += (argstr and ',' or '') + str(id_argument) # check if equal authorization exists for (id_trav, ) in run_sql("""SELECT DISTINCT argumentlistid FROM accROLE_accACTION_accARGUMENT WHERE id_accROLE = %s AND id_accACTION = %s """, (id_role, id_action)): listlength = run_sql("""SELECT COUNT(*) FROM accROLE_accACTION_accARGUMENT WHERE id_accROLE = %%s AND id_accACTION = %%s AND argumentlistid = %%s AND id_accARGUMENT IN (%s) """ % (argstr), (id_role, id_action, id_trav))[0][0] notlist = run_sql("""SELECT COUNT(*) FROM accROLE_accACTION_accARGUMENT WHERE id_accROLE = %%s AND id_accACTION = %%s AND argumentlistid = %%s AND id_accARGUMENT NOT IN (%s) """ % (argstr), (id_role, id_action, id_trav))[0][0] # this means that a duplicate already exists if not notlist and listlength == len(id_arguments): return [] # find new arglistid, highest + 1 try: arglistid = 1 + run_sql("""SELECT MAX(argumentlistid) FROM accROLE_accACTION_accARGUMENT WHERE id_accROLE = %s AND id_accACTION = %s""", (id_role, id_action))[0][0] except (IndexError, TypeError): arglistid = 1 if arglistid <= 0: arglistid = 1 # insert for id_argument in id_arguments: run_sql("""INSERT INTO accROLE_accACTION_accARGUMENT values (%s, %s, %s, %s) """, (id_role, id_action, id_argument, arglistid)) inserted.append([id_role, id_action, id_argument, arglistid]) return inserted
af7ec39f1bf5a2050b4b77ad2d9cdd5d6e645f9f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1931/af7ec39f1bf5a2050b4b77ad2d9cdd5d6e645f9f/access_control_admin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4078, 67, 1289, 67, 12218, 12, 529, 67, 4615, 2218, 2187, 508, 67, 1128, 2218, 2187, 3129, 33, 20, 16, 2826, 856, 1125, 4672, 3536, 445, 15607, 3222, 316, 4078, 16256, 67, 8981, 12249, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4078, 67, 1289, 67, 12218, 12, 529, 67, 4615, 2218, 2187, 508, 67, 1128, 2218, 2187, 3129, 33, 20, 16, 2826, 856, 1125, 4672, 3536, 445, 15607, 3222, 316, 4078, 16256, 67, 8981, 12249, ...
mods += " %s: %s" % (wikipedia.translate(insite.lang, msg)[3], ", ".join([fmt(x) for x in modifying]))
mods += " %s: %s" % (wikipedia.translate(insite.lang, msg)[3], ", ".join([fmt(new[x]) for x in modifying]))
def compareLanguages(old, new, insite): oldiw = set(old) newiw = set(new) # sort by language code adding = sorted(newiw - oldiw) removing = sorted(oldiw - newiw) modifying = sorted(site for site in oldiw & newiw if old[site] != new[site]) mods = "" if len(adding) + len(removing) + len(modifying) <= 3: # Use an extended format for the string linking to all added pages. fmt = lambda page: page.aslink(forceInterwiki=True) else: # Use short format, just the language code fmt = lambda page: page.site().lang if adding: mods += " %s: %s" % (wikipedia.translate(insite.lang, msg)[1], ", ".join([fmt(x) for x in adding])) if removing: mods += " %s: %s" % (wikipedia.translate(insite.lang, msg)[2], ", ".join([fmt(x) for x in removing])) if modifying: mods += " %s: %s" % (wikipedia.translate(insite.lang, msg)[3], ", ".join([fmt(x) for x in modifying])) return mods, adding, removing, modifying
08d0550b1d41429ffdba0b94beb08420ca05faba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/08d0550b1d41429ffdba0b94beb08420ca05faba/interwiki.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3400, 12912, 12, 1673, 16, 394, 16, 2763, 1137, 4672, 225, 1592, 22315, 273, 444, 12, 1673, 13, 394, 22315, 273, 444, 12, 2704, 13, 225, 468, 1524, 635, 2653, 981, 6534, 273, 3115, 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, 3400, 12912, 12, 1673, 16, 394, 16, 2763, 1137, 4672, 225, 1592, 22315, 273, 444, 12, 1673, 13, 394, 22315, 273, 444, 12, 2704, 13, 225, 468, 1524, 635, 2653, 981, 6534, 273, 3115, 12,...
line1 = infile.readline() line2 = infile.readline() if get_declaration(line1) or get_declaration(line2): infile.close() return False rest = infile.read() infile.close() if has_correct_encoding(line1+line2+rest, "ascii"): return False
def needs_declaration(fullpath): try: infile = open(fullpath, 'rU') except IOError: # Oops, the file was removed - ignore it return None line1 = infile.readline() line2 = infile.readline() if get_declaration(line1) or get_declaration(line2): # the file does have an encoding declaration, so trust it infile.close() return False # check the whole file for non-ASCII characters rest = infile.read() infile.close() if has_correct_encoding(line1+line2+rest, "ascii"): return False return True
cf21dba6a3042d2651a66805a6080a3c476ad222 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cf21dba6a3042d2651a66805a6080a3c476ad222/pysource.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4260, 67, 22448, 12, 2854, 803, 4672, 775, 30, 14568, 273, 1696, 12, 2854, 803, 16, 296, 86, 57, 6134, 1335, 8340, 30, 468, 531, 4473, 16, 326, 585, 1703, 3723, 300, 2305, 518, 327, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4260, 67, 22448, 12, 2854, 803, 4672, 775, 30, 14568, 273, 1696, 12, 2854, 803, 16, 296, 86, 57, 6134, 1335, 8340, 30, 468, 531, 4473, 16, 326, 585, 1703, 3723, 300, 2305, 518, 327, ...
sage: R([2,1,0]).mlist() [[(1, 0, 2), 1], [(1, 1, 1), 2], [(2, 1, 0), 1], [(1, 2, 0), 1], [(2, 0, 1), 1], [(0, 1, 2), 1], [(0, 2, 1), 1]]
sage: sorted(R([2,1,0]).mlist()) [[(1, 1, 1), 2], [(1, 2, 0), 1], [(1, 0, 2), 1], [(2, 1, 0), 1], [(2, 0, 1), 1], [(0, 1, 2), 1], [(0, 2, 1), 1]]
def WeylCharacterRing(ct, base_ring=ZZ, prefix=None, cache=False): r""" A class for rings of Weyl characters. The Weyl character is a character of a semisimple (or reductive) Lie group or algebra. They form a ring, in which the addition and multiplication correspond to direct sum and tensor product of representations. INPUT: - ``ct`` - The Cartan Type OPTIONAL ARGUMENTS: - ``base_ring`` - (default: `\mathbb{Z}`) - ``prefix`` (default an automatically generated prefix based on Cartan type) - ``cache`` - (default False) setting cache = True is a substantial speedup at the expense of some memory. If no prefix specified, one is generated based on the Cartan type. It is good to name the ring after the prefix, since then it can parse its own output. EXAMPLES:: sage: G2 = WeylCharacterRing(['G',2]) sage: [fw1,fw2] = G2.lattice().fundamental_weights() sage: 2*G2(2*fw1+fw2) 2*G2(4,-1,-3) sage: 2*G2(4,-1,-3) 2*G2(4,-1,-3) sage: G2(4,-1,-3).degree() 189 Note that since the ring was named `G_2` after its default prefix, it was able to parse its own output. You do not have to use the default prefix. Thus: EXAMPLES:: sage: R = WeylCharacterRing(['B',3], prefix='R') sage: chi = R(R.lattice().fundamental_weights()[3]); chi R(1/2,1/2,1/2) sage: R(1/2,1/2,1/2) == chi True The multiplication in R corresponds to the product of characters, which you can use to determine the decomposition of tensor products into irreducibles. For example, let us compute the tensor product of the standard and spin representations of Spin(7). EXAMPLES:: sage: B3 = WeylCharacterRing(['B',3]) sage: [fw1,fw2,fw3]=B3.lattice().fundamental_weights() sage: [B3(fw1).degree(),B3(fw3).degree()] [7, 8] sage: B3(fw1)*B3(fw3) B3(1/2,1/2,1/2) + B3(3/2,1/2,1/2) The name of the irreducible representation encodes the highest weight vector. TESTS:: sage: F4 = WeylCharacterRing(['F',4], cache = True) sage: [fw1,fw2,fw3,fw4] = F4.lattice().fundamental_weights() sage: chi = F4(fw4); chi, chi.degree() (F4(1,0,0,0), 26) sage: chi^2 F4(0,0,0,0) + F4(1,0,0,0) + F4(1,1,0,0) + F4(3/2,1/2,1/2,1/2) + F4(2,0,0,0) sage: [x.degree() for x in [F4(0,0,0,0), F4(1,0,0,0), F4(1,1,0,0), F4(3/2,1/2,1/2,1/2), F4(2,0,0,0)]] [1, 26, 52, 273, 324] You can produce a list of the irreducible elements of an irreducible character. EXAMPLES:: sage: R = WeylCharacterRing(['A',2], prefix = R) sage: R([2,1,0]).mlist() [[(1, 0, 2), 1], [(1, 1, 1), 2], [(2, 1, 0), 1], [(1, 2, 0), 1], [(2, 0, 1), 1], [(0, 1, 2), 1], [(0, 2, 1), 1]] """ ct = cartan_type.CartanType(ct) return cache_wcr(ct, base_ring=base_ring, prefix=prefix, cache=cache)
a6b2a205dd28fe40cc7065c8e2affb912677dd03 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/a6b2a205dd28fe40cc7065c8e2affb912677dd03/weyl_characters.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 678, 402, 80, 7069, 10369, 12, 299, 16, 1026, 67, 8022, 33, 27096, 16, 1633, 33, 7036, 16, 1247, 33, 8381, 4672, 436, 8395, 432, 667, 364, 26537, 434, 678, 402, 80, 3949, 18, 1021, 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, 678, 402, 80, 7069, 10369, 12, 299, 16, 1026, 67, 8022, 33, 27096, 16, 1633, 33, 7036, 16, 1247, 33, 8381, 4672, 436, 8395, 432, 667, 364, 26537, 434, 678, 402, 80, 3949, 18, 1021, 6...
return S_OK('No jobs selected for conditions: %s' %self.matchDict)
return S_OK( 'No jobs selected for conditions: %s' % self.matchDict )
def __getPilots(self):
364464017f61dc703439c7a2235a47d4ba35aafe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/364464017f61dc703439c7a2235a47d4ba35aafe/DiracSiteAgent.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 52, 330, 6968, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 52, 330, 6968, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
for k in osenv:
for k in osenv.keys():
def restore_nocgi(sav_env, si, so): """ see setup_cgi() """ osenv = os.environ # restore env for k in osenv: del osenv[k] for k in sav_env: osenv[k] = env[k] sys.stdout = si sys.stdin = so
6e60ea5b0b4c5311f7f8be1e719d9715c24a3c00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10002/6e60ea5b0b4c5311f7f8be1e719d9715c24a3c00/apache.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5217, 67, 31470, 10052, 12, 87, 842, 67, 3074, 16, 7533, 16, 1427, 4672, 3536, 2621, 3875, 67, 19062, 1435, 3536, 225, 1140, 3074, 273, 1140, 18, 28684, 225, 468, 5217, 1550, 364, 417, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5217, 67, 31470, 10052, 12, 87, 842, 67, 3074, 16, 7533, 16, 1427, 4672, 3536, 2621, 3875, 67, 19062, 1435, 3536, 225, 1140, 3074, 273, 1140, 18, 28684, 225, 468, 5217, 1550, 364, 417, ...
other_attrs.append(a)
if _in_subset(self.subset, a): other_attrs.append(a) xml_attrs.update(xml_attrs_local)
def _do_element(self, node, initial_other_attrs = []): '''_do_element(self, node, initial_other_attrs = []) -> None Process an element (and its children).'''
6df2d566784161a533c97fa1bd11ec1e27489fcb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13054/6df2d566784161a533c97fa1bd11ec1e27489fcb/c14n.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2896, 67, 2956, 12, 2890, 16, 756, 16, 2172, 67, 3011, 67, 7039, 273, 5378, 4672, 9163, 67, 2896, 67, 2956, 12, 2890, 16, 756, 16, 2172, 67, 3011, 67, 7039, 273, 5378, 13, 317, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2896, 67, 2956, 12, 2890, 16, 756, 16, 2172, 67, 3011, 67, 7039, 273, 5378, 4672, 9163, 67, 2896, 67, 2956, 12, 2890, 16, 756, 16, 2172, 67, 3011, 67, 7039, 273, 5378, 13, 317, ...
i = 0
def on_doneFindNode(self, lst): """ Receive a callback from findNode Send STORE command to each node that comes back """ localNode = self.localNode # normalise results normalisePeer = localNode._normalisePeer peers = [normalisePeer(p) for p in lst] # wrap in KPeer objects self.log(2, "STORE RPC findNode - got peers %s" % repr(peers)) self.numPeersToStore = min(len(peers), numStorePeers) self.numPeersSucceeded = 0 self.numPeersFailed = 0 self.numPeersFinished = 0 i = 0 # and fire off store messages for each peer for peer in peers: if peer.dest == localNode.dest: self.log(3, "storing to ourself") localNode.storage.putKey(self.keyHashed, self.value, keyIsHashed=True) self.numPeersSucceeded += 1 self.numPeersFinished += 1 else: msgId = self.localNode._msgIdAlloc() self.log(4, "forwarding store cmd to peer:\npeer=%s\nmsgId=%s" % (peer, msgId)) self.bindPeerReply(peer, msgId) peer.send_store(key=self.keyHashed, value=self.value, msgId=msgId) i += 1 if i >= numStorePeers: break self.log(2, "Sent store cmd to %s peers, awaiting responses" % i)
e60b30ed443abca39b1d5552a464df392e201c33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11109/e60b30ed443abca39b1d5552a464df392e201c33/stasher.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 8734, 3125, 907, 12, 2890, 16, 9441, 4672, 3536, 17046, 279, 1348, 628, 1104, 907, 225, 2479, 29656, 1296, 358, 1517, 756, 716, 14535, 1473, 3536, 1191, 907, 273, 365, 18, 3729,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 8734, 3125, 907, 12, 2890, 16, 9441, 4672, 3536, 17046, 279, 1348, 628, 1104, 907, 225, 2479, 29656, 1296, 358, 1517, 756, 716, 14535, 1473, 3536, 1191, 907, 273, 365, 18, 3729,...
util.wait(d)
return d
def expectedFailure(err): err.trap(q2q.BadCertificateRequest)
37f03e58474c9d3756dd1192a546f215552de242 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8962/37f03e58474c9d3756dd1192a546f215552de242/test_q2q.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2665, 5247, 12, 370, 4672, 393, 18, 27170, 12, 85, 22, 85, 18, 6434, 27330, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2665, 5247, 12, 370, 4672, 393, 18, 27170, 12, 85, 22, 85, 18, 6434, 27330, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return "/bin/rm -f %s" % pfn.replace("file://", "", 1)
return "/bin/rm -f %s" % pfn.replace("file:", "", 1)
def createRemoveFileCommand(self, pfn): """ handle both srm and file pfn types """ if pfn.startswith("srm://"): return "lcg-del -b -l -D srmv2 --vo cms %s" % pfn elif pfn.startswith("file:"): return "/bin/rm -f %s" % pfn.replace("file://", "", 1) else: return StageOutImpl.createRemoveFileCommand(self, pfn)
9cf26c4f5c14eb3a1f5d8696d132a50095509b93 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8887/9cf26c4f5c14eb3a1f5d8696d132a50095509b93/LCGImpl.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 3288, 812, 2189, 12, 2890, 16, 293, 4293, 4672, 3536, 1640, 3937, 272, 8864, 471, 585, 293, 4293, 1953, 3536, 309, 293, 4293, 18, 17514, 1918, 2932, 87, 8864, 14334, 4672, 327, 315,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 3288, 812, 2189, 12, 2890, 16, 293, 4293, 4672, 3536, 1640, 3937, 272, 8864, 471, 585, 293, 4293, 1953, 3536, 309, 293, 4293, 18, 17514, 1918, 2932, 87, 8864, 14334, 4672, 327, 315,...
RESPONSE.setStatus(401)
RESPONSE.setStatus(status)
def response(RESPONSE, status, msg): if RESPONSE: RESPONSE.setStatus(401) RESPONSE.write(msg) else: raise ValueError(msg)
26e0692b10046933fe70ab05c1868968e444b27c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/26e0692b10046933fe70ab05c1868968e444b27c/Collector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 766, 12, 14508, 16, 1267, 16, 1234, 4672, 309, 20645, 30, 20645, 18, 542, 1482, 12, 2327, 13, 20645, 18, 2626, 12, 3576, 13, 469, 30, 1002, 2068, 12, 3576, 13, 2, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 766, 12, 14508, 16, 1267, 16, 1234, 4672, 309, 20645, 30, 20645, 18, 542, 1482, 12, 2327, 13, 20645, 18, 2626, 12, 3576, 13, 469, 30, 1002, 2068, 12, 3576, 13, 2, -100, -100, -100, -...
self.connect("all_engines_discovered", cb)
def count(self_, binname, engine, wentwell): self.toBeRechecked[engine] = True if all(self.toBeRechecked.values()): self.emit("all_engines_discovered")
161075e7ea4bcdc8387b3f511ade9d9e406c82f8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5339/161075e7ea4bcdc8387b3f511ade9d9e406c82f8/engineNest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1056, 12, 2890, 67, 16, 4158, 529, 16, 4073, 16, 16343, 30389, 4672, 365, 18, 869, 1919, 426, 4532, 63, 8944, 65, 273, 1053, 309, 777, 12, 2890, 18, 869, 1919, 426, 4532, 18, 2372, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1056, 12, 2890, 67, 16, 4158, 529, 16, 4073, 16, 16343, 30389, 4672, 365, 18, 869, 1919, 426, 4532, 63, 8944, 65, 273, 1053, 309, 777, 12, 2890, 18, 869, 1919, 426, 4532, 18, 2372, 1...
if sort:
if self.is_commutative() and sort:
def __init__(self, x, unit=None, cr=False, sort=True): if not isinstance(x, list): raise TypeError, "x must be a list" if isinstance(x, Factorization): if unit is None: unit = x.__unit else: unit = x.__unit * unit from sage.rings.integer import Integer for t in x: if not (isinstance(t, tuple) and len(t) == 2 and isinstance(t[1],(int, long, Integer))): raise TypeError, "x must be a list of tuples of length 2" if unit is None: if len(x) > 0: try: unit = x[0][0].parent()(1) except AttributeError: unit = Integer(1) else: unit = Integer(1) list.__init__(self, x) self.__unit = unit self.__cr = cr if sort: self.sort()
01e2c0cbf9f6b75f1c49e047f6cf4843089fab3e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/01e2c0cbf9f6b75f1c49e047f6cf4843089fab3e/factorization.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 619, 16, 2836, 33, 7036, 16, 4422, 33, 8381, 16, 1524, 33, 5510, 4672, 309, 486, 1549, 12, 92, 16, 666, 4672, 1002, 3580, 16, 315, 92, 1297, 506, 279, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 619, 16, 2836, 33, 7036, 16, 4422, 33, 8381, 16, 1524, 33, 5510, 4672, 309, 486, 1549, 12, 92, 16, 666, 4672, 1002, 3580, 16, 315, 92, 1297, 506, 279, ...
self.o2 = oldstyle()
self.o2 = newstyle()
def setUp(self): self.o = oldstyle() self.n = newstyle() self.o2 = oldstyle() self.n2 = newstyle()
dd2f2fb6f49a3894e0f0d77b54f58e720924c666 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/dd2f2fb6f49a3894e0f0d77b54f58e720924c666/test_index.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 365, 18, 83, 273, 1592, 4060, 1435, 365, 18, 82, 273, 394, 4060, 1435, 365, 18, 83, 22, 273, 394, 4060, 1435, 365, 18, 82, 22, 273, 394, 4060, 1435, 2, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 365, 18, 83, 273, 1592, 4060, 1435, 365, 18, 82, 273, 394, 4060, 1435, 365, 18, 83, 22, 273, 394, 4060, 1435, 365, 18, 82, 22, 273, 394, 4060, 1435, 2, -100, ...
self._conn.send_data(text)
if isinstance(text, unicode): text = text.encode('utf-8') result = self._conn.send_data(text) if callback: msg_id = int(result[2][0]) self._callbacks[msg_id] = (callback, event_types) return result
def speak(self, text): """Say given message.
111ae263bafae36c4bfdce16995ca02adf6dd153 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7484/111ae263bafae36c4bfdce16995ca02adf6dd153/client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 10244, 12, 2890, 16, 977, 4672, 3536, 55, 528, 864, 883, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 10244, 12, 2890, 16, 977, 4672, 3536, 55, 528, 864, 883, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
locations = self.ctx_map.get_locations() if (not location in locations.keys()): if (not self.cb_offline.get_active()): l = self.ctx_map.search_location(location) if (False == l): self.error_msg( "Can't find %s in google map" % location) self.entry.set_text("")
if (location == self.default_text): self.clean_entry(self) else: locations = self.ctx_map.get_locations() if (not location in locations.keys()): if (not self.cb_offline.get_active()): l = self.ctx_map.search_location(location) if (False == l): self.error_msg( "Can't find %s in google map" % location) self.entry.set_text("") return location = l; self.entry.set_text(l) self.set_completion() coord = self.ctx_map.get_locations()[location] else: self.error_msg("Offline mode, cannot do search")
def confirm_clicked(self, button): location = self.entry.get_text() if (0 == len(location)): self.error_msg("Need location") return locations = self.ctx_map.get_locations() if (not location in locations.keys()): if (not self.cb_offline.get_active()): l = self.ctx_map.search_location(location) if (False == l): self.error_msg( "Can't find %s in google map" % location) self.entry.set_text("") return location = l; self.entry.set_text(l) self.set_completion() coord = self.ctx_map.get_locations()[location] else: self.error_msg("Offline mode, cannot do search") return else: coord = locations[location] print "%s at %f, %f" % (location, coord[0], coord[1])
0cbfc61564ea417700459fc0ad128aafd1101acf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5373/0cbfc61564ea417700459fc0ad128aafd1101acf/maps.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6932, 67, 7475, 329, 12, 2890, 16, 3568, 4672, 2117, 273, 365, 18, 4099, 18, 588, 67, 955, 1435, 309, 261, 20, 422, 562, 12, 3562, 3719, 30, 365, 18, 1636, 67, 3576, 2932, 14112, 211...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6932, 67, 7475, 329, 12, 2890, 16, 3568, 4672, 2117, 273, 365, 18, 4099, 18, 588, 67, 955, 1435, 309, 261, 20, 422, 562, 12, 3562, 3719, 30, 365, 18, 1636, 67, 3576, 2932, 14112, 211...
for dep in self.bin_rec_deps: bin_results.append( dep.install(['bin','rc']) )
for dep in self.bin_deps: bin_results.append( dep.install(['bin','deps','rc']) )
def install (self, opts = ['deps','rc']): """Create the installation targets for project's results files and return them.
bcbdc19df9039d356c3134f89d1657ec5f6ac768 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8002/bcbdc19df9039d356c3134f89d1657ec5f6ac768/project.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 261, 2890, 16, 1500, 273, 10228, 14877, 17023, 1310, 3546, 4672, 3536, 1684, 326, 13193, 5774, 364, 1984, 1807, 1686, 1390, 471, 327, 2182, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 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, 3799, 261, 2890, 16, 1500, 273, 10228, 14877, 17023, 1310, 3546, 4672, 3536, 1684, 326, 13193, 5774, 364, 1984, 1807, 1686, 1390, 471, 327, 2182, 18, 2, -100, -100, -100, -100, -100, -100,...
def findbest(particles, comparator):
def findbest(self, particles, comparator):
def findbest(particles, comparator): """Returns the best particle from the given list.""" best = None bestval = None for p in particles: if (best is None) or comp(p.pbestval, bestval): best = p bestval = p.pbestval return best
36ae431c781eadb36d132d2c809bd3683200ef09 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/966/36ae431c781eadb36d132d2c809bd3683200ef09/standardpso.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 12729, 12, 2890, 16, 28312, 16, 8862, 4672, 3536, 1356, 326, 3796, 20036, 628, 326, 864, 666, 12123, 3796, 273, 599, 3796, 1125, 273, 599, 364, 293, 316, 28312, 30, 309, 261, 12729...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12729, 12, 2890, 16, 28312, 16, 8862, 4672, 3536, 1356, 326, 3796, 20036, 628, 326, 864, 666, 12123, 3796, 273, 599, 3796, 1125, 273, 599, 364, 293, 316, 28312, 30, 309, 261, 12729...
day_len='2', cal_meta_types='Naaya Event', start_day='Monday', catalog=self.getCatalogTool().id, REQUEST=None)
day_len='2', start_day='Monday', catalog=self.getCatalogTool().id, REQUEST=None) calendar = self._getOb('portal_calendar') calendar.cal_meta_types = calendar.setCalMetaTypes('Naaya Event')
def loadDefaultData(self): """ """ #set default 'Naaya' configuration NySite.__dict__['createPortalTools'](self) NySite.__dict__['loadDefaultData'](self)
e6b817ab4244dbcc6e80ee347ef5d6a5a20866ae /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/e6b817ab4244dbcc6e80ee347ef5d6a5a20866ae/CHMSite.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 1868, 751, 12, 2890, 4672, 3536, 3536, 468, 542, 805, 296, 24101, 528, 69, 11, 1664, 423, 93, 4956, 16186, 1576, 972, 3292, 2640, 24395, 10348, 3546, 12, 2890, 13, 423, 93, 4956, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 1868, 751, 12, 2890, 4672, 3536, 3536, 468, 542, 805, 296, 24101, 528, 69, 11, 1664, 423, 93, 4956, 16186, 1576, 972, 3292, 2640, 24395, 10348, 3546, 12, 2890, 13, 423, 93, 4956, ...
anchor=NSEW (or subset) - position anchor according to given direction
anchor=NSEW (or subset) - position anchor according to given direction
def place_configure(self, cnf={}, **kw): """Place a widget in the parent widget. Use as options: in=master - master relative to which the widget is placed. x=amount - locate anchor of this widget at position x of master y=amount - locate anchor of this widget at position y of master relx=amount - locate anchor of this widget between 0.0 and 1.0 relative to width of master (1.0 is right edge) rely=amount - locate anchor of this widget between 0.0 and 1.0 relative to height of master (1.0 is bottom edge) anchor=NSEW (or subset) - position anchor according to given direction width=amount - width of this widget in pixel height=amount - height of this widget in pixel relwidth=amount - width of this widget between 0.0 and 1.0 relative to width of master (1.0 is the same width as the master) relheight=amount - height of this widget between 0.0 and 1.0 relative to height of master (1.0 is the same height as the master) bordermode="inside" or "outside" - whether to take border width of master widget into account """ for k in ['in_']: if kw.has_key(k): kw[k[:-1]] = kw[k] del kw[k] self.tk.call( ('place', 'configure', self._w) + self._options(cnf, kw))
1a34834e0993d46fc81f4ef6639e6c278d5879d9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/1a34834e0993d46fc81f4ef6639e6c278d5879d9/Tkinter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3166, 67, 14895, 12, 2890, 16, 23118, 28793, 2826, 9987, 4672, 3536, 6029, 279, 3604, 316, 326, 982, 3604, 18, 2672, 487, 702, 30, 316, 33, 7525, 300, 4171, 3632, 358, 1492, 326, 3604, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3166, 67, 14895, 12, 2890, 16, 23118, 28793, 2826, 9987, 4672, 3536, 6029, 279, 3604, 316, 326, 982, 3604, 18, 2672, 487, 702, 30, 316, 33, 7525, 300, 4171, 3632, 358, 1492, 326, 3604, ...
None
pass if meta.has_key(u'Task'): try: def_task = removelink(meta[u'Task'][0]) except: pass
def show_entryform(request): time_now = datetime.datetime.now() + datetime.timedelta(minutes=30) time_now -= datetime.timedelta(minutes=int(time_now.strftime("%M"))%30) def_date = time_now.strftime("%Y-%m-%d") def_time = time_now.strftime("%H:%M") duration = u'00:00' edit_page = u'' title = u'' time_opts = unicode() categories = categories = request.form.get('categories', [rc['timetrack']])[0] if request.form.has_key('date'): def_date = request.form.get('date')[0].encode() elif request.form.has_key('edit'): edit = request.form.get('edit')[0].encode() edit_page = u'<input type="hidden" name="edit" value="%s">' % edit def_date = edit.split('_')[0] #categories = ','.join(categories) pagelist, metakeys, styles = metatable_parseargs(request, categories, get_all_keys=True) meta = get_metas(request, edit, metakeys, display=False, checkAccess=True) if meta[u'Date']: if meta.has_key(u'Duration'): try: duration = meta[u'Duration'][0] except: None if meta.has_key(u'Time'): try: def_time = meta[u'Time'][0] except: None body = PageEditor(request, edit).get_raw_body() if '----' in body: title = body.split('----')[0] temp = list() for line in title.split("\n"): if not line.startswith("#acl"): temp.append(line) title = " ".join(temp) for h in range(24): for m in ['00','30']: t = u'"%02d:%s"' % (h,m) if t.find(def_time) != -1: t += ' selected' time_opts += u'<option value=%s>%02d:%s</option>\n' % (t,h,m) tasklist = unicode() for task in pages_in_category(request, rc['task']): tasktitle = Task(request, task).title() if not tasktitle: tasktitle = task tasklist += " <option value='%s'>%s</option>\n" % (task, tasktitle) pass html = u'''
1636607e83070b1850fefef779872b8fd3bbec85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/888/1636607e83070b1850fefef779872b8fd3bbec85/editTimeTrackEntry.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 67, 4099, 687, 12, 2293, 4672, 813, 67, 3338, 273, 3314, 18, 6585, 18, 3338, 1435, 397, 3314, 18, 31295, 12, 17916, 33, 5082, 13, 813, 67, 3338, 3947, 3314, 18, 31295, 12, 17916,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 67, 4099, 687, 12, 2293, 4672, 813, 67, 3338, 273, 3314, 18, 6585, 18, 3338, 1435, 397, 3314, 18, 31295, 12, 17916, 33, 5082, 13, 813, 67, 3338, 3947, 3314, 18, 31295, 12, 17916,...
url = "http://participatoryculture.org/democracytest/cookie.php" httpclient.grabURL(url, self.callback, self.errback,
url = "http://pculture.org/cookie.php" httpclient.grabURL(url, self.callback, self.errback,
def test_cookie(self): url = "http://participatoryculture.org/democracytest/cookie.php" httpclient.grabURL(url, self.callback, self.errback, clientClass=TestHTTPClient) self.runEventLoop(timeout=5) # self.data is a 404 self.assertEquals(len(self.data['cookies']), 1) self.assert_(self.data['cookies'].has_key('MiroTestCookie')) self.assertEquals(self.data['cookies']['MiroTestCookie']['Value'], 'foobar') httpclient.grabURL(url, self.callback, self.errback, cookies=self.data['cookies'], clientClass=TestHTTPClient) self.runEventLoop(timeout=2) self.assertNotEqual(self.data['body'].find('MiroTestCookie=foobar'), -1)
e30788a9dacabc7a8a0d8e1a962216cf42816d5e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/e30788a9dacabc7a8a0d8e1a962216cf42816d5e/httpclienttest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 8417, 12, 2890, 4672, 880, 273, 315, 2505, 2207, 2436, 29923, 18, 3341, 19, 8417, 18, 2684, 6, 1062, 2625, 18, 2752, 70, 1785, 12, 718, 16, 365, 18, 3394, 16, 365, 18, 370,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8417, 12, 2890, 4672, 880, 273, 315, 2505, 2207, 2436, 29923, 18, 3341, 19, 8417, 18, 2684, 6, 1062, 2625, 18, 2752, 70, 1785, 12, 718, 16, 365, 18, 3394, 16, 365, 18, 370,...
def getSession(request): cookiename = "_".join(['TWISTED_SESSION'] + self.sitepath) sessionCookie = request.getCookie(cookiename) if sessionCookie: try: return request.site.getSession(sessionCookie) except KeyError: pass session = Session(request.site, request.site.mkuid()) site.setSession(session) request.addCookie(cookiename, session.uid, path='/') request.setComponent(ISession, session) return session
def recache(self): self.doCache = 1
def getSession(request): cookiename = "_".join(['TWISTED_SESSION'] + self.sitepath) sessionCookie = request.getCookie(cookiename) if sessionCookie: try: return request.site.getSession(sessionCookie) except KeyError: pass session = Session(request.site, request.site.mkuid()) site.setSession(session) request.addCookie(cookiename, session.uid, path='/') request.setComponent(ISession, session) # is this needed? return session
a6f9b1004d2fe42a11a3c1e0fb62efa3b08afccc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a6f9b1004d2fe42a11a3c1e0fb62efa3b08afccc/requtil.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7183, 12, 2293, 4672, 15860, 77, 1069, 273, 8802, 18, 5701, 12, 3292, 18869, 5511, 2056, 67, 7042, 3546, 397, 365, 18, 4256, 803, 13, 1339, 6151, 273, 590, 18, 588, 6151, 12, 29854, 77...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7183, 12, 2293, 4672, 15860, 77, 1069, 273, 8802, 18, 5701, 12, 3292, 18869, 5511, 2056, 67, 7042, 3546, 397, 365, 18, 4256, 803, 13, 1339, 6151, 273, 590, 18, 588, 6151, 12, 29854, 77...
return w self.coordinates(w) return w
return self._element_class(self, x, coerce, copy) try: self.coordinates(x) except ArithmeticError: raise ValueError, "element (= %s) is not in free module"%(x,) return self._element_class(self, x, coerce, copy)
def __call__(self, x, coerce=True, copy=True, check=True): """ Create an element of this free module.
e72eccbd467d09d7755b5e1d77e83c243ec01f8c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/e72eccbd467d09d7755b5e1d77e83c243ec01f8c/free_module.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 619, 16, 12270, 33, 5510, 16, 1610, 33, 5510, 16, 866, 33, 5510, 4672, 3536, 1788, 392, 930, 434, 333, 4843, 1605, 18, 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, 1001, 1991, 972, 12, 2890, 16, 619, 16, 12270, 33, 5510, 16, 1610, 33, 5510, 16, 866, 33, 5510, 4672, 3536, 1788, 392, 930, 434, 333, 4843, 1605, 18, 2, -100, -100, -100, -100, -100, ...
return self.get(False)
self.not_empty.acquire() try: if self._empty(): raise Empty else: item = self._get() self.not_full.notify() return item finally: self.not_empty.release()
def get_nowait(self): """Remove and return an item from the queue without blocking.
a3002703c147de35193af30e3a73b4e7695ecc17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a3002703c147de35193af30e3a73b4e7695ecc17/Queue.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 3338, 1540, 12, 2890, 4672, 3536, 3288, 471, 327, 392, 761, 628, 326, 2389, 2887, 9445, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 3338, 1540, 12, 2890, 4672, 3536, 3288, 471, 327, 392, 761, 628, 326, 2389, 2887, 9445, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
return S_ERROR( 'Missing /LocalSite/Databases/Password in %s' % cfgFile )
return S_ERROR( 'Missing /LocalInstallation/Databases/Password in %s' % cfgFile )
def _addMySQLToDiracCfg(): """ Add the database access info to the local configuration """ if not mysqlPassword: return S_ERROR( 'Missing /LocalSite/Databases/Password in %s' % cfgFile ) section = '/'.join( ['Systems', 'Databases'] ) cfg = __getCfg( section, 'User', mysqlUser ) cfg.setOption( '/'.join( [section, 'Password'] ), mysqlPassword ) return _addCfgToDiracCfg( cfg )
635657907930ea9f7bdc0205351cf483304aabe6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/635657907930ea9f7bdc0205351cf483304aabe6/InstallTools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1289, 28723, 774, 14521, 8836, 8198, 13332, 3536, 1436, 326, 2063, 2006, 1123, 358, 326, 1191, 1664, 3536, 309, 486, 7219, 3913, 30, 327, 348, 67, 3589, 12, 296, 4841, 342, 2042, 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, 1289, 28723, 774, 14521, 8836, 8198, 13332, 3536, 1436, 326, 2063, 2006, 1123, 358, 326, 1191, 1664, 3536, 309, 486, 7219, 3913, 30, 327, 348, 67, 3589, 12, 296, 4841, 342, 2042, 21...
self.server.av_transport_server.set_variable(self.server.connection_manager_server.lookup_avt_id(self.current_connection_id), 'CurrentTrack',self.playcontainer[0]+1) self.load(next_track[0],next_track[1],next_track[2])
av_transport.set_variable(conn_id, 'CurrentTrack', self.playcontainer[0]+1) self.load(next_track[0], next_track[1], next_track[2])
def update( self,message=None): _, current,_ = self.player.get_state() self.debug("update current %r" % current) """ if current == gst.STATE_NULL: return if current not in (gst.STATE_PLAYING, gst.STATE_PAUSED, gst.STATE_READY): print "I'm out" return """ if current == gst.STATE_PLAYING: state = 'playing' self.server.av_transport_server.set_variable(self.server.connection_manager_server.lookup_avt_id(self.current_connection_id), 'TransportState', 'PLAYING') elif current == gst.STATE_PAUSED: state = 'paused' self.server.av_transport_server.set_variable(self.server.connection_manager_server.lookup_avt_id(self.current_connection_id), 'TransportState', 'PAUSED_PLAYBACK') elif(self.playcontainer != None and message == gst.MESSAGE_EOS and self.playcontainer[0]+1 < len(self.playcontainer[2])): state = 'transitioning' self.server.av_transport_server.set_variable(self.server.connection_manager_server.lookup_avt_id(self.current_connection_id), 'TransportState', 'TRANSITIONING')
56a690641745e5de48e43c2d6f0dd10f24a0e22c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11626/56a690641745e5de48e43c2d6f0dd10f24a0e22c/gstreamer_renderer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 365, 16, 2150, 33, 7036, 4672, 389, 16, 783, 16, 67, 273, 365, 18, 14872, 18, 588, 67, 2019, 1435, 365, 18, 4148, 2932, 2725, 783, 738, 86, 6, 738, 783, 13, 3536, 309, 78...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 365, 16, 2150, 33, 7036, 4672, 389, 16, 783, 16, 67, 273, 365, 18, 14872, 18, 588, 67, 2019, 1435, 365, 18, 4148, 2932, 2725, 783, 738, 86, 6, 738, 783, 13, 3536, 309, 78...
q = board.data[cord1.y][cord0.x]
q = board.data[cord0.y][cord1.x]
def move (self, move, mvlist=False): board = self.clone() board.movelist = None cord0, cord1 = move.cords p = board[cord0] if p.sign == KING: if cord0.y == 0: if cord0.x - cord1.x == 2: board._move(a1, d1) elif cord0.x - cord1.x == -2: board._move(h1, f1) else: if cord0.x - cord1.x == 2: board._move(a8, d8) elif cord0.x - cord1.x == -2: board._move(h8, f8) elif p.sign == PAWN and cord0.y in (3,4): if cord0.x != cord1.x and board[cord1] == None: q = board.data[cord1.y][cord0.x] if q: board.myhash = board.myhash ^ zobrit[q.color][q.sign][cord1.x][cord0.y] board.data[cord1.y][cord0.x] = None elif p.sign == PAWN and cord1.y in (0,7): q = board[cord0] board.myhash = board.myhash ^ zobrit[q.color][q.sign][cord0.x][cord0.y] board[cord0] = Piece(q.color, move.promotion) q = board[cord0] try: board.myhash = board.myhash ^ zobrit[q.color][q.sign][cord0.x][cord0.y] except: print [q.color, q.sign, cord0.x, cord0.y] board._move(cord0, cord1) board.color = 1 - self.color if board[cord1].sign == KING: if abs(cord0.x - cord1.x) == 2: if board[cord1].color == WHITE: board.castling |= WHITE_CASTLED board.castling = rm(board.castling, WHITE_OO) board.castling = rm(board.castling, WHITE_OOO) else: board.castling |= BLACK_CASTLED board.castling = rm(board.castling, BLACK_OO) board.castling = rm(board.castling, BLACK_OOO) else: if board[cord1].color == WHITE: board.castling = rm(board.castling, WHITE_OO) board.castling = rm(board.castling, WHITE_OOO) else: board.castling = rm(board.castling, BLACK_OO) board.castling = rm(board.castling, BLACK_OOO) elif board[cord1].sign == ROOK: if board[cord1].color == WHITE: if cord0 == a1: board.castling = rm(board.castling, WHITE_OOO) elif cord0 == h1: board.castling = rm(board.castling, WHITE_OO) else: if cord0 == a8: board.castling = rm(board.castling, BLACK_OOO) elif cord0 == h8: board.castling = rm(board.castling, BLACK_OO) elif board[cord1].sign == PAWN and abs(cord0.y - cord1.y) == 2: board.enpassant = Cord(cord0.x, (cord0.y+cord1.y)/2) else: board.enpassant = None iscapture = self[cord1] != None if iscapture or board[cord1].sign != PAWN: board.fifty += 1 else: board.fifty = 0 if mvlist: board.movelist = validator.findMoves(board) if not board[cord1]: log.warn("How is this move possible? "+str(move)) if board[cord1] and board[cord1].sign == "p" and cord1.y in [0,7]: board[cord1] = Piece(board[cord1].color, move.promotion) return board
550eac02f25b0d3b19800626a8a282df0170623c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5339/550eac02f25b0d3b19800626a8a282df0170623c/Board.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3635, 261, 2890, 16, 3635, 16, 7701, 1098, 33, 8381, 4672, 11094, 273, 365, 18, 14056, 1435, 11094, 18, 8683, 941, 376, 273, 599, 276, 517, 20, 16, 276, 517, 21, 273, 3635, 18, 901, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3635, 261, 2890, 16, 3635, 16, 7701, 1098, 33, 8381, 4672, 11094, 273, 365, 18, 14056, 1435, 11094, 18, 8683, 941, 376, 273, 599, 276, 517, 20, 16, 276, 517, 21, 273, 3635, 18, 901, ...
while ((day[localbegin.tm_wday] != 0) or (mktime(localrepeatedbegindate) > mktime(localbegin)) or ((day[localbegin.tm_wday] == 0) and ((findRunningEvent and localend < localnow) or ((not findRunningEvent) and localbegin < localnow)))):
while ((day[localbegin.tm_wday] != 0) or (mktime(localrepeatedbegindate) > mktime(localbegin)) or ((day[localbegin.tm_wday] == 0) and ((findRunningEvent and localend < localnow) or ((not findRunningEvent) and localbegin < localnow)))):
def processRepeated(self, findRunningEvent = True): print "ProcessRepeated" if (self.repeated != 0): now = int(time()) + 1
9ddb6ca949731ad0f510602b012ee0b2ea53890f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6652/9ddb6ca949731ad0f510602b012ee0b2ea53890f/timer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 20730, 12, 2890, 16, 1104, 7051, 1133, 273, 1053, 4672, 1172, 315, 2227, 20730, 6, 309, 261, 2890, 18, 266, 9061, 480, 374, 4672, 2037, 273, 509, 12, 957, 10756, 397, 404, 2, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 20730, 12, 2890, 16, 1104, 7051, 1133, 273, 1053, 4672, 1172, 315, 2227, 20730, 6, 309, 261, 2890, 18, 266, 9061, 480, 374, 4672, 2037, 273, 509, 12, 957, 10756, 397, 404, 2, -10...
fbasemodel = gtk.ListStore(object, str, str, str)
fbasemodel = gtk.ListStore(object, str)
def __init__(self, watcher, songs): super(SongProperties, self).__init__() if len(songs) > 1: self.set_default_size(600, 400) else: self.set_default_size(400, 400) self.plugins.rescan()
8e6dab9c9e23e1c960b042d3eef4f294cf9b9cda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/8e6dab9c9e23e1c960b042d3eef4f294cf9b9cda/properties.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 9527, 16, 272, 7260, 4672, 2240, 12, 55, 932, 2297, 16, 365, 2934, 972, 2738, 972, 1435, 309, 562, 12, 816, 564, 13, 405, 404, 30, 365, 18, 542, 67, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 9527, 16, 272, 7260, 4672, 2240, 12, 55, 932, 2297, 16, 365, 2934, 972, 2738, 972, 1435, 309, 562, 12, 816, 564, 13, 405, 404, 30, 365, 18, 542, 67, ...
tmpCM=tmpCM + (index*m)
def getCMPixel(self): """ Method which returns the traits of the center of mass point for the kurve. Here center of mass is 1 dim along the kurve. It returns a single element of a Kurve which is a list with entries [Row,Col,gpsStamp,Freq,Power] """ print "Hi girl. The CM is ?" if not(self.sortedByTime): self.__timeOrderCurve__() M=0 m=0 r=0 rCM=1 tmpCM=0 index=1 for element in self.element: row,col,gpsStamp,Freq,Power=element M=M+Power m=Power r=0 index=index+1 tmpCM=tmpCM + (index*m) rCM=int(round(tmpCM/M)) return self.element[rCM]
f8356864ebd3e4f4c62944a76ace8501c23ac979 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/f8356864ebd3e4f4c62944a76ace8501c23ac979/tracksearchutils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1927, 4566, 3556, 12, 2890, 4672, 3536, 2985, 1492, 1135, 326, 18370, 434, 326, 4617, 434, 8039, 1634, 364, 326, 417, 295, 537, 18, 225, 13743, 4617, 434, 8039, 353, 404, 2464, 7563, 326...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1927, 4566, 3556, 12, 2890, 4672, 3536, 2985, 1492, 1135, 326, 18370, 434, 326, 4617, 434, 8039, 1634, 364, 326, 417, 295, 537, 18, 225, 13743, 4617, 434, 8039, 353, 404, 2464, 7563, 326...
elif nl.search(s[0]) < 0 and s[1]:
elif nl.search(s[0]) < 0 and s[1] and s[0][-1:] != ':':
def _str(self,structure,level):
4bf472476dd8f1951924bc51314fa330c37ae22f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4bf472476dd8f1951924bc51314fa330c37ae22f/StructuredText.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 701, 12, 2890, 16, 7627, 16, 2815, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 701, 12, 2890, 16, 7627, 16, 2815, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return 'Package %s successfuly converted to %s' % \ (package, destination_format)
print 'Package %s successfuly converted to %s' % (package, destination_format) return os.path.abspath(package)
def convert(package, destination_format): """\ Convert packages with the 'alien' utility. If alien is not installed, it throws a NotImplementedError exception. returns: filename of the package generated. """ try: os_dep.command('alien') except: e_msg = 'Cannot convert to %s, alien not installed' % destination_format raise TestError(e_msg) # alien supports converting to many formats, but its interesting to map # convertions only for the implemented package types. if destination_format == 'dpkg': deb_pattern = re.compile('[A-Za-z0-9_.-]*[.][d][e][b]') conv_output = system_output('alien --to-deb %s 2>/dev/null' % package) return re.findall(deb_pattern, conv_output)[0] elif destination_format == 'rpm': rpm_pattern = re.compile('[A-Za-z0-9_.-]*[.][r][p][m]') conv_output = system_output('alien --to-rpm %s 2>/dev/null' % package) return re.findall(rpm_pattern, conv_output)[0] else: e_msg = 'Convertion to format %s not implemented' % destination_format raise NotImplementedError(e_msg) return 'Package %s successfuly converted to %s' % \ (package, destination_format)
3a01d01c0b8cc65a9fb0a8069c38545506f5cb5a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/3a01d01c0b8cc65a9fb0a8069c38545506f5cb5a/package.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 12, 5610, 16, 2929, 67, 2139, 4672, 3536, 64, 4037, 5907, 598, 326, 296, 18083, 275, 11, 12788, 18, 971, 15033, 275, 353, 486, 5876, 16, 518, 1216, 279, 11206, 1520, 18, 1135, 30...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 12, 5610, 16, 2929, 67, 2139, 4672, 3536, 64, 4037, 5907, 598, 326, 296, 18083, 275, 11, 12788, 18, 971, 15033, 275, 353, 486, 5876, 16, 518, 1216, 279, 11206, 1520, 18, 1135, 30...
if chk.dtype is object_ and chk.item() is None:
if not chk or (chk.dtype is object_ and chk.item() is None):
def _typedmethod(self, name, myiter, dtype): result = empty(myiter.shape, dtype=dtype) res = result.flat for k, val in enumerate(myiter): newval = [] for chk in val[1:]: if chk.dtype is object_ and chk.item() is None: break newval.append(chk) this_str = val[0].rstrip('\x00') newitem = getattr(this_str,name)(*newval) res[k] = newitem return result
9f036ecd5ae67db2af4d486199f2b64c73670acb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/9f036ecd5ae67db2af4d486199f2b64c73670acb/defchararray.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 11585, 2039, 12, 2890, 16, 508, 16, 3399, 2165, 16, 3182, 4672, 563, 273, 1008, 12, 4811, 2165, 18, 4867, 16, 3182, 33, 8972, 13, 400, 273, 563, 18, 15401, 364, 417, 16, 1244, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 11585, 2039, 12, 2890, 16, 508, 16, 3399, 2165, 16, 3182, 4672, 563, 273, 1008, 12, 4811, 2165, 18, 4867, 16, 3182, 33, 8972, 13, 400, 273, 563, 18, 15401, 364, 417, 16, 1244, 3...
@classmethod def get_searchable(cls): """ get_searchable will return the description of how this object can be searched by returning a dict with the derived Class' name (or display name) as the key, and a list of fields that can be searched after any field filtering has been applied """ return cls._create_search_description(dict(includes = ['Description','Driver','Vendor_id','Device_id']))
def __init__(self, vendor_id=None, device_id=None, subsys_device_id=None, subsys_vendor_id=None, bus=None, driver=None, device_class=None, description=None): if not device_class: device_class = "NONE" try: dc = DeviceClass.query.filter_by(device_class = device_class).one() except InvalidRequestError: dc = DeviceClass(device_class = device_class) session.save(dc) session.flush([dc]) self.vendor_id = vendor_id self.device_id = device_id self.subsys_vendor_id = subsys_vendor_id self.subsys_device_id = subsys_device_id self.bus = bus self.driver = driver self.description = description self.device_class = dc
9b07dabc35f2aeacd44895611672b31c24432fe6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14755/9b07dabc35f2aeacd44895611672b31c24432fe6/model.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 8556, 67, 350, 33, 7036, 16, 2346, 67, 350, 33, 7036, 16, 720, 9499, 67, 5964, 67, 350, 33, 7036, 16, 720, 9499, 67, 10645, 67, 350, 33, 7036, 16, 57...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 8556, 67, 350, 33, 7036, 16, 2346, 67, 350, 33, 7036, 16, 720, 9499, 67, 5964, 67, 350, 33, 7036, 16, 720, 9499, 67, 10645, 67, 350, 33, 7036, 16, 57...
self.sock.bind(self.addr_local)
test_support.bind_port(self.sock, self.localhost)
def testAcceptTimeout(self): # Test accept() timeout _timeout = 2 self.sock.settimeout(_timeout) self.sock.bind(self.addr_local) self.sock.listen(5)
ce6e4b0930f3beaff0d2d11f7473d295d87866c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/ce6e4b0930f3beaff0d2d11f7473d295d87866c5/test_timeout.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 5933, 2694, 12, 2890, 4672, 468, 7766, 2791, 1435, 2021, 389, 4538, 273, 576, 365, 18, 15031, 18, 542, 4538, 24899, 4538, 13, 225, 1842, 67, 13261, 18, 4376, 67, 655, 12, 2890, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 5933, 2694, 12, 2890, 4672, 468, 7766, 2791, 1435, 2021, 389, 4538, 273, 576, 365, 18, 15031, 18, 542, 4538, 24899, 4538, 13, 225, 1842, 67, 13261, 18, 4376, 67, 655, 12, 2890, 1...
if complete: for install in deps: context.linkPath(deps[install],install + 'Dir') else: if not prereq in missings: missings += [ prereq ]
if not complete and not prereq in missings: missings += [ prereq ] else: for install in projects[project].buildDeps[prereq]: context.linkPath( projects[project].buildDeps[prereq][install], install + 'Dir')
def linkDependencies(projects, cuts=[]): '''All projects which are dependencies but are not part of *srcTop* are not under development in the current workspace. Links to the required executables, headers, libraries, etc. will be added to the install directories such that projects in *srcTop* can build.''' import __main__ missings = [] for project in projects: for prereq in projects[project].buildDeps: if not prereq in cuts: complete = True deps = projects[project].buildDeps[prereq] for dir in deps: for path in deps[dir]: command = 'linkPath' + dir.capitalize() if dir == 'lib': path = 'lib' + path + '.a' linkName = __main__.__dict__[command](path) if not os.path.exists(linkName): complete = False if not complete: deps, complete = findPrerequisites( projects[project].buildDeps[prereq], projects[project].buildExcludes[prereq]) if complete: for install in deps: context.linkPath(deps[install],install + 'Dir') else: if not prereq in missings: missings += [ prereq ] if len(missings) > 0: raise Error("incomplete prerequisites for " + ' '.join(missings),1)
d388c9929f8806fbbfffc49c79ce311c048dc2f0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1360/d388c9929f8806fbbfffc49c79ce311c048dc2f0/dws.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1692, 8053, 12, 13582, 16, 6391, 87, 33, 8526, 4672, 9163, 1595, 10137, 1492, 854, 5030, 1496, 854, 486, 1087, 434, 380, 4816, 3401, 14, 854, 486, 3613, 17772, 316, 326, 783, 6003, 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, 1692, 8053, 12, 13582, 16, 6391, 87, 33, 8526, 4672, 9163, 1595, 10137, 1492, 854, 5030, 1496, 854, 486, 1087, 434, 380, 4816, 3401, 14, 854, 486, 3613, 17772, 316, 326, 783, 6003, 18, ...
if obj.ships[index][0] == designID:
if obj.ships[index][SHIP_IDX_DESIGNID] == designID:
def serviceShips(self, tran, obj): player = tran.db[obj.owner] # check conditions # no combat in the system system = tran.db[obj.orbiting] if system.combatCounter != 0: return # player's or ally's planet in the system and upgrade facility there # check for train facilities too upgrPlanets = [] trainPlanets = [] trainShipInc = 0.0 trainShipMax = 0 for planetID in system.planets: planet = tran.db[planetID] if planet.owner == player.oid and planet.upgradeShip > 0: upgrPlanets.append(planet) elif self.cmd(player).isPactActive(tran, player, planet.owner, PACT_ALLOW_TANKING): upgrPlanets.append(planet) if planet.owner == player.oid and planet.trainShipInc > 0.0: trainShipInc = max(trainShipInc, planet.trainShipInc) trainShipMax = max(trainShipMax, planet.trainShipMax) # train ships if trainShipInc > 0: for index, ship in enumerate(obj.ships): spec = player.shipDesigns[ship[SHIP_IDX_DESIGNID]] if ship[SHIP_IDX_EXP] / spec.baseExp < trainShipMax and spec.isMilitary: ship[SHIP_IDX_EXP] = min( spec.baseExp * trainShipMax, ship[SHIP_IDX_EXP] + max(int(trainShipInc * spec.baseExp), 1), ) if not upgrPlanets: # no service facility return upgraded = 0 # perform upgrade for designID in player.shipDesigns.keys(): spec = player.shipDesigns[designID] if spec.upgradeTo: #@log.debug("Upgrading design", designID, "to", spec.upgradeTo, "for player", player.oid) upgradeToSpec = player.shipDesigns[spec.upgradeTo] player.fleetUpgradeInProgress = 1 diff = max( Rules.shipMinUpgrade, int((upgradeToSpec.buildProd - spec.buildProd) * Rules.shipUpgradeMod), ) if player.fleetUpgradePool < diff: continue # scan all ships for design designExists = 0 for index in xrange(0, len(obj.ships)): if obj.ships[index][0] == designID: # find planet with free upgrade points needsUPts = Rules.shipUpgradePts[upgradeToSpec.combatClass] planet = None for tmpPlanet in upgrPlanets: if tmpPlanet.upgradeShip >= needsUPts: planet = tmpPlanet break if not planet: break # check strategic resources neededSR = {} # new design for sr in upgradeToSpec.buildSRes: if not sr in neededSR: neededSR[sr] = 0 neededSR[sr] += 1 # old desing for sr in spec.buildSRes: if not sr in neededSR: neededSR[sr] = 0 neededSR[sr] -= 1 # check player's resources ok = 1 for sr in neededSR: if player.stratRes.get(sr, 0) < neededSR[sr]: Utils.sendMessage(tran, obj, MSG_CANNOT_UPGRADE_SR, obj.oid, (spec.name, upgradeToSpec.name, sr)) # skip this ship ok = 0 if not ok: # skip this ship break # consume strategic resources for sr in neededSR: player.stratRes[sr] -= neededSR[sr] # upgrade ship log.debug("Upgrading ship in fleet", obj.oid, needsUPts, planet.upgradeShip, planet.oid) maxHPRatio = max(0.01, 1.0 - max(upgradeToSpec.buildProd - spec.buildProd, 0) / float(upgradeToSpec.buildProd)) obj.ships[index][0] = spec.upgradeTo obj.ships[index][1] = max(1, min( obj.ships[index][1], int(upgradeToSpec.maxHP * maxHPRatio) )) upgraded += 1 #@log.debug("HP penalty", diff, upgradeToSpec.buildProd, maxHPRatio) player.fleetUpgradePool -= diff designExists = 1 # consume upgrade points planet.upgradeShip -= needsUPts # record last upgrade obj.lastUpgrade = tran.db[OID_UNIVERSE].turn # send a message to the player # Utils.sendMessage(tran, obj, MSG_UPGRADED_SHIP, obj.oid, (spec.name, player.shipDesigns[spec.upgradeTo].name)) if player.fleetUpgradePool < diff: break if player.fleetUpgradePool < diff: break # fix fleet stats if upgraded > 0: self.cmd(obj).update(tran, obj)
dcdab9d2dba70a24e9444cc5e7b6de204347f28a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/503/dcdab9d2dba70a24e9444cc5e7b6de204347f28a/IFleet.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1156, 1555, 7146, 12, 2890, 16, 13637, 16, 1081, 4672, 7291, 273, 13637, 18, 1966, 63, 2603, 18, 8443, 65, 468, 866, 4636, 468, 1158, 3894, 270, 316, 326, 2619, 2619, 273, 13637, 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, 1156, 1555, 7146, 12, 2890, 16, 13637, 16, 1081, 4672, 7291, 273, 13637, 18, 1966, 63, 2603, 18, 8443, 65, 468, 866, 4636, 468, 1158, 3894, 270, 316, 326, 2619, 2619, 273, 13637, 18, 1...
[-1.0/3**0.5, +1.0/3**0.5, +1.0/3**0.5], [+1.0/3**0.5, +1.0/3**0.5, +1.0/3**0.5]])
[+1.0/3**0.5, +1.0/3**0.5, +1.0/3**0.5], [-1.0/3**0.5, +1.0/3**0.5, +1.0/3**0.5]])
def __init__(self): """ Setup hex8 cell. """ vertices = numpy.array([[-1.0, -1.0, -1.0], [+1.0, -1.0, -1.0], [-1.0, +1.0, -1.0], [+1.0, +1.0, -1.0], [-1.0, -1.0, +1.0], [+1.0, -1.0, +1.0], [-1.0, +1.0, +1.0], [+1.0, +1.0, +1.0]]) quadPts = numpy.array([ [-1.0/3**0.5, -1.0/3**0.5, -1.0/3**0.5], [+1.0/3**0.5, -1.0/3**0.5, -1.0/3**0.5], [-1.0/3**0.5, +1.0/3**0.5, -1.0/3**0.5], [+1.0/3**0.5, +1.0/3**0.5, -1.0/3**0.5], [-1.0/3**0.5, -1.0/3**0.5, +1.0/3**0.5], [+1.0/3**0.5, -1.0/3**0.5, +1.0/3**0.5], [-1.0/3**0.5, +1.0/3**0.5, +1.0/3**0.5], [+1.0/3**0.5, +1.0/3**0.5, +1.0/3**0.5]]) quadWts = numpy.array( [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0])
fe068c7d5a9a7a2245d29d05c23d7dc62cec27ce /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8645/fe068c7d5a9a7a2245d29d05c23d7dc62cec27ce/TestFIATLagrange.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 3536, 10939, 3827, 28, 2484, 18, 3536, 6928, 273, 3972, 18, 1126, 3816, 18919, 21, 18, 20, 16, 300, 21, 18, 20, 16, 300, 21, 18, 20, 6487, 306, 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, 1001, 2738, 972, 12, 2890, 4672, 3536, 10939, 3827, 28, 2484, 18, 3536, 6928, 273, 3972, 18, 1126, 3816, 18919, 21, 18, 20, 16, 300, 21, 18, 20, 16, 300, 21, 18, 20, 6487, 306, 15, ...
channelName = '%s-%s' % (hopSourceSE,hopDestSE) res = self.TransferDB.addFileToChannel(channelID, fileID, sourceSURL, targetSURL,fileSize,spaceToken,fileStatus=status)
res = self.TransferDB.addFileToChannel(channelID,fileID,sourceSE,sourceSURL,targetSE,targetSURL,fileSize,fileStatus=status)
def execute(self): """ The main agent execution method """
c1f8eb1d2bbc7cd4df2a54c42faff5c04a709853 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/c1f8eb1d2bbc7cd4df2a54c42faff5c04a709853/ReplicationScheduler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 12, 2890, 4672, 3536, 1021, 2774, 4040, 4588, 707, 3536, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 12, 2890, 4672, 3536, 1021, 2774, 4040, 4588, 707, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
if stat <> 0: warning ("Command `fontforge -usage' failed. Cannot simplify or convert to TTF.")
if stat != 0: warning ("Command `fontforge -usage' failed. Cannot simplify or convert to TTF.")
def check_pfaedit_scripting (): global fontforge_cmd stat = system ("fontforge -usage > pfv 2>&1 > /dev/null", ignore_error = 1) if stat <> 0: stat = system ("pfaedit -usage > pfv 2>&1", ignore_error = 1) if stat == 0: fontforge_cmd = 'pfaedit' else: fontforge_cmd = 'fontforge' if stat <> 0: warning ("Command `fontforge -usage' failed. Cannot simplify or convert to TTF.") return 0 if fontforge_cmd == 'pfaedit' and \ re.search ("-script", open ('pfv').read()) == None: warning ("pfaedit does not support -script. Install 020215 or later.\nCannot simplify or convert to TTF.\n") return 0 return 1
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, 866, 67, 84, 507, 4619, 67, 4263, 310, 1832, 30, 2552, 3512, 1884, 908, 67, 4172, 610, 273, 2619, 7566, 5776, 1884, 908, 300, 9167, 405, 10811, 90, 576, 22393, 21, 405, 342, 5206, 19, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 84, 507, 4619, 67, 4263, 310, 1832, 30, 2552, 3512, 1884, 908, 67, 4172, 610, 273, 2619, 7566, 5776, 1884, 908, 300, 9167, 405, 10811, 90, 576, 22393, 21, 405, 342, 5206, 19, ...
for inc in get_inclist(rp): return_list.append(inc.getinctime())
for inc in get_inclist(rp): d[inc.getinctime()] = None for inc in get_inclist(Globals.rbdir.append("mirror_metadata")): d[inc.getinctime()] = None return_list = d.keys() return_list.sort()
def get_increment_times(cls, rp = None): """Return list of times of backups, including current mirror""" if not _mirror_time: return_list = [cls.get_mirror_time()] else: return_list = [_mirror_time] if not rp or not rp.index: rp = Globals.rbdir.append("increments") for inc in get_inclist(rp): return_list.append(inc.getinctime()) return return_list
81d6374f3b5427954b077f724a90597d1721119e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/783/81d6374f3b5427954b077f724a90597d1721119e/restore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 15016, 67, 8293, 12, 6429, 16, 8715, 273, 599, 4672, 3536, 990, 666, 434, 4124, 434, 22091, 16, 6508, 783, 15593, 8395, 309, 486, 389, 27197, 67, 957, 30, 327, 67, 1098, 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, 15016, 67, 8293, 12, 6429, 16, 8715, 273, 599, 4672, 3536, 990, 666, 434, 4124, 434, 22091, 16, 6508, 783, 15593, 8395, 309, 486, 389, 27197, 67, 957, 30, 327, 67, 1098, 273, ...
new = re.pcre_expand(m, self.replvar.get())
new = self._expand(m, self.replvar.get())
def do_replace(self): prog = self.engine.getprog() if not prog: return 0 text = self.text try: first = pos = text.index("sel.first") last = text.index("sel.last") except TclError: pos = None if not pos: first = last = pos = text.index("insert") line, col = SearchEngine.get_line_col(pos) chars = text.get("%d.0" % line, "%d.0" % (line+1)) m = prog.match(chars, col) if not prog: return 0 new = re.pcre_expand(m, self.replvar.get()) text.mark_set("insert", first) text.undo_block_start() if m.group(): text.delete(first, last) if new: text.insert(first, new) text.undo_block_stop() self.show_hit(first, text.index("insert")) self.ok = 0 return 1
f8d071332a485ede280675a55e3319e136826dd0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f8d071332a485ede280675a55e3319e136826dd0/ReplaceDialog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 2079, 12, 2890, 4672, 11243, 273, 365, 18, 8944, 18, 588, 14654, 1435, 309, 486, 11243, 30, 327, 374, 977, 273, 365, 18, 955, 775, 30, 1122, 273, 949, 273, 977, 18, 1615, 29...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 2079, 12, 2890, 4672, 11243, 273, 365, 18, 8944, 18, 588, 14654, 1435, 309, 486, 11243, 30, 327, 374, 977, 273, 365, 18, 955, 775, 30, 1122, 273, 949, 273, 977, 18, 1615, 29...
changelog = open(os.path.join('doc', 'changelog'))
if sys.version_info >= (3, 0): extra = dict(encoding='UTF-8') else: extra = {} changelog = open(os.path.join('doc', 'changelog'), **extra)
def get_version(): changelog = open(os.path.join('doc', 'changelog')) try: return changelog.readline().split()[1].strip('()') finally: changelog.close()
c9e6e5ea686b8d6988bdad121f59550b0938e120 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3681/c9e6e5ea686b8d6988bdad121f59550b0938e120/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1589, 13332, 309, 2589, 18, 1589, 67, 1376, 1545, 261, 23, 16, 374, 4672, 2870, 273, 2065, 12, 5999, 2218, 5159, 17, 28, 6134, 469, 30, 2870, 273, 2618, 21182, 273, 1696, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1589, 13332, 309, 2589, 18, 1589, 67, 1376, 1545, 261, 23, 16, 374, 4672, 2870, 273, 2065, 12, 5999, 2218, 5159, 17, 28, 6134, 469, 30, 2870, 273, 2618, 21182, 273, 1696, 12, ...
return self.http_error_auth_reqed('www-authenticate',
response = self.http_error_auth_reqed('www-authenticate',
def http_error_401(self, req, fp, code, msg, headers): url = req.full_url return self.http_error_auth_reqed('www-authenticate', url, req, headers)
d381e177aa0fcffa5fb5322069fb388049ef0a43 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/d381e177aa0fcffa5fb5322069fb388049ef0a43/request.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1062, 67, 1636, 67, 27002, 12, 2890, 16, 1111, 16, 4253, 16, 981, 16, 1234, 16, 1607, 4672, 880, 273, 1111, 18, 2854, 67, 718, 766, 273, 365, 18, 2505, 67, 1636, 67, 1944, 67, 3658, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1062, 67, 1636, 67, 27002, 12, 2890, 16, 1111, 16, 4253, 16, 981, 16, 1234, 16, 1607, 4672, 880, 273, 1111, 18, 2854, 67, 718, 766, 273, 365, 18, 2505, 67, 1636, 67, 1944, 67, 3658, ...
error_handler=log.err)
error_handler=d.errback)
def list_contacts_cb(contacts): # this two should match self.assertEqual(count, len(contacts)) d.callback(True)
45c00959c14e666ef31b3f93137f14e6d66959e4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12036/45c00959c14e666ef31b3f93137f14e6d66959e4/test_dbus.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 67, 20777, 67, 7358, 12, 20777, 4672, 468, 333, 2795, 1410, 845, 365, 18, 11231, 5812, 12, 1883, 16, 562, 12, 20777, 3719, 302, 18, 3394, 12, 5510, 13, 2, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 666, 67, 20777, 67, 7358, 12, 20777, 4672, 468, 333, 2795, 1410, 845, 365, 18, 11231, 5812, 12, 1883, 16, 562, 12, 20777, 3719, 302, 18, 3394, 12, 5510, 13, 2, -100, -100, -100, -100, ...
'minimum_delay': sys.maxint,
'minimum_delay': MAXINT,
def test0050on_time(self): ''' Test on_time ''' with Transaction().start(DB_NAME, USER, CONTEXT) as transaction: model_id = self.model.search([ ('model', '=', 'test.triggered'), ])[0]
54e2a3fd0bb29068293199047c4fa4ef7351d27b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9266/54e2a3fd0bb29068293199047c4fa4ef7351d27b/test_trigger.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 713, 3361, 265, 67, 957, 12, 2890, 4672, 9163, 7766, 603, 67, 957, 9163, 598, 5947, 7675, 1937, 12, 2290, 67, 1985, 16, 7443, 16, 13862, 13, 487, 2492, 30, 938, 67, 350, 273, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 713, 3361, 265, 67, 957, 12, 2890, 4672, 9163, 7766, 603, 67, 957, 9163, 598, 5947, 7675, 1937, 12, 2290, 67, 1985, 16, 7443, 16, 13862, 13, 487, 2492, 30, 938, 67, 350, 273, 3...
l2 = wx.StaticText( self, -1, "wx.ColumnHeader (1002)", (80, 70), (200, 20) )
cntlID = 1002 prompt = "wx.ColumnHeader (%d)" %(cntlID) l2 = wx.StaticText( self, -1, prompt, (80, 70), (200, 20) )
def __init__( self, parent, log ): wx.Panel.__init__( self, parent, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE ) self.log = log
97785f3f33dd20f2b36619b4084b435cbedc5e2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/97785f3f33dd20f2b36619b4084b435cbedc5e2e/ColumnHeader.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 365, 16, 982, 16, 613, 262, 30, 7075, 18, 5537, 16186, 2738, 972, 12, 365, 16, 982, 16, 300, 21, 16, 2154, 33, 27226, 18, 3417, 67, 18111, 67, 862, 4066, 3217, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 365, 16, 982, 16, 613, 262, 30, 7075, 18, 5537, 16186, 2738, 972, 12, 365, 16, 982, 16, 300, 21, 16, 2154, 33, 27226, 18, 3417, 67, 18111, 67, 862, 4066, 3217, ...
s += plaintext_writer.write(apidoc, **options.__dict__)
s += plaintext_writer.write(apidoc, **options.__dict__)+'\n'
def write_text(docindex, options): log.start_progress('Writing output') from epydoc.docwriter.plaintext import PlaintextWriter plaintext_writer = PlaintextWriter() s = '' for apidoc in docindex.root: s += plaintext_writer.write(apidoc, **options.__dict__) log.end_progress() if isinstance(s, unicode): s = s.encode('ascii', 'backslashreplace') print s
bfd4694f28e34bf508b3e1409f08e5fd3f2f0a6e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3512/bfd4694f28e34bf508b3e1409f08e5fd3f2f0a6e/cli.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 955, 12, 2434, 1615, 16, 702, 4672, 613, 18, 1937, 67, 8298, 2668, 18835, 876, 6134, 628, 425, 2074, 2434, 18, 2434, 6299, 18, 412, 10133, 1930, 3008, 10133, 2289, 11917, 67, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 955, 12, 2434, 1615, 16, 702, 4672, 613, 18, 1937, 67, 8298, 2668, 18835, 876, 6134, 628, 425, 2074, 2434, 18, 2434, 6299, 18, 412, 10133, 1930, 3008, 10133, 2289, 11917, 67, ...
if options["verbose"] >=9: write_message("Getting records from collections enabled for rank method.") res = run_sql("SELECT collection.name FROM collection,collection_rnkMETHOD,rnkMETHOD WHERE collection.id=id_collection and id_rnkMETHOD=rnkMETHOD.id and rnkMETHOD.name='%s'" % key) l_of_colls = [] for coll in res: l_of_colls.append(coll[0])
def get_valid_range(key): """Returns which records are valid for this rank method, according to which collections it is enabled for.""" if options["verbose"] >=9: write_message("Getting records from collections enabled for rank method.") res = run_sql("SELECT collection.name FROM collection,collection_rnkMETHOD,rnkMETHOD WHERE collection.id=id_collection and id_rnkMETHOD=rnkMETHOD.id and rnkMETHOD.name='%s'" % key) l_of_colls = [] for coll in res: l_of_colls.append(coll[0]) #if len(l_of_colls) > 0: recIDs = perform_request_search(c="") #else: # recIDs = [] valid = HitSet() valid.addlist(recIDs) return valid
75c14ef84ff021cd847da70ff9279e5df8f1425e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/75c14ef84ff021cd847da70ff9279e5df8f1425e/bibrank_word_indexer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 877, 67, 3676, 12, 856, 4672, 3536, 1356, 1492, 3853, 854, 923, 364, 333, 6171, 707, 16, 4888, 358, 1492, 6980, 518, 353, 3696, 364, 12123, 3639, 468, 430, 562, 12, 80, 67, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 877, 67, 3676, 12, 856, 4672, 3536, 1356, 1492, 3853, 854, 923, 364, 333, 6171, 707, 16, 4888, 358, 1492, 6980, 518, 353, 3696, 364, 12123, 3639, 468, 430, 562, 12, 80, 67, ...
if size is not None: if i==-1 and len(c) > size: i=size-1 elif size <= i: i = size -1
if (size <= i) or (i == -1 and len(c) > size): i = size - 1
def readline(self, size=-1): if size < 0: size = sys.maxint bufs = [] readsize = min(100, size) # Read from the file in small chunks while True: if size == 0: return "".join(bufs) # Return resulting line
81cdb59db2d3e3ff09fc38324d672d60689cbcda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/81cdb59db2d3e3ff09fc38324d672d60689cbcda/gzip.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12023, 12, 2890, 16, 963, 29711, 21, 4672, 309, 963, 411, 374, 30, 963, 273, 2589, 18, 1896, 474, 1681, 87, 273, 5378, 855, 1467, 273, 1131, 12, 6625, 16, 963, 13, 565, 468, 2720, 62...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12023, 12, 2890, 16, 963, 29711, 21, 4672, 309, 963, 411, 374, 30, 963, 273, 2589, 18, 1896, 474, 1681, 87, 273, 5378, 855, 1467, 273, 1131, 12, 6625, 16, 963, 13, 565, 468, 2720, 62...
t1 = addtask(doc, "0@1", title1, text1, ["1@1", "2@1", "3@1", "4@1", "5@1", "6@1"])
t1 = addtask(doc, "0@1", title1, text1, [], ["1@1", "2@1", "3@1", "4@1", "5@1", "6@1"])
def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager.
13f4333779e7aa3068a4bfe7e366596dd92c7d01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/13f4333779e7aa3068a4bfe7e366596dd92c7d01/firstrun_tasks.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6490, 13332, 997, 16, 3085, 273, 2721, 2902, 18, 5531, 2434, 2932, 4406, 7923, 225, 468, 2174, 374, 36, 21, 30, 26602, 5746, 598, 19688, 43, 2077, 21, 273, 389, 2932, 19213, 5746, 598, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 13332, 997, 16, 3085, 273, 2721, 2902, 18, 5531, 2434, 2932, 4406, 7923, 225, 468, 2174, 374, 36, 21, 30, 26602, 5746, 598, 19688, 43, 2077, 21, 273, 389, 2932, 19213, 5746, 598, ...
return (self.x * self.width, (self.y + 1) * self.height)
return (self.i * self.width, (self.j + 1) * self.height)
def get_topleft(self): return (self.x * self.width, (self.y + 1) * self.height)
ae46287e32a1e7a487f4f47ee34d687ee3d6604c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7473/ae46287e32a1e7a487f4f47ee34d687ee3d6604c/tiles.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 3669, 4482, 12, 2890, 4672, 327, 261, 2890, 18, 92, 380, 365, 18, 2819, 16, 261, 2890, 18, 93, 397, 404, 13, 380, 365, 18, 4210, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 336, 67, 3669, 4482, 12, 2890, 4672, 327, 261, 2890, 18, 92, 380, 365, 18, 2819, 16, 261, 2890, 18, 93, 397, 404, 13, 380, 365, 18, 4210, 13, 2, -100, -100, -100, -100, -100, -100, ...
if theano.config.device.startswith('gpu'): register_specialize(use_gpu_images2neibs)
if cuda_available: register_gpu_opt()(use_gpu_images2neibs)
def use_gpu_images2neibs(node): if node.op == images2neibs: return [host_from_gpu(gpu_images2neibs(*[gpu_from_host(node.inputs[0]),node.inputs[1]]))]
711f083550d5274d4f2ce7974cbc9017a7a3975a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/711f083550d5274d4f2ce7974cbc9017a7a3975a/neighbours.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 999, 67, 23162, 67, 7369, 22, 4644, 495, 87, 12, 2159, 4672, 309, 756, 18, 556, 422, 4602, 22, 4644, 495, 87, 30, 327, 306, 2564, 67, 2080, 67, 23162, 12, 23162, 67, 7369, 22, 4644, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 999, 67, 23162, 67, 7369, 22, 4644, 495, 87, 12, 2159, 4672, 309, 756, 18, 556, 422, 4602, 22, 4644, 495, 87, 30, 327, 306, 2564, 67, 2080, 67, 23162, 12, 23162, 67, 7369, 22, 4644, ...
], CONTEXT)
], 0, None, None, CONTEXT)
def test0050char(self): ''' Test Char. ''' char1_id = self.char.create({ 'char': 'Test', }, CONTEXT) self.assert_(char1_id)
52062c763bf1737b3f2071e48338f60845edc54d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9266/52062c763bf1737b3f2071e48338f60845edc54d/test_tryton.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 713, 3361, 3001, 12, 2890, 4672, 9163, 7766, 3703, 18, 9163, 1149, 21, 67, 350, 273, 365, 18, 3001, 18, 2640, 12590, 296, 3001, 4278, 296, 4709, 2187, 19879, 13862, 13, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 713, 3361, 3001, 12, 2890, 4672, 9163, 7766, 3703, 18, 9163, 1149, 21, 67, 350, 273, 365, 18, 3001, 18, 2640, 12590, 296, 3001, 4278, 296, 4709, 2187, 19879, 13862, 13, 365, 18, ...
if result == '': result = '1'
if ('result' not in vars()) or (result == ''): result = '1' if ('channel' not in vars()) or (channel == ''): channel = ''
def show_concurrent_calls(request): kwargs = {} graph_view = '1' result = '1' channel = '' if request.method == 'POST': channel = variable_value(request,'channel') result = variable_value(request,'result') if channel != '': kwargs[ 'channel' ] = channel if result == '': result = '1' now = datetime.now() last_day = {1:31, 2:28, 3:31, 4:30, 5:31, 6:30, 7:31, 8:31, 9:30, 10:31, 11:30, 12:31} if(result == '1'): start_date = datetime(now.year, now.month, now.day, 0, 0, 0, 0) end_date = datetime(now.year, now.month, now.day, 23, 59, 59, 0) elif(result == '2'): start_date = datetime(now.year, now.month, now.day, 0, 0, 0, 0) - relativedelta(days=1) end_date = datetime(now.year, now.month, now.day, 23, 59, 59, 0) - relativedelta(days=1) elif(result == '3'): start_date = datetime(now.year, now.month, now.day, 0, 0, 0, 0) - relativedelta(days=7) end_date = datetime(now.year, now.month, now.day, 23, 59, 59, 0) elif(result == '4'): start_date = datetime(now.year, now.month, now.day, 0, 0, 0, 0) - relativedelta(days=14) end_date = datetime(now.year, now.month, now.day, 23, 59, 59, 0) - relativedelta(days=7) elif(result == '5'): start_date = datetime(now.year, now.month, 1, 0, 0, 0, 0) end_date = datetime(now.year, now.month, now.day, 23, 59, 59, 0) elif(result == '6'): start_date = datetime(now.year, now.month, 1, 0, 0, 0, 0) - relativedelta(months=1) end_date = datetime(now.year, now.month, last_day[now.month], 23, 59, 59, 0) - relativedelta(months=1) kwargs[ 'calldate__range' ] = (start_date,end_date) form = ConcurrentCallForm(initial={'channel':channel,'result':result}) if kwargs: calls_in_day = CDR.objects.filter(**kwargs).values('calldate','duration').order_by('calldate') calls = {} # Populate the calls array for data in calls_in_day: start_call = int(data[ 'calldate' ].strftime("%Y%m%d%H%M%S")) end_call = int((data[ 'calldate' ] + timedelta(seconds=data['duration'])).strftime("%Y%m%d%H%M%S")) if start_call in calls.keys(): calls[start_call].append({'load': 1, 'calldate': data['calldate'], 'duration':data['duration']}) else: calls[start_call] = [{'load': 1, 'calldate': data['calldate'], 'duration':data['duration']}] if end_call in calls.keys(): calls[end_call].append({'load': -1, 'calldate': data['calldate'], 'duration':data['duration']}) else: calls[end_call] = [{'load': -1, 'calldate': data['calldate'], 'duration':data['duration']}] aux = {} # Sort the $calls array by its keys. for i in range(len(calls)): aux[sorted(calls.keys())[i]] = calls[sorted(calls.keys())[i]] calls = aux # Initialize some variables which will be used in processing the concurrent calls concurrent_calls = {} total_call_count = 0 #call_detail = [] calls_ok = [] calls = {} time_calls = {} last_time = 0 for data in calls_in_day: starttime = data['calldate'] int_starttime = int(starttime.strftime("%Y%m%d%H%M%S")) if int_starttime in time_calls.keys(): time_calls[int_starttime] += 1 else: time_calls[int_starttime] = 1 for data in calls_in_day: starttime = data['calldate'] endtime = starttime + timedelta(seconds=data['duration']) int_starttime = int(starttime.strftime("%Y%m%d%H%M%S")) int_endtime = int(endtime.strftime("%Y%m%d%H%M%S")) if int_starttime > last_time: for time in range(int_starttime, int_endtime): if int(result) < 5: if time in time_calls.keys(): if str(time)[0:10] in concurrent_calls.keys(): if time == int_starttime: concurrent_calls[str(time)[0:10]] += time_calls[time] - 1 else: concurrent_calls[str(time)[0:10]] += time_calls[time] else: if time == int_starttime: concurrent_calls[str(time)[0:10]] = time_calls[time] - 1 else: concurrent_calls[str(time)[0:10]] = time_calls[time] else: if time in time_calls.keys(): if str(time)[0:8] in concurrent_calls.keys(): if time == int_starttime: concurrent_calls[str(time)[0:8]] += time_calls[time] - 1 else: concurrent_calls[str(time)[0:8]] += time_calls[time] else: if time == int_starttime: concurrent_calls[str(time)[0:8]] = time_calls[time] - 1 else: concurrent_calls[str(time)[0:8]] = time_calls[time] last_time = int_endtime for data in concurrent_calls: total_call_count += concurrent_calls[data] call_count_range=range(0,total_call_count) call_count_range.reverse() dates = date_range(start_date,end_date) dateList = [] datelist_final = [] if result == '5': for i in range(1,now.day+1): if len(str(i)) <= 1: j = '0' + str(i) else: j = str(i) dateList.append(int(str(now.strftime("%Y%m") + j))) datelist_final.append(( now.strftime("%Y-%m") )) elif result == '6': for i in range(1,start_date.day+1): if len(str(i)) <= 1: j = '0' + str(i) else: j = str(i) dateList.append(int(str(start_date.strftime("%Y%m") + j))) datelist_final.append(( start_date.strftime("%Y-%m") )) else: for i in dates: for j in range(0,24): if len(str(j)) <= 1: j = '0' + str(j) else: j = str(j) dateList.append(int(i.strftime("%Y%m%d") + j)) datelist_final.append(( i.strftime("%Y-%m-%d") )) total_record_final = [] if int(result) < 5: for i in dateList: y = str(i)[0:10] if y in concurrent_calls.keys(): total_record_final.append((y[0:4]+'-'+y[4:6]+'-'+y[6:8], int(y[8:10]), concurrent_calls[y])) else: total_record_final.append((y[0:4]+'-'+y[4:6]+'-'+y[6:8], int(y[8:10]), 0)) else: for i in dateList: y = str(i)[0:8] if y in concurrent_calls.keys(): total_record_final.append((y[0:4]+'-'+y[4:6], int(y[6:8]), concurrent_calls[y])) else: total_record_final.append((y[0:4]+'-'+y[4:6], int(y[6:8]), 0)) if result == '5': total_hour = range(1,now.day+1) elif result == '6': total_hour = range(1,last_day[start_date.month]) else: total_hour = range(0,24) if int(result) < 5: graph_by = _('Hours') else: graph_by = _('Days') variables = RequestContext(request, {'form': form, 'result':'min', 'record_dates':datelist_final, 'total_hour':total_hour, 'graph_view':graph_view, 'call_count_range':call_count_range, 'total_record':sorted(total_record_final, key=lambda total: total[0]), 'calls_in_day':calls_in_day, 'graph_by':graph_by, }) return render_to_response('cdr/show_graph_concurrent_calls.html', variables, context_instance = RequestContext(request))
518e19a1983937f7437775e42d099ee7ddca8c3a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/143/518e19a1983937f7437775e42d099ee7ddca8c3a/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 67, 591, 2972, 67, 12550, 12, 2293, 4672, 225, 1205, 273, 2618, 2667, 67, 1945, 273, 296, 21, 11, 563, 273, 296, 21, 11, 1904, 273, 875, 225, 309, 590, 18, 2039, 422, 296, 3798...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 67, 591, 2972, 67, 12550, 12, 2293, 4672, 225, 1205, 273, 2618, 2667, 67, 1945, 273, 296, 21, 11, 563, 273, 296, 21, 11, 1904, 273, 875, 225, 309, 590, 18, 2039, 422, 296, 3798...
'pure conduction problem in ice and bedrock',3,' -Mx 4 -My 4 -y 130000.0 -Lbz 1000 -quadZ',
'pure conduction problem in ice and bedrock',3,' -Mx 4 -My 4 -y 130000.0 -Lbz 1000',
def verify(executable,test,report_file=None): print ' ++++ TEST ' + test[0] + ': verifying with ' + test[2] + ' exact soln ++++' print ' ' + test[5] # for myMx in test[1][:levs]: for lev_index in range(levs): myMx = test[1][lev_index] if test[3] == 0: gridopts = ' -Mx ' + str(myMx) + ' -My ' + str(myMx) elif test[3] == 1: gridopts = ' -Mx ' + str(myMx) elif test[3] == 2: gridopts = ' -Mx ' + str(myMx) + ' -My ' + str(myMx) if (uneq == 0): gridopts = gridopts + ' -Mz ' + str(myMx) else: gridopts = gridopts + ' -Mz ' + str(test[6][lev_index]) elif test[3] == 3: myMz = myMx myMbz = (myMz - 1) / 4 + 1 gridopts = ' -Mz %d -Mbz %d' % (myMz, myMbz) testdo = executable + ' -test ' + test[0] + gridopts + test[4] if (uneq == 1): testdo = testdo + ' -quadZ' elif (uneq == 2): testdo = testdo + ' -chebZ' if (doeta): testdo = testdo + ' -eta' print ' trying \"' + testdo + '\"' testdo = testdo + ' -verbose 1' # only need final errors anyway if (report_file): testdo += " -report_file %s" % report_file # write report to a NetCDF file try: lasttime = time.time() (status,output) = commands.getstatusoutput(testdo) elapsetime = time.time() - lasttime except KeyboardInterrupt: sys.exit(2) if status: sys.exit(status) print ' finished in %7.4f seconds; reported numerical errors as follows:' % elapsetime errpos = output.find('NUMERICAL ERRORS') if errpos >= 0: errreport = output[errpos:output.find('NUM ERRORS DONE')] endline = errreport.find('\n') print ' ' + errreport[0:endline] errreport = errreport[endline+1:] while (len(errreport) > 1) and (endline > 0): endline = errreport.find('\n') if endline == -1: endline = len(errreport) print ' #' + errreport[0:endline] errreport = errreport[endline+1:] endline = errreport.find('\n') if endline == -1: endline = len(errreport) print ' |' + errreport[0:endline] errreport = errreport[endline+1:] else: print ' ERROR: can\'t find reported numerical error' sys.exit(99)
1c74f48a04ef0417205565a0889b9e6260c1747f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7383/1c74f48a04ef0417205565a0889b9e6260c1747f/verifynow.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3929, 12, 17751, 16, 3813, 16, 6006, 67, 768, 33, 7036, 4672, 1172, 296, 965, 9904, 225, 22130, 296, 397, 1842, 63, 20, 65, 397, 4290, 225, 3929, 310, 598, 296, 397, 1842, 63, 22, 65...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3929, 12, 17751, 16, 3813, 16, 6006, 67, 768, 33, 7036, 4672, 1172, 296, 965, 9904, 225, 22130, 296, 397, 1842, 63, 20, 65, 397, 4290, 225, 3929, 310, 598, 296, 397, 1842, 63, 22, 65...
pointless.set_hklin(temp_mtz)
pointless.set_hklin(hklout)
def _scale_prepare(self): '''Prepare the data for scaling - this will reindex it the reflections to the correct pointgroup and setting, for instance, and move the reflection files to the scale directory.'''
775e56d0abc580e59a39738ead28bc5d0b415fb7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3290/775e56d0abc580e59a39738ead28bc5d0b415fb7/XDSScaler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5864, 67, 9366, 12, 2890, 4672, 9163, 7543, 326, 501, 364, 10612, 300, 333, 903, 17492, 518, 326, 5463, 87, 358, 326, 3434, 1634, 1655, 471, 3637, 16, 364, 791, 16, 471, 3635, 326...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5864, 67, 9366, 12, 2890, 4672, 9163, 7543, 326, 501, 364, 10612, 300, 333, 903, 17492, 518, 326, 5463, 87, 358, 326, 3434, 1634, 1655, 471, 3637, 16, 364, 791, 16, 471, 3635, 326...
self.input_codec)
self.output_charset)
def __init__(self, input_charset=DEFAULT_CHARSET): # RFC 2046, $4.1.2 says charsets are not case sensitive input_charset = input_charset.lower() # Set the input charset after filtering through the aliases self.input_charset = ALIASES.get(input_charset, input_charset) # We can try to guess which encoding and conversion to use by the # charset_map dictionary. Try that first, but let the user override # it. henc, benc, conv = CHARSETS.get(self.input_charset, (SHORTEST, BASE64, None)) # Set the attributes, allowing the arguments to override the default. self.header_encoding = henc self.body_encoding = benc self.output_charset = ALIASES.get(conv, conv) # Now set the codecs. If one isn't defined for input_charset, # guess and try a Unicode codec with the same name as input_codec. self.input_codec = CODEC_MAP.get(self.input_charset, self.input_charset) self.output_codec = CODEC_MAP.get(self.output_charset, self.input_codec)
fe2e809e660914ba5b9d18242cb4488668dfbedf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/fe2e809e660914ba5b9d18242cb4488668dfbedf/Charset.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 810, 67, 9999, 33, 5280, 67, 26977, 4672, 468, 8372, 11492, 26, 16, 271, 24, 18, 21, 18, 22, 20185, 1149, 4424, 854, 486, 648, 16692, 810, 67, 9999, 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, 810, 67, 9999, 33, 5280, 67, 26977, 4672, 468, 8372, 11492, 26, 16, 271, 24, 18, 21, 18, 22, 20185, 1149, 4424, 854, 486, 648, 16692, 810, 67, 9999, 27...
cmds = object.__getattr(self, 'cmds')
cmds = object.__getattribute__(self, 'cmds')
def __getattr__(self, name): cmds = object.__getattr(self, 'cmds') if name in cmds: return cmds[name]
d81fa0f5194e77bb6e3917d0f89d3b2fc522dbd5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14549/d81fa0f5194e77bb6e3917d0f89d3b2fc522dbd5/mrsd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 1747, 972, 12, 2890, 16, 508, 4672, 13446, 273, 733, 16186, 588, 4589, 972, 12, 2890, 16, 296, 24680, 6134, 309, 508, 316, 13446, 30, 327, 13446, 63, 529, 65, 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, 1001, 588, 1747, 972, 12, 2890, 16, 508, 4672, 13446, 273, 733, 16186, 588, 4589, 972, 12, 2890, 16, 296, 24680, 6134, 309, 508, 316, 13446, 30, 327, 13446, 63, 529, 65, 2, -100, -100,...
replaces_to_perform = [[' ', '_'], ['(', '\('], [')', '\)'], ['.', '\.'], ['[', '\['], [']', '\]'], ['{', '\{'], ['}', '\}']] for replace_to_perform in replaces_to_perform: image_to_resub = images_to_tag_list[-1].replace(replace_to_perform[0], replace_to_perform[1]) from_regex = r'\n\*\[\[:%s\]\]' % (self.image_namespace + image_to_resub)
image_to_resub = images_to_tag_list[-1] from_regex = r'\n\*\[\[:%s\]\]' % re.escape(self.image_namespace + image_to_resub)
def checkImageDuplicated(self, duplicates_rollback): """ Function to check the duplicated images. """ # {{Dupe|Image:Blanche_Montel.jpg}} # Skip the stub images #if 'stub' in self.imageName.lower() and self.project == 'wikipedia' and self.site.lang == 'it': # return True # Skip the stub, ok dupText = wikipedia.translate(self.site, duplicatesText) dupRegex = wikipedia.translate(self.site, duplicatesRegex) dupTalkHead = wikipedia.translate(self.site, duplicate_user_talk_head) dupTalkText = wikipedia.translate(self.site, duplicates_user_talk_text) dupComment_talk = wikipedia.translate(self.site, duplicates_comment_talk) dupComment_image = wikipedia.translate(self.site, duplicates_comment_image) duplicateRegex = r'\n\*(?:\[\[:Image:%s\]\] has the following duplicates(?: \(\'\'\'forced mode\'\'\'\)|):|\*\[\[:Image:%s\]\])$' % (self.convert_to_url(self.imageName), self.convert_to_url(self.imageName)) imagePage = wikipedia.ImagePage(self.site, u'Image:%s' % self.imageName) hash_found = imagePage.getHash() duplicates = self.site.getImagesFromAnHash(hash_found) if duplicates == None: return False # Error, image deleted, no hash found. Skip the image. if len(duplicates) > 1: if len(duplicates) == 2: wikipedia.output(u'%s has a duplicate! Reporting it...' % self.imageName) else: wikipedia.output(u'%s has %s duplicates! Reporting them...' % (self.imageName, len(duplicates) - 1)) if not dupText == None and not dupRegex == None: time_image_list = list() time_list = list() for duplicate in duplicates: DupePage = wikipedia.ImagePage(self.site, u'Image:%s' % duplicate) if DupePage == self.image and self.timestamp != None: imagedata = self.timestamp else: imagedata = DupePage.getLatestUploader()[1] # '2008-06-18T08:04:29Z' data = time.strptime(imagedata, u"%Y-%m-%dT%H:%M:%SZ") data_seconds = time.mktime(data) time_image_list.append([data_seconds, duplicate]) time_list.append(data_seconds) older_image = self.returnOlderTime(time_image_list, time_list) # And if the images are more than two? Page_oder_image = wikipedia.ImagePage(self.site, u'Image:%s' % older_image) string = '' images_to_tag_list = [] for duplicate in duplicates: if wikipedia.ImagePage(self.site, u'%s:%s' % (self.image_namespace, duplicate)) == \ wikipedia.ImagePage(self.site, u'%s:%s' % (self.image_namespace, older_image)): continue # the older image, not report also this as duplicate DupePage = wikipedia.ImagePage(self.site, u'Image:%s' % duplicate) try: DupPageText = DupePage.get() older_page_text = Page_oder_image.get() except wikipedia.NoPage: continue # The page doesn't exists if re.findall(dupRegex, DupPageText) == [] and re.findall(dupRegex, older_page_text) == []: wikipedia.output(u'%s is a duplicate and has to be tagged...' % duplicate) images_to_tag_list.append(duplicate) #if duplicate != duplicates[-1]: string += u"*[[:%s%s]]\n" % (self.image_namespace, duplicate) #else: # string += "*[[:%s%s]]" % (self.image_namespace, duplicate) else: wikipedia.output(u"Already put the dupe-template in the image's page or in the dupe's page. Skip.") return True # Ok - No problem. Let's continue the checking phase older_image_ns = u'%s%s' % (self.image_namespace, older_image) # adding the namespace only_report = False # true if the image are not to be tagged as dupes
3af72b5411217b4b76ab442d3061b846ad4e354a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/3af72b5411217b4b76ab442d3061b846ad4e354a/checkimages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 2040, 19682, 690, 12, 2890, 16, 11211, 67, 20050, 4672, 3536, 4284, 358, 866, 326, 16975, 4602, 18, 3536, 468, 10179, 40, 89, 347, 96, 2040, 30, 4802, 304, 18706, 67, 49, 1580, 29...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 2040, 19682, 690, 12, 2890, 16, 11211, 67, 20050, 4672, 3536, 4284, 358, 866, 326, 16975, 4602, 18, 3536, 468, 10179, 40, 89, 347, 96, 2040, 30, 4802, 304, 18706, 67, 49, 1580, 29...
fname = opts.prefix + "_"+text + opts.suffix + ".png"
fname = "Images/" + opts.prefix + "_"+text + opts.suffix + ".png" if opts.output_path is not None: fname = opts.output_path + fname
def set_figure_name(opts, text): """ return a string containing a standard output name for pylal plotting functions. """ fname = opts.prefix + "_"+text + opts.suffix + ".png" return fname
23e0f5d16b32f4abfb4a4ad0a23c7d8e4ce7ef26 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3592/23e0f5d16b32f4abfb4a4ad0a23c7d8e4ce7ef26/InspiralUtils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 19675, 67, 529, 12, 4952, 16, 977, 4672, 3536, 327, 279, 533, 4191, 279, 4529, 876, 508, 364, 2395, 80, 287, 20947, 4186, 18, 3536, 5299, 273, 315, 8946, 4898, 397, 1500, 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, 444, 67, 19675, 67, 529, 12, 4952, 16, 977, 4672, 3536, 327, 279, 533, 4191, 279, 4529, 876, 508, 364, 2395, 80, 287, 20947, 4186, 18, 3536, 5299, 273, 315, 8946, 4898, 397, 1500, 18, ...
hdf['totals'] = {'loc': total_loc, 'cov': int(total_cov / total_loc)}
hdf['totals'] = {'loc': total_loc, 'cov': int(coverage)}
def render_summary(self, req, config, build, step, category): assert category == 'coverage'
d5ddb72ab95295f1c1d7ad2e435145f4064bfc4a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4547/d5ddb72ab95295f1c1d7ad2e435145f4064bfc4a/summarizers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 7687, 12, 2890, 16, 1111, 16, 642, 16, 1361, 16, 2235, 16, 3150, 4672, 1815, 3150, 422, 296, 16356, 11, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 7687, 12, 2890, 16, 1111, 16, 642, 16, 1361, 16, 2235, 16, 3150, 4672, 1815, 3150, 422, 296, 16356, 11, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
result.sort(lambda record: -record.last_modified)
result.sort(key=lambda record: record.last_modified, reverse=True)
def f(scan_status): q = { 'type': '/type/scan_record', 'scan_status': scan_status, 'sort': '-last_modified' } result = web.ctx.site.things(q) return [web.ctx.site.get(key) for key in result]
9770c6086cdc7587677ab5a1d44cbf2cd287f6b1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3913/9770c6086cdc7587677ab5a1d44cbf2cd287f6b1/code.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 12, 9871, 67, 2327, 4672, 1043, 273, 288, 296, 723, 4278, 1173, 723, 19, 9871, 67, 3366, 2187, 296, 9871, 67, 2327, 4278, 4135, 67, 2327, 16, 296, 3804, 4278, 2400, 2722, 67, 7342...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 12, 9871, 67, 2327, 4672, 1043, 273, 288, 296, 723, 4278, 1173, 723, 19, 9871, 67, 3366, 2187, 296, 9871, 67, 2327, 4278, 4135, 67, 2327, 16, 296, 3804, 4278, 2400, 2722, 67, 7342...
def get(self, zstr, no_abbrev=False):
def get(self, zstr, allow_abbreviations=True):
def get(self, zstr, no_abbrev=False): state = { 'curr_alpha': 0, 'prev_alpha': 0, 'zscii': [], 'allow_abbreviations': no_abbrev, }
2a8bf089bdb21c096fca11fd2b08ec990ed95b62 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3943/2a8bf089bdb21c096fca11fd2b08ec990ed95b62/zstring.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 2890, 16, 998, 701, 16, 1699, 67, 378, 7379, 1012, 33, 5510, 4672, 919, 273, 288, 296, 17016, 67, 5429, 4278, 374, 16, 296, 10001, 67, 5429, 4278, 374, 16, 296, 94, 1017, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 2890, 16, 998, 701, 16, 1699, 67, 378, 7379, 1012, 33, 5510, 4672, 919, 273, 288, 296, 17016, 67, 5429, 4278, 374, 16, 296, 10001, 67, 5429, 4278, 374, 16, 296, 94, 1017, 28...
if typ is list or typ is tuple: if typ is list:
if issubclass(typ, list) or issubclass(typ, tuple): if issubclass(typ, list):
def _safe_repr(object, context, maxlevels, level): typ = _type(object) if typ is str: if 'locale' not in _sys.modules: return `object`, True, False if "'" in object and '"' not in object: closure = '"' quotes = {'"': '\\"'} else: closure = "'" quotes = {"'": "\\'"} qget = quotes.get sio = _StringIO() write = sio.write for char in object: if char.isalpha(): write(char) else: write(qget(char, `char`[1:-1])) return ("%s%s%s" % (closure, sio.getvalue(), closure)), True, False if typ is dict: if not object: return "{}", True, False objid = _id(object) if maxlevels and level > maxlevels: return "{...}", False, objid in context if objid in context: return _recursion(object), False, True context[objid] = 1 readable = True recursive = False components = [] append = components.append level += 1 saferepr = _safe_repr for k, v in object.iteritems(): krepr, kreadable, krecur = saferepr(k, context, maxlevels, level) vrepr, vreadable, vrecur = saferepr(v, context, maxlevels, level) append("%s: %s" % (krepr, vrepr)) readable = readable and kreadable and vreadable if krecur or vrecur: recursive = True del context[objid] return "{%s}" % _commajoin(components), readable, recursive if typ is list or typ is tuple: if typ is list: if not object: return "[]", True, False format = "[%s]" elif _len(object) == 1: format = "(%s,)" else: if not object: return "()", True, False format = "(%s)" objid = _id(object) if maxlevels and level > maxlevels: return format % "...", False, objid in context if objid in context: return _recursion(object), False, True context[objid] = 1 readable = True recursive = False components = [] append = components.append level += 1 for o in object: orepr, oreadable, orecur = _safe_repr(o, context, maxlevels, level) append(orepr) if not oreadable: readable = False if orecur: recursive = True del context[objid] return format % _commajoin(components), readable, recursive rep = `object` return rep, (rep and not rep.startswith('<')), False
a288657cc0d81b1cbf5f3a074a1507444c1db272 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a288657cc0d81b1cbf5f3a074a1507444c1db272/pprint.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4626, 67, 12715, 12, 1612, 16, 819, 16, 943, 12095, 16, 1801, 4672, 3815, 273, 389, 723, 12, 1612, 13, 309, 3815, 353, 609, 30, 309, 296, 6339, 11, 486, 316, 389, 9499, 18, 6400...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4626, 67, 12715, 12, 1612, 16, 819, 16, 943, 12095, 16, 1801, 4672, 3815, 273, 389, 723, 12, 1612, 13, 309, 3815, 353, 609, 30, 309, 296, 6339, 11, 486, 316, 389, 9499, 18, 6400...
vec = [ argv[0], argv[2], argv[3], argv[1], argv[4], argv[5] ]
vec = [ argv[0], argv[2], argv[3], argv[1], argv[4], argv[5], argv[6] ]
def main(argv): # Parse and manipulate the command line arguments. if len(argv) != 6: error(usage(argv[0])) output_format = string.lower(argv[1]) dir, latex_file = os.path.split(argv[2]) if len(dir) != 0: os.chdir(dir) dpi = string.atoi(argv[3]) fg_color = make_texcolor(argv[4], False) bg_color = make_texcolor(argv[5], False) bg_color_gr = make_texcolor(argv[5], True) # External programs used by the script. path = string.split(os.environ["PATH"], os.pathsep) latex = find_exe_or_terminate(["latex", "pplatex", "platex", "latex2e"], path) # This can go once dvipng becomes widespread. dvipng = find_exe(["dvipng"], path) if dvipng == None: # The data is input to legacy_conversion in as similar # as possible a manner to that input to the code used in # LyX 1.3.x. vec = [ argv[0], argv[2], argv[3], argv[1], argv[4], argv[5] ] return legacy_conversion(vec) pngtopnm = "" if output_format == "ppm": pngtopnm = find_exe_or_terminate(["pngtopnm"], path) # Move color information for PDF into the latex file. if not color_pdf(latex_file, bg_color_gr): error("Unable to move color info into the latex file") # Compile the latex file. latex_call = '%s "%s"' % (latex, latex_file) latex_status, latex_stdout = run_command(latex_call) if latex_status != None: warning("%s failed to compile %s" \ % (os.path.basename(latex), latex_file)) # Run the dvi file through dvipng. dvi_file = latex_file_re.sub(".dvi", latex_file) dvipng_call = '%s -Ttight -depth -height -D %d -fg "%s" -bg "%s" "%s"' \ % (dvipng, dpi, fg_color, bg_color, dvi_file) dvipng_status, dvipng_stdout = run_command(dvipng_call) if dvipng_status != None: warning("%s failed to generate images from %s ... looking for PDF" \ % (os.path.basename(dvipng), dvi_file)) return legacy_conversion_step2(latex_file, dpi, output_format) # Extract metrics info from dvipng_stdout. metrics_file = latex_file_re.sub(".metrics", latex_file) if not extract_metrics_info(dvipng_stdout, metrics_file): error("Failed to extract metrics info from dvipng") # Convert images to ppm format if necessary. if output_format == "ppm": convert_to_ppm_format(pngtopnm, latex_file_re.sub("", latex_file)) return 0
c2ef2905474678cdb276aafcc759014579054acc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7514/c2ef2905474678cdb276aafcc759014579054acc/lyxpreview2bitmap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 4672, 468, 2884, 471, 28286, 326, 1296, 980, 1775, 18, 309, 562, 12, 19485, 13, 480, 1666, 30, 555, 12, 9167, 12, 19485, 63, 20, 22643, 225, 876, 67, 2139, 273, 533, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 4672, 468, 2884, 471, 28286, 326, 1296, 980, 1775, 18, 309, 562, 12, 19485, 13, 480, 1666, 30, 555, 12, 9167, 12, 19485, 63, 20, 22643, 225, 876, 67, 2139, 273, 533, ...
cacheListTest = 0
cacheListTest = 0
def filesMatchingGPSinCache(self, cacheString, time=None, cacheType=None, ifo_tag=None, ifo_in_coinc=None): cacheSubSet = self.ifoDict() try: cacheList = Cache.fromfile(open(cacheString)) cacheListTest = 0 except: print >> sys.stderr, "could not open the file " + cacheString cacheListTest = 1 if not cacheListTest: for ifo in self.ifoTypes: try: if time: if time[ifo]: time_ifo = time[ifo] else: #if ifo found in the analysed times, but not in coinc... if ifo_tag and len(ifo)==2 and re.search(ifo,ifo_tag): time_ifo = time[ifo_in_coinc[0]] else: continue seg1 = segments.segment(time_ifo,time_ifo+1) seg2 = segments.segment(time_ifo-1,time_ifo) else: seg1 = None seg2 = None list = cacheList.sieve(ifo,cacheType,seg1) list = list.sieve(None,None,seg2) cacheSubSet[ifo] = list except: continue return(cacheSubSet)
83b03267f2a1ecc7fe4cacf4bd67596f4157dab5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/83b03267f2a1ecc7fe4cacf4bd67596f4157dab5/fu_utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1390, 9517, 28983, 267, 1649, 12, 2890, 16, 1247, 780, 16, 813, 33, 7036, 16, 1247, 559, 33, 7036, 16, 21479, 67, 2692, 33, 7036, 16, 21479, 67, 267, 67, 12645, 71, 33, 7036, 4672, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1390, 9517, 28983, 267, 1649, 12, 2890, 16, 1247, 780, 16, 813, 33, 7036, 16, 1247, 559, 33, 7036, 16, 21479, 67, 2692, 33, 7036, 16, 21479, 67, 267, 67, 12645, 71, 33, 7036, 4672, 1...
def msvc_prelink_hack (self, sources, ext, extra_args): def_file = ext.export_symbol_file if def_file is not None: extra_args.append ('/DEF:' + def_file) else: modname = string.split (ext.name, '.')[-1] extra_args.append('/export:init%s' % modname) implib_file = os.path.join ( self.implib_dir, self.get_ext_libname (ext.name)) extra_args.append ('/IMPLIB:' + implib_file) self.mkpath (os.path.dirname (implib_file))
def find_swig (self): """Return the name of the SWIG executable. On Unix, this is just "swig" -- it should be in the PATH. Tries a bit harder on Windows. """
4af195eaba7e2658f3d6590c72fdaa3d40432e7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4af195eaba7e2658f3d6590c72fdaa3d40432e7f/build_ext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 5328, 360, 261, 2890, 4672, 3536, 990, 326, 508, 434, 326, 16392, 3047, 9070, 18, 225, 2755, 9480, 16, 333, 353, 2537, 315, 5328, 360, 6, 1493, 518, 1410, 506, 316, 326, 7767...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1104, 67, 5328, 360, 261, 2890, 4672, 3536, 990, 326, 508, 434, 326, 16392, 3047, 9070, 18, 225, 2755, 9480, 16, 333, 353, 2537, 315, 5328, 360, 6, 1493, 518, 1410, 506, 316, 326, 7767...
self.send_response(301)
self.send_response(303)
def redirect(self, path): self.send_response(301) self.send_header('Location', path) self.end_headers()
cf287f8fd774858d60b6fd9d5ed3e7548c242f50 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3042/cf287f8fd774858d60b6fd9d5ed3e7548c242f50/PremiumHTTPServer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3136, 12, 2890, 16, 589, 4672, 365, 18, 4661, 67, 2740, 12, 23, 4630, 13, 365, 18, 4661, 67, 3374, 2668, 2735, 2187, 589, 13, 365, 18, 409, 67, 2485, 1435, 225, 2, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3136, 12, 2890, 16, 589, 4672, 365, 18, 4661, 67, 2740, 12, 23, 4630, 13, 365, 18, 4661, 67, 3374, 2668, 2735, 2187, 589, 13, 365, 18, 409, 67, 2485, 1435, 225, 2, -100, -100, -100, ...
handle = NCBI.efetch( self.database, rettype=self.format, id=id)
handle = NCBI.efetch(self.database, **params)
def __getitem__(self, id): """S.__getitem__(id) -> object
dbbf028f659ddd27c253f2038a4cec1ee7ee6c9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/dbbf028f659ddd27c253f2038a4cec1ee7ee6c9d/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 31571, 972, 12, 2890, 16, 612, 4672, 3536, 55, 16186, 31571, 972, 12, 350, 13, 317, 733, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1001, 31571, 972, 12, 2890, 16, 612, 4672, 3536, 55, 16186, 31571, 972, 12, 350, 13, 317, 733, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
zopen1 = zipf.open('ones') data1 = zopen1.read(500) zopen2 = zipf.open('twos') data2 = zopen2.read(500) data1 += zopen1.read(500) data2 += zopen2.read(500)
with zipf.open('ones') as zopen1, zipf.open('twos') as zopen2: data1 = zopen1.read(500) data2 = zopen2.read(500) data1 += zopen1.read(500) data2 += zopen2.read(500)
def test_interleaved(self): # Verify that (when the ZipFile is in control of creating file objects) # multiple open() calls can be made without interfering with each other. with zipfile.ZipFile(TESTFN2, mode="r") as zipf: zopen1 = zipf.open('ones') data1 = zopen1.read(500) zopen2 = zipf.open('twos') data2 = zopen2.read(500) data1 += zopen1.read(500) data2 += zopen2.read(500) self.assertEqual(data1, b'1'*FIXEDTEST_SIZE) self.assertEqual(data2, b'2'*FIXEDTEST_SIZE)
b851957a42b68791e7491840103c69844875e2e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/b851957a42b68791e7491840103c69844875e2e0/test_zipfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2761, 22593, 12, 2890, 4672, 468, 8553, 716, 261, 13723, 326, 18364, 353, 316, 3325, 434, 4979, 585, 2184, 13, 468, 3229, 1696, 1435, 4097, 848, 506, 7165, 2887, 1554, 586, 310...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2761, 22593, 12, 2890, 4672, 468, 8553, 716, 261, 13723, 326, 18364, 353, 316, 3325, 434, 4979, 585, 2184, 13, 468, 3229, 1696, 1435, 4097, 848, 506, 7165, 2887, 1554, 586, 310...
origsender = mail.GetSender()
origsender = mail.get_sender()
def ProcessOptionsCmd(self, args, cmd, mail):
fd50f6ba3c52ce475f91f07aef2835cffeada335 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/fd50f6ba3c52ce475f91f07aef2835cffeada335/MailCommandHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4389, 1320, 5931, 12, 2890, 16, 833, 16, 1797, 16, 4791, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 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, 4389, 1320, 5931, 12, 2890, 16, 833, 16, 1797, 16, 4791, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
+"time-independent background")
+"wavelength-dependent background")
def run(config, tim=None): """ This method is where the data reduction process gets done. @param config: Object containing the data reduction configuration information. @type config: L{hlr_utils.Configure} @param tim: (OPTIONAL) Object that will allow the method to perform timing evaluations. @type tim: C{sns_time.DiffTime} """ # Steps 1-3 ratio_min_parts = __calculate_ratio(config, config.ctib_min) ratio_min = __make_ratio(ratio_min_parts) if tim is not None: tim.getTime(msg="After minimum ratio calculation ") # Step 4 ratio_max_parts = __calculate_ratio(config, config.ctib_max) ratio_max = __make_ratio(ratio_max_parts) if tim is not None: tim.getTime(msg="After maximum ratio calculation ") # Step 5 if __check_parts(ratio_min_parts) and __check_parts(ratio_max_parts): if (config.ratio[0] < ratio_min or config.ratio[0] > ratio_max): raise RuntimeError("Ratios from minimum and maximum ctibs do not "\ +"bracket ratio. Increase the maximum ctib " +"parameter. Min: %f, Max: %f, Given Ratio: %f"\ % (ratio_min, ratio_max, config.ratio[0])) elif __check_parts(ratio_min_parts) and not __check_parts(ratio_max_parts): if ratio_min > config.ratio[0]: raise RuntimeError("Ratio from minimum ctib is greater than "\ +"requested ratio. Decrease the minimum ctib "\ +"parameter. Min: %f, Given Ratio: %f" \ %(ratio_min, config.ratio[0])) elif not __check_parts(ratio_min_parts) and \ not __check_parts(ratio_max_parts): raise RuntimeError("The components of both ratios are negative. "\ +"Decrease the value of the minimum ctib "\ +"parameter.") else: pass # Step 6 tib_try = 0.0 ratio_try = 0.0 tib_range = [config.ctib_min, config.ctib_max] run_ok = False counter = 0 while counter < config.niter: tib_try = __bisect_range(tib_range) if config.verbose: print "TIB Try: ", tib_try ratio_try_parts = __calculate_ratio(config, tib_try) ratio_try = __make_ratio(ratio_try_parts) # First, check to see if ratio is within tolerance if __check_range(ratio_try, config.ratio[0]-config.ratio[1], config.ratio[0]+config.ratio[1]): if config.verbose: print "Final TIB: %f" % tib_try run_ok = True break # If not, check if the ratio parts if not __check_parts(ratio_try_parts): # It's not +/+, move range down tib_range[1] = tib_try else: # It's +/+, so look at ratio if ratio_try > config.ratio[0]: # Move range down tib_range[1] = tib_try else: # Move range up tib_range[0] = tib_try counter += 1 if not run_ok: # If you hit here, you've exhausted the number of iterations print "Maximum number of iterations exceeded! No suitable TIB found!" print "Best Value: %f, Ratio: %f" % (tib_try, ratio_try)
36badd65c251eeb079d3bfab833aabc1dc8ebc9b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/763/36badd65c251eeb079d3bfab833aabc1dc8ebc9b/find_ldb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 1425, 16, 1658, 33, 7036, 4672, 3536, 1220, 707, 353, 1625, 326, 501, 20176, 1207, 5571, 2731, 18, 225, 632, 891, 642, 30, 1033, 4191, 326, 501, 20176, 1664, 1779, 18, 632, 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, 1086, 12, 1425, 16, 1658, 33, 7036, 4672, 3536, 1220, 707, 353, 1625, 326, 501, 20176, 1207, 5571, 2731, 18, 225, 632, 891, 642, 30, 1033, 4191, 326, 501, 20176, 1664, 1779, 18, 632, 7...
str.__init__(self, dname)
str.__init__(self)
def __init__(self, dname): str.__init__(self, dname) pairs = [x.replace('\,', ',') for x in re.split(r'(?<!\\),\s*', dname)] for pair in pairs: try: name, value = pair.split(':', 1) except ValueError: raise ValueError("Invalid certificate access list: %s" % dname) if name not in self.ids: raise ValueError("Invalid authorization attribute: %s", name) str.__setattr__(self, name, value) for name in crypto.X509Name.ids: if not hasattr(self, name): str.__setattr__(self, name, None)
c4e3b7fdb4de16ec7e67fd992035c5c68702052f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3445/c4e3b7fdb4de16ec7e67fd992035c5c68702052f/tls.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 302, 529, 4672, 609, 16186, 2738, 972, 12, 2890, 13, 5574, 273, 306, 92, 18, 2079, 2668, 64, 16, 2187, 3316, 13, 364, 619, 316, 283, 18, 4939, 12, 86, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 302, 529, 4672, 609, 16186, 2738, 972, 12, 2890, 13, 5574, 273, 306, 92, 18, 2079, 2668, 64, 16, 2187, 3316, 13, 364, 619, 316, 283, 18, 4939, 12, 86, ...
if (INSTALLER != 0 and TARGET in ["all", "installer"]):
if (INSTALLER != 0 or (TARGET in ["all", "installer"])):
def MakeInstallerOSX(): import compileall PYTHONV=SDK["PYTHONVERSION"].replace("python", "").strip() if (os.path.isfile("Panda3D-tpl-rw.dmg")): oscmd("rm -f Panda3D-tpl-rw.dmg") if (os.path.isdir("Panda3D-tpl-rw")): oscmd("hdiutil detach Panda3D-tpl-rw -quiet -force", True) oscmd("rm -rf Panda3D-tpl-rw") if (os.path.isfile("Panda3D-%s.dmg" % VERSION)): oscmd("rm -f Panda3D-%s.dmg" % VERSION) oscmd("hdiutil convert -format UDRW -o Panda3D-tpl-rw.dmg makepanda/Panda3D-tpl.dmg", True) if (not os.path.exists("Panda3D-tpl-rw.dmg")): exit() oscmd("mkdir Panda3D-tpl-rw") oscmd("hdiutil attach Panda3D-tpl-rw.dmg -noautoopen -quiet -mountpoint Panda3D-tpl-rw", True) if (not os.path.exists("Panda3D-tpl-rw")): exit() try: oscmd("mkdir -p Panda3D-tpl-rw/Panda3D/%s/etc" % VERSION) oscmd("mkdir -p Panda3D-tpl-rw/Panda3D/%s/bin" % VERSION) oscmd("mkdir -p Panda3D-tpl-rw/Panda3D/%s/lib" % VERSION) oscmd("mkdir -p Panda3D-tpl-rw/Panda3D/%s/lib/direct" % VERSION) oscmd("ln -s /usr/bin/python Panda3D-tpl-rw/Panda3D/%s/bin/ppython" % VERSION) oscmd("sed -e 's@\\$1@%s@' < direct/src/directscripts/profilepaths-osx.command >> Panda3D-tpl-rw/panda3dpaths.command" % VERSION) oscmd("sed -e 's@model-cache-@# model-cache-@' -e 's@$THIS_PRC_DIR/[.][.]@/Applications/Panda3D/%s@' < %s/etc/Config.prc > Panda3D-tpl-rw/Panda3D/%s/etc/Config.prc" % (VERSION, GetOutputDir(), VERSION)) # Append the plugin-path to the Config.prc. f = open("Panda3D-tpl-rw/Panda3D/%s/etc/Config.prc" % VERSION, "a") f.write("\nplugin-path /Applications/Panda3D/%s/lib\n" % VERSION) f.close() WriteFile("Panda3D-tpl-rw/Panda3D/%s/lib/direct/__init__.py" % VERSION, "") oscmd("cp %s/etc/Confauto.prc Panda3D-tpl-rw/Panda3D/%s/etc/Confauto.prc" % (GetOutputDir(), VERSION)) oscmd("cp -R %s/include Panda3D-tpl-rw/Panda3D/%s/include" % (GetOutputDir(), VERSION)) oscmd("cp -R direct/src/* Panda3D-tpl-rw/Panda3D/%s/lib/direct" % VERSION) oscmd("cp -R %s/pandac Panda3D-tpl-rw/Panda3D/%s/lib/pandac" % (GetOutputDir(), VERSION)) oscmd("cp -R %s/models Panda3D-tpl-rw/Panda3D/%s/models" % (GetOutputDir(), VERSION)) oscmd("cp -R doc/LICENSE Panda3D-tpl-rw/Panda3D/%s/LICENSE" % VERSION) oscmd("cp -R doc/ReleaseNotes Panda3D-tpl-rw/Panda3D/%s/ReleaseNotes" % VERSION) oscmd("cp -R %s/bin/* Panda3D-tpl-rw/Panda3D/%s/bin/" % (GetOutputDir(), VERSION)) if os.path.isdir("samples"): oscmd("cp -R samples Panda3D-tpl-rw/Panda3D/%s/samples" % VERSION) if os.path.isdir(GetOutputDir()+"/Pmw"): oscmd("cp -R %s/Pmw Panda3D-tpl-rw/Panda3D/%s/lib/Pmw" % (GetOutputDir(), VERSION)) if os.path.isdir(GetOutputDir()+"/plugins"): oscmd("cp -R %s/plugins Panda3D-tpl-rw/Panda3D/%s/plugins" % (GetOutputDir(), VERSION)) for base in os.listdir(GetOutputDir()+"/lib"): oscmd("cp "+GetOutputDir()+"/lib/"+base+" Panda3D-tpl-rw/Panda3D/"+VERSION+"/lib/"+base) # Loop through the binaries and libraries and execute install_name_tool on them bindir = "Panda3D-tpl-rw/Panda3D/%s/bin/" % VERSION libdir = "Panda3D-tpl-rw/Panda3D/%s/lib/" % VERSION for fn in os.listdir(bindir): if os.path.isfile(bindir + fn): oscmd("otool -L %s%s | grep %s/lib/ > %s/tmp/otool-libs.txt" % (bindir, fn, GetOutputDir(), GetOutputDir()), True) for line in open(GetOutputDir()+"/tmp/otool-libs.txt", "r"): if len(line.strip()) > 0: libname = line.strip().split(GetOutputDir()+"/lib/")[1].split(" ")[0] oscmd("install_name_tool -change %s/lib/%s %s %s%s" % (GetOutputDir(), libname, libname, bindir, fn), True) oscmd("chmod +x %s%s" % (bindir, fn), True) for fn in os.listdir(libdir): if os.path.isfile(libdir + fn): oscmd("install_name_tool -id %s %s%s" % (fn, libdir, fn), True) oscmd("otool -L %s%s | grep %s/lib/ > %s/tmp/otool-libs.txt" % (libdir, fn, GetOutputDir(), GetOutputDir()), True) for line in open(GetOutputDir()+"/tmp/otool-libs.txt", "r"): if len(line.strip()) > 0: libname = line.strip().split(GetOutputDir()+"/lib/")[1].split(" ")[0] oscmd("install_name_tool -change %s/lib/%s %s %s%s" % (GetOutputDir(), libname, libname, libdir, fn), True) oscmd("chmod +x %s%s" % (libdir, fn), True) # Compile the python files for base in os.listdir("Panda3D-tpl-rw/Panda3D/"+VERSION+"/lib/direct"): if ((base != "extensions") and (base != "extensions_native")): compileall.compile_dir("Panda3D-tpl-rw/Panda3D/"+VERSION+"/lib/direct/"+base) compileall.compile_dir("Panda3D-tpl-rw/Panda3D/"+VERSION+"/lib/Pmw") oscmd("chmod -R 555 Panda3D-tpl-rw/Panda3D/"+VERSION+"/lib/direct") oscmd("chmod -R 555 Panda3D-tpl-rw/Panda3D/"+VERSION+"/lib/pandac") oscmd("chmod -R 555 Panda3D-tpl-rw/Panda3D/"+VERSION+"/models") if os.path.isdir("samples"): oscmd("chmod -R 555 Panda3D-tpl-rw/Panda3D/"+VERSION+"/samples") if os.path.isdir(GetOutputDir()+"/Pmw"): oscmd("chmod -R 555 Panda3D-tpl-rw/Panda3D/"+VERSION+"/lib/Pmw") except: # Make sure the dmg gets unmounted even when error occurs oscmd("hdiutil detach Panda3D-tpl-rw -quiet -force", True) oscmd("rm -f Panda3D-tpl-rw.dmg") raise oscmd("hdiutil detach Panda3D-tpl-rw -quiet -force", True) oscmd("hdiutil convert -format UDBZ -o Panda3D-"+VERSION+".dmg Panda3D-tpl-rw.dmg", True) if (not os.path.exists("Panda3D-%s.dmg" % VERSION)): exit() oscmd("rm -f Panda3D-tpl-rw.dmg") oscmd("rm -rf Panda3D-tpl-rw")
3d5b46ad500e2dbc723fa06bcfdce3d29083b6c0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7242/3d5b46ad500e2dbc723fa06bcfdce3d29083b6c0/makepanda.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4344, 18678, 4618, 60, 13332, 1930, 4074, 454, 12191, 20131, 58, 33, 22625, 9614, 16235, 20131, 5757, 6, 8009, 2079, 2932, 8103, 3113, 1408, 2934, 6406, 1435, 309, 261, 538, 18, 803, 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, 4344, 18678, 4618, 60, 13332, 1930, 4074, 454, 12191, 20131, 58, 33, 22625, 9614, 16235, 20131, 5757, 6, 8009, 2079, 2932, 8103, 3113, 1408, 2934, 6406, 1435, 309, 261, 538, 18, 803, 18, ...
self.assertEqual(os.path.realpath(os.path.join(base, 'site1')),
self.assertEqual(os.path.join(base, 'site1'),
def test_inherit_multiple(self): base = os.path.dirname(self.filename) relsite1 = os.path.join('sub1', 'trac-site1.ini') site1 = os.path.join(base, relsite1) relsite2 = os.path.join('sub2', 'trac-site2.ini') site2 = os.path.join(base, relsite2) os.mkdir(os.path.dirname(site1)) create_file(site1, '[a]\noption1 = x\n' '[c]\noption = 1\npath1 = site1\n') try: os.mkdir(os.path.dirname(site2)) create_file(site2, '[b]\noption2 = y\n' '[c]\noption = 2\npath2 = site2\n') try: self._write(['[inherit]', 'file = %s, %s' % (relsite1, relsite2)]) config = self._read() self.assertEqual('x', config.get('a', 'option1')) self.assertEqual('y', config.get('b', 'option2')) self.assertEqual('1', config.get('c', 'option')) self.assertEqual(os.path.realpath(os.path.join(base, 'site1')), config.getpath('c', 'path1')) self.assertEqual(os.path.realpath(os.path.join(base, 'site2')), config.getpath('c', 'path2')) self.assertEqual('', config.getpath('c', 'path3')) self.assertEqual(os.path.realpath(os.path.join(base, 'site4')), config.getpath('c', 'path4', 'site4')) finally: os.remove(site2) os.rmdir(os.path.dirname(site2)) finally: os.remove(site1) os.rmdir(os.path.dirname(site1))
6c101510b9f590ed577fd60e4f78a52e24b77bd8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9317/6c101510b9f590ed577fd60e4f78a52e24b77bd8/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 6018, 67, 9622, 12, 2890, 4672, 1026, 273, 1140, 18, 803, 18, 12287, 12, 2890, 18, 3459, 13, 1279, 4256, 21, 273, 1140, 18, 803, 18, 5701, 2668, 1717, 21, 2187, 296, 313, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6018, 67, 9622, 12, 2890, 4672, 1026, 273, 1140, 18, 803, 18, 12287, 12, 2890, 18, 3459, 13, 1279, 4256, 21, 273, 1140, 18, 803, 18, 5701, 2668, 1717, 21, 2187, 296, 313, 1...
.select(lambda item: (proj1(item), proj2(item))) \ .todict() elif proj1:
.select(lambda item: (key_selector(item), element_selector(item))) \ .to_dict() elif key_selector:
def todict(self, proj1=None, proj2=None): if proj1 and proj2: return self \ .select(lambda item: (proj1(item), proj2(item))) \ .todict() elif proj1: return self \ .select(lambda item: (item, proj1(item))) \ .todict() else: return dict(self)
f134b825431ac82f3dbba76e7a945a0e195d27cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14315/f134b825431ac82f3dbba76e7a945a0e195d27cf/pyquery.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 1576, 12, 2890, 16, 10296, 21, 33, 7036, 16, 10296, 22, 33, 7036, 4672, 309, 10296, 21, 471, 10296, 22, 30, 327, 365, 521, 263, 4025, 12, 14661, 761, 30, 261, 856, 67, 9663, 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, 358, 1576, 12, 2890, 16, 10296, 21, 33, 7036, 16, 10296, 22, 33, 7036, 4672, 309, 10296, 21, 471, 10296, 22, 30, 327, 365, 521, 263, 4025, 12, 14661, 761, 30, 261, 856, 67, 9663, 12,...
log.debug('Bad identifier %r' % (piece,))
def __init__(self, *pieces): """ Construct a new dotted name from the given sequence of pieces, each of which can be either a C{string} or a C{DottedName}. Each piece is divided into a sequence of identifiers, and these sequences are combined together (in order) to form the identifier sequence for the new C{DottedName}. If a piece contains a string, then it is divided into substrings by splitting on periods, and each substring is checked to see if it is a valid identifier. """ if len(pieces) == 0: raise DottedName.InvalidDottedName('Empty DottedName') self._identifiers = [] for piece in pieces: if isinstance(piece, DottedName): self._identifiers += piece._identifiers elif isinstance(piece, basestring): for subpiece in piece.split('.'): if not self._IDENTIFIER_RE.match(subpiece): log.debug('Bad identifier %r' % (piece,)) raise DottedName.InvalidDottedName( 'Bad identifier %r' % (piece,)) self._identifiers.append(subpiece) else: log.debug('Bad identifier %r' % (piece,)) raise DottedName.InvalidDottedName( 'Bad identifier %r' % (piece,)) self._identifiers = tuple(self._identifiers)
10e1638a0b292114df3293f65295feff33443395 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/10e1638a0b292114df3293f65295feff33443395/apidoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 31016, 4672, 3536, 14291, 279, 394, 20965, 508, 628, 326, 864, 3102, 434, 10167, 16, 1517, 434, 1492, 848, 506, 3344, 279, 385, 95, 1080, 97, 578, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 31016, 4672, 3536, 14291, 279, 394, 20965, 508, 628, 326, 864, 3102, 434, 10167, 16, 1517, 434, 1492, 848, 506, 3344, 279, 385, 95, 1080, 97, 578, 2...
path = os.path.join(os.getcwd(), "addons/dm/dm_dtp_plugins", cr.dbname)
path = os.path.join(os.getcwd(), "addons/dm/dm_dtp_plugins",cr.dbname)
def _generate_value(cr, uid, plugin_obj, localcontext, **args): # {{{ pool = pooler.get_pool(cr.dbname) localcontext['plugin_obj'] = plugin_obj plugin_args = {} plugin_value = '' if plugin_obj.type in ('fields','image'): res = pool.get('ir.model').browse(cr, uid, plugin_obj.model_id.id) args['model_name'] = res.model args['field_name'] = str(plugin_obj.field_id.name) args['field_type'] = str(plugin_obj.field_id.ttype) args['field_relation'] = str(plugin_obj.field_id.relation) plugin_value = customer_function(cr, uid, **args) or '!!!Missing-Plugin-Value!!!' if not plugin_value : return False else: arg_ids = pool.get('dm.plugin.argument').search(cr, uid, [('plugin_id', '=', plugin_obj.id)]) for arg in pool.get('dm.plugin.argument').browse(cr, uid, arg_ids): if not arg.stored_plugin: plugin_args[str(arg.name)] = arg.value else: plugin_args[str(arg.name)] = _generate_value(cr, uid, arg.custome_plugin_id, localcontext, **args) if plugin_obj.type == 'dynamic' and plugin_obj.python_code: localcontext.update(plugin_args) localcontext['pool'] = pool exec plugin_obj.python_code.replace('\r','') in localcontext plugin_value = plugin_obj.code in localcontext and \ localcontext[plugin_obj.code] or '' elif plugin_obj.type == 'dynamic_text': plugin_args['ref_text_id'] = plugin_obj.ref_text_id.id args.update(plugin_args) plugin_value = dynamic_text(cr, uid, **args) elif plugin_obj.type == 'url': plugin_args['encode'] = plugin_obj.encode plugin_value = php_url(cr, uid, **plugin_args) else: path = os.path.join(os.getcwd(), "addons/dm/dm_dtp_plugins", cr.dbname) plugin_name = plugin_obj.file_fname.split('.')[0] sys.path.append(path) X = __import__(plugin_name) plugin_func = getattr(X, plugin_name) plugin_value = plugin_func(cr, uid, **args) return plugin_value or '!!!Missing-Plugin-Value!!!' # }}} return plugin_value # }}}
9cd798416ade9ed448f60ce566837a8301a96740 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/9cd798416ade9ed448f60ce566837a8301a96740/dm_report_design.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 7163, 67, 1132, 12, 3353, 16, 4555, 16, 1909, 67, 2603, 16, 1191, 2472, 16, 2826, 1968, 4672, 468, 10179, 95, 2845, 273, 2845, 264, 18, 588, 67, 6011, 12, 3353, 18, 20979, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 7163, 67, 1132, 12, 3353, 16, 4555, 16, 1909, 67, 2603, 16, 1191, 2472, 16, 2826, 1968, 4672, 468, 10179, 95, 2845, 273, 2845, 264, 18, 588, 67, 6011, 12, 3353, 18, 20979, 13, 1...
sorted(list(set(flags)-set(provided.flags.keys()))))
sorted(list(requiredSet-providedSet)))
def _createELFDepSet(self, m, elfinfo, recipe=None, basedir=None, soname=None, soflags=None, libPathMap={}, getRPATH=None): """ Add dependencies from ELF information.
b6c1a20f1677f8663f27f992d0737eaf6f78af0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/b6c1a20f1677f8663f27f992d0737eaf6f78af0f/packagepolicy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2640, 2247, 42, 16316, 694, 12, 2890, 16, 312, 16, 415, 926, 617, 16, 16100, 33, 7036, 16, 15573, 33, 7036, 16, 18882, 339, 33, 7036, 16, 272, 792, 80, 1341, 33, 7036, 16, 2561,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2640, 2247, 42, 16316, 694, 12, 2890, 16, 312, 16, 415, 926, 617, 16, 16100, 33, 7036, 16, 15573, 33, 7036, 16, 18882, 339, 33, 7036, 16, 272, 792, 80, 1341, 33, 7036, 16, 2561,...
if field._type=='one2many':
if field._properties: arg = [args.pop(i)] j = i while j<len(args): if args[j][0]==arg[0][0]: arg.append(args.pop(j)) else: j+=1 if field._fnct_search: args.extend(field.search(cr, user, self, arg[0][0], arg)) elif field._type=='one2many':
def _where_calc(self, cr, user, args, context={}): # if the object has a field named 'active', filter out all inactive # records unless they were explicitely asked for if 'active' in self._columns: i = 0 active_found = False while i<len(args): if args[i][0]=='active': if not args[i][2]: active_found = True i += 1 if not active_found: args.append(('active', '=', 1))
dec3355ef91c3adec93f6461292b301bb49cb677 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12853/dec3355ef91c3adec93f6461292b301bb49cb677/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6051, 67, 12448, 12, 2890, 16, 4422, 16, 729, 16, 833, 16, 819, 12938, 4672, 468, 309, 326, 733, 711, 279, 652, 4141, 296, 3535, 2187, 1034, 596, 777, 16838, 468, 3853, 3308, 2898...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6051, 67, 12448, 12, 2890, 16, 4422, 16, 729, 16, 833, 16, 819, 12938, 4672, 468, 309, 326, 733, 711, 279, 652, 4141, 296, 3535, 2187, 1034, 596, 777, 16838, 468, 3853, 3308, 2898...
phi0 = apply(f,(xk,)+args)
phi0 = old_fval
def line_search_BFGS(f, xk, pk, gfk, args=(), c1=1e-4, alpha0=1): """Minimize over alpha, the function f(xk+alpha pk) Uses the interpolation algorithm (Armiijo backtracking) as suggested by Wright and Nocedal in 'Numerical Optimization', 1999, pg. 56-57 Outputs: (alpha, fc, gc) """ fc = 0 phi0 = apply(f,(xk,)+args) # compute f(xk) phi_a0 = apply(f,(xk+alpha0*pk,)+args) # compute f fc = fc + 2 derphi0 = Num.dot(gfk,pk) if (phi_a0 <= phi0 + c1*alpha0*derphi0): return alpha0, fc, 0 # Otherwise compute the minimizer of a quadratic interpolant: alpha1 = -(derphi0) * alpha0**2 / 2.0 / (phi_a0 - phi0 - derphi0 * alpha0) phi_a1 = apply(f,(xk+alpha1*pk,)+args) fc = fc + 1 if (phi_a1 <= phi0 + c1*alpha1*derphi0): return alpha1, fc, 0 # Otherwise loop with cubic interpolation until we find an alpha which # satifies the first Wolfe condition (since we are backtracking, we will # assume that the value of alpha is not too small and satisfies the second # condition. while 1: # we are assuming pk is a descent direction factor = alpha0**2 * alpha1**2 * (alpha1-alpha0) a = alpha0**2 * (phi_a1 - phi0 - derphi0*alpha1) - \ alpha1**2 * (phi_a0 - phi0 - derphi0*alpha0) a = a / factor b = -alpha0**3 * (phi_a1 - phi0 - derphi0*alpha1) + \ alpha1**3 * (phi_a0 - phi0 - derphi0*alpha0) b = b / factor alpha2 = (-b + Num.sqrt(abs(b**2 - 3 * a * derphi0))) / (3.0*a) phi_a2 = apply(f,(xk+alpha2*pk,)+args) fc = fc + 1 if (phi_a2 <= phi0 + c1*alpha2*derphi0): return alpha2, fc, 0 if (alpha1 - alpha2) > alpha1 / 2.0 or (1 - alpha2/alpha1) < 0.96: alpha2 = alpha1 / 2.0 alpha0 = alpha1 alpha1 = alpha2 phi_a0 = phi_a1 phi_a1 = phi_a2
d00f433519cbe9ce0d4306fb9512ac79d655e1fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/d00f433519cbe9ce0d4306fb9512ac79d655e1fc/optimize.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 980, 67, 3072, 67, 15259, 16113, 12, 74, 16, 619, 79, 16, 2365, 16, 13828, 79, 16, 833, 33, 9334, 276, 21, 33, 21, 73, 17, 24, 16, 4190, 20, 33, 21, 4672, 3536, 2930, 10153, 1879, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 980, 67, 3072, 67, 15259, 16113, 12, 74, 16, 619, 79, 16, 2365, 16, 13828, 79, 16, 833, 33, 9334, 276, 21, 33, 21, 73, 17, 24, 16, 4190, 20, 33, 21, 4672, 3536, 2930, 10153, 1879, ...
Biopython will have each sequence on a single line, and each quality string on a single line (which is considered desirable for maximum compatibility).
Biopython will have each sequence on a single line, and each quality string on a single line (which is considered desirable for maximum compatibility).
def QualPhredIterator(handle, alphabet = single_letter_alphabet, title2ids = None) : """For QUAL files which include PHRED quality scores, but no sequence. For example, consider this short QUAL file: >EAS54_6_R1_2_1_413_324 26 26 18 26 26 26 26 26 26 26 26 26 26 26 26 22 26 26 26 26 26 26 26 23 23 >EAS54_6_R1_2_1_540_792 26 26 26 26 26 26 26 26 26 26 26 22 26 26 26 26 26 12 26 26 26 18 26 23 18 >EAS54_6_R1_2_1_443_348 26 26 26 26 26 26 26 26 26 26 26 24 26 22 26 26 13 22 26 18 24 18 18 18 18 Using this module directly you might run: >>> handle = open("Quality/example.qual", "rU") >>> for record in QualPhredIterator(handle) : ... print record.id, record.seq EAS54_6_R1_2_1_413_324 ????????????????????????? EAS54_6_R1_2_1_540_792 ????????????????????????? EAS54_6_R1_2_1_443_348 ????????????????????????? >>> handle.close() Typically however, you would call this via Bio.SeqIO instead with "qual" as the format: >>> from Bio import SeqIO >>> handle = open("Quality/example.qual", "rU") >>> for record in SeqIO.parse(handle, "qual") : ... print record.id, record.seq EAS54_6_R1_2_1_413_324 ????????????????????????? EAS54_6_R1_2_1_540_792 ????????????????????????? EAS54_6_R1_2_1_443_348 ????????????????????????? >>> handle.close() Becase QUAL files don't contain the sequence string itself, the seq property is set to an UnknownSeq object. As no alphabet was given, this has defaulted to a generic single letter alphabet and the character "?" used. By specifying a nucleotide alphabet, "N" is used instead: >>> from Bio import SeqIO >>> from Bio.Alphabet import generic_dna >>> handle = open("Quality/example.qual", "rU") >>> for record in SeqIO.parse(handle, "qual", alphabet=generic_dna) : ... print record.id, record.seq EAS54_6_R1_2_1_413_324 NNNNNNNNNNNNNNNNNNNNNNNNN EAS54_6_R1_2_1_540_792 NNNNNNNNNNNNNNNNNNNNNNNNN EAS54_6_R1_2_1_443_348 NNNNNNNNNNNNNNNNNNNNNNNNN >>> handle.close() However, the quality scores themselves are available as a list of integers in each record's per-letter-annotation: >>> print record.letter_annotations["phred_quality"] [26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 24, 26, 22, 26, 26, 13, 22, 26, 18, 24, 18, 18, 18, 18] The internal details are a little complicated, but you can still slice one of these SeqRecord objects: >>> sub_record = record[5:10] >>> print sub_record.id, sub_record.letter_annotations["phred_quality"] EAS54_6_R1_2_1_443_348 [26, 26, 26, 26, 26] """ #Skip any text before the first record (e.g. blank lines, comments) while True : line = handle.readline() if line == "" : return #Premature end of file, or just empty? if line[0] == ">" : break while True : if line[0]!=">" : raise ValueError("Records in Fasta files should start with '>' character") if title2ids : id, name, descr = title2ids(line[1:].rstrip()) else : descr = line[1:].rstrip() id = descr.split()[0] name = id qualities = [] line = handle.readline() while True: if not line : break if line[0] == ">": break qualities.extend([int(word) for word in line.split()]) line = handle.readline() if qualities : if min(qualities) < 0 or max(qualities) > 90 : raise ValueError(("Quality score range for %s is %i to %i, outside the " \ +"expected 0 to 90. Perhaps these are Solexa/Illumina " \ +"scores, and not PHRED scores?") \ % (id, min(qualities), max(qualities))) #Return the record and then continue... record = SeqRecord(UnknownSeq(len(qualities), alphabet), id = id, name = name, description = descr) record.letter_annotations["phred_quality"] = qualities yield record if not line : return #StopIteration assert False, "Should not reach this line"
e56d79f2d97ef19f21b535c042077c194de886f9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7167/e56d79f2d97ef19f21b535c042077c194de886f9/QualityIO.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15029, 3731, 1118, 3198, 12, 4110, 16, 10877, 273, 2202, 67, 13449, 67, 287, 8907, 16, 2077, 22, 2232, 273, 599, 13, 294, 3536, 1290, 10110, 1013, 1390, 1492, 2341, 15490, 5879, 9312, 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, 15029, 3731, 1118, 3198, 12, 4110, 16, 10877, 273, 2202, 67, 13449, 67, 287, 8907, 16, 2077, 22, 2232, 273, 599, 13, 294, 3536, 1290, 10110, 1013, 1390, 1492, 2341, 15490, 5879, 9312, 84...
if ArgumentOptions.cache_dir and os.access( ArgumentOptions.cache_dir, os.W_OK ) == True:
if Str_CacheDir and os.access( Str_CacheDir, os.W_OK ) == True:
def run(request, response, func=find_first_match): '''Get items from the request Queue, process them with func(), put the results along with the Thread's name into the response Queue. Stop running when item is None.''' while 1: tuple_item_key = request.get() if tuple_item_key is None: break (key, item) = tuple_item_key (url, file, download_size, checksum) = stripper(item) thread_name = threading.currentThread().getName() if key == 'Update': temp_file = file.split("_") PackageName = temp_file[0] PackageName += " - " + temp_file[len(temp_file) - 1] del temp_file #INFO: We pass None as a filename here because we don't want to do a tree search of # update files. Update files are changed daily and there is no point in doing a search of # them in the cache_dir response.put(func(cache_dir, None) ) #INFO: exit_status here would be False because for updates there's no need to do a # find_first_match # This is more with the above statement where None is passed as the filename exit_status = response.get() if exit_status == False: log.msg("Downloading %s.%s\n" % (PackageName, LINE_OVERWRITE_MID) ) if FetcherInstance.download_from_web(url, file, download_path) == True: log.success("\r%s done.%s\n" % (PackageName, LINE_OVERWRITE_FULL) ) if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file(zip_update_file, file) != True: log.err("Couldn't archive %s to file %s.%s\n" % (file, zip_update_file, LINE_OVERWRITE_MID) ) sys.exit(1) else: log.verbose("%s added to archive %s.%s\n" % (file, zip_update_file, LINE_OVERWRITE_FULL) ) os.unlink(os.path.join(download_path, file) ) else: errlist.append(file) elif key == 'Upgrade': try: PackageName = file.split("_")[0] except IndexError: log.err("Not getting a package name here is problematic. Better bail out.\n") sys.exit(1) #INFO: For Package version, we don't want to fail try: PackageVersion = file.split("_")[1] except IndexError: PackageVersion = "NA" log.verbose("Weird!! Package version not present. Is it really a deb file?\n") response.put(func(cache_dir, file) ) #INFO: find_first_match() returns False or a file name with absolute path full_file_path = response.get() #INFO: If we find the file in the local cache_dir, we'll execute this block. if full_file_path != False: # We'll first check for its md5 checksum if ArgumentOptions.disable_md5check is False: if FetcherInstance.CheckHashDigest(full_file_path, checksum) is True: log.verbose("md5checksum correct for package %s.%s\n" % (PackageName, LINE_OVERWRITE_FULL) ) if ArgumentOptions.deb_bugs: bug_fetched = 0 log.verbose("Fetching bug reports for package %s.%s\n" % (PackageName, LINE_OVERWRITE_FULL) ) if FetchBugReportsDebian.FetchBugsDebian(PackageName) in [1,2]: log.verbose("Fetched bug reports for package %s.%s\n" % (PackageName, LINE_OVERWRITE_FULL) ) bug_fetched = 1 else: log.verbose("Couldn't fetch bug reports for package %s.%s\n" % (PackageName, LINE_OVERWRITE_MID) ) if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file(zip_upgrade_file, full_file_path) is True: log.success("%s copied from local cache directory %s.%s\n" % (PackageName, cache_dir, LINE_OVERWRITE_MID) ) else: log.err("Couldn't add %s to archive %s.%s\n" % (file, zip_upgrade_file, LINE_OVERWRITE_MID) ) sys.exit(1) #INFO: If no zip option enabled, simply copy the downloaded package file # along with the downloaded bug reports. else: try: shutil.copy(full_file_path, download_path) log.success("%s copied from local cache directory %s.%s\n" % (PackageName, cache_dir, LINE_OVERWRITE_MID) ) except shutil.Error: log.verbose("%s already available in %s. Skipping copy!!!%s\n" % (file, download_path, LINE_OVERWRITE_MID) ) if bug_fetched == 1: for x in os.listdir(os.curdir): if (x.startswith(PackageName) and x.endswith(apt_bug_file_format) ): shutil.move(x, download_path) log.verbose("Moved %s file to %s folder.%s\n" % (x, download_path, LINE_OVERWRITE_FULL) ) #INFO: Damn!! The md5chesum didn't match :-( # The file is corrupted and we need to download a new copy from the internet else: log.verbose("%s checksum mismatch. Skipping file.%s\n" % (file, LINE_OVERWRITE_FULL) ) log.msg("Downloading %s - %s %s\n" % (PackageName, log.calcSize(download_size/1024), LINE_OVERWRITE_MID) ) if FetcherInstance.download_from_web(url, file, download_path) == True: log.success("\r%s done.%s\n" % (PackageName, LINE_OVERWRITE_FULL) ) #Add to cache_dir if possible if ArgumentOptions.cache_dir and os.access(ArgumentOptions.cache_dir, os.W_OK) == True: try: shutil.copy(file, cache_dir) log.verbose("%s copied to local cache directory %s.%s\n" % (file, ArgumentOptions.cache_dir, LINE_OVERWRITE_MID) ) except shutil.Error: log.verbose("Couldn't copy %s to %s.%s\n" % (file, ArgumentOptions.cache_dir, LINE_OVERWRITE_FULL) ) else: log.verbose("cache_dir %s is not writeable. Skipping copy to it.\n" % (ArgumentOptions.cache_dir) ) #Fetch bug reports if ArgumentOptions.deb_bugs: if FetchBugReportsDebian.FetchBugsDebian( PackageName ) in [1, 2]: log.verbose( "Fetched bug reports for package %s.%s\n" % ( PackageName, LINE_OVERWRITE_MID ) ) else: log.verbose( "Couldn't fetch bug reports for package %s.%s\n" % ( PackageName, LINE_OVERWRITE_MID ) ) if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file( zip_upgrade_file, file ) != True: log.err( "Couldn't archive %s to file %s.%s\n" % ( file, zip_upgrade_file, LINE_OVERWRITE_SMALL ) ) sys.exit( 1 ) else: log.verbose( "%s added to archive %s.%s\n" % ( file, zip_upgrade_file, LINE_OVERWRITE_SMALL ) ) os.unlink( os.path.join( download_path, file ) ) #INFO: You're and idiot. # You should NOT disable md5checksum for any files else: if ArgumentOptions.deb_bugs: bug_fetched = 0 if FetchBugReportsDebian.FetchBugsDebian( PackageName ) in [1, 2]: log.verbose( "Fetched bug reports for package %s.%s\n" % ( PackageName, LINE_OVERWRITE_MID ) ) bug_fetched = 1 else: log.verbose( "Couldn't fetch bug reports for package %s.%s\n" % ( PackageName, LINE_OVERWRITE_MID ) ) #FIXME: Don't know why this was really required. If this has no changes, delete it. #file = full_file_path.split("/") #file = file[len(file) - 1] #file = download_path + "/" + file if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file( zip_upgrade_file, file ) != True: log.err( "Couldn't archive %s to file %s.%s\n" % ( file, zip_upgrade_file, LINE_OVERWRITE_SMALL ) ) sys.exit( 1 ) else: log.verbose( "%s added to archive %s.%s\n" % ( file, zip_upgrade_file, LINE_OVERWRITE_SMALL ) ) os.unlink( os.path.join( download_path, file ) ) else: # Since zip file option is not enabled let's copy the file to the target folder try: shutil.copy( full_file_path, download_path ) log.success( "%s copied from local cache directory %s.%s\n" % ( file, cache_dir, LINE_OVERWRITE_SMALL ) ) except shutil.Error: log.verbose( "%s already available in dest_dir. Skipping copy!!!%s\n" % ( file, LINE_OVERWRITE_SMALL ) ) # And also the bug reports if bug_fetched == 1: for x in os.listdir( os.curdir ): if ( x.startswith( PackageName ) and x.endswith( apt_bug_file_format ) ): shutil.move( x, download_path ) log.verbose( "Moved %s file to %s folder.%s\n" % ( x, download_path, LINE_OVERWRITE_MID ) ) else: #INFO: This block gets executed if the file is not found in local cache_dir or cache_dir is None # We go ahead and try to download it from the internet log.verbose( "%s not available in local cache %s.%s\n" % ( file, ArgumentOptions.cache_dir, LINE_OVERWRITE_MID ) ) log.msg( "Downloading %s %s - %s %s\n" % ( PackageName, PackageVersion, log.calcSize( download_size / 1024 ), LINE_OVERWRITE_MID ) ) if FetcherInstance.download_from_web( url, file, download_path ) == True: #INFO: This block gets executed if md5checksum is allowed if ArgumentOptions.disable_md5check is False: #INFO: Debian moved to SHA256. So we use that now. Older systems could have md5 log.verbose( "File %s has checksum %s\n" % ( file, checksum ) ) if FetcherInstance.CheckHashDigest( file, checksum ) is True: if ArgumentOptions.cache_dir and os.access( ArgumentOptions.cache_dir, os.W_OK ) == True: try: shutil.copy( file, ArgumentOptions.cache_dir ) log.verbose( "%s copied to local cache directory %s.%s\n" % ( file, ArgumentOptions.cache_dir, LINE_OVERWRITE_MID ) ) except shutil.Error: log.verbose( "%s already available in %s. Skipping copy!!!%s\n" % ( file, ArgumentOptions.cache_dir, LINE_OVERWRITE_MID ) ) else: log.verbose( "cache_dir %s is not writeable. Skipping copy to it.\n" % ( ArgumentOptions.cache_dir ) ) if ArgumentOptions.deb_bugs: if FetchBugReportsDebian.FetchBugsDebian( PackageName ) in [1, 2]: log.verbose( "Fetched bug reports for package %s.%s\n" % ( PackageName, LINE_OVERWRITE_MID ) ) else: log.verbose( "Couldn't fetch bug reports for package %s.%s\n" % ( PackageName, LINE_OVERWRITE_MID ) ) if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file( zip_upgrade_file, file ) != True: log.err( "Couldn't archive %s to file %s.%s\n" % ( file, zip_upgrade_file, LINE_OVERWRITE_SMALL ) ) sys.exit( 1 ) else: log.verbose( "%s added to archive %s.%s\n" % ( file, zip_upgrade_file, LINE_OVERWRITE_SMALL ) ) os.unlink( os.path.join( download_path, file ) ) else: #INFO MD5 Checksum is incorrect. log.err( "%s MD5 Checksum mismatch.\n" % ( PackageName ) ) errlist.append( PackageName ) else: if ArgumentOptions.deb_bugs: if FetchBugReportsDebian.FetchBugsDebian( PackageName ) in [1, 2]: log.verbose( "Fetched bug reports for package %s.%s\n" % ( PackageName, LINE_OVERWRITE_MID ) ) else: log.verbose( "Couldn't fetch bug reports for package %s.%s\n" % ( PackageName, LINE_OVERWRITE_MID ) ) if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file( zip_upgrade_file, file ) != True: log.err( "Couldn't archive %s to file %s.%s\n" % ( file, zip_upgrade_file, LINE_OVERWRITE_SMALL ) ) sys.exit( 1 ) else: log.verbose( "%s added to archive %s.%s\n" % ( file, zip_upgrade_file, LINE_OVERWRITE_SMALL ) ) os.unlink( os.path.join( download_path, file ) ) log.success( "\r%s %s done.%s\n" % ( PackageName, PackageVersion, LINE_OVERWRITE_FULL ) ) else: errlist.append( PackageName ) else: raise FetchDataKeyError
da63a417a8560a39ca821994468a1533f4c1445a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12499/da63a417a8560a39ca821994468a1533f4c1445a/AptOfflineCoreLib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2293, 16, 766, 16, 1326, 33, 4720, 67, 3645, 67, 1916, 4672, 9163, 967, 1516, 628, 326, 590, 7530, 16, 1207, 2182, 598, 1326, 9334, 1378, 326, 1686, 7563, 598, 326, 4884, 180...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2293, 16, 766, 16, 1326, 33, 4720, 67, 3645, 67, 1916, 4672, 9163, 967, 1516, 628, 326, 590, 7530, 16, 1207, 2182, 598, 1326, 9334, 1378, 326, 1686, 7563, 598, 326, 4884, 180...
self.settings["CFLAGS"]="-O2 -mtune=G3 -fno-strict-aliasing -pipe"
self.settings["CFLAGS"]="-O2 -mcpu=G3 -mtune=G3 -fno-strict-aliasing -pipe"
def __init__(self,myspec): generic_ppc.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -mtune=G3 -fno-strict-aliasing -pipe"
7e86939d1a46a2f73dfb4fc7a8cd0046dde53dd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7327/7e86939d1a46a2f73dfb4fc7a8cd0046dde53dd7/ppc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 81, 1900, 705, 4672, 5210, 67, 84, 2436, 16186, 2738, 972, 12, 2890, 16, 81, 1900, 705, 13, 365, 18, 4272, 9614, 8955, 6552, 55, 11929, 1546, 17, 51, 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 81, 1900, 705, 4672, 5210, 67, 84, 2436, 16186, 2738, 972, 12, 2890, 16, 81, 1900, 705, 13, 365, 18, 4272, 9614, 8955, 6552, 55, 11929, 1546, 17, 51, 2...
restoreAll = False
def main(): singlePageTitle = [] start = None # Which namespaces should be processed? # default to [] which means all namespaces will be processed namespaces = [] number = None until = None warnfile = None # a normal PageGenerator (which doesn't give hints, only Pages) hintlessPageGen = None optContinue = False optRestore = False restoreAll = False restoredFiles = [] File2Restore = [] dumpFileName = '' append = True newPages = None # This factory is responsible for processing command line arguments # that are also used by other scripts and that determine on which pages # to work on. genFactory = pagegenerators.GeneratorFactory() for arg in pywikibot.handleArgs(): if globalvar.readOptions(arg): continue elif arg.startswith('-warnfile:'): warnfile = arg[10:] elif arg.startswith('-years'): # Look if user gave a specific year at which to start # Must be a natural number or negative integer. if len(arg) > 7 and (arg[7:].isdigit() or (arg[7] == "-" and arg[8:].isdigit())): startyear = int(arg[7:]) else: startyear = 1 # avoid problems where year pages link to centuries etc. globalvar.followredirect = False hintlessPageGen = pagegenerators.YearPageGenerator(startyear) elif arg.startswith('-days'): if len(arg) > 6 and arg[5] == ':' and arg[6:].isdigit(): # Looks as if the user gave a specific month at which to start # Must be a natural number. startMonth = int(arg[6:]) else: startMonth = 1 hintlessPageGen = pagegenerators.DayPageGenerator(startMonth) elif arg.startswith('-new'): if len(arg) > 5 and arg[4] == ':' and arg[5:].isdigit(): # Looks as if the user gave a specific number of pages newPages = int(arg[5:]) else: newPages = 100 elif arg.startswith('-restore'): globalvar.restoreAll = arg[9:].lower() == 'all' optRestore = not globalvar.restoreAll elif arg == '-continue': optContinue = True elif arg.startswith('-namespace:'): try: namespaces.append(int(arg[11:])) except ValueError: namespaces.append(arg[11:]) # deprecated for consistency with other scripts elif arg.startswith('-number:'): number = int(arg[8:]) elif arg.startswith('-until:'): until = arg[7:] else: if not genFactory.handleArg(arg): singlePageTitle.append(arg) # ensure that we don't try to change main page try: site = pywikibot.getSite() try: mainpagename = site.siteinfo()['mainpage'] except TypeError: #pywikibot module handle mainpagename = site.siteinfo['mainpage'] globalvar.skip.add(pywikibot.Page(site, mainpagename)) except pywikibot.Error: pywikibot.output(u'Missing main page name') if newPages is not None: if len(namespaces) == 0: ns = 0 elif len(namespaces) == 1: ns = namespaces[0] if ns != 'all': if isinstance(ns, unicode) or isinstance(ns, str): index = site.getNamespaceIndex(ns) if index is None: raise ValueError(u'Unknown namespace: %s' % ns) ns = index namespaces = [] else: ns = 'all' hintlessPageGen = pagegenerators.NewpagesPageGenerator(newPages, namespace=ns) elif optRestore or optContinue or globalvar.restoreAll: site = pywikibot.getSite() if globalvar.restoreAll: import glob for FileName in glob.iglob('interwiki-dumps/interwikidump-*.txt'): s = FileName.split('\\')[1].split('.')[0].split('-') sitename = s[1] for i in range(0,2): s.remove(s[0]) sitelang = '-'.join(s) if site.family.name == sitename: File2Restore.append([sitename, sitelang]) else: File2Restore.append([site.family.name, site.lang]) for sitename, sitelang in File2Restore: dumpfn = pywikibot.config.datafilepath( 'interwiki-dumps', u'interwikidump-%s-%s.txt' % (sitename, sitelang)) pywikibot.output(u'Reading interwikidump-%s-%s.txt' % (sitename, sitelang)) site = pywikibot.getSite(sitelang, sitename) if not hintlessPageGen: hintlessPageGen = pagegenerators.TextfilePageGenerator(dumpfn, site) else: hintlessPageGen = pagegenerators.CombinedPageGenerator([hintlessPageGen,pagegenerators.TextfilePageGenerator(dumpfn, site)]) restoredFiles.append(dumpfn) if hintlessPageGen: hintlessPageGen = pagegenerators.DuplicateFilterPageGenerator(hintlessPageGen) if optContinue: # We waste this generator to find out the last page's title # This is an ugly workaround. nextPage = "!" namespace = 0 for page in hintlessPageGen: lastPage = page.titleWithoutNamespace() if lastPage > nextPage: nextPage = lastPage namespace = page.namespace() if nextPage == "!": pywikibot.output(u"Dump file is empty?! Starting at the beginning.") else: nextPage = page.titleWithoutNamespace() + '!' hintlessPageGen = pagegenerators.CombinedPageGenerator([hintlessPageGen, pagegenerators.AllpagesPageGenerator(nextPage, namespace, includeredirects = False)]) if not hintlessPageGen: pywikibot.output(u'No Dumpfiles found.') return bot = InterwikiBot() if not hintlessPageGen: hintlessPageGen = genFactory.getCombinedGenerator() if hintlessPageGen: if len(namespaces) > 0: hintlessPageGen = pagegenerators.NamespaceFilterPageGenerator(hintlessPageGen, namespaces) # we'll use iter() to create make a next() function available. bot.setPageGenerator(iter(hintlessPageGen), number = number, until=until) elif warnfile: # TODO: filter namespaces if -namespace parameter was used readWarnfile(warnfile, bot) else: singlePageTitle = ' '.join(singlePageTitle) if not singlePageTitle: singlePageTitle = pywikibot.input(u'Which page to check:') singlePage = pywikibot.Page(pywikibot.getSite(), singlePageTitle) bot.add(singlePage, hints = globalvar.hints) try: try: append = not (optRestore or optContinue or globalvar.restoreAll) bot.run() except KeyboardInterrupt: dumpFileName = bot.dump(append) except: dumpFileName = bot.dump(append) raise finally: if globalvar.contentsondisk: StoredPage.SPdeleteStore() if dumpFileName: try: restoredFiles.remove(dumpFileName) except ValueError: pass for dumpFileName in restoredFiles: try: os.remove(dumpFileName) pywikibot.output(u'Dumpfile %s deleted' % dumpFileName.split('\\')[-1]) except WindowsError: pass
b421653495df9d3562b948c4ff88d74f81dc43f0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/b421653495df9d3562b948c4ff88d74f81dc43f0/interwiki.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 2202, 1964, 4247, 273, 5378, 787, 273, 599, 468, 21918, 7728, 1410, 506, 5204, 35, 468, 805, 358, 5378, 1492, 4696, 777, 7728, 903, 506, 5204, 7728, 273, 5378, 1300, 273, 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, 2774, 13332, 2202, 1964, 4247, 273, 5378, 787, 273, 599, 468, 21918, 7728, 1410, 506, 5204, 35, 468, 805, 358, 5378, 1492, 4696, 777, 7728, 903, 506, 5204, 7728, 273, 5378, 1300, 273, 59...
field = forms.CharField(maxlen=self.maxlen,label=self.comment)
field = forms.CharField(max_length=self.maxlen,label=self.comment)
def asField(self):
9d3ad9c72b012835f0277b12e10aa72f66aa5b5d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7994/9d3ad9c72b012835f0277b12e10aa72f66aa5b5d/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 487, 974, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 487, 974, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
self.sendLine('+OK TLS not available')
self.sendLine('-ERR TLS not available')
def startTLS(self): if self.ctx is None: self.getContext()
15b2ab21feaeb85fb3fff11efeaec88d91007453 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/15b2ab21feaeb85fb3fff11efeaec88d91007453/pop3testserver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 9905, 12, 2890, 4672, 309, 365, 18, 5900, 353, 599, 30, 365, 18, 29120, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 9905, 12, 2890, 4672, 309, 365, 18, 5900, 353, 599, 30, 365, 18, 29120, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
return "PlotField defined by a %s x %s vector grid"%(len(self.xpos_array), len(self.ypos_array))
""" String representation of PlotField graphics primitive. EXAMPLES:: sage: x,y = var('x,y') sage: P=plot_vector_field((sin(x), cos(y)), (x,-3,3), (y,-3,3)) sage: P[0] PlotField defined by a 20 x 20 vector grid """ return "PlotField defined by a %s x %s vector grid"%(self.options()['plot_points'], self.options()['plot_points'])
def _repr_(self): return "PlotField defined by a %s x %s vector grid"%(len(self.xpos_array), len(self.ypos_array))
94a24998aaad8dc6b7e6faed7105bce7d769ef4b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/94a24998aaad8dc6b7e6faed7105bce7d769ef4b/plot_field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 12715, 67, 12, 2890, 4672, 327, 315, 11532, 974, 2553, 635, 279, 738, 87, 619, 738, 87, 3806, 3068, 6, 17105, 1897, 12, 2890, 18, 92, 917, 67, 1126, 3631, 562, 12, 2890, 18, 879...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 389, 12715, 67, 12, 2890, 4672, 327, 315, 11532, 974, 2553, 635, 279, 738, 87, 619, 738, 87, 3806, 3068, 6, 17105, 1897, 12, 2890, 18, 92, 917, 67, 1126, 3631, 562, 12, 2890, 18, 879...
out, err = system(['sbcl', '--end-runtime-options', '--no-sysinit', '--no-userinit', '--disable-debugger', '--load MyBot.lisp', '--eval', "(save-lisp-and-die \"MyBot\" :executable t :toplevel
out, err = system(['sbcl', '--end-runtime-options', '--no-sysinit', '--no-userinit', '--disable-debugger', '--load', 'MyBot.lisp', '--eval', "(save-lisp-and-die \"MyBot\" :executable t :toplevel
def compile_function(language): if language == "Java": out_message = "" err_message = "" nukeglob('*.class') nukeglob('*.jar') sources = safeglob('*.java') out, err = system(['javac'] + sources) out_message += out err_message += err out, err = system(['jar', 'cfe', 'MyBot.jar', 'MyBot'] + \ safeglob('*.class')) out_message += out err_message += err err_message += check_path('MyBot.jar') if os.path.exists("MyBot.jar"): os.chmod("MyBot.jar", 0644) return out_message, err_message if language == "CoffeeScript": for script in safeglob('*.coffee'): os.chmod(script, 0644) check_path('MyBot.coffee') return "CoffeeScript scripts do not need to be compiled.", "" if language == "Haskell": nukeglob('MyBot') out, err = system(['ghc', '--make', 'MyBot.hs', '-O2', '-v0']) err += check_path('MyBot') return out, err if language == "C#": nukeglob('MyBot.exe') sources = safeglob('*.cs') out, err = system(['gmcs', '-warn:0', '-out:MyBot.exe'] + sources) err += check_path('MyBot.exe') return out, err if language == "C++": out_message = "" err_message = "" nukeglob('*.o') nukeglob('MyBot') sources = safeglob('*.c') + safeglob('*.cc') + safeglob('*.cpp') for source in sources: object_file = \ source.replace(".cc", "").replace(".cpp", "").replace(".c", "") + ".o" out, err = system(['g++', '-O3', '-funroll-loops', '-c', '-o', \ object_file, source]) out_message += out err_message += err out, err = system(['g++', '-O2', '-o', 'MyBot'] + safeglob('*.o') + ['-lm']) out_message += out err_message += err err_message += check_path('MyBot') return out_message, err_message if language == "C": nukeglob('*.o') nukeglob('MyBot') sources = safeglob('*.c') for source in sources: object_file = source.replace(".c", "") + ".o" system(['gcc', '-O3', '-funroll-loops', '-c', '-o', object_file, source]) system(['gcc', '-O2', '-o', 'MyBot'] + safeglob('*.o') + ['-lm']) check_path('MyBot') if language == "Go": nukeglob('*.6') nukeglob('MyBot') sources = safeglob('*.go') system(['/usr/local/bin/6g', '-o', '_go_.6'] + sources) system(['/usr/local/bin/6l', '-o', 'MyBot', '_go_.6']) check_path('MyBot') if language == "Python": nukeglob('*.pyc') for script in safeglob('*.py'): os.chmod(script, 0644) check_path('MyBot.py') return "Python scripts do not need to be compiled.", "" if language == "PHP": for script in safeglob('*.php'): os.chmod(script, 0644) check_path('MyBot.php') return "Php scripts need not be compiled", "" if language == "Ruby": for script in safeglob('*.rb'): os.chmod(script, 0644) check_path('MyBot.rb') return "Ruby scripts need not be compiled", "" if language == "Perl": for script in safeglob('*.pl'): os.chmod(script, 0644) check_path('MyBot.pl') return "Perl scripts need not be compiled", "" if language == "Javascript": for script in safeglob('*.js'): os.chmod(script, 0644) check_path('MyBot.js') return "Javascript scripts do not need to be compiled.", "" if language == "Scheme": print "Scheme scripts need not be compiled" for script in safeglob('*.ss'): os.chmod(script, 0644) check_path('MyBot.ss') if language == "Lua": print "Lua scripts need not be compiled" for script in safeglob('*.lua'): os.chmod(script, 0644) check_path('MyBot.lua') if language == "Clojure": print "Clojure scripts need not be compiled" for script in safeglob('*.clj'): os.chmod(script, 0644) check_path('MyBot.clj') if language == "Ocaml": nukeglob('MyBot.native') out, err = system(['ocamlbuild', 'MyBot.native']) check_path('MyBot.native') return out, err if language == "Lisp": nukeglob('MyBot') out, err = system(['sbcl', '--end-runtime-options', '--no-sysinit', '--no-userinit', '--disable-debugger', '--load MyBot.lisp', '--eval', "(save-lisp-and-die \"MyBot\" :executable t :toplevel #'pwbot::main)"]) check_path('MyBot') return out, err
47636ae73110439260ea76805e1b52fa94dafc17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13129/47636ae73110439260ea76805e1b52fa94dafc17/compile_anything.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4074, 67, 915, 12, 4923, 4672, 309, 2653, 422, 315, 5852, 6877, 596, 67, 2150, 273, 1408, 393, 67, 2150, 273, 1408, 9244, 79, 1332, 1295, 2668, 11146, 1106, 6134, 9244, 79, 1332, 1295, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4074, 67, 915, 12, 4923, 4672, 309, 2653, 422, 315, 5852, 6877, 596, 67, 2150, 273, 1408, 393, 67, 2150, 273, 1408, 9244, 79, 1332, 1295, 2668, 11146, 1106, 6134, 9244, 79, 1332, 1295, ...
'reset_invoice': 'You cannot reset to draft an invoice '\ 'generated by a sale.',
'reset_invoice_sale': 'You cannot reset to draft ' \ 'an invoice generated by a sale.',
def __init__(self): super(Invoice, self).__init__() self._error_messages.update({ 'delete_sale_invoice': 'You can not delete invoices ' \ 'that come from a sale!', 'reset_invoice': 'You cannot reset to draft an invoice '\ 'generated by a sale.', })
b1f099b98b678be21a5bda08e1101f919bae9fcf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9306/b1f099b98b678be21a5bda08e1101f919bae9fcf/sale.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 2240, 12, 10467, 16, 365, 2934, 972, 2738, 972, 1435, 365, 6315, 1636, 67, 6833, 18, 2725, 12590, 296, 3733, 67, 87, 5349, 67, 16119, 4278, 296, 6225, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4672, 2240, 12, 10467, 16, 365, 2934, 972, 2738, 972, 1435, 365, 6315, 1636, 67, 6833, 18, 2725, 12590, 296, 3733, 67, 87, 5349, 67, 16119, 4278, 296, 6225, ...