rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
def sort(self, mode=None): """ Returns the string how to sort this item """ if mode == 'date': return u'%s%s' % (os.stat(self.filename).st_ctime, Unicode(self.filename)) return Unicode(self.name) | def sort(self, mode=None): """ Returns the string how to sort this item """ if mode == 'date': return u'%s%s' % (os.stat(self.filename).st_ctime, Unicode(self.filename)) return Unicode(self.name) | 0710989ab5e31436736f020e1e3d5ba0dfecca41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/0710989ab5e31436736f020e1e3d5ba0dfecca41/imageitem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1524,
12,
2890,
16,
1965,
33,
7036,
4672,
3536,
2860,
326,
533,
3661,
358,
1524,
333,
761,
3536,
309,
1965,
422,
296,
712,
4278,
327,
582,
11,
9,
87,
9,
87,
11,
738,
261,
538,
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,
1524,
12,
2890,
16,
1965,
33,
7036,
4672,
3536,
2860,
326,
533,
3661,
358,
1524,
333,
761,
3536,
309,
1965,
422,
296,
712,
4278,
327,
582,
11,
9,
87,
9,
87,
11,
738,
261,
538,
18,
... | |
if x+(w)>self.screen.get_width(): x=self.screen.get_width()-w if x<0: x = 0 if y-h >= 0: self.popup.move(x,y-h) | if x + w > mgeo.x + mgeo.width: x = mgeo.x + mgeo.width - w if x < mgeo.x: x = mgeo.x if y - h >= mgeo.y: self.popup.move(x, y - h) | def on_popup_size_allocate(self, widget, allocation): # Move popup to it's right spot offset = 3 x,y = self.button.window.get_origin() b_alloc = self.button.get_allocation() w,h = self.popup.get_size() if self.globals.orient == "h": if self.globals.settings['popup_align'] == 'left': x = b_alloc.x + x if self.globals.settings['popup_align'] == 'center': x = b_alloc.x + x + (b_alloc.width/2)-(w/2) if self.globals.settings['popup_align'] == 'right': x = b_alloc.x + x + b_alloc.width - w y = b_alloc.y + y-offset if x+(w)>self.screen.get_width(): x=self.screen.get_width()-w if x<0: x = 0 if y-h >= 0: self.popup.move(x,y-h) else: self.popup.move(x,y+b_alloc.height+(offset*2)) else: x = b_alloc.x + x y = b_alloc.y + y if y+h>self.screen.get_height(): y=self.screen.get_height()-h if x+w >= self.screen.get_width(): self.popup.move(x - w - offset,y) else: self.popup.move(x + b_alloc.width + offset,y) | fe9fdc7226ed408633caedb0ca4d1c8b003970cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7075/fe9fdc7226ed408633caedb0ca4d1c8b003970cf/groupbutton.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
16086,
67,
1467,
67,
16247,
12,
2890,
16,
3604,
16,
13481,
4672,
468,
9933,
10431,
358,
518,
1807,
2145,
16463,
1384,
273,
890,
619,
16,
93,
273,
365,
18,
5391,
18,
5668,
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,
603,
67,
16086,
67,
1467,
67,
16247,
12,
2890,
16,
3604,
16,
13481,
4672,
468,
9933,
10431,
358,
518,
1807,
2145,
16463,
1384,
273,
890,
619,
16,
93,
273,
365,
18,
5391,
18,
5668,
18,
... |
for k in [k for k,v in constraints.items() if not type(v) is ListType]: self.req.hdf.setValue('query.%s' % k, constraints[k]) self.req.hdf.setValue('query.order', order) self.req.hdf.setValue('query.desc', str(desc)) | def add_db_options(field, db, sql, constraints, prefix): cursor.execute(sql) options = [] while 1: row = cursor.fetchone() if not row: break if row[0]: options.append({'name': row[0]}) add_options(field, options, constraints, prefix) | 880aa9ff4e6fbb362a2b26298b12a57c57c572dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/880aa9ff4e6fbb362a2b26298b12a57c57c572dd/Query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
1966,
67,
2116,
12,
1518,
16,
1319,
16,
1847,
16,
6237,
16,
1633,
4672,
3347,
18,
8837,
12,
4669,
13,
702,
273,
5378,
1323,
404,
30,
1027,
273,
3347,
18,
5754,
476,
1435,
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,
527,
67,
1966,
67,
2116,
12,
1518,
16,
1319,
16,
1847,
16,
6237,
16,
1633,
4672,
3347,
18,
8837,
12,
4669,
13,
702,
273,
5378,
1323,
404,
30,
1027,
273,
3347,
18,
5754,
476,
1435,
30... | |
if(data_.strip() in ["?","*","."]): continue if(sigma_.strip() in ["?","*","."]): sigma_ = 1.0 | if(data_ in ["?","*","."]): continue if(sigma_ in ["?","*","."]): sigma_ = 1.0 | def __init__(self, key_counter, file_name, file_lines, crystal_symmetry): self.indices = flex.miller_index() self.data = flex.double() self.sigmas = flex.double() self.flags = flex.std_string() self.file_name = file_name start_counter = 0 start_flag = False for line in file_lines: line_orig = line h_,k_,l_,data_,sigma_,flag_ = [None]*6 line = line.strip() line = line.split() if(len(key_counter.keys) != start_counter or not start_flag): if(len(line) == 1): if(line[0] == "loop_"): start_flag = True if(start_flag and (line[0].replace("_refln.","") in key_counter.keys) and line[0] != "loop_"): start_counter += 1 if(len(key_counter.keys) == start_counter and start_flag): if(self.indices.size() > 0 and len(line) != len(key_counter.keys)): break if(len(line) == len(key_counter.keys)): try: if(key_counter.i_fobs is not None): data_ = line[key_counter.i_fobs] if(key_counter.i_sfobs is not None): sigma_ = line[key_counter.i_sfobs] else: if(key_counter.i_siobs is not None): sigma_ = line[key_counter.i_siobs] data_ = line[key_counter.i_iobs] if(key_counter.i_flag is not None): flag_ = line[key_counter.i_flag] if(data_.strip() in ["?","*","."]): continue if(sigma_.strip() in ["?","*","."]): sigma_ = 1.0 except: self.reset(message = "Cannot extract column data,#1.",line=line) break try: h_ = line[key_counter.i_h] k_ = line[key_counter.i_k] l_ = line[key_counter.i_l] try_h = h_.replace("-","").strip().isdigit() try_k = k_.replace("-","").strip().isdigit() try_l = l_.replace("-","").strip().isdigit() if(not (try_h and try_k and try_l)): if(line[0] not in ["#END","#","#;"] and line_orig.count("This file should contain")==0): self.reset(message="h or k or k or all: NOT digit(s).",line=line) break h_ = int(h_) k_ = int(k_) l_ = int(l_) data_ = float(data_) if(data_ == 0.0): continue if(sigma_ is not None): sigma_ = float(sigma_) if(sigma_ < 0.0): continue except: self.reset(message = "Cannot extract column data,#2.",line=line) break assert [h_, k_, l_].count(None) == 0 assert data_ is not None if([h_,k_,l_].count(0) != 3 and data_ != 0): self.indices.append([h_, k_, l_]) self.data.append(data_) if(flag_ is not None): self.flags.append(flag_) if(sigma_ is not None): self.sigmas.append(sigma_) if(self.indices.size() != self.data.size()): self.reset(message = "self.indices.size() != self.data.size()") if(len(self.sigmas) > 0): if(self.indices.size() != self.sigmas.size()): self.reset(message = "self.indices.size() != self.sigmas.size()") else: self.sigmas = flex.double(self.data.size(), 1.0) if(self.indices.size() > 0 and self.flags.size() > 0): if(self.indices.size() != self.flags.size()): self.reset(message = "self.indices.size() != self.flags.size()") else: self.flags, cif_selection = get_array_of_r_free_flags( flags = self.flags, crystal_symmetry = crystal_symmetry, indices = self.indices, file_name = file_name) if([self.flags, cif_selection].count(None) == 0): self.indices = self.indices.select(cif_selection) self.data = self.data.select(cif_selection) self.sigmas = self.sigmas.select(cif_selection) self.flags = self.flags.select(cif_selection) | 7fdc560a5623b0136b455536a533a3705ec4f5ac /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/696/7fdc560a5623b0136b455536a533a3705ec4f5ac/cif_as_mtz.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
498,
67,
7476,
16,
585,
67,
529,
16,
585,
67,
3548,
16,
4422,
31365,
67,
8117,
18042,
4672,
365,
18,
6836,
273,
16600,
18,
81,
24462,
67,
1615,
1435,
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,
1001,
2738,
972,
12,
2890,
16,
498,
67,
7476,
16,
585,
67,
529,
16,
585,
67,
3548,
16,
4422,
31365,
67,
8117,
18042,
4672,
365,
18,
6836,
273,
16600,
18,
81,
24462,
67,
1615,
1435,
3... |
print list_type_id_ls | def generate_params(self, min_no_of_genes=10): """ 2008-07-24 only association results (results_method_type_id=1) only candidate gene lists with >min_no_of_genes genes skip ones that been done """ sys.stderr.write("Generating parameters ...") i = 0 block_size = 5000 rows = ResultsMethod.query.filter_by(results_method_type_id=1).offset(i).limit(block_size) results_method_id_ls = [] while rows.count()!=0: for row in rows: results_method_id_ls.append(row.id) i += 1 rows = ResultsMethod.query.offset(i).limit(block_size) sys.stderr.write("%s results. "%(len(results_method_id_ls))) i = 0 rows = GeneListType.query.offset(i).limit(block_size) list_type_id_ls = [] while rows.count()!=0: for row in rows: if len(row.gene_list)>=min_no_of_genes: list_type_id_ls.append(row.id) i += 1 rows = GeneListType.query.offset(i).limit(block_size) print list_type_id_ls sys.stderr.write("%s candidate gene lists. "%(len(list_type_id_ls))) i = 0 rows = CandidateGeneRankSumTestResult.query.offset(i).limit(block_size) rm_id_lt_id_set = Set() while rows.count()!=0: for row in rows: rm_id_lt_id_set.add((row.results_method_id, row.list_type_id)) i += 1 rows = CandidateGeneRankSumTestResult.query.offset(i).limit(block_size) sys.stderr.write("%s candidate gene rank sum test results. "%(len(rm_id_lt_id_set))) params_ls = [] for results_method_id in results_method_id_ls: for list_type_id in list_type_id_ls: rm_id_lt_id = (results_method_id, list_type_id) if rm_id_lt_id not in rm_id_lt_id_set: params_ls.append(rm_id_lt_id) sys.stderr.write("generating params done.\n") return params_ls | 4b9ca4579458f68da2d72f1b02871e00146bfbbd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9645/4b9ca4579458f68da2d72f1b02871e00146bfbbd/MpiGeneListRankTest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
2010,
12,
2890,
16,
1131,
67,
2135,
67,
792,
67,
18036,
33,
2163,
4672,
3536,
4044,
28,
17,
8642,
17,
3247,
1338,
6384,
1686,
261,
4717,
67,
2039,
67,
723,
67,
350,
33,
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,
2103,
67,
2010,
12,
2890,
16,
1131,
67,
2135,
67,
792,
67,
18036,
33,
2163,
4672,
3536,
4044,
28,
17,
8642,
17,
3247,
1338,
6384,
1686,
261,
4717,
67,
2039,
67,
723,
67,
350,
33,
21,... | |
self.table_xml("idle_thrust", self.data.idle_thrust, 1000.0, 0.1, 1) self.table_xml("mil_thrust", self.data.mil_thrust, 1000.0, 0.1, 1) self.table_xml("ab_thrust", self.data.ab_thrust, 1000.0, 0.1, 1) | self.table_xml("idle_thrust", self.data.idle_thrust, 0.1, 1000.0, 1) self.table_xml("mil_thrust", self.data.mil_thrust, 0.1, 1000.0, 1) self.table_xml("ab_thrust", self.data.ab_thrust, 0.1, 1000.0, 1) | def engine_xml(self): self.table_xml("idle_thrust", self.data.idle_thrust, 1000.0, 0.1, 1) self.table_xml("mil_thrust", self.data.mil_thrust, 1000.0, 0.1, 1) self.table_xml("ab_thrust", self.data.ab_thrust, 1000.0, 0.1, 1) | 7f770db324048a7a5a9a3a5b7781fb090aa5fce0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14747/7f770db324048a7a5a9a3a5b7781fb090aa5fce0/falcon_acdata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4073,
67,
2902,
12,
2890,
4672,
365,
18,
2121,
67,
2902,
2932,
20390,
67,
451,
86,
641,
3113,
365,
18,
892,
18,
20390,
67,
451,
86,
641,
16,
4336,
18,
20,
16,
374,
18,
21,
16,
404,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4073,
67,
2902,
12,
2890,
4672,
365,
18,
2121,
67,
2902,
2932,
20390,
67,
451,
86,
641,
3113,
365,
18,
892,
18,
20390,
67,
451,
86,
641,
16,
4336,
18,
20,
16,
374,
18,
21,
16,
404,... |
Utils.QuotePeriods(body) + '\n' + \ | Utils.QuotePeriods(msg.body) + '\n' + \ | def HandleBouncingAddress(self, addr, msg): """Disable or remove addr according to bounce_action setting.""" if self.automatic_bounce_action == 0: return elif self.automatic_bounce_action == 1: # Only send if call works ok. (succeeded, send) = self.DisableBouncingAddress(addr) did = "disabled" elif self.automatic_bounce_action == 2: (succeeded, send) = self.DisableBouncingAddress(addr) did = "disabled" # Never send. send = 0 elif self.automatic_bounce_action == 3: (succeeded, send) = self.RemoveBouncingAddress(addr) # Always send. send = 1 did = "removed" if send: if succeeded != 1: negative="not " else: negative="" recipient = self.GetAdminEmail() if addr in self.owner + [recipient]: # Whoops! This is a bounce of a bounce notice - do not # perpetuate the bounce loop! Log it prominently and be # satisfied with that. syslog("error", "%s: Bounce recipient loop" " encountered!\n\t%s\n\tBad admin recipient: %s" % (self.internal_name(), "(Ie, bounce notification addr, itself, bounces.)", addr)) return import mimetools boundary = mimetools.choose_boundary() # report about success but = '' if succeeded <> 1: but = 'BUT: %s' % succeeded # disabled? if did == 'disabled' and succeeded == 1: reenable = Utils.maketext( 'reenable.txt', {'admin_url': self.GetScriptURL('admin', absolute=1), }) else: reenable = '' # the mail message text text = Utils.maketext( 'bounce.txt', {'boundary' : boundary, 'listname' : self.real_name, 'addr' : addr, 'negative' : negative, 'did' : did, 'but' : but, 'reenable' : reenable, 'owneraddr': mm_cfg.MAILMAN_OWNER, }) # add this here so it doesn't get wrapped/filled text = text + '\n\n--' + boundary + \ '\nContent-type: text/plain; charset=us-ascii\n' | 81ecd48ac963f1aad00086f2f0bad6f280bc6fe6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/81ecd48ac963f1aad00086f2f0bad6f280bc6fe6/Bouncer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5004,
38,
465,
2822,
1887,
12,
2890,
16,
3091,
16,
1234,
4672,
3536,
11879,
578,
1206,
3091,
4888,
358,
324,
8386,
67,
1128,
3637,
12123,
309,
365,
18,
5854,
4941,
67,
70,
8386,
67,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5004,
38,
465,
2822,
1887,
12,
2890,
16,
3091,
16,
1234,
4672,
3536,
11879,
578,
1206,
3091,
4888,
358,
324,
8386,
67,
1128,
3637,
12123,
309,
365,
18,
5854,
4941,
67,
70,
8386,
67,
11... |
self._cacheFileContents(encFileId, fileObj.f) | fobj = self._compressStreamContents(fileObj.f) self._cacheFileContents(encFileId, fobj) | def getFileContents(self, caller, authToken, clientVersion, fileList, authCheckOnly = False): if clientVersion < 42: # server doesn't support auth checks through getFileContents return caller.getFileContents(clientVersion, fileList, authCheckOnly) | 89e28f8dccaeabc819282832ca71bb076d6625c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8747/89e28f8dccaeabc819282832ca71bb076d6625c8/proxy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6034,
6323,
12,
2890,
16,
4894,
16,
24050,
16,
1004,
1444,
16,
18645,
16,
1357,
1564,
3386,
273,
1083,
4672,
309,
1004,
1444,
411,
14856,
30,
468,
1438,
3302,
1404,
2865,
1357,
4271,
305... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6034,
6323,
12,
2890,
16,
4894,
16,
24050,
16,
1004,
1444,
16,
18645,
16,
1357,
1564,
3386,
273,
1083,
4672,
309,
1004,
1444,
411,
14856,
30,
468,
1438,
3302,
1404,
2865,
1357,
4271,
305... |
removedList.append((trvName, trvVersion, trvFlavor)) | removedList.append(nvf) | def recurseTrove(sourceRepos, name, version, flavor, callback = ChangesetCallback()): global recursedGroups assert(name.startswith("group-")) # there's nothing much we can recurse from the source if name.endswith(":source"): return [] # avoid grabbing the same group multiple times if (name, version, flavor) in recursedGroups: return [] # we need to grab the trove list recursively for # mirroring. Unfortunately the netclient does not wire the # repository's getChangeSet parameters, so we need to cheat a # little to keep the roundtrips to a minimum log.debug("recursing group trove: %s=%s[%s]" % (name, version, flavor)) groupCs = sourceRepos.createChangeSet( [(name, (None, None), (version, flavor), True)], withFiles=False, withFileContents = False, recurse = True, callback = callback) recursedGroups.add((name, version, flavor)) ret = [] removedList = [] for troveCs in groupCs.iterNewTroveList(): (trvName, trvVersion, trvFlavor) = troveCs.getNewNameVersionFlavor() # keep track of groups we have already recursed through if trvName.startswith("group-"): recursedGroups.add((trvName, trvVersion, trvFlavor)) if troveCs.getType() == trove.TROVE_TYPE_REMOVED: removedList.append((trvName, trvVersion, trvFlavor)) else: ret.append((trvName, trvVersion, trvFlavor)) return ret, removedList | 2799f6fd34899a0b190318bab5da59c9dc79411c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/2799f6fd34899a0b190318bab5da59c9dc79411c/mirror.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11502,
56,
303,
537,
12,
3168,
28453,
16,
508,
16,
1177,
16,
19496,
16,
1348,
273,
17776,
278,
2428,
1435,
4672,
2552,
8112,
730,
3621,
1815,
12,
529,
18,
17514,
1918,
2932,
1655,
10951,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11502,
56,
303,
537,
12,
3168,
28453,
16,
508,
16,
1177,
16,
19496,
16,
1348,
273,
17776,
278,
2428,
1435,
4672,
2552,
8112,
730,
3621,
1815,
12,
529,
18,
17514,
1918,
2932,
1655,
10951,... |
def GetFleetAndSystemIDs(object_ids_list): empire = foaiint.GetEmpire() empire_id = foaiint.EmpireID() universe = foaiint.GetUniverse() | def GenerateOrders(): #foaiint.SendChatMessage(0, "Sending chat message from within Python!") empire = foaiint.GetEmpire() empire_id = foaiint.EmpireID() universe = foaiint.GetUniverse() object_ids_list = universe.ObjectIDs() [fleet_ids_list, system_ids_list] = GetFleetAndSystemIDs(object_ids_list) #foaiint.SendChatMessage(0, "My homeworld id: " + str(empire.HomeworldID())) foaiint.DoneTurn() foaiint.LogOutput("Generated Orders") | 08cf1ec6fbb2b7490d0daed7afd5bae80d1a1fbb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4376/08cf1ec6fbb2b7490d0daed7afd5bae80d1a1fbb/FreeOrionAI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6654,
16528,
13332,
468,
617,
10658,
474,
18,
3826,
14163,
1079,
12,
20,
16,
315,
16322,
7916,
883,
628,
3470,
6600,
4442,
13,
225,
801,
84,
577,
273,
18261,
10658,
474,
18,
967,
41,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6654,
16528,
13332,
468,
617,
10658,
474,
18,
3826,
14163,
1079,
12,
20,
16,
315,
16322,
7916,
883,
628,
3470,
6600,
4442,
13,
225,
801,
84,
577,
273,
18261,
10658,
474,
18,
967,
41,
1... | |
lines = string.split(message, '\n') for line in lines: self.sendLine(":%s!%s@%s PRIVMSG %s :%s" % (senderName, senderName, self.servicename, self.nickname, line)) def receiveGroupMessage(self, sender, group, message): | if (metadata is not None) and (metadata['style'] == 'emote'): message = irc.ctcpStringify([('ACTION', message)]) self.sendLine(":%s!%s@%s PRIVMSG %s :%s" % (senderName, senderName, self.servicename, self.nickname, irc.lowQuote(message))) def receiveGroupMessage(self, sender, group, message, metadata=None): if (metadata is not None) and (metadata['style'] == 'emote'): message = irc.ctcpStringify([('ACTION', message)]) | def receiveDirectMessage(self, senderName, message): #>> :glyph_!glyph@adsl-64-123-27-108.dsl.austtx.swbell.net PRIVMSG glyph_ :hello #>> :glyph!glyph@adsl-64-123-27-108.dsl.austtx.swbell.net PRIVMSG glyph_ :hello | fb5c4485fb829bdefd61c579b3f24943941d7c43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fb5c4485fb829bdefd61c579b3f24943941d7c43/ircservice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6798,
5368,
1079,
12,
2890,
16,
5793,
461,
16,
883,
4672,
468,
9778,
294,
19426,
67,
5,
19426,
36,
361,
2069,
17,
1105,
17,
12936,
17,
5324,
17,
21770,
18,
30249,
18,
69,
641,
978,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6798,
5368,
1079,
12,
2890,
16,
5793,
461,
16,
883,
4672,
468,
9778,
294,
19426,
67,
5,
19426,
36,
361,
2069,
17,
1105,
17,
12936,
17,
5324,
17,
21770,
18,
30249,
18,
69,
641,
978,
1... |
elif response.isdigit() is True: found = False for full_bug_file_name in bugs_number: if response in full_bug_file_name: bug_file_to_display = full_bug_file_name found = True break if found == False: log.err("Incorrect bug number %s provided.\n" % (response) ) response = get_response() if found: display_pager = PagerCmd() retval = display_pager.send_to_pager(file.read(bug_file_to_display) ) if retval == 1: log.err("Broken pager. Can't display the bug details.\n") response = get_response() elif response.startswith('r') or response.startswith('R'): list_bugs() response = get_response() else: log.err('Incorrect choice. Exiting\n') sys.exit(1) | magic_check_and_uncompress(os.path.abspath(filename), target_path, filename) | def list_bugs(): log.msg("\n\nFollowing are the list of bugs present.\n") for each_bug in bugs_number.keys(): bug_num = each_bug.split('.')[1] bug_subject = bugs_number[each_bug] log.msg("%s\t%s\n" % (bug_num, bug_subject) ) | bf27eda3758a3b77fdeff5b846a63c1c8feb3962 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12499/bf27eda3758a3b77fdeff5b846a63c1c8feb3962/pypt_core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
67,
19381,
13332,
613,
18,
3576,
31458,
82,
64,
82,
8328,
310,
854,
326,
666,
434,
22398,
3430,
8403,
82,
7923,
364,
1517,
67,
925,
316,
22398,
67,
2696,
18,
2452,
13332,
7934,
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,
666,
67,
19381,
13332,
613,
18,
3576,
31458,
82,
64,
82,
8328,
310,
854,
326,
666,
434,
22398,
3430,
8403,
82,
7923,
364,
1517,
67,
925,
316,
22398,
67,
2696,
18,
2452,
13332,
7934,
67... |
old_items.discard(item) | self.old_items.discard(item) | def _createItemsForParsed(self, parsed): # This is a HACK for Yahoo! search which doesn't provide # enclosures for entry in parsed['entries']: if 'enclosures' not in entry: try: url = entry['link'] except (SystemExit, KeyboardInterrupt): raise except: continue mimetype = filetypes.guess_mime_type(url) if mimetype is not None: entry['enclosures'] = [{'url': to_uni(url), 'type': to_uni(mimetype)}] elif flashscraper.is_maybe_flashscrapable(url): entry['enclosures'] = [{'url': to_uni(url), 'type': to_uni("video/flv")}] else: logging.info('unknown url type %s, not generating enclosure' % url) | 3c3b6870a8d2a53770dbfe886ab2230073ce65f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/3c3b6870a8d2a53770dbfe886ab2230073ce65f7/feed.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
3126,
1290,
11257,
12,
2890,
16,
2707,
4672,
468,
1220,
353,
279,
670,
3649,
364,
1624,
9795,
5161,
5,
1623,
1492,
3302,
1404,
5615,
468,
2446,
383,
8421,
364,
1241,
316,
2707... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2640,
3126,
1290,
11257,
12,
2890,
16,
2707,
4672,
468,
1220,
353,
279,
670,
3649,
364,
1624,
9795,
5161,
5,
1623,
1492,
3302,
1404,
5615,
468,
2446,
383,
8421,
364,
1241,
316,
2707... |
version = "0.51", | version = "0.52", | def create_batch_file(self, directory, data, filename): filename = os.path.join(directory, filename) # write the batch file util.execute(write_file, (filename, data), "creating %s" % filename, self.verbose>=1, self.dry_run) | afddd5dd8a0038b1afbf3aecb72e9530ebec3b27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/afddd5dd8a0038b1afbf3aecb72e9530ebec3b27/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
5303,
67,
768,
12,
2890,
16,
1867,
16,
501,
16,
1544,
4672,
1544,
273,
1140,
18,
803,
18,
5701,
12,
5149,
16,
1544,
13,
468,
1045,
326,
2581,
585,
1709,
18,
8837,
12,
2626,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
5303,
67,
768,
12,
2890,
16,
1867,
16,
501,
16,
1544,
4672,
1544,
273,
1140,
18,
803,
18,
5701,
12,
5149,
16,
1544,
13,
468,
1045,
326,
2581,
585,
1709,
18,
8837,
12,
2626,
... |
for source in sources: (base, ext) = os.path.splitext(source) if ext == ".i": new_sources.append(base + target_ext) swig_sources.append(source) swig_targets[source] = new_sources[-1] | if self.swig_cpp: target_ext = '.cpp' | def swig_sources (self, sources): """Walk the list of source files in 'sources', looking for SWIG interface (.i) files. Run SWIG on all that are found, and return a modified 'sources' list with SWIG source files replaced by the generated C (or C++) files. """ new_sources = [] swig_sources = [] swig_targets = {} # XXX this drops generated C/C++ files into the source tree, which # is fine for developers who want to distribute the generated # source -- but there should be an option to put SWIG output in # the temp dir. if self.swig_cpp: target_ext = '.cpp' else: target_ext = '.c' for source in sources: (base, ext) = os.path.splitext(source) if ext == ".i": # SWIG interface file new_sources.append(base + target_ext) swig_sources.append(source) swig_targets[source] = new_sources[-1] else: new_sources.append(source) if not swig_sources: return new_sources swig = self.find_swig() swig_cmd = [swig, "-python", "-ISWIG"] if self.swig_cpp: swig_cmd.append("-c++") for source in swig_sources: target = swig_targets[source] self.announce("swigging %s to %s" % (source, target)) self.spawn(swig_cmd + ["-o", target, source]) return new_sources | 792d215f022fc86e5b15c34c904b2f0ac7c51fb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10522/792d215f022fc86e5b15c34c904b2f0ac7c51fb7/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1352,
360,
67,
10141,
261,
2890,
16,
5550,
4672,
225,
3536,
9463,
326,
666,
434,
1084,
1390,
316,
296,
10141,
2187,
7849,
364,
16392,
3047,
1560,
261,
18,
77,
13,
1390,
18,
225,
1939,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1352,
360,
67,
10141,
261,
2890,
16,
5550,
4672,
225,
3536,
9463,
326,
666,
434,
1084,
1390,
316,
296,
10141,
2187,
7849,
364,
16392,
3047,
1560,
261,
18,
77,
13,
1390,
18,
225,
1939,
... |
i = s.find('\n') if i == -1: return True, '' j = s.find(' ') if j == -1: j = i else: j = min(i,j) sys = s[1:j] s = s[i+1:] cmd = self._eval_cmd(sys, s, os.path.abspath(C.directory())) if sys == 'html': | system = first_word(s)[1:] code_to_eval = after_first_word(s) cmd = self._eval_cmd(system, code_to_eval, os.path.abspath(C.directory())) if system == 'html': | def check_for_system_switching(self, s, C): r""" Check for input cells that start with \code{\%foo}, where \var{foo} is an object with an eval method. """ z = s s = s.lstrip() S = self.system() if S != 'sage': if s.startswith('%sage'): s = after_first_word(s).lstrip() z = s else: return True, self._eval_cmd(S, s, os.path.abspath(C.directory())) if len(s) == 0 or s[0] != '%': return False, z if s.startswith('%hide'): t = after_first_word(s).lstrip() if len(t) == 0 or t[0] != '%': return False, t s = t if s.startswith('%save_server'): self.notebook().save() t = after_first_word(s).lstrip() if len(t) == 0 or t[0] != '%': return False, t s = t if s.startswith("%cython") or s.startswith("%pyrex") or s.startswith("%sagex"): # a block of Cython code. return True, self.cython_import(after_first_word(s).lstrip(), C) i = s.find('\n') if i == -1: # nothing to evaluate return True, '' j = s.find(' ') if j == -1: j = i else: j = min(i,j) sys = s[1:j] s = s[i+1:] cmd = self._eval_cmd(sys, s, os.path.abspath(C.directory())) if sys == 'html': C.set_is_html(True) return True, cmd | baf616d8dc7a45699b894b80f8fae8ee4143f33e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/baf616d8dc7a45699b894b80f8fae8ee4143f33e/worksheet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1884,
67,
4299,
67,
9610,
310,
12,
2890,
16,
272,
16,
385,
4672,
436,
8395,
2073,
364,
810,
5983,
716,
787,
598,
521,
710,
23241,
9,
11351,
5779,
1625,
521,
1401,
95,
11351,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1884,
67,
4299,
67,
9610,
310,
12,
2890,
16,
272,
16,
385,
4672,
436,
8395,
2073,
364,
810,
5983,
716,
787,
598,
521,
710,
23241,
9,
11351,
5779,
1625,
521,
1401,
95,
11351,
... |
sage: st = g.steiner_tree(g.vertices()[:5]) sage: st.is_tree() | sage: st = g.steiner_tree(g.vertices()[:5]) sage: st.is_tree() | def steiner_tree(self,vertices, weighted = False): r""" Returns a tree of minimum weight connecting the given set of vertices. | ab8938ee4489ea4b0bde5a6b5927cff64d96a7b6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/ab8938ee4489ea4b0bde5a6b5927cff64d96a7b6/generic_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
384,
13685,
264,
67,
3413,
12,
2890,
16,
17476,
16,
13747,
273,
1083,
4672,
436,
8395,
2860,
279,
2151,
434,
5224,
3119,
14244,
326,
864,
444,
434,
6928,
18,
2,
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,
384,
13685,
264,
67,
3413,
12,
2890,
16,
17476,
16,
13747,
273,
1083,
4672,
436,
8395,
2860,
279,
2151,
434,
5224,
3119,
14244,
326,
864,
444,
434,
6928,
18,
2,
-100,
-100,
-100,
-100,
... |
for item in selection: | for item in paused: | def resume_all(): for item in selection: messages.ResumeDownload(item.id).send_to_backend() | 841888bd2d8fb6b7cd9bf7de6ed4a4a6328edb5c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/841888bd2d8fb6b7cd9bf7de6ed4a4a6328edb5c/itemcontextmenu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10774,
67,
454,
13332,
364,
761,
316,
17781,
30,
2743,
18,
20911,
7109,
12,
1726,
18,
350,
2934,
4661,
67,
869,
67,
9993,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10774,
67,
454,
13332,
364,
761,
316,
17781,
30,
2743,
18,
20911,
7109,
12,
1726,
18,
350,
2934,
4661,
67,
869,
67,
9993,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
Return a connection string url needed by SQL Alchemy. Exemple: 'postgres://scott:tiger@localhost:5432/mydatabase' @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of connection’s IDs @param context: A standard dictionary for contextual values | Return a connection string url needed by SQL Alchemy. Exemple: 'postgres://scott:tiger@localhost:5432/mydatabase' @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of connection’s IDs @param context: A standard dictionary for contextual values | def _connection_get(self, cr, uid, ids, field_name, arg, context = {}): """ Return a connection string url needed by SQL Alchemy. Exemple: 'postgres://scott:tiger@localhost:5432/mydatabase' @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of connection’s IDs @param context: A standard dictionary for contextual values | 1dc268e357fe6ce10746aa6f778e8fad1db095de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1dc268e357fe6ce10746aa6f778e8fad1db095de/olap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4071,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
529,
16,
1501,
16,
819,
273,
2618,
4672,
3536,
2000,
279,
1459,
533,
880,
3577,
635,
3063,
2262,
17192,
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,
389,
4071,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
529,
16,
1501,
16,
819,
273,
2618,
4672,
3536,
2000,
279,
1459,
533,
880,
3577,
635,
3063,
2262,
17192,
18,
1... |
self.Freeze() | self.list.Freeze() | def resetList(self, msg=None, sort=False): """Wrapper around ListMode.resetList because we need to do a few more things. """ if self.updating: # don't process if we're currently updating the list dprint("skipping an update while we're in the middle of an execute") return self.origDataMap = {} self.Freeze() ListMode.resetList(self, msg) if sort: self.SortListItems() self.Thaw() | fd53a03098c59b1da9ce45ef779063e765b70798 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11522/fd53a03098c59b1da9ce45ef779063e765b70798/dired.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
682,
12,
2890,
16,
1234,
33,
7036,
16,
1524,
33,
8381,
4672,
3536,
3611,
6740,
987,
2309,
18,
6208,
682,
2724,
732,
1608,
358,
741,
279,
11315,
1898,
9198,
18,
3536,
309,
365,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
682,
12,
2890,
16,
1234,
33,
7036,
16,
1524,
33,
8381,
4672,
3536,
3611,
6740,
987,
2309,
18,
6208,
682,
2724,
732,
1608,
358,
741,
279,
11315,
1898,
9198,
18,
3536,
309,
365,
18... |
filesNeeded += [ (x[0], troveName, | filesNeeded.update( ( (x[0], troveName, | def _getCsFromShim(target, cs, server, job, recurse, withFiles, withFileContents, excludeAutoSource, filesNeeded, chgSetList, removedList): (newCs, extraTroveList, extraFileList, removedList) = \ server.getChangeSetObj(job, recurse, withFiles, withFileContents, excludeAutoSource) if not cs: cs = newCs else: cs.merge(newCs) return cs, extraTroveList, extraFileList | 295cc050fcc97e7532a834f85d7fb639ea665ba4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/295cc050fcc97e7532a834f85d7fb639ea665ba4/netclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
14272,
1265,
1555,
381,
12,
3299,
16,
2873,
16,
1438,
16,
1719,
16,
11502,
16,
598,
2697,
16,
598,
812,
6323,
16,
4433,
4965,
1830,
16,
1390,
11449,
16,
462,
75,
694,
682,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
14272,
1265,
1555,
381,
12,
3299,
16,
2873,
16,
1438,
16,
1719,
16,
11502,
16,
598,
2697,
16,
598,
812,
6323,
16,
4433,
4965,
1830,
16,
1390,
11449,
16,
462,
75,
694,
682,
... |
if not os.path.exists (os.path.join(extModuleDir, "sources-" + version + ".tar.gz")): | sourceTarball = os.path.join(extModuleDir, "sources-" + version + ".tar.gz") log.write("Checking for source tarball " + sourceTarball) if not os.path.exists(sourceTarball) : | def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log): # make sure workingDir is absolute, remove it, and create it workingDir = os.path.abspath(workingDir) if not os.path.exists(workingDir): os.mkdir(workingDir) os.chdir(workingDir) # remove outputDir and create it outputDir = os.path.join(workingDir, "output") if os.path.exists(outputDir): hardhatutil.rmdirRecursive(outputDir) os.mkdir(outputDir) # Initialize external (hardly ever changes) print "Initializing external modules ..." log.write("- - - - external - - - - - - -\n") # not needed here? moduleData["external"] = {} # Do external setup for both debug and release here for releaseMode in ('debug', 'release'): releaseModeDir = os.path.join(workingDir, releaseMode) os.chdir(releaseModeDir) if releaseMode == "debug": dbgStr = "DEBUG=1" relStr = "debug" else: dbgStr = "" relStr = "release" # Find out if the initialization was ever done try: extModuleDir = os.path.join(releaseModeDir, "external") intModuleDir = os.path.join(releaseModeDir, "internal") version = getVersion(os.path.join(extModuleDir, "Makefile")) if not os.path.exists (os.path.join(extModuleDir, "sources-" + version + ".tar.gz")): print "checking out external" log.write("Checking out: external with " + cvsVintage + "\n") outputList = hardhatutil.executeCommandReturnOutputRetry( [cvsProgram, "-q", "checkout", cvsVintage, "external"]) hardhatutil.dumpOutputList(outputList, log) print "checking out internal" log.write("Checking out: internal with " + cvsVintage + "\n") outputList = hardhatutil.executeCommandReturnOutputRetry( [cvsProgram, "-q", "checkout", cvsVintage, "internal"]) hardhatutil.dumpOutputList(outputList, log) # Now need to do the setup for external - "expand" and "make" os.chdir(extModuleDir) os.putenv("BUILD_ROOT", os.path.join(outputDir, "debug", "external") ) print "Building " + relStr log.write("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n") log.write("Expanding external sources\n") outputList = hardhatutil.executeCommandReturnOutput( ['make', "expand" ]) hardhatutil.dumpOutputList(outputList, log) outputList = hardhatutil.executeCommandReturnOutput( [buildenv['make'], dbgStr ]) hardhatutil.dumpOutputList(outputList, log) log.write("Making external (debug) binaries\n") outputList = hardhatutil.executeCommandReturnOutput( [buildenv['make'], dbgStr, "binaries" ]) hardhatutil.dumpOutputList(outputList, log) os.chdir(intModuleDir) log.write("Making internal (debug) programs\n") outputList = hardhatutil.executeCommandReturnOutput( [buildenv['make'], dbgStr ]) hardhatutil.dumpOutputList(outputList, log) log.write("Making internal (debug) binaries\n") outputList = hardhatutil.executeCommandReturnOutput( [buildenv['make'], dbgStr, "binaries" ]) hardhatutil.dumpOutputList(outputList, log) except Exception, e: print "an initialization error" log.write("***Error during initialization***" + "\n") log.write("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n") log.write("initialization log:" + "\n") CopyLog(os.path.join(releaseModeDir, logPath), log) log.write("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n") return "init_failed" # do debug ret = Do(hardhatScript, "debug", workingDir, outputDir, cvsVintage, buildVersion, clobber, log) if ret == "no_changes" or ret =="build_failed" or ret == "test_failed": modeDir = os.path.join(workingDir, "debug") CopyLog(os.path.join(modeDir, logPath), log) pass # return ret # do release ret = Do(hardhatScript, "release", workingDir, outputDir, cvsVintage, buildVersion, clobber, log) modeDir = os.path.join(workingDir, "release") CopyLog(os.path.join(modeDir, logPath), log) return ret | b800f8c58d07d3194bffd6b37d8c5caa6d3b2fba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/b800f8c58d07d3194bffd6b37d8c5caa6d3b2fba/chandler-newbuild.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3603,
12,
20379,
11304,
3651,
16,
5960,
1621,
16,
276,
6904,
58,
474,
410,
16,
1361,
1444,
16,
30152,
16,
613,
4672,
225,
468,
1221,
3071,
5960,
1621,
353,
4967,
16,
1206,
518,
16,
471... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3603,
12,
20379,
11304,
3651,
16,
5960,
1621,
16,
276,
6904,
58,
474,
410,
16,
1361,
1444,
16,
30152,
16,
613,
4672,
225,
468,
1221,
3071,
5960,
1621,
353,
4967,
16,
1206,
518,
16,
471... |
sub = SubRootController() | def index(self): return '/sub' | 9cd414fa9668a1c6ab1c97185d4460814cdd87c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3117/9cd414fa9668a1c6ab1c97185d4460814cdd87c5/test_validation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
12,
2890,
4672,
327,
1173,
1717,
11,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
770,
12,
2890,
4672,
327,
1173,
1717,
11,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
class Attribute(Content): | class Attribute(TypedContent): | def description(self): """ Get the names used for str() and repr() description. @return: A dictionary of relavent attributes. @rtype: [str,...] """ return ('ns', 'location') | 338ad04d0a263c7a6148ef6a08d7bcf27388c257 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5930/338ad04d0a263c7a6148ef6a08d7bcf27388c257/sxbasic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2477,
12,
2890,
4672,
3536,
968,
326,
1257,
1399,
364,
609,
1435,
471,
8480,
1435,
2477,
18,
632,
2463,
30,
225,
432,
3880,
434,
1279,
69,
616,
1677,
18,
632,
86,
723,
30,
306,
701,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2477,
12,
2890,
4672,
3536,
968,
326,
1257,
1399,
364,
609,
1435,
471,
8480,
1435,
2477,
18,
632,
2463,
30,
225,
432,
3880,
434,
1279,
69,
616,
1677,
18,
632,
86,
723,
30,
306,
701,
... |
pass | webbrowser.open(link) | def url(dialog, link, data=None): pass | d424f4badedea026e86b750a7af75c76e8fe8c34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1563/d424f4badedea026e86b750a7af75c76e8fe8c34/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
880,
12,
12730,
16,
1692,
16,
501,
33,
7036,
4672,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
880,
12,
12730,
16,
1692,
16,
501,
33,
7036,
4672,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
tf = None | g = None | def fix(filename): | b84614f43186fc92896afc304f85cdb7961cf46b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b84614f43186fc92896afc304f85cdb7961cf46b/classfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
12,
3459,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
12,
3459,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.firstEvent = self.overrideFirstEvent | self.firstEvent = self.overrideFirstEvent eventsLeft -= self.eventsPerJob | def __call__(self): """ _operator()_ | 74dbb745ed3f1e26b8a12386e34be04dac7ecdca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/74dbb745ed3f1e26b8a12386e34be04dac7ecdca/RequestJobFactory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
4672,
3536,
389,
9497,
1435,
67,
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,
1001,
1991,
972,
12,
2890,
4672,
3536,
389,
9497,
1435,
67,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
return 10**(-5) | return 10 ** ( -5 ) | def __hackJobPriority( self, jobPriority ): jobPriority = min( max( int( jobPriority ), self.__jobPriorityBoundaries[0] ), self.__jobPriorityBoundaries[1] ) if jobPriority == self.__jobPriorityBoundaries[0]: return 10**(-5) if jobPriority == self.__jobPriorityBoundaries[1]: return 10**6 return jobPriority | a733eda307fd1b6e03d6d8f0aee8c9c601eac082 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/a733eda307fd1b6e03d6d8f0aee8c9c601eac082/TaskQueueDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
76,
484,
2278,
8183,
12,
365,
16,
1719,
8183,
262,
30,
1719,
8183,
273,
1131,
12,
943,
12,
509,
12,
1719,
8183,
262,
16,
365,
16186,
4688,
8183,
30657,
63,
20,
65,
262,
16,
365... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
76,
484,
2278,
8183,
12,
365,
16,
1719,
8183,
262,
30,
1719,
8183,
273,
1131,
12,
943,
12,
509,
12,
1719,
8183,
262,
16,
365,
16186,
4688,
8183,
30657,
63,
20,
65,
262,
16,
365... |
blocked = False if self.versionnumber() >= 11: if self._userData[index]: blocked = self._isBlocked[index] else: blocked = self.isBlocked(sysop = sysop) else: pass if blocked and not self._isBlocked[index]: if sysop: account = 'Your sysop account' else: account = 'Your account' output(u'WARNING: %s on %s is blocked. Editing using this account will stop the run.' % (account, self)) self._isBlocked[index] = blocked | if self.versionnumber() >= 11 and not self._userData[index]: blocked = self.isBlocked(sysop = sysop) if blocked and not self._isBlocked[index]: if sysop: account = 'Your sysop account' else: account = 'Your account' output(u'WARNING: %s on %s is blocked. Editing using this account will stop the run.' % (account, self)) self._isBlocked[index] = blocked | def _getUserData(self, text, sysop = False): """ Get the user data from a wiki page data. | 118ffed80c581b8740251f3c65f783dded20c823 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/118ffed80c581b8740251f3c65f783dded20c823/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
19265,
12,
2890,
16,
977,
16,
2589,
556,
273,
1083,
4672,
3536,
968,
326,
729,
501,
628,
279,
9050,
1363,
501,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
19265,
12,
2890,
16,
977,
16,
2589,
556,
273,
1083,
4672,
3536,
968,
326,
729,
501,
628,
279,
9050,
1363,
501,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
op1 = list(self._int) op2 = list(other._int) op1.reverse() op2.reverse() if len(op2) > len(op1): op1, op2 = op2, op1 _divmod = divmod accumulator = [0]*(len(self._int) + len(other._int)) for i in xrange(len(op2)): if op2[i] == 0: continue mult = op2[i] carry = 0 for j in xrange(len(op1)): carry, accumulator[i+j] = _divmod( mult * op1[j] + carry + accumulator[i+j], 10) if carry: accumulator[i + j + 1] += carry while not accumulator[-1]: accumulator.pop() accumulator.reverse() ans = Decimal( (resultsign, accumulator, resultexp)) | op1 = _WorkRep(self) op2 = _WorkRep(other) ans = Decimal( (resultsign, map(int, str(op1.int * op2.int)), resultexp)) | def __mul__(self, other, context=None): """Return self * other. | 55342e783760513207a56d5a31fa49e579a96cd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/55342e783760513207a56d5a31fa49e579a96cd3/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16411,
972,
12,
2890,
16,
1308,
16,
819,
33,
7036,
4672,
3536,
990,
365,
380,
1308,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16411,
972,
12,
2890,
16,
1308,
16,
819,
33,
7036,
4672,
3536,
990,
365,
380,
1308,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if __debug__: print "cancel scheduled recolorizer" | if DEBUG: print "cancel scheduled recolorizer" | def toggle_colorize_event(self, event): if self.after_id: after_id = self.after_id self.after_id = None if __debug__: print "cancel scheduled recolorizer" self.after_cancel(after_id) if self.allow_colorizing and self.colorizing: if __debug__: print "stop colorizing" self.stop_colorizing = 1 self.allow_colorizing = not self.allow_colorizing if self.allow_colorizing and not self.colorizing: self.after_id = self.after(1, self.recolorize) if __debug__: print "auto colorizing turned", self.allow_colorizing and "on" or "off" return "break" | 96348e6d241363b9e73c5d75af2b60a10b08b93e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/96348e6d241363b9e73c5d75af2b60a10b08b93e/ColorDelegator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10486,
67,
3266,
554,
67,
2575,
12,
2890,
16,
871,
4672,
309,
365,
18,
5205,
67,
350,
30,
1839,
67,
350,
273,
365,
18,
5205,
67,
350,
365,
18,
5205,
67,
350,
273,
599,
309,
6369,
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,
10486,
67,
3266,
554,
67,
2575,
12,
2890,
16,
871,
4672,
309,
365,
18,
5205,
67,
350,
30,
1839,
67,
350,
273,
365,
18,
5205,
67,
350,
365,
18,
5205,
67,
350,
273,
599,
309,
6369,
3... |
<Timetable: ('C', 'D'), ...>, | def doctest_findRelatedTimetables_forSchoolTimetables(): """Tests for findRelatedTimetables() with school timetables >>> from schooltool.app.interfaces import ISchoolToolApplication >>> app = ISchoolToolApplication(None) >>> directlyProvides(app, IOwnTimetables) Let's creare a schoolyear and a couple of terms: >>> from schooltool.schoolyear.schoolyear import SchoolYear >>> from schooltool.schoolyear.interfaces import ISchoolYearContainer >>> schoolyears = ISchoolYearContainer(app) >>> schoolyears['2005-2006'] = SchoolYear("2005-2006", ... date(2005, 1, 1), ... date(2006, 12, 31)) >>> from schooltool.term.interfaces import ITermContainer >>> from schooltool.term.term import Term >>> t1 = ITermContainer(app)['2005'] = Term('2005', date(2005, 1, 1), ... date(2005, 12, 31)) >>> t2 = ITermContainer(app)['2006'] = Term('2006', date(2006, 1, 1), ... date(2006, 12, 31)) and a timetable schema: >>> from schooltool.timetable.schema import TimetableSchema >>> from schooltool.timetable.schema import TimetableSchemaDay >>> days = ('A', 'B') >>> periods1 = ('Green', 'Blue') >>> tts = TimetableSchema(days, model=makeTimetableModel()) >>> tts["A"] = TimetableSchemaDay(periods1) >>> tts["B"] = TimetableSchemaDay(periods1) >>> days = ('C', 'D') >>> tts2 = TimetableSchema(days, model=makeTimetableModel()) >>> tts2["C"] = TimetableSchemaDay(periods1) >>> tts2["D"] = TimetableSchemaDay(periods1) >>> ITimetableSchemaContainer(app)['simple'] = tts >>> ITimetableSchemaContainer(app)['other'] = tts2 Now we can call our utility function. Since our schema is not used, an empty list is returned: >>> from schooltool.timetable import findRelatedTimetables >>> findRelatedTimetables(tts) [] Let's add a timetable to the app object: >>> ITimetables(app).timetables['2006.simple'] = tts.createTimetable(t1) >>> findRelatedTimetables(tts) [<Timetable: ('A', 'B'), {'A': <schooltool.timetable.TimetableDay object at ...>, 'B': <schooltool.timetable.TimetableDay object at ...>}, <schooltool.timetable.model.WeeklyTimetableModel object at ...>] Now, let's add a timetable of a different schema: >>> ITimetables(app).timetables['2006.other'] = tts2.createTimetable(t1) >>> findRelatedTimetables(tts) [<Timetable: ('A', 'B'), {'A': <schooltool.timetable.TimetableDay object at ...>, 'B': <schooltool.timetable.TimetableDay object at ...>}, <schooltool.timetable.model.WeeklyTimetableModel object at ...>] Let's add some persons, groups and resources with timetables: >>> from schooltool.person.person import Person >>> from schooltool.group.group import Group >>> from schooltool.resource.resource import Resource >>> app['persons']['p1'] = Person('p1') >>> app['persons']['p2'] = Person('p2') >>> IGroupContainer(app)['g'] = Group('friends') >>> app['resources']['r'] = Resource('friends') >>> for ob in (app['persons']['p1'], app['persons']['p2'], ... IGroupContainer(app)['g'], app['resources']['r']): ... directlyProvides(ob, IOwnTimetables) >>> adapter = ITimetables(app['persons']['p1']) >>> adapter.timetables['2006.simple'] = tts.createTimetable(t2) >>> adapter.timetables['2005.simple'] = tts.createTimetable(t1) >>> adapter.timetables['2006.other'] = tts2.createTimetable(t2) >>> adapter = ITimetables(app['persons']['p2']) >>> adapter.timetables['2006.simple'] = tts.createTimetable(t2) >>> adapter = ITimetables(IGroupContainer(app)['g']) >>> adapter.timetables['2006.simple'] = tts.createTimetable(t2) >>> adapter.timetables['2006.other'] = tts2.createTimetable(t2) >>> adapter = ITimetables(app['resources']['r']) >>> adapter.timetables['2006.simple'] = tts.createTimetable(t2) Let's see the timetables for this schema now: >>> findRelatedTimetables(tts) [<Timetable: ('A', 'B'), ...>, <Timetable: ('A', 'B'), ...>, <Timetable: ('A', 'B'), ...>, <Timetable: ('A', 'B'), ...>, <Timetable: ('A', 'B'), ...>, <Timetable: ('A', 'B'), ...>] >>> [(tt.__parent__.__parent__.__name__, tt.__name__) ... for tt in findRelatedTimetables(tts)] [(None, '2006.simple'), (u'p1', '2006.simple'), (u'p1', '2005.simple'), (u'p2', '2006.simple'), (u'g', '2006.simple'), (u'r', '2006.simple')] Let's see the timetables of the other schema: >>> findRelatedTimetables(tts2) [<Timetable: ('C', 'D'), ...>, <Timetable: ('C', 'D'), ...>, <Timetable: ('C', 'D'), ...>] >>> [(tt.__parent__.__parent__.__name__, tt.__name__) ... for tt in findRelatedTimetables(tts2)] [(None, '2006.other'), (u'p1', '2006.other'), (u'g', '2006.other')] """ | 5327ab07ac6b37626f0e915d61c2f9b2129a747d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7127/5327ab07ac6b37626f0e915d61c2f9b2129a747d/test_timetable.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31263,
395,
67,
4720,
8017,
10178,
278,
1538,
67,
1884,
55,
343,
1371,
10178,
278,
1538,
13332,
3536,
14650,
364,
1104,
8017,
10178,
278,
1538,
1435,
598,
18551,
1371,
26668,
1538,
225,
40... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31263,
395,
67,
4720,
8017,
10178,
278,
1538,
67,
1884,
55,
343,
1371,
10178,
278,
1538,
13332,
3536,
14650,
364,
1104,
8017,
10178,
278,
1538,
1435,
598,
18551,
1371,
26668,
1538,
225,
40... | |
r""" Sloane's A000016 INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A000016; a Sloane's A000016. sage: a(1) 1 sage: a(0) 1 sage: a(8) 16 sage: a(75) 251859545753048193000 sage: a(-4) Traceback (most recent call last): ... ValueError: input n (=-4) must be an integer >= 0 sage: a.list(12) [1, 1, 1, 2, 2, 4, 6, 10, 16, 30, 52, 94] AUTHOR: -- Jaap Spies (2007-01-18) """ def __init__(self): | def __init__(self): r""" Sloane's A000016 INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A000016; a Sloane's A000016. sage: a(1) 1 sage: a(0) 1 sage: a(8) 16 sage: a(75) 251859545753048193000 sage: a(-4) Traceback (most recent call last): ... ValueError: input n (=-4) must be an integer >= 0 sage: a.list(12) [1, 1, 1, 2, 2, 4, 6, 10, 16, 30, 52, 94] AUTHOR: -- Jaap Spies (2007-01-18) """ | def _eval(self, n): if arith.is_prime_power(n): return n else: return arith.next_prime_power(n) | d2510d4232e17c9cea8d1a0271c6be68a81d317b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/d2510d4232e17c9cea8d1a0271c6be68a81d317b/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8622,
12,
2890,
16,
290,
4672,
309,
419,
483,
18,
291,
67,
16382,
67,
12238,
12,
82,
4672,
327,
290,
469,
30,
327,
419,
483,
18,
4285,
67,
16382,
67,
12238,
12,
82,
13,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8622,
12,
2890,
16,
290,
4672,
309,
419,
483,
18,
291,
67,
16382,
67,
12238,
12,
82,
4672,
327,
290,
469,
30,
327,
419,
483,
18,
4285,
67,
16382,
67,
12238,
12,
82,
13,
2,
-10... |
<span class="options">[<a href="javascript: void(0);" class="privatelink" | <span class="options">[<a href="javascript:void(0);" class="privatelink" | def _term_index_to_anchor(self, term): """ Given the name of an inline index item, construct a URI anchor. These anchors are used to create links from the index page to each index item. """ # Include "-" so we don't accidentally collide with the name # of a python identifier. s = re.sub(r'\s\s+', '-', term.to_plaintext(None)) return "index-"+re.sub("[^a-zA-Z0-9]", "_", s) | 22df3c34132fac2617a8cedb6f57b1134306f1a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/22df3c34132fac2617a8cedb6f57b1134306f1a5/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6408,
67,
1615,
67,
869,
67,
16215,
12,
2890,
16,
2481,
4672,
3536,
16803,
326,
508,
434,
392,
6370,
770,
761,
16,
4872,
279,
3699,
6984,
18,
8646,
22941,
854,
1399,
358,
752,
471... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6408,
67,
1615,
67,
869,
67,
16215,
12,
2890,
16,
2481,
4672,
3536,
16803,
326,
508,
434,
392,
6370,
770,
761,
16,
4872,
279,
3699,
6984,
18,
8646,
22941,
854,
1399,
358,
752,
471... |
cmdtable[alias] = (aliasdef, aliasdef.opts, aliasdef.help) | cmdtable[aliasdef.cmd] = (aliasdef, aliasdef.opts, aliasdef.help) | aliasdef = cmdalias(alias, definition, cmdtable) | 610ef1cf73c28c5642dc504665609217804f7b5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/610ef1cf73c28c5642dc504665609217804f7b5b/dispatch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
2308,
536,
273,
1797,
4930,
12,
4930,
16,
2379,
16,
1797,
2121,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
2308,
536,
273,
1797,
4930,
12,
4930,
16,
2379,
16,
1797,
2121,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
paths = {} for name, path in ui.configitems("paths"): paths[name] = path if source in paths: source = paths[source] link = 0 if not source.startswith("http://"): d1 = os.stat(os.getcwd()).st_dev d2 = os.stat(source).st_dev if d1 == d2: link = 1 if link: ui.debug("copying by hardlink\n") os.system("cp -al %s/.hg .hg" % source) try: os.remove(".hg/dirstate") except: pass repo = hg.repository(ui, ".") else: repo = hg.repository(ui, ".", create=1) other = hg.repository(ui, source) cg = repo.getchangegroup(other) repo.addchangegroup(cg) f = repo.opener("hgrc", "w") f.write("[paths]\n") f.write("default = %s\n" % source) if opts['update']: update(ui, repo) | ui.warn("this use of init is deprecated: use \"hg clone\" instead\n") opts['no-update'] = not opts['update'] clone(ui, source, None, **opts) | def init(ui, source=None, **opts): """create a new repository or copy an existing one""" if source: paths = {} for name, path in ui.configitems("paths"): paths[name] = path if source in paths: source = paths[source] link = 0 if not source.startswith("http://"): d1 = os.stat(os.getcwd()).st_dev d2 = os.stat(source).st_dev if d1 == d2: link = 1 if link: ui.debug("copying by hardlink\n") os.system("cp -al %s/.hg .hg" % source) try: os.remove(".hg/dirstate") except: pass repo = hg.repository(ui, ".") else: repo = hg.repository(ui, ".", create=1) other = hg.repository(ui, source) cg = repo.getchangegroup(other) repo.addchangegroup(cg) f = repo.opener("hgrc", "w") f.write("[paths]\n") f.write("default = %s\n" % source) if opts['update']: update(ui, repo) else: repo = hg.repository(ui, ".", create=1) | 66017adc3729a7ac17f7407484deddbb12301315 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/66017adc3729a7ac17f7407484deddbb12301315/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
4881,
16,
1084,
33,
7036,
16,
2826,
4952,
4672,
3536,
2640,
279,
394,
3352,
578,
1610,
392,
2062,
1245,
8395,
225,
309,
1084,
30,
5915,
18,
8935,
2932,
2211,
999,
434,
1208,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
4881,
16,
1084,
33,
7036,
16,
2826,
4952,
4672,
3536,
2640,
279,
394,
3352,
578,
1610,
392,
2062,
1245,
8395,
225,
309,
1084,
30,
5915,
18,
8935,
2932,
2211,
999,
434,
1208,
... |
coords = evt.get_coords() path, c, x, y = tv.get_path_at_pos(int(coords[0]), int(coords[1])) | (_, event_x, event_y) = evt.get_coords() path, c, x, y = tv.get_path_at_pos(int(event_x), int(event_y)) | def on_treeview_row_clicked(self, tv, evt): """ Called when the user clicked on a treeview element. """ try: if evt.button == 3: path = tv.get_path_at_pos(int(evt.x), int(evt.y)) sel = tv.get_selection() (rows, _) = sel.get_selected_rows() if path[0] not in rows[1]: sel.unselect_all() sel.select_path(path[0]) tv.grab_focus() self.popup.popup(None, None, None, evt.button, evt.time) return True coords = evt.get_coords() path, c, x, y = tv.get_path_at_pos(int(coords[0]), int(coords[1])) if (path.get_depth() == 1): if tv.row_expanded(path): tv.collapse_row(path) else: tv.expand_row(path, False) self.album_button.set_sensitive(True) except: pass | 23dcebe216890665c4e48f0517fadbf00f85273d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11070/23dcebe216890665c4e48f0517fadbf00f85273d/jamendo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
3413,
1945,
67,
492,
67,
7475,
329,
12,
2890,
16,
13521,
16,
6324,
4672,
3536,
11782,
1347,
326,
729,
17688,
603,
279,
2151,
1945,
930,
18,
3536,
775,
30,
309,
6324,
18,
5391,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3413,
1945,
67,
492,
67,
7475,
329,
12,
2890,
16,
13521,
16,
6324,
4672,
3536,
11782,
1347,
326,
729,
17688,
603,
279,
2151,
1945,
930,
18,
3536,
775,
30,
309,
6324,
18,
5391,... |
cannot_set_attr(self.f.a, "im_class", self.f, TypeError) cannot_set_attr(self.fi.a, "im_class", self.f, TypeError) | self.cannot_set_attr(self.f.a, "im_class", self.f, TypeError) self.cannot_set_attr(self.fi.a, "im_class", self.f, TypeError) | def test_im_class(self): self.assertEqual(self.f.a.im_class, self.f) self.assertEqual(self.fi.a.im_class, self.f) cannot_set_attr(self.f.a, "im_class", self.f, TypeError) cannot_set_attr(self.fi.a, "im_class", self.f, TypeError) | 83eab6910e0145bc66eaf399de3570146bc6a09d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/83eab6910e0145bc66eaf399de3570146bc6a09d/test_funcattrs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
381,
67,
1106,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
2890,
18,
74,
18,
69,
18,
381,
67,
1106,
16,
365,
18,
74,
13,
365,
18,
11231,
5812,
12,
2890,
18,
22056,
18,
69,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
381,
67,
1106,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
2890,
18,
74,
18,
69,
18,
381,
67,
1106,
16,
365,
18,
74,
13,
365,
18,
11231,
5812,
12,
2890,
18,
22056,
18,
69,
... |
output of shape: image_shape - filter_shape + 1 | output of shape: image_shape - filter_shape + 1 | def conv2d(input, filters, image_shape=None, filter_shape=None, border_mode='valid', subsample=(1,1), **kargs): """ This function will build the symbolic graph for convolving a stack of input images with a set of filters. The implementation is modelled after Convolutional Neural Networks (CNN). It is simply a wrapper to the ConvOp but provides a much cleaner interface. :type input: symbolic 4D tensor :param input: mini-batch of feature map stacks, of shape image_shape. :type filters: symbolic 4D tensor :param filters: set of filters used in CNN layer of shape filter_shape :param border_mode: 'valid'-- only apply filter to complete patches of the image. Generates output of shape: image_shape - filter_shape + 1 'full' -- zero-pads image to multiple of filter shape to generate output of shape: image_shape + filter_shape - 1 :type subsample: tuple of len 2 :param subsample: factor by which to subsample the output :type image_shape: tuple of len 4 of int or Contant variable :param image_shape: (batch size, stack size, nb row, nb col) Optional, used for optimization. :type filter_shape: tuple of len 4 of int or Contant variable :param filter_shape: (nb filters, stack size, nb row, nb col) Optional, used for optimization. :param kwargs: kwargs are passed onto ConvOp. Can be used to set the following: unroll_batch, unroll_kern, unroll_patch (see ConvOp doc) :rtype: symbolic 4D tensor :return: set of feature maps generated by convolutional layer. Tensor is of shape (batch size, nb filters, output row, output col) """ #accept Constant value for image_shape and filter_shape. if image_shape is not None: image_shape = list(image_shape) for i in range(len(image_shape)): if image_shape[i] is not None: image_shape[i] = tensor.get_constant_value(tensor.as_tensor_variable(image_shape[i])) assert str(image_shape[i].dtype).startswith('int') image_shape[i] = int(image_shape[i]) if filter_shape is not None: filter_shape = list(filter_shape) for i in range(len(filter_shape)): if filter_shape[i] is not None: filter_shape[i] = tensor.get_constant_value(tensor.as_tensor_variable(filter_shape[i])) assert str(filter_shape[i].dtype).startswith('int') filter_shape[i] = int(filter_shape[i]) if image_shape and filter_shape: try: assert image_shape[1]==filter_shape[1] except: print 'image ', image_shape, ' filters ', filter_shape raise if filter_shape is not None: nkern = filter_shape[0] kshp = filter_shape[2:] else: nkern, kshp = None, None if image_shape is not None: bsize = image_shape[0] imshp = image_shape[1:] else: bsize, imshp = None, None op = ConvOp(output_mode=border_mode, dx=subsample[0], dy=subsample[1], imshp=imshp, kshp=kshp, nkern=nkern, bsize=bsize,**kargs) return op(input, filters) | aaea1d322c657ba643c240526cb3f00d5d2d997d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/aaea1d322c657ba643c240526cb3f00d5d2d997d/conv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6292,
22,
72,
12,
2630,
16,
3415,
16,
1316,
67,
4867,
33,
7036,
16,
1034,
67,
4867,
33,
7036,
16,
5795,
67,
3188,
2218,
877,
2187,
720,
6358,
28657,
21,
16,
21,
3631,
2826,
79,
1968,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6292,
22,
72,
12,
2630,
16,
3415,
16,
1316,
67,
4867,
33,
7036,
16,
1034,
67,
4867,
33,
7036,
16,
5795,
67,
3188,
2218,
877,
2187,
720,
6358,
28657,
21,
16,
21,
3631,
2826,
79,
1968,... |
if new_behavior: self.assertResult((p.obsoletes_x86_64, p.requires_obsoletes)) else: self.assertResult((p.installed_x86_64, p.obsoletes_x86_64, p.requires_obsoletes)) | self.assertResult((p.obsoletes_x86_64, p.requires_obsoletes)) | def testObsoletex86_64ToMultiarchForDependency(self): p = self.pkgs res, msg = self.runOperation(['install', 'superzippy'], [p.installed_x86_64], [p.obsoletes_i386, p.obsoletes_x86_64, p.requires_obsoletes]) self.assert_(res=='ok', msg) if new_behavior: self.assertResult((p.obsoletes_x86_64, p.requires_obsoletes)) else: self.assertResult((p.installed_x86_64, p.obsoletes_x86_64, p.requires_obsoletes)) | 8e2a5f5410c9856fccd419757faf7f21560db8df /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5445/8e2a5f5410c9856fccd419757faf7f21560db8df/operationstests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
27637,
355,
278,
338,
5292,
67,
1105,
774,
5002,
991,
1290,
7787,
12,
2890,
4672,
293,
273,
365,
18,
25376,
400,
16,
1234,
273,
365,
18,
2681,
2988,
12,
3292,
5425,
2187,
296,
95... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
27637,
355,
278,
338,
5292,
67,
1105,
774,
5002,
991,
1290,
7787,
12,
2890,
4672,
293,
273,
365,
18,
25376,
400,
16,
1234,
273,
365,
18,
2681,
2988,
12,
3292,
5425,
2187,
296,
95... |
Returns the permutation corresponding to the pair of tableaux (p,q) using the inverse of Robinson-Schensted algorithm. | Returns the permutation corresponding to the pair of tableaux `(p,q)` using the inverse of Robinson-Schensted algorithm. | def robinson_schensted_inverse(p, q): r""" Returns the permutation corresponding to the pair of tableaux (p,q) using the inverse of Robinson-Schensted algorithm. INPUT: - a pair (p, q) of tableaux of the same shape and where q is standard. EXAMPLES:: sage: from sage.combinat.permutation import robinson_schensted_inverse sage: t1 = Tableau([[1, 2, 5], [3], [4]]) sage: t2 = Tableau([[1, 2, 3], [4], [5]]) sage: robinson_schensted_inverse(t1, t2) [1, 4, 5, 3, 2] sage: robinson_schensted_inverse(t1, t1) [1, 4, 3, 2, 5] sage: robinson_schensted_inverse(t2, t2) [1, 2, 5, 4, 3] sage: robinson_schensted_inverse(t2, t1) [1, 5, 4, 2, 3] If the first tableau is not standard, then it is not a bijection:: sage: p = Tableau([[1,3,2]]); q = Tableau([[1,2,3]]) sage: robinson_schensted_inverse(p, q) [1, 3, 2] sage: _.robinson_schensted() [[[1, 2], [3]], [[1, 2], [3]]] sage: robinson_schensted_inverse(*_) [1, 3, 2] If the first tableau is semistandard:: sage: p = Tableau([[1,2,2]]); q = Tableau([[1,2,3]]) sage: robinson_schensted_inverse(p, q) [1, 2, 2] sage: _.robinson_schensted() [[[1, 2, 2]], [[1, 2, 3]]] TESTS:: From empty tableaux:: sage: robinson_schensted_inverse(Tableau([]), Tableau([])) [] This function is the inverse of robinson_shensted:: sage: f = lambda p: robinson_schensted_inverse(*p.robinson_schensted()) sage: all(p == f(p) for n in range(7) for p in Permutations(n)) True sage: n = ZZ.random_element(200) sage: p = Permutations(n).random_element() sage: is_fine = True if p == f(p) else p ; is_fine True Both tableaux must be of the same shape:: sage: robinson_schensted_inverse(Tableau([[1,2,3]]), Tableau([[1,2]])) Traceback (most recent call last): ... ValueError: p(=[[1, 2, 3]]) and q(=[[1, 2]]) must have the same shape The second tableau must be standard:: sage: robinson_schensted_inverse(Tableau([[1,2,3]]), Tableau([[1,3,2]])) Traceback (most recent call last): ... ValueError: q(=[[1, 3, 2]]) must be standard """ if p.shape() != q.shape(): raise ValueError, "p(=%s) and q(=%s) must have the same shape"%(p, q) if not q.is_standard(): raise ValueError, "q(=%s) must be standard"%q size = p.size() permutation = [] d = dict((q[i][j],(i,j)) for i in range(len(q)) for j in range(len(q[i]))) p = map(list, p) for n in range(size, 0, -1): i,j = d[n] x = p[i][j] del p[i][j] if len(p[i]) == 0: del p[i] while i > 0: row = p[i-1] y = max(filter(lambda z: z<x, row )) row[row.index(y)] = x x = y i = i-1 permutation.insert(0, x) return Permutation(permutation) | f845b803c2350bb78c89f7c7e1f7112309453ec8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/f845b803c2350bb78c89f7c7e1f7112309453ec8/permutation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
721,
4757,
816,
67,
28204,
275,
334,
329,
67,
22552,
12,
84,
16,
1043,
4672,
436,
8395,
2860,
326,
17440,
4656,
358,
326,
3082,
434,
1014,
18196,
1375,
12,
84,
16,
85,
22025,
1450,
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,
721,
4757,
816,
67,
28204,
275,
334,
329,
67,
22552,
12,
84,
16,
1043,
4672,
436,
8395,
2860,
326,
17440,
4656,
358,
326,
3082,
434,
1014,
18196,
1375,
12,
84,
16,
85,
22025,
1450,
326... |
result = selement.getStorageParameters(protocol) | result = selement.getStorageParameters( protocol ) | def _checkLFNPFNConvention(self,lfn,pfn,se): """ Check that the PFN corresponds to the LFN-PFN convention """ # Check if the PFN corresponds to the LFN convention if pfn == lfn: return S_OK() lfn_pfn = True # flag that the lfn is contained in the pfn if (len(pfn)<len(lfn)) or (pfn[-len(lfn):] != lfn) : return S_ERROR('PFN does not correspond to the LFN convention') if not pfn.endswith(lfn): return S_ERROR() # Check if the pfn corresponds to the SE definition result = self._getStorageElement(se) if not result['OK']: return result selement = result['Value'] res = pfnparse(pfn) if not res['OK']: return res pfnDict = res['Value'] protocol = pfnDict['Protocol'] pfnpath = pfnDict['Path'] result = selement.getStorageParameters(protocol) if not result['OK']: return result seDict = result['Value'] sePath = seDict['Path'] ind = pfnpath.find(sePath) if ind == -1: return S_ERROR('The given PFN %s does not correspond to the %s SE definition' % (pfn,se)) # Check the full LFN-PFN-SE convention lfn_pfn_se = True if lfn_pfn: seAccessDict = dict(seDict) seAccessDict['Path'] = sePath + '/' + lfn check_pfn = pfnunparse(seAccessDict) if check_pfn != pfn: return S_ERROR('PFN does not correspond to the LFN convention') return S_OK() | 26c5008a7adbc1c761e2409bed59b7710e5f2c74 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/26c5008a7adbc1c761e2409bed59b7710e5f2c74/FileManagerBase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
9105,
23430,
19793,
25947,
12,
2890,
16,
80,
4293,
16,
84,
4293,
16,
307,
4672,
3536,
2073,
716,
326,
453,
19793,
13955,
358,
326,
18803,
50,
17,
52,
19793,
15797,
3536,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
9105,
23430,
19793,
25947,
12,
2890,
16,
80,
4293,
16,
84,
4293,
16,
307,
4672,
3536,
2073,
716,
326,
453,
19793,
13955,
358,
326,
18803,
50,
17,
52,
19793,
15797,
3536,
468,
... |
self.logger.info("value: Converting dict") | self.logger.debug("value: Converting dict") | def _convert_value(self, value, id, name): results = [] | f640b15368e4d3037d291c060bcc1380e557323f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7713/f640b15368e4d3037d291c060bcc1380e557323f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6283,
67,
1132,
12,
2890,
16,
460,
16,
612,
16,
508,
4672,
1686,
273,
5378,
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,
389,
6283,
67,
1132,
12,
2890,
16,
460,
16,
612,
16,
508,
4672,
1686,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
elif request.form['do'][0] == 'savedrawing': | elif do == 'savedrawing': | def execute(pagename, request): """ Main dispatcher for the 'AttachFile' action. """ _ = request.getText msg = None if action_name in request.cfg.actions_excluded: msg = _('File attachments are not allowed in this wiki!') elif 'do' not in request.form: upload_form(pagename, request) elif request.form['do'][0] == 'savedrawing': if request.user.may.write(pagename): save_drawing(pagename, request) request.emit_http_headers() request.write("OK") else: msg = _('You are not allowed to save a drawing on this page.') elif request.form['do'][0] == 'upload': if request.user.may.write(pagename): if 'file' in request.form: do_upload(pagename, request) else: # This might happen when trying to upload file names # with non-ascii characters on Safari. msg = _("No file content. Delete non ASCII characters from the file name and try again.") else: msg = _('You are not allowed to attach a file to this page.') elif request.form['do'][0] == 'del': if request.user.may.delete(pagename): del_file(pagename, request) else: msg = _('You are not allowed to delete attachments on this page.') elif request.form['do'][0] == 'move': if request.user.may.delete(pagename): send_moveform(pagename, request) else: msg = _('You are not allowed to move attachments from this page.') elif request.form['do'][0] == 'attachment_move': if 'cancel' in request.form: msg = _('Move aborted!') error_msg(pagename, request, msg) return if not wikiutil.checkTicket(request, request.form['ticket'][0]): msg = _('Please use the interactive user interface to move attachments!') error_msg(pagename, request, msg) return if request.user.may.delete(pagename): attachment_move(pagename, request) else: msg = _('You are not allowed to move attachments from this page.') elif request.form['do'][0] == 'get': if request.user.may.read(pagename): get_file(pagename, request) else: msg = _('You are not allowed to get attachments from this page.') elif request.form['do'][0] == 'unzip': if request.user.may.delete(pagename) and request.user.may.read(pagename) and request.user.may.write(pagename): unzip_file(pagename, request) else: msg = _('You are not allowed to unzip attachments of this page.') elif request.form['do'][0] == 'install': if request.user.isSuperUser(): install_package(pagename, request) else: msg = _('You are not allowed to install files.') elif request.form['do'][0] == 'view': if request.user.may.read(pagename): view_file(pagename, request) else: msg = _('You are not allowed to view attachments of this page.') else: msg = _('Unsupported upload action: %s') % (request.form['do'][0],) if msg: error_msg(pagename, request, msg) | 0b374a0e7f09a6bc8083ad52cb15f4654fa1108a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/888/0b374a0e7f09a6bc8083ad52cb15f4654fa1108a/AttachFile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
9095,
1069,
16,
590,
4672,
3536,
12740,
7393,
364,
326,
296,
4761,
812,
11,
1301,
18,
3536,
389,
273,
590,
18,
588,
1528,
225,
1234,
273,
599,
309,
1301,
67,
529,
316,
590,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
9095,
1069,
16,
590,
4672,
3536,
12740,
7393,
364,
326,
296,
4761,
812,
11,
1301,
18,
3536,
389,
273,
590,
18,
588,
1528,
225,
1234,
273,
599,
309,
1301,
67,
529,
316,
590,
... |
if not self.add_rfs(index): return None | if not self.add_rfs(index, mir_rorp): return None | def get_rf(self, index): """Get a RestoreFile for given index, or None""" while 1: if not self.rf_list: if not self.add_rfs(index): return None rf = self.rf_list[0] if rf.index == index: if Globals.process_uid != 0: self.perm_changer(index) return rf elif rf.index > index: # Try to add earlier indicies. But if first is # already from same directory, or we can't find any # from that directory, then we know it can't be added. if (index[:-1] == rf.index[:-1] or not self.add_rfs(index)): return None else: del self.rf_list[0] | 5e2f4cf96e473b8bdfc69f590da7fc2d7b90761f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6202/5e2f4cf96e473b8bdfc69f590da7fc2d7b90761f/restore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5809,
12,
2890,
16,
770,
4672,
3536,
967,
279,
11197,
812,
364,
864,
770,
16,
578,
599,
8395,
1323,
404,
30,
309,
486,
365,
18,
5809,
67,
1098,
30,
309,
486,
365,
18,
1289,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5809,
12,
2890,
16,
770,
4672,
3536,
967,
279,
11197,
812,
364,
864,
770,
16,
578,
599,
8395,
1323,
404,
30,
309,
486,
365,
18,
5809,
67,
1098,
30,
309,
486,
365,
18,
1289,
... |
results = tupleQuery.evaluate() | return tupleQuery.evaluate() def execute_sparql(self,q_string,format = 'JSON'): results = self.__execute_sparql(q_string) | def execute_sparql(self,q_string,format = 'JSON'): self.log.debug(q_string) tupleQuery = self.__con.prepareTupleQuery(QueryLanguage.SPARQL, q_string) tupleQuery.setIncludeInferred(self.inference) results = tupleQuery.evaluate() return self._results_to_json(results) if format == 'JSON' else results | 5ea83e59d347287ea3992828d0841b202c522618 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13812/5ea83e59d347287ea3992828d0841b202c522618/reader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
87,
25366,
12,
2890,
16,
85,
67,
1080,
16,
2139,
273,
296,
2986,
11,
4672,
365,
18,
1330,
18,
4148,
12,
85,
67,
1080,
13,
3193,
1138,
273,
365,
16186,
591,
18,
9366,
9038,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
87,
25366,
12,
2890,
16,
85,
67,
1080,
16,
2139,
273,
296,
2986,
11,
4672,
365,
18,
1330,
18,
4148,
12,
85,
67,
1080,
13,
3193,
1138,
273,
365,
16186,
591,
18,
9366,
9038,
... |
@needs_radix_and_thousands | @unittest.skipUnless(nl_langinfo, "nl_langinfo is not available") | def test_lc_numeric_localeconv(self): # Test localeconv against known values for loc in candidate_locales: try: setlocale(LC_NUMERIC, loc) setlocale(LC_CTYPE, loc) except Error: continue for li, lc in ((_locale.RADIXCHAR, "decimal_point"), (_locale.THOUSEP, "thousands_sep")): self.numeric_tester('localeconv', localeconv()[lc], lc, loc) | 7847cd6b41daea1a0740d8ac0f0a028445603198 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/7847cd6b41daea1a0740d8ac0f0a028445603198/test__locale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
17704,
67,
5246,
67,
3729,
17181,
90,
12,
2890,
4672,
468,
7766,
1191,
17181,
90,
5314,
4846,
924,
364,
1515,
316,
5500,
67,
22638,
30,
775,
30,
444,
6339,
12,
13394,
67,
229... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
17704,
67,
5246,
67,
3729,
17181,
90,
12,
2890,
4672,
468,
7766,
1191,
17181,
90,
5314,
4846,
924,
364,
1515,
316,
5500,
67,
22638,
30,
775,
30,
444,
6339,
12,
13394,
67,
229... |
pre_exists = os.path.isfile(cfg.ownage.file) | def perm_gen(): '''Permissions' information file ('path uid:gid\n' format) generator''' pre_exists = os.path.isfile(cfg.ownage.file) numeric = cfg.ownage.use_ids if cfg.ownage.omit: return log.warn('Omit permissions flag is set, skipping FS metadata changes') ownage = {} errz = False for path in ls_files(): path = path.strip(spaces) if path == cfg.ownage.file: continue path = path.split(os.sep) while True: if path[0] not in ownage: try: fstat = os.lstat(path[0]) ownage[path[0]] = '%s:%s:%s'%( fstat.st_uid if numeric else sh.uname(fstat.st_uid), fstat.st_gid if numeric else sh.gname(fstat.st_gid), oct(fstat.st_mode & 07777) # can produce likes of 04755 ) except OSError: log.error('Unable to stat path: %s'%path[0]) errz = True if len(path) == 1: break path[0] = os.path.join(path[0], path.pop(1)) if ownage: ownage = ''.join( '%s %s\n'%(path, own) for path,own in sorted(ownage.iteritems(), key=op.itemgetter(0)) ) try: old_ownage = open(cfg.ownage.file).read() except IOError: old_ownage = None if old_ownage != ownage: open(cfg.ownage.file, 'w').write(ownage) os.chmod(cfg.ownage.file, int(oct(cfg.ownage.mode), 8)) log.info('Updated ownership information') if old_ownage is None: exe.add((cfg.bin.git, 'add', cfg.ownage.file), block=True) else: log.info('No files given to harvest ownership info') if errz: log.warn('Execution halted because of errors, send \\n or break it.') sys.stdin.readline() | 1eb490ecf022d10b9baff3f98342b64ecf7ff733 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11594/1eb490ecf022d10b9baff3f98342b64ecf7ff733/git.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4641,
67,
4507,
13332,
9163,
6521,
11,
1779,
585,
7707,
803,
4555,
30,
15780,
64,
82,
11,
740,
13,
4456,
26418,
6389,
273,
2776,
18,
995,
410,
18,
1202,
67,
2232,
309,
2776,
18,
995,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4641,
67,
4507,
13332,
9163,
6521,
11,
1779,
585,
7707,
803,
4555,
30,
15780,
64,
82,
11,
740,
13,
4456,
26418,
6389,
273,
2776,
18,
995,
410,
18,
1202,
67,
2232,
309,
2776,
18,
995,
... | |
if type and not mime_re.match(self.value): | if self.value and not mime_re.match(self.value): | def validate(self): self.value = self.attrs.get((None,u'bitrate')) if self.value and not re.match('\d+\.?\d*', self.value): self.log(InvalidFloat({"parent":self.parent.name, "element":self.name, "attr": 'bitrate', "value":self.value})) | b108b6c7f3fff8340958cc52862cc52de37aceb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5012/b108b6c7f3fff8340958cc52862cc52de37aceb3/media.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
12,
2890,
4672,
365,
18,
1132,
273,
365,
18,
7039,
18,
588,
12443,
7036,
16,
89,
11,
3682,
5141,
26112,
309,
365,
18,
1132,
471,
486,
283,
18,
1916,
2668,
64,
72,
15,
5834,
109... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
12,
2890,
4672,
365,
18,
1132,
273,
365,
18,
7039,
18,
588,
12443,
7036,
16,
89,
11,
3682,
5141,
26112,
309,
365,
18,
1132,
471,
486,
283,
18,
1916,
2668,
64,
72,
15,
5834,
109... |
util.spinUntil(lambda :p.disconnected) | spinUntil(lambda :p.disconnected) | def cleanPorts(self, *ports): for p in ports: if not hasattr(p, 'disconnected'): raise RuntimeError, ("You handed something to cleanPorts that" " doesn't have a disconnected attribute, dummy!") if not p.disconnected: d = getattr(p, self.callToLoseCnx)() if isinstance(d, defer.Deferred): wait(d) else: try: util.spinUntil(lambda :p.disconnected) except: failure.Failure().printTraceback() | 9a3d0d2921ec234c9c9e21996761793126512933 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9a3d0d2921ec234c9c9e21996761793126512933/test_unix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
11107,
12,
2890,
16,
380,
4363,
4672,
364,
293,
316,
9048,
30,
309,
486,
3859,
12,
84,
16,
296,
2251,
8537,
11,
4672,
1002,
7265,
16,
7566,
6225,
27309,
5943,
358,
2721,
11107,
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,
2721,
11107,
12,
2890,
16,
380,
4363,
4672,
364,
293,
316,
9048,
30,
309,
486,
3859,
12,
84,
16,
296,
2251,
8537,
11,
4672,
1002,
7265,
16,
7566,
6225,
27309,
5943,
358,
2721,
11107,
7... |
else: self.short = INFINITY | def setup(self, allvars, smartIn): """Check how many variables in this term, and how long it would take to search | 9014f1b29ec001a58490a448dc6782aa1860acf4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/9014f1b29ec001a58490a448dc6782aa1860acf4/llyn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
16,
777,
4699,
16,
13706,
382,
4672,
3536,
1564,
3661,
4906,
3152,
316,
333,
2481,
16,
471,
3661,
1525,
518,
4102,
4862,
358,
1623,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
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,
3875,
12,
2890,
16,
777,
4699,
16,
13706,
382,
4672,
3536,
1564,
3661,
4906,
3152,
316,
333,
2481,
16,
471,
3661,
1525,
518,
4102,
4862,
358,
1623,
2,
-100,
-100,
-100,
-100,
-100,
-100,... | |
w=int(dx)-1 h=int(dy)-1 if w<1: w=1 if h<1: h=1 if w<=1 and h<=1: g.drawLine(x,y,x,y) else: g.fillRect(x,y,w,h) | if pdftemplate is not None: pdf.setLineWidth(1) | def paintComponent(self,g): core.DataViewComponent.paintComponent(self,g) if self.usemap and self.map is None: self.initialize_map() border_top = self.border_top + self.label_offset g.color=Color(0.8,0.8,0.8) g.drawLine(self.border_left,self.height-self.border_bottom,self.size.width-self.border_right,self.size.height-self.border_bottom) | 9f31917740a85396cd8815f101f84dcf64439ab7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9336/9f31917740a85396cd8815f101f84dcf64439ab7/spike_raster.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12574,
1841,
12,
2890,
16,
75,
4672,
2922,
18,
751,
1767,
1841,
18,
84,
1598,
1841,
12,
2890,
16,
75,
13,
225,
309,
365,
18,
1202,
1458,
471,
365,
18,
1458,
353,
599,
30,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12574,
1841,
12,
2890,
16,
75,
4672,
2922,
18,
751,
1767,
1841,
18,
84,
1598,
1841,
12,
2890,
16,
75,
13,
225,
309,
365,
18,
1202,
1458,
471,
365,
18,
1458,
353,
599,
30,
365,
18,
... |
data=getdata(inhandle,dims,True) | data=getdata(inhandle,dims,False) | def getdata(handle,dims,use_slabs=False): if not use_slabs: data=nessi_list.NessiList(type="double") return sns_napi.getdata(handle,data) data=nessi_list.NessiList(type="double") for x in range(dims[0]): for y in range(dims[1]): slab=nessi_list.NessiList(type="double") start=(x,y,0) stop=(1,1,dims[2])#x,y,dims[2]) print start,stop, slab=sns_napi.getslab(handle,start,stop) print slab data.extend(slab) print len(data),data return data | 85045fac820d8010a650552d31012505a8165d03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/762/85045fac820d8010a650552d31012505a8165d03/dump_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
892,
12,
4110,
16,
8550,
16,
1202,
67,
2069,
5113,
33,
8381,
4672,
309,
486,
999,
67,
2069,
5113,
30,
501,
33,
4496,
77,
67,
1098,
18,
50,
403,
77,
682,
12,
723,
1546,
9056,
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,
336,
892,
12,
4110,
16,
8550,
16,
1202,
67,
2069,
5113,
33,
8381,
4672,
309,
486,
999,
67,
2069,
5113,
30,
501,
33,
4496,
77,
67,
1098,
18,
50,
403,
77,
682,
12,
723,
1546,
9056,
7... |
Multiplicative Abelian Group isomorphic to C2 x C3 x C3 x C3 x C4 x C4 x C5 x C8 x C8 | Multiplicative Abelian Group isomorphic to C2 x C4 x C12 x C24 x C120 | def is_AbelianGroup(x): """ Return True if $x$ is an abelian group. EXAMPLES: sage: F = AbelianGroup(5,[5,5,7,8,9],names = list("abcde")); F Multiplicative Abelian Group isomorphic to C5 x C5 x C7 x C8 x C9 sage: is_AbelianGroup(F) True sage: is_AbelianGroup(AbelianGroup(7, [3]*7)) True """ return isinstance(x, AbelianGroup_class) | 4b76758ecf69f92f14b50ef31dd04f2252c5a26c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/4b76758ecf69f92f14b50ef31dd04f2252c5a26c/abelian_group.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
5895,
292,
2779,
1114,
12,
92,
4672,
3536,
2000,
1053,
309,
271,
92,
8,
353,
392,
1223,
292,
2779,
1041,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
478,
273,
9771,
292,
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,
353,
67,
5895,
292,
2779,
1114,
12,
92,
4672,
3536,
2000,
1053,
309,
271,
92,
8,
353,
392,
1223,
292,
2779,
1041,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
478,
273,
9771,
292,
2... |
worker_ud['password'] = self.app.ud['password'] | if self.app.ud.has_key('password'): worker_ud['password'] = self.app.ud['password'] | def add_instances( self, num_nodes, instance_type=''): num_nodes = int( num_nodes ) ec2_conn = self.app.cloud_interface.get_ec2_connection() log.info( "Adding %s instance(s)..." % num_nodes ) # Compose worker instance user data worker_ud = {} worker_ud['access_key'] = self.app.ud['access_key'] worker_ud['secret_key'] = self.app.ud['secret_key'] worker_ud['password'] = self.app.ud['password'] worker_ud['cluster_name'] = self.app.ud['cluster_name'] worker_ud['role'] = 'worker' worker_ud['master_ip'] = self.app.cloud_interface.get_self_private_ip() worker_ud_str = "\n".join(['%s: %s' % (key, value) for key, value in worker_ud.iteritems()]) #log.debug( "Worker user data: %s " % worker_ud ) reservation = None if instance_type == '': instance_type = self.app.cloud_interface.get_type() log.debug( "Using following command: ec2_conn.run_instances( image_id='%s', min_count=1, max_count='%s', key_name='%s', security_groups=['%s'], user_data=[%s], instance_type='%s', placement='%s' )" % ( self.app.cloud_interface.get_ami(), num_nodes, self.app.cloud_interface.get_key_pair_name(), ", ".join( self.app.cloud_interface.get_security_groups() ), worker_ud_str, instance_type, self.app.cloud_interface.get_zone() ) ) try: # log.debug( "Would be starting worker instance(s)..." ) reservation = ec2_conn.run_instances( image_id=self.app.cloud_interface.get_ami(), min_count=1, max_count=num_nodes, key_name=self.app.cloud_interface.get_key_pair_name(), security_groups=self.app.cloud_interface.get_security_groups(), user_data=worker_ud_str, instance_type=instance_type, placement=self.app.cloud_interface.get_zone() ) if reservation: for instance in reservation.instances: i = Instance( self.app, inst=instance, m_state=instance.state ) self.worker_instances.append( i ) # Save list of started instances into a file on S3 to be used in case of cluster restart self.save_worker_instance_IDs_to_S3( self.worker_instances ) except BotoServerError, e: log.error( "EC2 insufficient capacity error: %s" % str( e ) ) return False except EC2ResponseError, e: err = "EC2 response error when starting worker nodes: %s" % str( e ) log.error( err ) return False # Update cluster status # self.master_state = master_states.ERROR # self.console_monitor.last_state_change_time = dt.datetime.utcnow() # log.debug( "Changed state to '%s'" % self.master_state ) except Exception, ex: err = "Error when starting worker nodes: %s" % str( ex ) log.error( err ) return False # self.master_state = master_states.ERROR # self.console_monitor.last_state_change_time = dt.datetime.utcnow() # log.debug( "Changed state to '%s'" % self.master_state ) log.debug( "Started %s instance(s)" % num_nodes ) return True | 205a92c3a71434241e5a56d4835900c4fa466752 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5255/205a92c3a71434241e5a56d4835900c4fa466752/master.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
10162,
12,
365,
16,
818,
67,
4690,
16,
791,
67,
723,
2218,
11,
4672,
818,
67,
4690,
273,
509,
12,
818,
67,
4690,
262,
6557,
22,
67,
4646,
273,
365,
18,
2910,
18,
7277,
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,
527,
67,
10162,
12,
365,
16,
818,
67,
4690,
16,
791,
67,
723,
2218,
11,
4672,
818,
67,
4690,
273,
509,
12,
818,
67,
4690,
262,
6557,
22,
67,
4646,
273,
365,
18,
2910,
18,
7277,
67,... |
separator += linesep * (1 + isdigest) | separator += linesep | def _parsebody(self, container, fp): # Parse the body, but first split the payload on the content-type # boundary if present. boundary = container.get_boundary() isdigest = (container.get_type() == 'multipart/digest') # If there's a boundary, split the payload text into its constituent # parts and parse each separately. Otherwise, just parse the rest of # the body as a single message. Note: any exceptions raised in the # recursive parse need to have their line numbers coerced. if boundary: preamble = epilogue = None # Split into subparts. The first boundary we're looking for won't # have the leading newline since we're at the start of the body # text. separator = '--' + boundary payload = fp.read() start = payload.find(separator) if start < 0: raise Errors.BoundaryError( "Couldn't find starting boundary: %s" % boundary) if start > 0: # there's some pre-MIME boundary preamble preamble = payload[0:start] # Find out what kind of line endings we're using start += len(separator) cre = re.compile('\r\n|\r|\n') mo = cre.search(payload, start) if mo: start += len(mo.group(0)) * (1 + isdigest) # We create a compiled regexp first because we need to be able to # specify the start position, and the module function doesn't # support this signature. :( cre = re.compile('(?P<sep>\r\n|\r|\n)' + re.escape(separator) + '--') mo = cre.search(payload, start) if not mo: raise Errors.BoundaryError( "Couldn't find terminating boundary: %s" % boundary) terminator = mo.start() linesep = mo.group('sep') if mo.end() < len(payload): # there's some post-MIME boundary epilogue epilogue = payload[mo.end():] # We split the textual payload on the boundary separator, which # includes the trailing newline. If the container is a # multipart/digest then the subparts are by default message/rfc822 # instead of text/plain. In that case, they'll have an extra # newline before the headers to distinguish the message's headers # from the subpart headers. separator += linesep * (1 + isdigest) parts = payload[start:terminator].split(linesep + separator) for part in parts: msgobj = self.parsestr(part) container.preamble = preamble container.epilogue = epilogue container.attach(msgobj) elif container.get_main_type() == 'multipart': # Very bad. A message is a multipart with no boundary! raise Errors.BoundaryError( 'multipart message with no defined boundary') elif container.get_type() == 'message/delivery-status': # This special kind of type contains blocks of headers separated # by a blank line. We'll represent each header block as a # separate Message object blocks = [] while 1: blockmsg = self._class() self._parseheaders(blockmsg, fp) if not len(blockmsg): # No more header blocks left break blocks.append(blockmsg) container.set_payload(blocks) elif container.get_main_type() == 'message': # Create a container for the payload, but watch out for there not # being any headers left try: msg = self.parse(fp) except Errors.HeaderParseError: msg = self._class() self._parsebody(msg, fp) container.attach(msg) else: container.set_payload(fp.read()) | 15964324c25f03947e37cd91303e6b24912bebaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/15964324c25f03947e37cd91303e6b24912bebaf/Parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
3432,
12,
2890,
16,
1478,
16,
4253,
4672,
468,
2884,
326,
1417,
16,
1496,
1122,
1416,
326,
2385,
603,
326,
913,
17,
723,
468,
7679,
309,
3430,
18,
7679,
273,
1478,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
3432,
12,
2890,
16,
1478,
16,
4253,
4672,
468,
2884,
326,
1417,
16,
1496,
1122,
1416,
326,
2385,
603,
326,
913,
17,
723,
468,
7679,
309,
3430,
18,
7679,
273,
1478,
18,
588,
... |
RDD_parameters_ctype = ctypes.byref(tmp_array(*RDD_parameters)) | RDD_parameters_ctype = ctypes.byref(tmp_array(*RDD_parameters)) | def AT_IGK (self, n, E_MeV_u, particle_no, fluence_cm2, material_no, RDD_model, RDD_parameters, ER_model, ER_parameters, gamma_model, gamma_parameters, saturation_cross_section_factor): ''' Computes HCP response and RE/RBE using Katz\' Ion-Gamma-Kill approach according to Waligorski, 1988 | 2770306776b3d696c9e7b966b3a8931dc9aa15f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3253/2770306776b3d696c9e7b966b3a8931dc9aa15f9/pyamtrack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14464,
67,
3047,
47,
261,
2890,
16,
290,
16,
512,
67,
4667,
58,
67,
89,
16,
20036,
67,
2135,
16,
1183,
23209,
67,
7670,
22,
16,
9390,
67,
2135,
16,
534,
5698,
67,
2284,
16,
534,
56... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14464,
67,
3047,
47,
261,
2890,
16,
290,
16,
512,
67,
4667,
58,
67,
89,
16,
20036,
67,
2135,
16,
1183,
23209,
67,
7670,
22,
16,
9390,
67,
2135,
16,
534,
5698,
67,
2284,
16,
534,
56... |
data[suid][ref.field] = src.getField(ref.field).getRaw(src) | field = src.getField(ref.field) if field: data[suid][ref.field] = field.getRaw(src) | def getData(self): """ Returns backreferences: { 'uid-obj-a': { 'the-field': [ 'uid-of-another-unpublished-object', 'my-uid', 'uid-obj-b', ], }, 'uid-obj-b': { 'ref-field': 'my-uid', }, } """ data = {} for ref in self.context.getBackReferenceImpl(): # get source object src = ref.getSourceObject() suid = src.UID() if suid not in data.keys(): data[suid] = {} if getattr(ref, 'field', None) == None: continue if ref.field in data[suid]: # we already added this field continue else: # add the field value data[suid][ref.field] = src.getField(ref.field).getRaw(src) return data | 7c85b3e4da8a679f21a1075df8f2afe3dfc64ba3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12934/7c85b3e4da8a679f21a1075df8f2afe3dfc64ba3/backreferences.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4303,
12,
2890,
4672,
3536,
2860,
1473,
14353,
30,
288,
296,
1911,
17,
2603,
17,
69,
4278,
288,
296,
5787,
17,
1518,
4278,
306,
296,
1911,
17,
792,
17,
304,
3011,
17,
318,
12614,
17,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4303,
12,
2890,
4672,
3536,
2860,
1473,
14353,
30,
288,
296,
1911,
17,
2603,
17,
69,
4278,
288,
296,
5787,
17,
1518,
4278,
306,
296,
1911,
17,
792,
17,
304,
3011,
17,
318,
12614,
17,
... |
log.info('Got initial challenge from server, sending response.') | log.debug('Got initial challenge from server, sending response.') | def _handle_packet_before_auth(self, seq, type, payload): """ This function handles any packet received by the remote end while we are waiting for authentication. It responds to AUTH or RESP packets (auth packets) while closing the connection on all other packets (non- auth packets). | 842d345982b9d6198e33a7209cc9906dc2aa2fbd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11722/842d345982b9d6198e33a7209cc9906dc2aa2fbd/rpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
67,
11482,
67,
5771,
67,
1944,
12,
2890,
16,
3833,
16,
618,
16,
2385,
4672,
3536,
1220,
445,
7372,
1281,
4414,
5079,
635,
326,
2632,
679,
1323,
732,
854,
7336,
364,
5107,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
67,
11482,
67,
5771,
67,
1944,
12,
2890,
16,
3833,
16,
618,
16,
2385,
4672,
3536,
1220,
445,
7372,
1281,
4414,
5079,
635,
326,
2632,
679,
1323,
732,
854,
7336,
364,
5107,
18... |
assert pngs_equal('test_docPaint_flat.png', 'correct_docPaint_flat.png', exact=True) assert pngs_equal('test_docPaint_alpha.png', 'correct_docPaint_alpha.png', exact=True) | assert pngs_equal('test_docPaint_flat.png', 'correct_docPaint_flat.png') assert pngs_equal('test_docPaint_alpha.png', 'correct_docPaint_alpha.png') | def docPaint(): b1 = brush.Brush() b1.load_from_string(open('../brushes/s008.myb').read()) b2 = brush.Brush() b2.load_from_string(open('../brushes/redbrush.myb').read()) b2.set_color_hsv((0.3, 0.4, 0.35)) # test some actions doc = document.Document() doc.undo() # nop events = loadtxt('painting30sec.dat.gz') events = events[:len(events)/8] t_old = events[0][0] n = len(events) for i, (t, x, y, pressure) in enumerate(events): dtime = t - t_old t_old = t #print dtime doc.stroke_to(dtime, x, y, pressure) if i == n*1/8: doc.set_brush(b2) if i == n*2/8: doc.clear_layer() doc.undo() assert not doc.get_bbox().empty() doc.redo() assert doc.get_bbox().empty() if i == n*3/8: doc.undo() doc.set_brush(b1) if i == n*4/8: doc.set_brush(b2) if i == n*5/8: doc.undo() doc.redo() if i == n*6/8: doc.set_brush(b2) if i == n*7/8: doc.add_layer(1) doc.layers[0].surface.save('test_docPaint_a.png') doc.layers[0].surface.save('test_docPaint_a1.png') # the resulting images will look slightly different because of dithering assert pngs_equal('test_docPaint_a.png', 'test_docPaint_a1.png', exact=False) # test save/load doc.save('test_f1.ora') doc2 = document.Document() doc2.load('test_f1.ora') print doc.get_bbox(), doc2.get_bbox() # TODO: fix this one?! #assert doc.get_bbox() == doc2.get_bbox() doc2.layers[0].surface.save('test_docPaint_b.png') assert pngs_equal('test_docPaint_a.png', 'test_docPaint_b.png', exact=False) doc2.save('test_f2.ora') #check not possible, because PNGs not exactly equal: #assert files_equal('test_f1.ora', 'test_f2.ora') # less strict test than above (just require load-save-load-save not to alter the file) doc3 = document.Document() doc3.load('test_f2.ora') assert doc2.get_bbox() == doc3.get_bbox() doc3.layers[0].surface.save('test_docPaint_c.png') assert pngs_equal('test_docPaint_b.png', 'test_docPaint_c.png', exact=False) # TODO: exact=True please doc2.save('test_f3.ora') #check not possible, because PNGs not exactly equal: #assert files_equal('test_f2.ora', 'test_f3.ora') # note: this is not supposed to be strictly reproducible because # of different random seeds [huh? what does that mean?] bbox = doc.get_bbox() print 'document bbox is', bbox # test for appearance changes (make sure they are intended) doc.save('test_docPaint_flat.png', alpha=False) doc.save('test_docPaint_alpha.png', alpha=True) assert pngs_equal('test_docPaint_flat.png', 'correct_docPaint_flat.png', exact=True) assert pngs_equal('test_docPaint_alpha.png', 'correct_docPaint_alpha.png', exact=True) | 99bcb84a1eb5277244d6e9af26a837eb85305b25 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7129/99bcb84a1eb5277244d6e9af26a837eb85305b25/test_mypaintlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
12699,
13332,
324,
21,
273,
5186,
1218,
18,
19114,
1218,
1435,
324,
21,
18,
945,
67,
2080,
67,
1080,
12,
3190,
2668,
6216,
2848,
1218,
281,
19,
87,
713,
28,
18,
4811,
70,
16063,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
12699,
13332,
324,
21,
273,
5186,
1218,
18,
19114,
1218,
1435,
324,
21,
18,
945,
67,
2080,
67,
1080,
12,
3190,
2668,
6216,
2848,
1218,
281,
19,
87,
713,
28,
18,
4811,
70,
16063,
... |
('dbserv2.theopalgroup.com', '/mediumfile'), ('dbserv2.theopalgroup.com', '/smallfile'), | def test(): """Test this module. A hodge podge of tests collected here, because they have too many external dependencies for the regular test suite. """ import sys import getopt opts, args = getopt.getopt(sys.argv[1:], 'd') dl = 0 for o, a in opts: if o == '-d': dl = dl + 1 host = 'www.python.org' selector = '/' if args[0:]: host = args[0] if args[1:]: selector = args[1] h = HTTP() h.set_debuglevel(dl) h.connect(host) h.putrequest('GET', selector) h.endheaders() status, reason, headers = h.getreply() print 'status =', status print 'reason =', reason print "read", len(h.getfile().read()) print if headers: for header in headers.headers: print header.strip() print # minimal test that code to extract host from url works class HTTP11(HTTP): _http_vsn = 11 _http_vsn_str = 'HTTP/1.1' h = HTTP11('www.python.org') h.putrequest('GET', 'http://www.python.org/~jeremy/') h.endheaders() h.getreply() h.close() if hasattr(socket, 'ssl'): for host, selector in (('sourceforge.net', '/projects/python'), ('dbserv2.theopalgroup.com', '/mediumfile'), ('dbserv2.theopalgroup.com', '/smallfile'), ): print "https://%s%s" % (host, selector) hs = HTTPS() hs.set_debuglevel(dl) hs.connect(host) hs.putrequest('GET', selector) hs.endheaders() status, reason, headers = hs.getreply() print 'status =', status print 'reason =', reason print "read", len(hs.getfile().read()) print if headers: for header in headers.headers: print header.strip() print # Test a buggy server -- returns garbled status line. # http://www.yahoo.com/promotions/mom_com97/supermom.html c = HTTPConnection("promotions.yahoo.com") c.set_debuglevel(1) c.connect() c.request("GET", "/promotions/mom_com97/supermom.html") r = c.getresponse() print r.status, r.version lines = r.read().split("\n") print "\n".join(lines[:5]) c = HTTPConnection("promotions.yahoo.com", strict=1) c.set_debuglevel(1) c.connect() c.request("GET", "/promotions/mom_com97/supermom.html") try: r = c.getresponse() except BadStatusLine, err: print "strict mode failed as expected" print err else: print "XXX strict mode should have failed" for strict in 0, 1: h = HTTP(strict=strict) h.connect("promotions.yahoo.com") h.putrequest('GET', "/promotions/mom_com97/supermom.html") h.endheaders() status, reason, headers = h.getreply() assert (strict and status == -1) or status == 200, (strict, status) | d190ea85986d83831714483fc1f4bbb87411c355 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/d190ea85986d83831714483fc1f4bbb87411c355/httplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13332,
3536,
4709,
333,
1605,
18,
225,
432,
366,
369,
908,
3713,
908,
434,
7434,
12230,
2674,
16,
2724,
2898,
1240,
4885,
4906,
3903,
5030,
364,
326,
6736,
1842,
11371,
18,
3536,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13332,
3536,
4709,
333,
1605,
18,
225,
432,
366,
369,
908,
3713,
908,
434,
7434,
12230,
2674,
16,
2724,
2898,
1240,
4885,
4906,
3903,
5030,
364,
326,
6736,
1842,
11371,
18,
3536,
2... | |
self.insertedRows[obj] = 1 | self.insertedRows.add(obj) | def updateRow(self, obj): """Mark on object for updating when sync()ing.""" if self.insertedRows.has_key(obj): self.insertedRows[obj] = 1 else: self.dirtyRows[obj] = 1 | 99ef8dc45ac95cf0f7340c6550585958fa21eeac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/99ef8dc45ac95cf0f7340c6550585958fa21eeac/rowjournal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
1999,
12,
2890,
16,
1081,
4672,
3536,
3882,
603,
733,
364,
9702,
1347,
3792,
1435,
310,
12123,
309,
365,
18,
6387,
329,
4300,
18,
5332,
67,
856,
12,
2603,
4672,
365,
18,
6387,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
1999,
12,
2890,
16,
1081,
4672,
3536,
3882,
603,
733,
364,
9702,
1347,
3792,
1435,
310,
12123,
309,
365,
18,
6387,
329,
4300,
18,
5332,
67,
856,
12,
2603,
4672,
365,
18,
6387,
32... |
import networkx if isinstance(arg1, (networkx.XGraph, networkx.Graph)): Graph.__init__(self, arg1, *args, **kwds) if hasattr(arg1, 'node_type'): self.left = [] self.right = [] for v in arg1.nodes_iter(): if arg1.node_type[v] == 'Bottom': self.left.append(v) elif arg1.node_type[v] == 'Top': self.right.append(v) else: raise TypeError("NetworkX node_type defies bipartite assumtion (is not 'Top' or 'Bottom')") | def __init__(self, *args, **kwds): r""" Bipartite graph. | 49be70e5a95362ec30dd81b8dbc8ce6bf5fa414a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/49be70e5a95362ec30dd81b8dbc8ce6bf5fa414a/bipartite_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
605,
5762,
1137,
2667,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
605,
5762,
1137,
2667,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
self._read_base() | def __init__(self, dirs = []): self._dirs = dirs self._read_base() | 1ebf788da78a5bb76600f32596f7b89e23b8e444 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5794/1ebf788da78a5bb76600f32596f7b89e23b8e444/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
7717,
273,
5378,
4672,
365,
6315,
8291,
273,
7717,
365,
6315,
896,
67,
1969,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
7717,
273,
5378,
4672,
365,
6315,
8291,
273,
7717,
365,
6315,
896,
67,
1969,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
self.externalMethods[name] = _policyUpdater(policyObj) | def loadPolicy(self): (self._policyPathMap, self._policies) = policy.loadPolicy(self) # create bucketless name->policy map for getattr policyList = [] for bucket in self._policies.keys(): policyList.extend(self._policies[bucket]) self._policyMap = dict((x.__class__.__name__, x) for x in policyList) # Some policy needs to pass arguments to other policy at init # time, but that can't happen until after all policy has been # initialized for name, policyObj in self._policyMap.iteritems(): policyObj.postInit() self.externalMethods[name] = _policyUpdater(policyObj) | adce9b9f25dd19d22eb761890df52c65072382c3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/adce9b9f25dd19d22eb761890df52c65072382c3/packagerecipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
2582,
12,
2890,
4672,
261,
2890,
6315,
5086,
743,
863,
16,
365,
6315,
17407,
13,
273,
3329,
18,
945,
2582,
12,
2890,
13,
468,
752,
2783,
2656,
508,
2122,
5086,
852,
364,
3869,
33... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
2582,
12,
2890,
4672,
261,
2890,
6315,
5086,
743,
863,
16,
365,
6315,
17407,
13,
273,
3329,
18,
945,
2582,
12,
2890,
13,
468,
752,
2783,
2656,
508,
2122,
5086,
852,
364,
3869,
33... | |
while not l: reactor.iterate(0.1) timeout -= 1 self.failIf(timeout == 0) | util.spinWhile(lambda :not l, timeout=30) | def testTimer(self): timeout = 30 l = [] t = internet.TimerService(1, l.append, "hello") t.startService() while not l: reactor.iterate(0.1) timeout -= 1 self.failIf(timeout == 0) t.stopService() self.failIf(t.running) self.assertEqual(l, ["hello"]) l.pop() | a79e9f9c61953c867382db060dfde03dbf771dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a79e9f9c61953c867382db060dfde03dbf771dc3/test_application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
6777,
12,
2890,
4672,
2021,
273,
5196,
328,
273,
5378,
268,
273,
24264,
18,
6777,
1179,
12,
21,
16,
328,
18,
6923,
16,
315,
23711,
7923,
268,
18,
1937,
1179,
1435,
1709,
18,
2287... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6777,
12,
2890,
4672,
2021,
273,
5196,
328,
273,
5378,
268,
273,
24264,
18,
6777,
1179,
12,
21,
16,
328,
18,
6923,
16,
315,
23711,
7923,
268,
18,
1937,
1179,
1435,
1709,
18,
2287... |
C{r.createNewGroup('group-foo')} | C{r.createGroup('group-foo')} | def addCopy(self, name, versionStr = None, flavor = None, ref = None, recurse=True, groupName = None, use = True, searchPath = None, flatten = False, copyScripts = True, copyCompatibilityClass = True): """ NAME ==== | 424a343598acc951c9fdccf3491a30632f799d35 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/424a343598acc951c9fdccf3491a30632f799d35/grouprecipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
2951,
12,
2890,
16,
508,
16,
1177,
1585,
273,
599,
16,
19496,
273,
599,
16,
1278,
273,
599,
16,
11502,
33,
5510,
16,
11619,
273,
599,
16,
999,
273,
1053,
16,
1623,
743,
273,
599... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
2951,
12,
2890,
16,
508,
16,
1177,
1585,
273,
599,
16,
19496,
273,
599,
16,
1278,
273,
599,
16,
11502,
33,
5510,
16,
11619,
273,
599,
16,
999,
273,
1053,
16,
1623,
743,
273,
599... |
def fl_get_choice_maxitems(ob): """ fl_get_choice_maxitems(ob) -> items num. """ retval = _fl_get_choice_maxitems(ob) return retval _fl_get_choice_text = cfuncproto(so_libforms, "fl_get_choice_text", STRING, [cty.POINTER(FL_OBJECT)], | def fl_get_choice_maxitems(pObject): """ fl_get_choice_maxitems(pObject) -> items num. """ retval = _fl_get_choice_maxitems(pObject) return retval _fl_get_choice_text = cfuncproto(so_libforms, "fl_get_choice_text", STRING, [cty.POINTER(FL_OBJECT)], | def fl_get_choice_maxitems(ob): """ fl_get_choice_maxitems(ob) -> items num. """ retval = _fl_get_choice_maxitems(ob) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
588,
67,
11569,
67,
1896,
3319,
12,
947,
4672,
3536,
1183,
67,
588,
67,
11569,
67,
1896,
3319,
12,
947,
13,
317,
1516,
818,
18,
3536,
225,
5221,
273,
389,
2242,
67,
588,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
588,
67,
11569,
67,
1896,
3319,
12,
947,
4672,
3536,
1183,
67,
588,
67,
11569,
67,
1896,
3319,
12,
947,
13,
317,
1516,
818,
18,
3536,
225,
5221,
273,
389,
2242,
67,
588,
67... |
try: parsed_docstring = parse_docstring(docstring, errors) except KeyboardError: raise | try: parsed_docstring = parse_docstring(docstring, errors, **options) except KeyboardInterrupt: raise | def parse(docstring, markup='plaintext', errors=None): """ Parse the given docstring, and use it to construct a C{ParsedDocstring}. If any fatal C{ParseError}s are encountered while parsing the docstring, then the docstring will be rendered as plaintext, instead. @type docstring: C{string} @param docstring: The docstring to encode. @type markup: C{string} @param markup: The name of the markup language that is used by the docstring. If the markup language is not supported, then the docstring will be treated as plaintext. The markup name is case-insensitive. @param errors: A list where any errors generated during parsing will be stored. If no list is specified, then fatal errors will generate exceptions, and non-fatal errors will be ignored. @type errors: C{list} of L{ParseError} @rtype: L{ParsedDocstring} @return: A L{ParsedDocstring} that encodes the contents of C{docstring}. @raise ParseError: If C{errors} is C{None} and an error is encountered while parsing. """ # Initialize errors list. raise_on_error = (errors is None) if errors == None: errors = [] # Normalize the markup language name. markup = markup.lower() # Is the markup language valid? if not re.match(r'\w+', markup): _parse_warn('Warning: Bad markup language name: %s' % markup) return plaintext.parse_docstring(docstring, errors) # Is the markup language supported? try: exec('from epydoc.markup.%s import parse_docstring' % markup) except: _parse_warn('Warning: Unsupported markup language: %s' % markup) return plaintext.parse_docstring(docstring, errors) # Parse the docstring. try: parsed_docstring = parse_docstring(docstring, errors) except KeyboardError: raise except Exception, e: errors.append(ParseError('Internal error: %s' % e)) return plaintext.parse_docstring(docstring, errors) # Check for fatal errors. fatal_errors = [e for e in errors if e.is_fatal()] if fatal_errors and raise_on_error: raise fatal_errors[0] if fatal_errors: return plaintext.parse_docstring(docstring, errors) return parsed_docstring | 5d6d3686ad5478c03b268d9124508276e16aea3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/5d6d3686ad5478c03b268d9124508276e16aea3a/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
24675,
16,
9813,
2218,
412,
10133,
2187,
1334,
33,
7036,
4672,
3536,
2884,
326,
864,
14525,
16,
471,
999,
518,
358,
4872,
279,
385,
95,
11257,
1759,
1080,
5496,
225,
971,
1281,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
24675,
16,
9813,
2218,
412,
10133,
2187,
1334,
33,
7036,
4672,
3536,
2884,
326,
864,
14525,
16,
471,
999,
518,
358,
4872,
279,
385,
95,
11257,
1759,
1080,
5496,
225,
971,
1281,... |
buf += struct.pack("%ds" % BLOCKSIZE, "".join(parts)) | buf += "".join(parts).ljust(BLOCKSIZE, NUL) | def tobuf(self, posix=False): """Return a tar header as a string of 512 byte blocks. """ buf = "" type = self.type prefix = "" | 8ff1f6a69e967951fb4de3049fbb847aacc901c8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/8ff1f6a69e967951fb4de3049fbb847aacc901c8/tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
4385,
12,
2890,
16,
16366,
33,
8381,
4672,
3536,
990,
279,
8232,
1446,
487,
279,
533,
434,
13908,
1160,
4398,
18,
3536,
1681,
273,
1408,
618,
273,
365,
18,
723,
1633,
273,
1408,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
4385,
12,
2890,
16,
16366,
33,
8381,
4672,
3536,
990,
279,
8232,
1446,
487,
279,
533,
434,
13908,
1160,
4398,
18,
3536,
1681,
273,
1408,
618,
273,
365,
18,
723,
1633,
273,
1408,
2... |
f = f.strip("\r\n\x00",) uri = vfs_clean_uri(f) lines = None try: content = gnomevfs.read_entire_file(uri) except gnomevfs.IsDirectoryError: pass except gnomevfs.NotFoundError: pass | uri = f.strip("\r\n\x00",) if self.get_hashfile_format(uri): glade = os.path.join(DATADIR, "parano.glade") dialog = gtk.glade.XML(glade,"dialog_add_or_open") dialog = dialog.get_widget("dialog_add_or_open") result = dialog.run() dialog.hide_all() if result == gtk.RESPONSE_CANCEL: continue if result == gtk.RESPONSE_CLOSE: self.load_hashfile(f) continue | def on_filelist_drag_data_received(self, widget, drag_context, x, y, selection_data, info, timestamp): files = selection_data.data.split() drag_context.drop_finish(True, timestamp) for f in files: # remove trailing noise f = f.strip("\r\n\x00",) | 4ea1f13de038d4f844826cb7bd3925ffd32e0440 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2200/4ea1f13de038d4f844826cb7bd3925ffd32e0440/parano.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
7540,
5449,
67,
15997,
67,
892,
67,
15213,
12,
2890,
16,
3604,
16,
8823,
67,
2472,
16,
619,
16,
677,
16,
4421,
67,
892,
16,
1123,
16,
2858,
4672,
225,
1390,
273,
4421,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
7540,
5449,
67,
15997,
67,
892,
67,
15213,
12,
2890,
16,
3604,
16,
8823,
67,
2472,
16,
619,
16,
677,
16,
4421,
67,
892,
16,
1123,
16,
2858,
4672,
225,
1390,
273,
4421,
67,
... |
log( "il.raw_input", 1 ) self.inp.write( raw_input() + '\n' ) | text = raw_input() self.inp.write ( text + newline ) | def run( self ): global terminate | 7c7a679102e6ac5ef4702ffb14ac6f40280d6ba5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10890/7c7a679102e6ac5ef4702ffb14ac6f40280d6ba5/slimv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
365,
262,
30,
2552,
10850,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
365,
262,
30,
2552,
10850,
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... |
"request" : context.REQUEST, | "request" : request, | def __init__(self, context, expose_schema=True): """ @param expose_schema: Map AT schema accessors directly to template variables for engines which cannot traverse Zope content (Cheetah). """ security=getSecurityManager() #portal_state = getMultiAdapter((context, context.REQUEST), name=u'plone_portal_state') try: portal_state = context.restrictedTraverse("@@plone_portal_state") except Unauthorized: # portal_state may be limited to admin users only portal_state = None except AttributeError: # traversing it not yet proplerly set up # may happen with some contexts, e.g. with LinguaPlone translate portal_state = None site = getSite() # Site might not have portal url when it is being duplicated through ZMI... # corner cases... you must love them! portal_url = getattr(site, "portal_url", None) | 379fac3f1303aa0006320e21e8326e30adfde243 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9221/379fac3f1303aa0006320e21e8326e30adfde243/plone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
819,
16,
15722,
67,
4821,
33,
5510,
4672,
3536,
225,
632,
891,
15722,
67,
4821,
30,
1635,
14464,
1963,
28088,
5122,
358,
1542,
3152,
364,
20504,
1492,
2780... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
819,
16,
15722,
67,
4821,
33,
5510,
4672,
3536,
225,
632,
891,
15722,
67,
4821,
30,
1635,
14464,
1963,
28088,
5122,
358,
1542,
3152,
364,
20504,
1492,
2780... |
file.Write(" cmd.header.size * 4); // NOLINT\n") | file.Write(" cmd.header.size * 4u); // NOLINT\n") file.Write(" EXPECT_EQ(static_cast<char*>(next_cmd),\n") file.Write(" reinterpret_cast<char*>(&cmd) + sizeof(cmd) +\n") file.Write(" RoundSizeToMultipleOfEntries(sizeof(data)));\n") | def WriteImmediateFormatTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("TEST(GLES2FormatTest, %s) {\n" % func.name) file.Write(" const int kSomeBaseValueToTestWith = 51;\n") file.Write(" static %s data[] = {\n" % func.info.data_type) for v in range(0, func.info.count): file.Write(" static_cast<%s>(kSomeBaseValueToTestWith + %d),\n" % (func.info.data_type, v)) file.Write(" };\n") file.Write(" int8 buf[256] = { 0, };\n") file.Write(" %s& cmd = *static_cast<%s*>(static_cast<void*>(&buf));\n" % (func.name, func.name)) file.Write(" void* next_cmd = cmd.Set(\n") file.Write(" &cmd") args = func.GetCmdArgs() value = 11 for arg in args: file.Write(",\n static_cast<%s>(%d)" % (arg.type, value)) value += 1 file.Write(",\n data);\n") args = func.GetCmdArgs() value = 11 file.Write(" EXPECT_EQ(%s::kCmdId, cmd.header.command);\n" % func.name) file.Write(" EXPECT_EQ(sizeof(cmd) +\n") file.Write(" RoundSizeToMultipleOfEntries(sizeof(data)),\n") file.Write(" cmd.header.size * 4); // NOLINT\n") for arg in args: file.Write(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" % (arg.type, value, arg.name)) value += 1 file.Write(" // TODO(gman): Check that data was inserted;\n") file.Write("}\n") file.Write("\n") | d294ef3a7f91afdc1e5f9f570da7b8ef4b5bd8b7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/d294ef3a7f91afdc1e5f9f570da7b8ef4b5bd8b7/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
22651,
1630,
4709,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
2932,
16961,
12,
43,
11386,
22,
1630,
4709,
16,
738,
87,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
22651,
1630,
4709,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
2932,
16961,
12,
43,
11386,
22,
1630,
4709,
16,
738,
87,
13,
... |
"""Adds documentation to obj which is in module place. | """Adds documentation to obj which is in module place. | def add_newdoc(place, obj, doc): """Adds documentation to obj which is in module place. If doc is a string add it to obj as a docstring If doc is a tuple, then the first element is interpreted as an attribute of obj and the second as the docstring (method, docstring) If doc is a list, then each element of the list should be a sequence of length two --> [(method1, docstring1), (method2, docstring2), ...] This routine never raises an error. """ try: new = {} exec 'from %s import %s' % (place, obj) in new if isinstance(doc, str): add_docstring(new[obj], doc.strip()) elif isinstance(doc, tuple): add_docstring(getattr(new[obj], doc[0]), doc[1].strip()) elif isinstance(doc, list): for val in doc: add_docstring(getattr(new[obj], val[0]), val[1].strip()) except: pass | c268f1d89bbf826e69bafabbf0029b7847ca59a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/c268f1d89bbf826e69bafabbf0029b7847ca59a4/function_base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2704,
2434,
12,
964,
16,
1081,
16,
997,
4672,
3536,
3655,
7323,
358,
1081,
1492,
353,
316,
1605,
3166,
18,
225,
971,
997,
353,
279,
533,
527,
518,
358,
1081,
487,
279,
14525,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2704,
2434,
12,
964,
16,
1081,
16,
997,
4672,
3536,
3655,
7323,
358,
1081,
1492,
353,
316,
1605,
3166,
18,
225,
971,
997,
353,
279,
533,
527,
518,
358,
1081,
487,
279,
14525,
... |
__version_info__ = (1, 0, 0) | __version_info__ = (1, 0, 1) | def do_status(self, subcmd, opts, *paths): print "handle 'svn status' command" | 4c0b0008ede1276b83fbc6292e5d52443a9e2bfb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10333/4c0b0008ede1276b83fbc6292e5d52443a9e2bfb/cmdln.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2327,
12,
2890,
16,
720,
4172,
16,
1500,
16,
380,
4481,
4672,
1172,
315,
4110,
296,
31505,
1267,
11,
1296,
6,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2327,
12,
2890,
16,
720,
4172,
16,
1500,
16,
380,
4481,
4672,
1172,
315,
4110,
296,
31505,
1267,
11,
1296,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if self.closed: raise ValueError, "I/O operation on closed file" | _complain_ifclosed(self.closed) | def truncate(self, size=None): if self.closed: raise ValueError, "I/O operation on closed file" if size is None: size = self.pos elif size < 0: raise IOError(EINVAL, "Negative size not allowed") elif size < self.pos: self.pos = size self.buf = self.getvalue()[:size] | 9e62ff287bf9e4c39fb9654b0bb0f3c9b523d459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e62ff287bf9e4c39fb9654b0bb0f3c9b523d459/StringIO.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10310,
12,
2890,
16,
963,
33,
7036,
4672,
389,
832,
7446,
67,
430,
12204,
12,
2890,
18,
12204,
13,
309,
963,
353,
599,
30,
963,
273,
365,
18,
917,
1327,
963,
411,
374,
30,
1002,
8340... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10310,
12,
2890,
16,
963,
33,
7036,
4672,
389,
832,
7446,
67,
430,
12204,
12,
2890,
18,
12204,
13,
309,
963,
353,
599,
30,
963,
273,
365,
18,
917,
1327,
963,
411,
374,
30,
1002,
8340... |
for line in self.body: | for line in body: | def _get_body(self): """Return the message body ready for HTML, decoded if necessary""" if self.charset is None or self.cenc != "quoted-printable": return null_to_space(string.join(self.body, "")) # the charset is specified and the body is quoted-printable # first get rid of soft line breaks, then decode literals lines = [] rx = self._rx_softline for line in self.body: mo = rx.search(line) if mo: i = string.rfind(line, "=") line = line[:i] lines.append(line) buf = string.join(lines, "") chunks = [] offset = 0 rx = self._rx_quote while 1: mo = rx.search(buf, offset) if not mo: chunks.append(buf[offset:]) break i = mo.start() chunks.append(buf[offset:i]) offset = i + 3 chunks.append(chr(string.atoi(mo.group(1), 16))) return null_to_space(string.join(chunks, "")) | 5b10063a6ae6264cdfd448ca41bab10499801d2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/5b10063a6ae6264cdfd448ca41bab10499801d2e/HyperArch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
3432,
12,
2890,
4672,
3536,
990,
326,
883,
1417,
5695,
364,
3982,
16,
6383,
309,
4573,
8395,
309,
365,
18,
9999,
353,
599,
578,
365,
18,
71,
1331,
480,
315,
15179,
17,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
3432,
12,
2890,
4672,
3536,
990,
326,
883,
1417,
5695,
364,
3982,
16,
6383,
309,
4573,
8395,
309,
365,
18,
9999,
353,
599,
578,
365,
18,
71,
1331,
480,
315,
15179,
17,
... |
self.send_response(status) | response_headers = [('Content-type', 'text/html')] self.start(status, response_headers) | def render(self, message=None, css_class='alert', form_contents=None, status=200, title="Python OpenID Consumer Example"): """Render a page.""" self.send_response(status) self.pageHeader(title) if message: self.wfile.write("<div class='%s'>" % (css_class,)) self.wfile.write(message) self.wfile.write("</div>") self.pageFooter(form_contents) | ac445d9fd079c380d0a80c6d06710bb66e2a1034 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11400/ac445d9fd079c380d0a80c6d06710bb66e2a1034/openid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
883,
33,
7036,
16,
3747,
67,
1106,
2218,
11798,
2187,
646,
67,
3980,
33,
7036,
16,
1267,
33,
6976,
16,
2077,
1546,
15774,
25781,
9326,
5090,
6,
4672,
3536,
3420,
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,
1743,
12,
2890,
16,
883,
33,
7036,
16,
3747,
67,
1106,
2218,
11798,
2187,
646,
67,
3980,
33,
7036,
16,
1267,
33,
6976,
16,
2077,
1546,
15774,
25781,
9326,
5090,
6,
4672,
3536,
3420,
27... |
optimizer = Optimizer(metainterp_sd, loop, optimizations, not_a_bridge=True) | optimizer = Optimizer(metainterp_sd, loop, optimizations) | def optimize_loop(self, ops, optops): loop = self.parse(ops) # self.loop = loop metainterp_sd = FakeMetaInterpStaticData(self.cpu) if hasattr(self, 'vrefinfo'): metainterp_sd.virtualref_info = self.vrefinfo # # XXX list the exact optimizations that are needed for each test from pypy.jit.metainterp.optimizeopt import (OptIntBounds, OptRewrite, OptVirtualize, OptString, OptHeap, OptFfiCall, Optimizer) optimizations = [OptIntBounds(), OptRewrite(), OptVirtualize(), OptString(), OptHeap(), OptFfiCall(), ] optimizer = Optimizer(metainterp_sd, loop, optimizations, not_a_bridge=True) optimizer.propagate_all_forward() # expected = self.parse(optops) print '\n'.join([str(o) for o in loop.operations]) self.assert_equal(loop, expected) | e7f5dad375cf1f28d07ab766e85a1f1288cacb83 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/e7f5dad375cf1f28d07ab766e85a1f1288cacb83/test_optimizebasic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10979,
67,
6498,
12,
2890,
16,
6727,
16,
2153,
4473,
4672,
2798,
273,
365,
18,
2670,
12,
4473,
13,
468,
365,
18,
6498,
273,
2798,
5100,
11606,
84,
67,
6427,
273,
11551,
2781,
2465,
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,
10979,
67,
6498,
12,
2890,
16,
6727,
16,
2153,
4473,
4672,
2798,
273,
365,
18,
2670,
12,
4473,
13,
468,
365,
18,
6498,
273,
2798,
5100,
11606,
84,
67,
6427,
273,
11551,
2781,
2465,
84,... |
if (shifted >> argument) != receiver: raise PrimitiveFailedError() | if shifted < 0: if constants.TAGGED_MININT ^ shifted > constants.TAGGED_MAXINT: raise PrimitiveFailedError() else: if shifted & constants.TAGGED_MAXINT != shifted: raise PrimitiveFailedError() | def func(interp, receiver, argument): # left shift, must fail if we loose bits beyond 32 if argument > 0: shifted = receiver << argument if (shifted >> argument) != receiver: raise PrimitiveFailedError() return interp.space.wrap_int(shifted) # right shift, ok to lose bits else: return interp.space.wrap_int(receiver >> -argument) | 12a0bb9573e5b6f538d92a78bc767a7ae0c02764 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/12a0bb9573e5b6f538d92a78bc767a7ae0c02764/primitives.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1326,
12,
24940,
16,
5971,
16,
1237,
4672,
225,
468,
2002,
4654,
16,
1297,
2321,
309,
732,
28393,
4125,
17940,
3847,
309,
1237,
405,
374,
30,
21340,
273,
5971,
2296,
1237,
282,
309,
2134... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1326,
12,
24940,
16,
5971,
16,
1237,
4672,
225,
468,
2002,
4654,
16,
1297,
2321,
309,
732,
28393,
4125,
17940,
3847,
309,
1237,
405,
374,
30,
21340,
273,
5971,
2296,
1237,
282,
309,
2134... |
return [i*valueStep for i in xrange(i0,i1+1)] | return valueStep,[i*valueStep for i in xrange(i0,i1+1)] def _calcTickPositions(self): return self._calcStepAndTickPositions()[1] | def _calcTickPositions(self): valueStep = getattr(self,'_computedValueStep',None) if valueStep: del self._computedValueStep self._valueStep = valueStep else: self._calcValueStep() valueStep = self._valueStep valueMin = self._valueMin valueMax = self._valueMax fuzz = 1e-8*valueStep rangeRound = self.rangeRound i0 = int(float(valueMin)/valueStep) v = i0*valueStep if rangeRound in ('both','floor'): if v>valueMin+fuzz: i0 -= 1 elif v<valueMin-fuzz: i0 += 1 i1 = int(float(valueMax)/valueStep) v = i1*valueStep if rangeRound in ('both','ceiling'): if v<valueMax-fuzz: i1 += 1 elif v>valueMax+fuzz: i1 -= 1 return [i*valueStep for i in xrange(i0,i1+1)] | 6167ecac4c19e1b70ea8ba58b40324e78339a6e2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3878/6167ecac4c19e1b70ea8ba58b40324e78339a6e2/axes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12448,
6264,
11024,
12,
2890,
4672,
460,
4160,
273,
3869,
12,
2890,
11189,
67,
20307,
620,
4160,
2187,
7036,
13,
309,
460,
4160,
30,
1464,
365,
6315,
20307,
620,
4160,
365,
6315,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12448,
6264,
11024,
12,
2890,
4672,
460,
4160,
273,
3869,
12,
2890,
11189,
67,
20307,
620,
4160,
2187,
7036,
13,
309,
460,
4160,
30,
1464,
365,
6315,
20307,
620,
4160,
365,
6315,
11... |
print e | wikipedia.output(u'%s' % e) | def run(self): commons = wikipedia.Site('commons', 'commons') comment = wikipedia.translate(self.site, nowCommonsMessage) for page in self.getPageGenerator(): wikipedia.output(u'\n\n>> %s <<\n' % page.title()) try: localImagePage = wikipedia.ImagePage(self.site, page.title()) if localImagePage.fileIsOnCommons(): wikipedia.output(u'File is already on Commons.') continue md5 = localImagePage.getFileMd5Sum() localText = localImagePage.get() match = self.nowCommonsR.search(localText) if not match: wikipedia.output(u'NowCommons template not found.') continue filename = match.group('filename') or localImagePage.titleWithoutNamespace() commonsImagePage = wikipedia.ImagePage(commons, 'Image:%s' % filename) if len(localImagePage.getFileVersionHistory()) > 1: wikipedia.output(u'This image has a version history. Please manually delete it after making sure that the old versions aren\'t worth keeping.') continue commonsText = commonsImagePage.get() if md5 == commonsImagePage.getFileMd5Sum(): wikipedia.output(u'The image is identical to the one on Commons.') wikipedia.output(u'\n\n>>>>>>> Description on %s <<<<<<\n\n' % repr(self.site)) wikipedia.output(localText) wikipedia.output(u'\n\n>>>>>> Description on Commons <<<<<<\n\n') wikipedia.output(commonsText) choice = wikipedia.inputChoice(u'Does the description on Commons contain all required source and license information?', ['yes', 'no'], ['y', 'N'], 'N') if choice == 'y': localImagePage.delete(comment, prompt = False) else: wikipedia.output(u'The image is not identical to the one on Commons!') except (wikipedia.NoPage, wikipedia.IsRedirectPage), e: print e continue | f9b75d68fd61037efde61754ac74574523aa6566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/f9b75d68fd61037efde61754ac74574523aa6566/nowcommons.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
24021,
273,
21137,
18,
4956,
2668,
6054,
87,
2187,
296,
6054,
87,
6134,
2879,
273,
21137,
18,
13929,
12,
2890,
18,
4256,
16,
2037,
6517,
87,
1079,
13,
364,
1363,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
24021,
273,
21137,
18,
4956,
2668,
6054,
87,
2187,
296,
6054,
87,
6134,
2879,
273,
21137,
18,
13929,
12,
2890,
18,
4256,
16,
2037,
6517,
87,
1079,
13,
364,
1363,
... |
"exclude=", "include=", "package=", "strip") | "exclude=", "include=", "package=", "strip", "iconfile=") | def main(builder=None): if builder is None: builder = AppBuilder(verbosity=1) shortopts = "b:n:r:e:m:c:p:lx:i:hvq" longopts = ("builddir=", "name=", "resource=", "executable=", "mainprogram=", "creator=", "nib=", "plist=", "link", "link-exec", "help", "verbose", "quiet", "standalone", "exclude=", "include=", "package=", "strip") try: options, args = getopt.getopt(sys.argv[1:], shortopts, longopts) except getopt.error: usage() for opt, arg in options: if opt in ('-b', '--builddir'): builder.builddir = arg elif opt in ('-n', '--name'): builder.name = arg elif opt in ('-r', '--resource'): builder.resources.append(arg) elif opt in ('-e', '--executable'): builder.executable = arg elif opt in ('-m', '--mainprogram'): builder.mainprogram = arg elif opt in ('-c', '--creator'): builder.creator = arg elif opt == "--nib": builder.nibname = arg elif opt in ('-p', '--plist'): builder.plist = Plist.fromFile(arg) elif opt in ('-l', '--link'): builder.symlink = 1 elif opt == '--link-exec': builder.symlink_exec = 1 elif opt in ('-h', '--help'): usage() elif opt in ('-v', '--verbose'): builder.verbosity += 1 elif opt in ('-q', '--quiet'): builder.verbosity -= 1 elif opt == '--standalone': builder.standalone = 1 elif opt in ('-x', '--exclude'): builder.excludeModules.append(arg) elif opt in ('-i', '--include'): builder.includeModules.append(arg) elif opt == '--package': builder.includePackages.append(arg) elif opt == '--strip': builder.strip = 1 if len(args) != 1: usage("Must specify one command ('build', 'report' or 'help')") command = args[0] if command == "build": builder.setup() builder.build() elif command == "report": builder.setup() builder.report() elif command == "help": usage() else: usage("Unknown command '%s'" % command) | bd25429c867b465b9b21a446ec81ab9bf3fcdf80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/bd25429c867b465b9b21a446ec81ab9bf3fcdf80/bundlebuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
9574,
33,
7036,
4672,
309,
2089,
353,
599,
30,
2089,
273,
4677,
1263,
12,
16629,
8807,
33,
21,
13,
225,
3025,
4952,
273,
315,
70,
30,
82,
30,
86,
30,
73,
30,
81,
30,
71,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9574,
33,
7036,
4672,
309,
2089,
353,
599,
30,
2089,
273,
4677,
1263,
12,
16629,
8807,
33,
21,
13,
225,
3025,
4952,
273,
315,
70,
30,
82,
30,
86,
30,
73,
30,
81,
30,
71,
... |
if self.__options.docstrings: | if opts.docstrings and not opts.nodocstrings.get(self.__curfile): | def __waiting(self, ttype, tstring, lineno): # Do docstring extractions, if enabled if self.__options.docstrings: # module docstring? if self.__freshmodule: if ttype == tokenize.STRING: self.__addentry(safe_eval(tstring), lineno, isdocstring=1) self.__freshmodule = 0 elif ttype not in (tokenize.COMMENT, tokenize.NL): self.__freshmodule = 0 return # class docstring? if ttype == tokenize.NAME and tstring in ('class', 'def'): self.__state = self.__suiteseen return if ttype == tokenize.NAME and tstring in self.__options.keywords: self.__state = self.__keywordseen | 6c846207c39841ddcb1877377b20ec30bef07b97 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/6c846207c39841ddcb1877377b20ec30bef07b97/pygettext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
20241,
12,
2890,
16,
27963,
16,
268,
1080,
16,
7586,
4672,
468,
2256,
14525,
7582,
4905,
16,
309,
3696,
309,
1500,
18,
2434,
10219,
471,
486,
1500,
18,
30631,
10219,
18,
588,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
20241,
12,
2890,
16,
27963,
16,
268,
1080,
16,
7586,
4672,
468,
2256,
14525,
7582,
4905,
16,
309,
3696,
309,
1500,
18,
2434,
10219,
471,
486,
1500,
18,
30631,
10219,
18,
588,
12,
... |
def synchronize_logs(self): """Transfer data from client ranks to the head rank. Must be called on all ranks simultaneously.""" if self.mpi_comm is None: return from boostmpi import gather if self.mpi_comm.rank == self.head_rank: for rank_data in gather(self.mpi_comm, None, self.head_rank)[1:]: for name, rows in rank_data: self.get_table(name).insert_rows(rows) if self.db_conn is not None: for row in rows: self.db_conn.execute( "insert into %s values (?,?,?)" % name, row) else: gather(self.mpi_comm, [(name, self.get_table(name).data) for name, qdat in self.quantity_data.iteritems()], self.head_rank) for qname in self.quantity_data.iterkeys(): self.get_table(qname).clear() | def save(self): self.synchronize_logs() | 68e52a934a22c3fe6fe78e9538bda5a4ece17736 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12871/68e52a934a22c3fe6fe78e9538bda5a4ece17736/log.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
4672,
365,
18,
87,
2600,
554,
67,
10011,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1923,
12,
2890,
4672,
365,
18,
87,
2600,
554,
67,
10011,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
def TestControlledBinomialSelection(self): 'Testing controlled bionomial selection (broken mating scheme)' freq = FreqTrajectoryStoch(freq=0.05, N=100) burnin = 100 mutAge = len(freq) def expectedFreq(gen): if gen <= burnin: return [0] else: return [freq[gen-1-burnin]] | def TestControlledBinomialSelection(self): 'Testing controlled bionomial selection (broken mating scheme)' #TurnOnDebug(DBG_MATING) #TurnOnDebug(DBG_DEVEL) # planned trajectory freq = FreqTrajectoryStoch(freq=0.05, N=100) # staring from when? burnin = 100 mutAge = len(freq) # trajectory function # 0 ...., 100, 101, .... 100+mutAge # x freq def expectedFreq(gen): if gen <= burnin: return [0] else: #print "Gen ", gen, " exp: ", freq[gen-1-burnin] return [freq[gen-1-burnin]] # | 0c33de1f86fdaae8f0d34208d96b1f99bc86d89d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/401/0c33de1f86fdaae8f0d34208d96b1f99bc86d89d/test_05_matings.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7766,
3367,
1259,
9913,
11496,
6233,
12,
2890,
4672,
296,
22218,
25934,
324,
285,
11496,
4421,
261,
70,
19906,
312,
1776,
4355,
2506,
468,
15858,
1398,
2829,
12,
2290,
43,
67,
24571,
1360,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7766,
3367,
1259,
9913,
11496,
6233,
12,
2890,
4672,
296,
22218,
25934,
324,
285,
11496,
4421,
261,
70,
19906,
312,
1776,
4355,
2506,
468,
15858,
1398,
2829,
12,
2290,
43,
67,
24571,
1360,... | |
if not first_child: | if need_indent: | def process_list_item(self, node, indent): found = False first_child = True for i in node.childNodes: name = i.localName if name == 'p': if not first_child: self.text.append(indent) self.process_paragraph_item(i) self.text.append("\n") found = True elif name == 'pre': if not first_child: self.text.append(indent) self.process_preformatted_item(i) found = True elif name in ('ol', 'ul',): self.process_list(i) found = True elif name == 'dl': self.process_dl(i) found = True elif name == 'table': if not first_child: self.text.append(indent) self.process_table(i) found = True #else: # self.process_inline(i) first_child = False if not found: self.process_paragraph_item(node) self.text.append("\n") | 108e46b88f2eb732af04601aaf840b326f10d34a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/108e46b88f2eb732af04601aaf840b326f10d34a/text_html_text_x_moin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
1098,
67,
1726,
12,
2890,
16,
756,
16,
3504,
4672,
1392,
273,
1083,
1122,
67,
3624,
273,
1053,
364,
277,
316,
756,
18,
3624,
3205,
30,
508,
273,
277,
18,
3729,
461,
309,
50... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
1098,
67,
1726,
12,
2890,
16,
756,
16,
3504,
4672,
1392,
273,
1083,
1122,
67,
3624,
273,
1053,
364,
277,
316,
756,
18,
3624,
3205,
30,
508,
273,
277,
18,
3729,
461,
309,
50... |
if profilers.present(): profilers.stop(self) profilers.report(self) | def execute(self, dir = None, pages_requested = 20): autotest_utils.check_kernel_ver("2.6.16") | 7b966edebce58b626c3b054de7ab66e9918adc99 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10349/7b966edebce58b626c3b054de7ab66e9918adc99/libhugetlbfs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
1577,
273,
599,
16,
4689,
67,
19065,
273,
4200,
4672,
2059,
352,
395,
67,
5471,
18,
1893,
67,
8111,
67,
502,
2932,
22,
18,
26,
18,
2313,
7923,
2,
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,
1836,
12,
2890,
16,
1577,
273,
599,
16,
4689,
67,
19065,
273,
4200,
4672,
2059,
352,
395,
67,
5471,
18,
1893,
67,
8111,
67,
502,
2932,
22,
18,
26,
18,
2313,
7923,
2,
-100,
-100,
-100... | |
roti=iii*self.zwopi/self.nrot self._rot.append((phii, ssii, roti)) | roti=(iii+1)*self.zwopi/self.nrot self._rot.append((phiii, ssii, roti)) | def read_rotdat(self): self.zwopi=2.0*3.14159265 self.NbRotByTrans=0 self.theta=[] self.nphi=[] # read theta,phi,rot data rotdat=open('rotation.dat','r') line=rotdat.readline().split() self.ntheta=int(line[0]) self.nrot=int(line[1]) print "ntheta, nrot: %i %i" %(self.ntheta,self.nrot) for i in range(self.ntheta): line=rotdat.readline().split() self.theta.append(float(line[0])) self.nphi.append(int(line[1])) self.NbRotByTrans=self.NbRotByTrans+self.nphi[i]*self.nrot self.theta[i]=self.zwopi*self.theta[i]/360.0 print self.theta[i],self.nphi[i] rotdat.close() self._rot=[] print "%i rotations by translation"%self.NbRotByTrans | b71bf692f1ebdba0a019cbdc1d4d14809d50d1ab /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11088/b71bf692f1ebdba0a019cbdc1d4d14809d50d1ab/Attract.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
8342,
3404,
12,
2890,
4672,
365,
18,
94,
91,
556,
77,
33,
22,
18,
20,
14,
23,
18,
3461,
24872,
30281,
365,
18,
22816,
8570,
858,
1429,
33,
20,
365,
18,
14482,
33,
8526,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
8342,
3404,
12,
2890,
4672,
365,
18,
94,
91,
556,
77,
33,
22,
18,
20,
14,
23,
18,
3461,
24872,
30281,
365,
18,
22816,
8570,
858,
1429,
33,
20,
365,
18,
14482,
33,
8526,
36... |
overlay.delete(self.config['storage']) raise Exception('Adding the overlay failed!') | raise Exception('Adding the overlay failed! Possible remains of' ' the opration have NOT been removed and may be' ' left at ' + path([self.config['storage'], overlay.name]) + '. Please re' 'move them manually if required.') | def add(self, overlay): ''' Add an overlay to the local list of overlays. | b44c3f3323ec3514a14ffc6c552dd1fe45ad228a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7305/b44c3f3323ec3514a14ffc6c552dd1fe45ad228a/db.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
12,
2890,
16,
9218,
4672,
9163,
1436,
392,
9218,
358,
326,
1191,
666,
434,
9218,
87,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
527,
12,
2890,
16,
9218,
4672,
9163,
1436,
392,
9218,
358,
326,
1191,
666,
434,
9218,
87,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
t[key] = d[key] | print >>sys.stderr, 'Unhandled/malformed CSS key:', key, d[key] if 'small' in t.values(): print d, 'font-size' in d.keys() | def translate_attrs(d, font_delta=0): """ Receives a dictionary of html attributes and styles and returns approximate Xylog equivalents in a new dictionary """ t = dict() for key in d.keys(): try: val = d[key].lower() except IndexError: val = None if key == "font-family": if max(val.find("courier"), val.find("mono"), val.find("fixed"), val.find("typewriter"))>=0: t["fontfacename"] = "Courier10 BT Roman" elif max(val.find("arial"), val.find("helvetica"), val.find("verdana"), val.find("trebuchet"), val.find("sans")) >= 0: t["fontfacename"] = "Swis721 BT Roman" else: t["fontfacename"] = "Dutch801 Rm BT Roman" elif key == "font-size": unit = Span.unit_convert(val, 14) if unit is not None: # Assume a 10 pt font (14 pixels) has fontsize 100 t["fontsize"] = str(int (unit / 14.0 * 100)) else: if val.find("xx-small") >= 0: t["fontsize"] = "40" elif val.find("x-small") >= 0: t["fontsize"] = "60" elif val.find("small") >= 0: t["fontsize"] = "80" elif val.find("xx-large") >= 0: t["fontsize"] = "180" elif val.find("x-large") >= 0: t["fontsize"] = "140" elif val.find("large") >= 0: t["fontsize"] = "120" else: t["fontsize"] = "100" fnsz = int(t['fontsize']) fnsz += font_delta * 20 t['fontsize'] = str(fnsz) elif key == "font-weight": m = re.match ("\s*([0-9]+)", val) if m is not None: #report (m.group(1)) t["fontweight"] = str(int(int(m.group(1)))) else: if val.find("bold") >= 0 or val.find("strong") >= 0: t["fontweight"] = "1000" else: t["fontweight"] = "400" elif key.startswith("margin"): if key == "margin": u = [] for x in val.split(" "): u.append(Span.unit_convert (x,200)*2) if len(u)==1: u = [u[0], u[0], u[0], u[0]] elif len(u)==2: u = [u[0], u[1], u[0], u[1]] elif len(u)==3: u = [u[0], u[1], u[2], u[1]] elif key == "margin-top": u = [Span.unit_convert(val, 200)*2, None, None, None] elif key == "margin-right": u = [None, Span.unit_convert(val, 200)*2, None, None] elif key == "margin-bottom": u = [None, None, Span.unit_convert(val, 200)*2, None] else: u = [None, None, None, Span.unit_convert(val, 200)*2] if u[2] is not None: t["parskip"] = str(u[2]) t["footskip"] = str(u[2]) if u[0] is not None: t["topskip"] = str(u[0]) if u[1] is not None: t["sidemargin"] = str(u[1]) elif key == "text-align" or key == "align": if val in ["right", "foot"]: t["align"] = "foot" elif val == "center": t["align"] = "center" else: t["align"] = "head" else: t[key] = d[key] return t | 99e11d3693afff0a8d954cfb9ed1a797a3fce436 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9125/99e11d3693afff0a8d954cfb9ed1a797a3fce436/convert_from.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4204,
67,
7039,
12,
72,
16,
3512,
67,
9878,
33,
20,
4672,
3536,
9797,
3606,
279,
3880,
434,
1729,
1677,
471,
5687,
471,
1135,
21204,
1139,
93,
1330,
1298,
5162,
4877,
316,
279,
394,
38... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4204,
67,
7039,
12,
72,
16,
3512,
67,
9878,
33,
20,
4672,
3536,
9797,
3606,
279,
3880,
434,
1729,
1677,
471,
5687,
471,
1135,
21204,
1139,
93,
1330,
1298,
5162,
4877,
316,
279,
394,
38... |
content = a.childNodes[0].nodeValue | if len(a.childNodes): content = a.childNodes[0].nodeValue else: content = "" | def task_from_xml(task,xmlnode) : cur_task = task cur_stat = "%s" %xmlnode.getAttribute("status") donedate = cleanxml.readTextNode(xmlnode,"donedate") cur_task.set_status(cur_stat,donedate=donedate) #we will fill the task with its content cur_task.set_title(cleanxml.readTextNode(xmlnode,"title")) #the subtasks sub_list = xmlnode.getElementsByTagName("subtask") for s in sub_list : sub_tid = s.childNodes[0].nodeValue cur_task.add_subtask(sub_tid) attr_list = xmlnode.getElementsByTagName("attribute") for a in attr_list: content = a.childNodes[0].nodeValue key = a.getAttribute("key") namespace = a.getAttribute("namespace") cur_task.set_attribute(key, content, namespace=namespace) tasktext = xmlnode.getElementsByTagName("content") if len(tasktext) > 0 : if tasktext[0].firstChild : tas = "<content>%s</content>" %tasktext[0].firstChild.nodeValue content = xml.dom.minidom.parseString(tas) cur_task.set_text(content.firstChild.toxml()) #pylint: disable-msg=E1103 cur_task.set_due_date(cleanxml.readTextNode(xmlnode,"duedate")) cur_task.set_start_date(cleanxml.readTextNode(xmlnode,"startdate")) cur_tags = xmlnode.getAttribute("tags").replace(' ','').split(",") if "" in cur_tags: cur_tags.remove("") for tag in cur_tags: cur_task.add_tag(tag) #Why should we sync here ? It makes no sense #cur_task.sync() return cur_task | 423a9ed078ac1f79aa04ca7d3a40d44c2823ece6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8234/423a9ed078ac1f79aa04ca7d3a40d44c2823ece6/taskxml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1562,
67,
2080,
67,
2902,
12,
4146,
16,
2902,
2159,
13,
294,
662,
67,
4146,
273,
1562,
662,
67,
5642,
273,
2213,
87,
6,
738,
2902,
2159,
18,
588,
1499,
2932,
2327,
7923,
2727,
329,
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,
1562,
67,
2080,
67,
2902,
12,
4146,
16,
2902,
2159,
13,
294,
662,
67,
4146,
273,
1562,
662,
67,
5642,
273,
2213,
87,
6,
738,
2902,
2159,
18,
588,
1499,
2932,
2327,
7923,
2727,
329,
3... |
if tests.unit(self.to_run): if sys.version[:3] == (2, 4, 2): print "You're running Python 2.4.2, which is buggy." raise SystemExit("Test failures are listed above.") | self.__test() | def run(self): import tests import mmap | 7fa36d0966a06d2d3bd832cf6e26f322626809f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1845/7fa36d0966a06d2d3bd832cf6e26f322626809f7/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
1930,
7434,
1930,
30749,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
1930,
7434,
1930,
30749,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def copy(self, cr, uid, id, default={}, context={}, done_list=[], local=False): group = self.browse(cr, uid, id, context=context) default = default.copy() if not 'name' in default: default['name'] = group['name'] default['name'] = default['name'] + _(' (copy)') return super(groups, self).copy(cr, uid, id, default, context=context) | def create(self, cr, uid, vals, context=None): if 'name' in vals: if vals['name'].startswith('-'): raise osv.except_osv(_('Error'), _('The name of the group can not start with "-"')) gid = super(groups, self).create(cr, uid, vals, context=context) if context and context.get('noadmin', False): pass else: # assign this new group to user_root user_obj = self.pool.get('res.users') aid = user_obj.browse(cr, 1, user_obj._get_admin_id(cr)) if aid: aid.write({'groups_id': [(4, gid)]}) return gid | 4d406ba4748c4d84f2261f081595271ee065f7c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4d406ba4748c4d84f2261f081595271ee065f7c3/res_user.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
4555,
16,
5773,
16,
819,
33,
7036,
4672,
309,
296,
529,
11,
316,
5773,
30,
309,
5773,
3292,
529,
29489,
17514,
1918,
2668,
6627,
4672,
1002,
1140,
90,
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,
752,
12,
2890,
16,
4422,
16,
4555,
16,
5773,
16,
819,
33,
7036,
4672,
309,
296,
529,
11,
316,
5773,
30,
309,
5773,
3292,
529,
29489,
17514,
1918,
2668,
6627,
4672,
1002,
1140,
90,
18,
... | |
self.setViewFrontAction.setText(self.__tr("Front View")) self.setViewFrontAction.setMenuText(self.__tr("&Front View")) self.setViewFrontAction.setToolTip(self.__tr("Front View")) self.setViewBackAction.setText(self.__tr("Back View")) self.setViewBackAction.setMenuText(self.__tr("&Back View")) self.setViewTopAction.setText(self.__tr("Top View")) self.setViewTopAction.setMenuText(self.__tr("&Top View")) self.setViewTopAction.setToolTip(self.__tr("Top View")) self.setViewBottomAction.setText(self.__tr("Bottom View")) self.setViewBottomAction.setMenuText(self.__tr("Botto&m View")) self.setViewRightAction.setText(self.__tr("Right View")) self.setViewRightAction.setMenuText(self.__tr("&Right View")) self.setViewRightAction.setToolTip(self.__tr("Right View")) self.setViewLeftAction.setText(self.__tr("Left View")) self.setViewLeftAction.setMenuText(self.__tr("&Left View")) self.setViewLeftAction.setToolTip(self.__tr("Left View")) | self.setViewFrontAction.setText(self.__tr("&Front")) self.setViewFrontAction.setMenuText(self.__tr("&Front")) self.setViewFrontAction.setToolTip(self.__tr("Front")) self.setViewBackAction.setText(self.__tr("Back")) self.setViewBackAction.setMenuText(self.__tr("&Back")) self.setViewTopAction.setText(self.__tr("Top")) self.setViewTopAction.setMenuText(self.__tr("&Top")) self.setViewTopAction.setToolTip(self.__tr("Top")) self.setViewBottomAction.setText(self.__tr("Bottom")) self.setViewBottomAction.setMenuText(self.__tr("Botto&m")) self.setViewRightAction.setText(self.__tr("Right")) self.setViewRightAction.setMenuText(self.__tr("&Right")) self.setViewRightAction.setToolTip(self.__tr("Right")) self.setViewLeftAction.setText(self.__tr("Left")) self.setViewLeftAction.setMenuText(self.__tr("&Left")) self.setViewLeftAction.setToolTip(self.__tr("Left")) | def languageChange(self): self.setCaption(self.__tr("Atom")) self.fileNewAction.setText(self.__tr("New")) self.fileNewAction.setMenuText(self.__tr("&New")) self.fileNewAction.setAccel(self.__tr("Ctrl+N")) self.fileOpenAction.setText(self.__tr("Open")) self.fileOpenAction.setMenuText(self.__tr("&Open...")) self.fileOpenAction.setAccel(self.__tr("Ctrl+O")) self.fileSaveAction.setText(self.__tr("Save")) self.fileSaveAction.setMenuText(self.__tr("&Save")) self.fileSaveAction.setAccel(self.__tr("Ctrl+S")) self.fileSaveAsAction.setText(self.__tr("Save As")) self.fileSaveAsAction.setMenuText(self.__tr("Save &As...")) self.fileSaveAsAction.setAccel(QString.null) self.fileImageAction.setText(self.__tr("&Image...")) self.fileImageAction.setMenuText(self.__tr("&Image...")) self.fileImageAction.setAccel(self.__tr("Ctrl+I")) self.fileExitAction.setText(self.__tr("Exit")) self.fileExitAction.setMenuText(self.__tr("E&xit")) self.fileExitAction.setAccel(QString.null) self.editUndoAction.setText(self.__tr("Undo")) self.editUndoAction.setMenuText(self.__tr("&Undo")) self.editUndoAction.setAccel(self.__tr("Ctrl+Z")) self.editRedoAction.setText(self.__tr("Redo")) self.editRedoAction.setMenuText(self.__tr("&Redo")) self.editRedoAction.setAccel(self.__tr("Ctrl+Y")) self.editCutAction.setText(self.__tr("Cut")) self.editCutAction.setMenuText(self.__tr("&Cut")) self.editCutAction.setAccel(self.__tr("Ctrl+X")) self.editCopyAction.setText(self.__tr("Copy")) self.editCopyAction.setMenuText(self.__tr("C&opy")) self.editCopyAction.setAccel(self.__tr("Ctrl+C")) self.editPasteAction.setText(self.__tr("Paste")) self.editPasteAction.setMenuText(self.__tr("&Paste")) self.editPasteAction.setAccel(self.__tr("Ctrl+V")) self.editFindAction.setText(self.__tr("Find")) self.editFindAction.setMenuText(self.__tr("&Find...")) self.helpContentsAction.setText(self.__tr("Contents")) self.helpContentsAction.setMenuText(self.__tr("&Contents...")) self.helpContentsAction.setAccel(QString.null) self.helpIndexAction.setText(self.__tr("Index")) self.helpIndexAction.setMenuText(self.__tr("&Index...")) self.helpIndexAction.setAccel(QString.null) self.helpAboutAction.setText(self.__tr("About")) self.helpAboutAction.setMenuText(self.__tr("&About")) self.helpAboutAction.setAccel(QString.null) self.setViewFitToWindowAction.setText(self.__tr("Fit to Window")) self.setViewFitToWindowAction.setMenuText(self.__tr("&Fit to Window")) self.setViewFitToWindowAction.setToolTip(self.__tr("Fit to Window (Ctrl+F)")) self.setViewFitToWindowAction.setAccel(self.__tr("Ctrl+F")) self.fileCloseAction.setText(self.__tr("Close")) self.fileCloseAction.setMenuText(self.__tr("&Close")) self.viewDefviewAction.setText(self.__tr("&Default Views")) self.viewDefviewAction.setMenuText(self.__tr("&Default Views")) self.viewDefviewAction.setToolTip(self.__tr("Default Views")) self.dispBGColorAction.setText(self.__tr("Background Color...")) self.dispBGColorAction.setMenuText(self.__tr("&Background Color...")) self.selectAllAction.setText(self.__tr("All")) self.selectAllAction.setMenuText(self.__tr("&All")) self.selectAllAction.setToolTip(self.__tr("Select All (Ctrl+A)")) self.selectAllAction.setAccel(self.__tr("Ctrl+A")) self.selectNoneAction.setText(self.__tr("None")) self.selectNoneAction.setMenuText(self.__tr("&None")) self.selectNoneAction.setToolTip(self.__tr("Select None (Ctrl+D)")) self.selectNoneAction.setAccel(self.__tr("Ctrl+D")) self.selectInvertAction.setText(self.__tr("Invert")) self.selectInvertAction.setMenuText(self.__tr("&Invert")) self.selectInvertAction.setToolTip(self.__tr("Select Invert (Ctrl+Shift+I)")) self.selectInvertAction.setAccel(self.__tr("Ctrl+Shift+I")) self.toolsRevolveAction.setText(self.__tr("Revolve")) self.toolsRevolveAction.setMenuText(self.__tr("&Revolve")) self.toolsRevolveAction.setToolTip(self.__tr("Revolve")) self.toolsExtrudeAction.setText(self.__tr("Extrude")) self.toolsExtrudeAction.setMenuText(self.__tr("&Extrude")) self.toolsExtrudeAction.setToolTip(self.__tr("Extrude")) self.toolsCookieCutAction.setText(self.__tr("Cookie Cutter")) self.toolsCookieCutAction.setMenuText(self.__tr("&Cookie Cutter")) self.toolsCookieCutAction.setToolTip(self.__tr("Cookie Cutter")) self.toolsSimulatorAction.setText(self.__tr("Simulator")) self.toolsSimulatorAction.setMenuText(self.__tr("&Simulator...")) self.toolsSimulatorAction.setToolTip(self.__tr("Simulator")) self.ccAddLayerAction.setText(self.__tr("Add Layer")) self.ccAddLayerAction.setMenuText(self.__tr("Add Layer")) self.toolsDoneAction.setText(self.__tr("Done")) self.toolsDoneAction.setMenuText(self.__tr("Done")) self.toolsCancelAction.setText(self.__tr("Cancel")) self.toolsCancelAction.setMenuText(self.__tr("Cancel")) self.editDeleteAction.setText(self.__tr("Delete")) self.editDeleteAction.setMenuText(self.__tr("&Delete")) self.editDeleteAction.setToolTip(self.__tr("Delete (Del)")) self.editDeleteAction.setAccel(self.__tr("Del")) self.viewToolbarsAction.setText(self.__tr("Toolbars")) self.viewToolbarsAction.setMenuText(self.__tr("&Toolbars")) self.dispObjectColorAction.setText(self.__tr("Object Color...")) self.dispObjectColorAction.setMenuText(self.__tr("&Object Color...")) self.dispOpenBondsAction.setText(self.__tr("Display Open Bonds")) self.dispOpenBondsAction.setMenuText(self.__tr("Display Open Bonds")) self.modifyHydrogenateAction.setText(self.__tr("Hydrogenate")) self.modifyHydrogenateAction.setMenuText(self.__tr("&Hydrogenate")) self.modifyHydrogenateAction.setToolTip(self.__tr("Hydrogenate (Ctrl+H)")) self.modifyHydrogenateAction.setAccel(self.__tr("Ctrl+H")) self.modifyPassivateAction.setText(self.__tr("Passivate")) self.modifyPassivateAction.setMenuText(self.__tr("&Passivate")) self.modifyPassivateAction.setToolTip(self.__tr("Passivate (Ctrl+P)")) self.modifyPassivateAction.setAccel(self.__tr("Ctrl+P")) self.jigsMotorAction.setText(self.__tr("Rotary Motor")) self.jigsMotorAction.setMenuText(self.__tr("&Rotary Motor")) self.modifyMinimizeAction.setText(self.__tr("Minimize")) self.modifyMinimizeAction.setMenuText(self.__tr("&Minimize")) self.modifyMinimizeAction.setToolTip(self.__tr("Minimize (Ctrl+M)")) self.modifyMinimizeAction.setAccel(self.__tr("Ctrl+M")) self.elemChangePTableAction.setText(self.__tr("Atom Type")) self.elemChangePTableAction.setMenuText(self.__tr("Atom Type")) self.toolsMovieAction.setText(self.__tr("Movie")) self.toolsMovieAction.setMenuText(self.__tr("&Movie...")) self.toggleFileTbarAction.setText(self.__tr("File")) self.toggleFileTbarAction.setMenuText(self.__tr("File")) self.toggleEditTbarAction.setText(self.__tr("Edit")) self.toggleEditTbarAction.setMenuText(self.__tr("Edit")) self.toggleViewTbarAction.setText(self.__tr("View")) self.toggleViewTbarAction.setMenuText(self.__tr("View")) self.toggleModelDispTbarAction.setText(self.__tr("Model Display")) self.toggleModelDispTbarAction.setMenuText(self.__tr("Model Display")) self.toggleSelectTbarAction.setText(self.__tr("Select")) self.toggleSelectTbarAction.setMenuText(self.__tr("Select")) self.toggleToolsTbarAction.setText(self.__tr("Tools")) self.toggleToolsTbarAction.setMenuText(self.__tr("Tools")) self.fileSetWorkDirAction.setText(self.__tr("Set Working Directory...")) self.fileSetWorkDirAction.setMenuText(self.__tr("Set &Working Directory...")) self.dispTrihedronAction.setText(self.__tr("Trihedron")) self.dispTrihedronAction.setMenuText(self.__tr("Trihedron")) self.dispTrihedronAction.setToolTip(self.__tr("Display Trihedron")) self.dispDatumPlanesAction.setText(self.__tr("Display Datum Planes")) self.dispDatumPlanesAction.setMenuText(self.__tr("Display Datum Planes")) self.dispCsysAction.setText(self.__tr("Display Coordinate System")) self.dispCsysAction.setMenuText(self.__tr("Display Coordinate System")) self.dispDatumLinesAction.setText(self.__tr("Display Datum Lines")) self.dispDatumLinesAction.setMenuText(self.__tr("Display Datum Lines")) self.dispGridAction.setText(self.__tr("Display Grid")) self.dispGridAction.setMenuText(self.__tr("Display Grid")) self.selectConnectedAction.setText(self.__tr("Connected")) self.selectConnectedAction.setMenuText(self.__tr("&Connected")) self.selectConnectedAction.setToolTip(self.__tr("Select Connected")) self.selectConnectedAction.setAccel(self.__tr("Ctrl+Shift+C")) self.selectDoublyAction.setText(self.__tr("Doubly")) self.selectDoublyAction.setMenuText(self.__tr("&Doubly")) self.selectDoublyAction.setToolTip(self.__tr("Select Doubly")) self.selectDoublyAction.setAccel(self.__tr("Ctrl+Shift+D")) self.editPreferencesAction.setText(self.__tr("Preferences...")) self.editPreferencesAction.setMenuText(self.__tr("P&references...")) self.jigsBearingAction.setText(self.__tr("Bearing")) self.jigsBearingAction.setMenuText(self.__tr("&Bearing")) self.jigsSpringAction.setText(self.__tr("Spring")) self.jigsSpringAction.setMenuText(self.__tr("&Spring")) self.jigsDynoAction.setText(self.__tr("Dyno")) self.jigsDynoAction.setMenuText(self.__tr("&Dyno")) self.jigsHeatsinkAction.setText(self.__tr("Heatsin&k")) self.jigsHeatsinkAction.setMenuText(self.__tr("Heatsin&k")) self.setViewOrthoAction.setText(self.__tr("Ortho")) self.setViewOrthoAction.setMenuText(self.__tr("Or&tho")) self.setViewPerspecAction.setText(self.__tr("Perspective")) self.setViewPerspecAction.setMenuText(self.__tr("&Perspective")) self.jigsGroundAction.setText(self.__tr("Ground")) self.jigsGroundAction.setMenuText(self.__tr("&Ground")) self.jigsHandleAction.setText(self.__tr("Handle")) self.jigsHandleAction.setMenuText(self.__tr("&Handle")) self.modifySeparateAction.setText(self.__tr("Separate")) self.modifySeparateAction.setMenuText(self.__tr("&Separate")) self.toolsSketchAtomAction.setText(self.__tr("Sketch Atom")) self.toolsSketchAtomAction.setMenuText(self.__tr("Sketch &Atom")) self.ccGraphiteAction.setText(self.__tr("Graphite")) self.ccGraphiteAction.setMenuText(self.__tr("Graphite")) self.orient100Action.setText(self.__tr("Surface 100")) self.orient100Action.setMenuText(self.__tr("Surface 100")) self.orient110Action.setText(self.__tr("Surface 110")) self.orient110Action.setMenuText(self.__tr("Surface 110")) self.orient111Action.setText(self.__tr("Surface 111")) self.orient111Action.setMenuText(self.__tr("Surface 111")) self.setViewFrontAction.setText(self.__tr("Front View")) self.setViewFrontAction.setMenuText(self.__tr("&Front View")) self.setViewFrontAction.setToolTip(self.__tr("Front View")) self.setViewBackAction.setText(self.__tr("Back View")) self.setViewBackAction.setMenuText(self.__tr("&Back View")) self.setViewTopAction.setText(self.__tr("Top View")) self.setViewTopAction.setMenuText(self.__tr("&Top View")) self.setViewTopAction.setToolTip(self.__tr("Top View")) self.setViewBottomAction.setText(self.__tr("Bottom View")) self.setViewBottomAction.setMenuText(self.__tr("Botto&m View")) self.setViewRightAction.setText(self.__tr("Right View")) self.setViewRightAction.setMenuText(self.__tr("&Right View")) self.setViewRightAction.setToolTip(self.__tr("Right View")) self.setViewLeftAction.setText(self.__tr("Left View")) self.setViewLeftAction.setMenuText(self.__tr("&Left View")) self.setViewLeftAction.setToolTip(self.__tr("Left View")) self.setViewHomeAction.setText(self.__tr("Home")) self.setViewHomeAction.setMenuText(self.__tr("&Home")) self.setViewHomeAction.setToolTip(self.__tr("Home")) self.setViewHomeAction.setAccel(self.__tr("Home")) self.setViewRecenterAction.setText(self.__tr("Recenter")) self.setViewRecenterAction.setMenuText(self.__tr("&Recenter")) self.setViewRecenterAction.setToolTip(self.__tr("Recenter (Ctrl+R)")) self.setViewRecenterAction.setAccel(self.__tr("Ctrl+R")) self.jigsLinearMotorAction.setText(self.__tr("&Linear Motor")) self.jigsLinearMotorAction.setMenuText(self.__tr("&Linear Motor")) self.toggleModifyTbarAction.setText(self.__tr("Modify")) self.toggleModifyTbarAction.setMenuText(self.__tr("Modify")) self.toolsStartOverAction.setText(self.__tr("Start Over")) self.toolsStartOverAction.setMenuText(self.__tr("Start Over")) self.toolsBackUpAction.setText(self.__tr("Back Up")) self.toolsBackUpAction.setMenuText(self.__tr("Back Up")) self.modifyDeleteBondAction.setText(self.__tr("Delete Bond")) self.modifyDeleteBondAction.setMenuText(self.__tr("&Delete Bond")) self.fileClearAction.setText(self.__tr("Clear")) self.fileClearAction.setMenuText(self.__tr("C&lear")) self.modifyCopyBondAction.setText(self.__tr("Copy Bond")) self.modifyCopyBondAction.setMenuText(self.__tr("&Copy Bond")) self.modifyEdgeBondAction.setText(self.__tr("Edge Bond")) self.modifyEdgeBondAction.setMenuText(self.__tr("Ed&ge Bond")) self.modifyAddBondAction.setText(self.__tr("Add Bond")) self.modifyAddBondAction.setMenuText(self.__tr("&Add Bond")) self.modifyWeldMoleculeAction.setText(self.__tr("Weld Molecule")) self.modifyWeldMoleculeAction.setMenuText(self.__tr("&Weld Molecule")) self.toggleDatumDispTbarAction.setText(self.__tr("Datum Display")) self.toggleDatumDispTbarAction.setMenuText(self.__tr("Datum Display")) self.modifySetElementAction.setText(self.__tr("Change Element")) self.modifySetElementAction.setMenuText(self.__tr("Change &Element...")) self.modifySetElementAction.setAccel(self.__tr("Ctrl+E")) self.fileInsertAction.setText(self.__tr("Inser&t...")) self.fileInsertAction.setMenuText(self.__tr("Inser&t...")) self.modifyDehydrogenateAction.setText(self.__tr("Dehydrogenate")) self.modifyDehydrogenateAction.setMenuText(self.__tr("Dehydrogenate")) self.toggleGridsTbarAction.setText(self.__tr("Grids")) self.toggleGridsTbarAction.setMenuText(self.__tr("Grids")) self.selectModeActionGroup.setText(self.__tr("Select Mode")) self.selectAtomsAction.setText(self.__tr("Select Atoms Mode")) self.selectAtomsAction.setToolTip(self.__tr("Select Atoms")) self.selectAtomsAction.setMenuText(self.__tr("Select Atoms Mode")) self.selectPartsAction.setText(self.__tr("Select Part Mode")) self.selectPartsAction.setToolTip(self.__tr("Select Part")) self.selectPartsAction.setMenuText(self.__tr("Select Part Mode")) self.selectModeActionGroup.setMenuText(self.__tr("Select Mode")) self.dispCPKAction.setText(self.__tr("CPK")) self.dispCPKAction.setMenuText(self.__tr("CPK")) self.dispDefaultAction.setText(self.__tr("Default")) self.dispDefaultAction.setMenuText(self.__tr("Default")) self.dispInvisAction.setText(self.__tr("Invisible")) self.dispInvisAction.setMenuText(self.__tr("Invisible")) self.dispLinesAction.setText(self.__tr("Lines")) self.dispLinesAction.setMenuText(self.__tr("Lines")) self.dispTubesAction.setText(self.__tr("Tubes")) self.dispTubesAction.setMenuText(self.__tr("Tubes")) self.dispVdWAction.setText(self.__tr("VdW")) self.dispVdWAction.setMenuText(self.__tr("VdW")) self.fileToolbar.setLabel(self.__tr("File")) self.editToolbar.setLabel(self.__tr("Edit")) self.viewToolbar.setLabel(self.__tr("View")) self.gridsToolbar.setLabel(self.__tr("Grids")) self.molecularDispToolbar.setLabel(self.__tr("Molecular Display")) self.selectToolbar.setLabel(self.__tr("Select")) self.cookieCutterToolbar.setLabel(self.__tr("Cookie Cutter")) self.textLabel2.setText(self.__tr("Cookie Cut")) self.sketchAtomToolbar.setLabel(self.__tr("Sketch Atom")) self.sketchAtomLabel.setText(self.__tr("Sketch Atom")) self.elemChangeComboBox.clear() self.elemChangeComboBox.insertItem(self.__tr("Hydrogen")) self.elemChangeComboBox.insertItem(self.__tr("Helium")) self.elemChangeComboBox.insertItem(self.__tr("Boron")) self.elemChangeComboBox.insertItem(self.__tr("Carbon")) self.elemChangeComboBox.insertItem(self.__tr("Nitrogen")) self.elemChangeComboBox.insertItem(self.__tr("Oxygen")) self.elemChangeComboBox.insertItem(self.__tr("Fluorine")) self.elemChangeComboBox.insertItem(self.__tr("Neon")) self.elemChangeComboBox.insertItem(self.__tr("Aluminum")) self.elemChangeComboBox.insertItem(self.__tr("Silicon")) self.elemChangeComboBox.insertItem(self.__tr("Phosphorus")) self.elemChangeComboBox.insertItem(self.__tr("Sulfur")) self.elemChangeComboBox.insertItem(self.__tr("Chlorine")) self.elemChangeComboBox.insertItem(self.__tr("Argon")) self.elemChangeComboBox.insertItem(self.__tr("Germanium")) self.elemChangeComboBox.insertItem(self.__tr("Astatine")) self.elemChangeComboBox.insertItem(self.__tr("Selenium")) self.elemChangeComboBox.insertItem(self.__tr("Bromine")) self.elemChangeComboBox.insertItem(self.__tr("Krypton")) self.elemChangeComboBox.insertItem(self.__tr("Antimony")) self.elemChangeComboBox.insertItem(self.__tr("Tellurium")) self.elemChangeComboBox.insertItem(self.__tr("Iodine")) self.elemChangeComboBox.insertItem(self.__tr("Xenon")) self.modifyToolbar.setLabel(self.__tr("Modify")) self.toolsToolbar.setLabel(self.__tr("Tools")) self.datumDispToolbar.setLabel(self.__tr("Datum Display")) if self.MenuBar.findItem(2): self.MenuBar.findItem(2).setText(self.__tr("&File")) if self.MenuBar.findItem(3): self.MenuBar.findItem(3).setText(self.__tr("&Edit")) self.unnamed.changeItem(self.unnamed.idAt(7),self.__tr("&Default Views")) self.unnamed.changeItem(self.unnamed.idAt(9),self.__tr("&Toolbars")) if self.MenuBar.findItem(4): self.MenuBar.findItem(4).setText(self.__tr("&View")) if self.MenuBar.findItem(5): self.MenuBar.findItem(5).setText(self.__tr("&Select")) if self.MenuBar.findItem(6): self.MenuBar.findItem(6).setText(self.__tr("&Display")) if self.MenuBar.findItem(7): self.MenuBar.findItem(7).setText(self.__tr("&Jigs")) if self.MenuBar.findItem(8): self.MenuBar.findItem(8).setText(self.__tr("&Modify")) if self.MenuBar.findItem(9): self.MenuBar.findItem(9).setText(self.__tr("&Tools")) if self.MenuBar.findItem(10): self.MenuBar.findItem(10).setText(self.__tr("&Help")) | 85a9a33737cb03ea81f35e97e98d59f2314cc01d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/85a9a33737cb03ea81f35e97e98d59f2314cc01d/MainWindowUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2653,
3043,
12,
2890,
4672,
365,
18,
542,
21158,
12,
2890,
16186,
313,
2932,
3641,
6,
3719,
365,
18,
768,
1908,
1803,
18,
542,
1528,
12,
2890,
16186,
313,
2932,
1908,
6,
3719,
365,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2653,
3043,
12,
2890,
4672,
365,
18,
542,
21158,
12,
2890,
16186,
313,
2932,
3641,
6,
3719,
365,
18,
768,
1908,
1803,
18,
542,
1528,
12,
2890,
16186,
313,
2932,
1908,
6,
3719,
365,
18,... |
self.type, | type, | def tobuf(self, posix=False): """Return a tar header block as a 512 byte string. """ parts = [ stn(self.name, 100), itn(self.mode & 07777, 8, posix), itn(self.uid, 8, posix), itn(self.gid, 8, posix), itn(self.size, 12, posix), itn(self.mtime, 12, posix), " ", # checksum field self.type, stn(self.linkname, 100), stn(MAGIC, 6), stn(VERSION, 2), stn(self.uname, 32), stn(self.gname, 32), itn(self.devmajor, 8, posix), itn(self.devminor, 8, posix), stn(self.prefix, 155) ] | 81f02e34efadb27c8e3954e259e5638999815387 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/81f02e34efadb27c8e3954e259e5638999815387/tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
4385,
12,
2890,
16,
16366,
33,
8381,
4672,
3536,
990,
279,
8232,
1446,
1203,
487,
279,
13908,
1160,
533,
18,
3536,
2140,
273,
306,
384,
82,
12,
2890,
18,
529,
16,
2130,
3631,
518,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4385,
12,
2890,
16,
16366,
33,
8381,
4672,
3536,
990,
279,
8232,
1446,
1203,
487,
279,
13908,
1160,
533,
18,
3536,
2140,
273,
306,
384,
82,
12,
2890,
18,
529,
16,
2130,
3631,
518,... |
now = datetime.utcnow() for t,f in list(self._active_fetchers): if t > now: break self._active_fetchers.remove((t,f)) self.purge_items() | self._lock.acquire() try: now = datetime.utcnow() for t,f in list(self._active_fetchers): if t > now: break f.timeout() self.purge_items() finally: self._lock.release() | def tick(self): now = datetime.utcnow() for t,f in list(self._active_fetchers): if t > now: break self._active_fetchers.remove((t,f)) self.purge_items() | 0565c1af1db0e5a1d306ebc4583856d6a63afa5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12769/0565c1af1db0e5a1d306ebc4583856d6a63afa5f/cache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4024,
12,
2890,
4672,
2037,
273,
3314,
18,
17892,
3338,
1435,
364,
268,
16,
74,
316,
666,
12,
2890,
6315,
3535,
67,
5754,
414,
4672,
309,
268,
405,
2037,
30,
898,
365,
6315,
3535,
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4024,
12,
2890,
4672,
2037,
273,
3314,
18,
17892,
3338,
1435,
364,
268,
16,
74,
316,
666,
12,
2890,
6315,
3535,
67,
5754,
414,
4672,
309,
268,
405,
2037,
30,
898,
365,
6315,
3535,
67,
... |
print "Location of the package cache is" + self.settings["pkgcache_path"] | print "Location of the package cache is " + self.settings["pkgcache_path"] | def __init__(self,myspec,addlargs): self.required_values.extend(["version_stamp","target","subarch","rel_type",\ "profile","snapshot","source_subpath"]) self.valid_values.extend(["version_stamp","target","subarch","rel_type","profile",\ "snapshot","source_subpath","portage_confdir","cflags","cxxflags","chost","hostuse"]) generic_target.__init__(self,addlargs,myspec) # map the mainarch we are running under to the mainarches we support for # building stages and LiveCDs. (for example, on amd64, we can build stages for # x86 or amd64. targetmap={ "x86" : ["x86"], "amd64" : ["x86","amd64"], "sparc64" : ["sparc","sparc64"], "ia64" : ["ia64"], "alpha" : ["alpha"], "sparc" : ["sparc"], "s390" : ["s390"], "ppc" : ["ppc"], "ppc64" : ["ppc","ppc64"], "hppa" : ["hppa"], "mips" : ["mips"], "arm" : ["arm"] } machinemap={ "i386" : "x86", "i486" : "x86", "i586" : "x86", "i686" : "x86", "x86_64" : "amd64", "sparc64" : "sparc64", "ia64" : "ia64", "alpha" : "alpha", "sparc" : "sparc", "s390" : "s390", "ppc" : "ppc", "ppc64" : "ppc64", "parisc" : "hppa", "parisc64" : "hppa", "mips" : "mips", "mips64" : "mips", "arm" : "arm", "armv4l" : "arm", "armeb" : "arm", "armv5b" : "arm" } | 3d56a2881693db67d745b7b1863bd81bb967dcdd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7327/3d56a2881693db67d745b7b1863bd81bb967dcdd/generic_stage_target.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
81,
1900,
705,
16,
1289,
80,
1968,
4672,
225,
365,
18,
4718,
67,
2372,
18,
14313,
3816,
6,
1589,
67,
14317,
15937,
3299,
15937,
1717,
991,
15937,
2878,
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,
1001,
2738,
972,
12,
2890,
16,
81,
1900,
705,
16,
1289,
80,
1968,
4672,
225,
365,
18,
4718,
67,
2372,
18,
14313,
3816,
6,
1589,
67,
14317,
15937,
3299,
15937,
1717,
991,
15937,
2878,
6... |
inc, exc = [], ['.hg*'] for pat, opt in ui.configitems('keyword'): if opt != 'ignore': inc.append(pat) else: exc.append(pat) if not inc: return kwtools['templater'] = kwt = kwtemplater(ui, repo, inc, exc) | kwtools['templater'] = kwt = kwtemplater(ui, repo) | def reposetup(ui, repo): '''Sets up repo as kwrepo for keyword substitution. Overrides file method to return kwfilelog instead of filelog if file matches user configuration. Wraps commit to overwrite configured files with updated keyword substitutions. This is done for local repos only, and only if there are files configured at all for keyword substitution.''' try: if (not repo.local() or kwtools['hgcmd'] in nokwcommands.split() or '.hg' in util.splitpath(repo.root) or repo._url.startswith('bundle:')): return except AttributeError: pass inc, exc = [], ['.hg*'] for pat, opt in ui.configitems('keyword'): if opt != 'ignore': inc.append(pat) else: exc.append(pat) if not inc: return kwtools['templater'] = kwt = kwtemplater(ui, repo, inc, exc) class kwrepo(repo.__class__): def file(self, f): if f[0] == '/': f = f[1:] return kwfilelog(self.sopener, f) def wread(self, filename): data = super(kwrepo, self).wread(filename) return kwt.wread(filename, data) def commit(self, files=None, text='', user=None, date=None, match=util.always, force=False, force_editor=False, p1=None, p2=None, extra={}, empty_ok=False): wlock = lock = None _p1 = _p2 = None try: wlock = self.wlock() lock = self.lock() # store and postpone commit hooks commithooks = {} for name, cmd in ui.configitems('hooks'): if name.split('.', 1)[0] == 'commit': commithooks[name] = cmd ui.setconfig('hooks', name, None) if commithooks: # store parents for commit hook environment if p1 is None: _p1, _p2 = repo.dirstate.parents() else: _p1, _p2 = p1, p2 or nullid _p1 = hex(_p1) if _p2 == nullid: _p2 = '' else: _p2 = hex(_p2) node = super(kwrepo, self).commit(files=files, text=text, user=user, date=date, match=match, force=force, force_editor=force_editor, p1=p1, p2=p2, extra=extra, empty_ok=empty_ok) # restore commit hooks for name, cmd in commithooks.iteritems(): ui.setconfig('hooks', name, cmd) if node is not None: kwt.overwrite(node=node) repo.hook('commit', node=node, parent1=_p1, parent2=_p2) return node finally: del wlock, lock repo.__class__ = kwrepo patch.patchfile.__init__ = _kwpatchfile_init patch.diff = _kw_diff webcommands.changeset = webcommands.rev = _kwweb_changeset webcommands.filediff = webcommands.diff = _kwweb_filediff | f0f2f142857321e7962ce6419c8ae2230b506410 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/f0f2f142857321e7962ce6419c8ae2230b506410/keyword.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13686,
278,
416,
12,
4881,
16,
3538,
4672,
9163,
2785,
731,
3538,
487,
5323,
7422,
364,
4932,
12785,
18,
531,
9857,
585,
707,
358,
327,
5323,
7540,
12970,
3560,
434,
661,
12970,
309,
585... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13686,
278,
416,
12,
4881,
16,
3538,
4672,
9163,
2785,
731,
3538,
487,
5323,
7422,
364,
4932,
12785,
18,
531,
9857,
585,
707,
358,
327,
5323,
7540,
12970,
3560,
434,
661,
12970,
309,
585... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.