rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
'invoice_id':False, | 'invoice_ids':{}, | def copy(self, cr, uid, id, default=None,context={}): if not default: default = {} default.update({ 'state':'draft', 'shipped':False, 'invoiced':False, 'invoice_id':False, 'picking_ids':[], 'name': self.pool.get('ir.sequence').get(cr, uid, 'purchase.order'), }) return super(purchase_order, self).copy(cr, uid, id, default, context) | c02056ffb2d9d9ffdf2670cf7d38d3cfb0fe32a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c02056ffb2d9d9ffdf2670cf7d38d3cfb0fe32a0/purchase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
805,
33,
7036,
16,
2472,
12938,
4672,
309,
486,
805,
30,
805,
273,
2618,
805,
18,
2725,
12590,
296,
2019,
11,
2497,
17153,
2187,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
805,
33,
7036,
16,
2472,
12938,
4672,
309,
486,
805,
30,
805,
273,
2618,
805,
18,
2725,
12590,
296,
2019,
11,
2497,
17153,
2187,
296,
... |
if not self._metadata_popupated: | if not self._metadata_populated: | def last_changelog(self): if not self._metadata_popupated: self.parse_metadata() return self._last_changelog | d7301a0b869a76845ebfdf478ff07d95dc243e3a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13693/d7301a0b869a76845ebfdf478ff07d95dc243e3a/source.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1142,
67,
24083,
12970,
12,
2890,
4672,
309,
486,
365,
6315,
4165,
67,
5120,
11799,
30,
365,
18,
2670,
67,
4165,
1435,
327,
365,
6315,
2722,
67,
24083,
12970,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
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,
1142,
67,
24083,
12970,
12,
2890,
4672,
309,
486,
365,
6315,
4165,
67,
5120,
11799,
30,
365,
18,
2670,
67,
4165,
1435,
327,
365,
6315,
2722,
67,
24083,
12970,
2,
-100,
-100,
-100,
-100,
... |
self.listupdate_event) | self.listselect_event) | def show_window(self, comp_lists, index, complete, mode, userWantsWin): """Show the autocomplete list, bind events. If complete is True, complete the text, and if there is exactly one matching completion, don't open a list.""" # Handle the start we already have self.completions, self.morecompletions = comp_lists self.mode = mode self.startindex = self.widget.index(index) self.start = self.widget.get(self.startindex, "insert") if complete: completed = self._complete_string(self.start) self._change_start(completed) i = self._binary_search(completed) if self.completions[i] == completed and \ (i == len(self.completions)-1 or self.completions[i+1][:len(completed)] != completed): # There is exactly one matching completion return self.userwantswindow = userWantsWin self.lasttypedstart = self.start | 0480cd31e9658edcbb1448817de1369456211c95 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/0480cd31e9658edcbb1448817de1369456211c95/AutoCompleteWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
5668,
12,
2890,
16,
1161,
67,
9772,
16,
770,
16,
3912,
16,
1965,
16,
729,
59,
4388,
18049,
4672,
3536,
5706,
326,
21429,
666,
16,
1993,
2641,
18,
971,
3912,
353,
1053,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
5668,
12,
2890,
16,
1161,
67,
9772,
16,
770,
16,
3912,
16,
1965,
16,
729,
59,
4388,
18049,
4672,
3536,
5706,
326,
21429,
666,
16,
1993,
2641,
18,
971,
3912,
353,
1053,
16,
... |
([8, 27*a + 23, 10*a + 20], {10*a + 20: 2, 8: 0, 27*a + 23: 1}) | ([8, 27*a + 23, 10*a + 20], {8: 0, 10*a + 20: 2, 27*a + 23: 1}) | def supersingular_points(self): r""" This function computes the supersingular j-invariants over the finite field associated to self. | e6762c64f64f579916fb35270b500c02238fade9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/e6762c64f64f579916fb35270b500c02238fade9/ssmod.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1169,
414,
17830,
67,
4139,
12,
2890,
4672,
436,
8395,
1220,
445,
15881,
326,
1169,
414,
17830,
525,
17,
267,
15886,
1879,
326,
25922,
652,
3627,
358,
365,
18,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
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,
1169,
414,
17830,
67,
4139,
12,
2890,
4672,
436,
8395,
1220,
445,
15881,
326,
1169,
414,
17830,
525,
17,
267,
15886,
1879,
326,
25922,
652,
3627,
358,
365,
18,
2,
-100,
-100,
-100,
-100,... |
context.update({'partner_id':data_partner}) | context.update({'partner_id':data_partner.id}) | def _amount_total(self, cr, uid, ids, name, args, context=None): res ={} data_dosseir = self.browse(cr,uid,ids) | cfde0fb9fd34be024074ed97900b1c7d143d1875 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/cfde0fb9fd34be024074ed97900b1c7d143d1875/cci_mission.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8949,
67,
4963,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
400,
273,
2916,
501,
67,
19219,
307,
481,
273,
365,
18,
25731,
12,
3353,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8949,
67,
4963,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
400,
273,
2916,
501,
67,
19219,
307,
481,
273,
365,
18,
25731,
12,
3353,
16,
... |
def remove_job(self, job): it = self.__get_iter(job.object_id) | def remove_job(self, object_id): it = self.__get_iter(object_id) | def remove_job(self, job): it = self.__get_iter(job.object_id) if it: self.remove(it) else: debug_trace("trying to remove non existing object %s from model" % job.object_id, sender=self) | c3a6e08c793b1c809e50d18e0642005e704282da /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2271/c3a6e08c793b1c809e50d18e0642005e704282da/TransferManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
4688,
12,
2890,
16,
733,
67,
350,
4672,
518,
273,
365,
16186,
588,
67,
2165,
12,
1612,
67,
350,
13,
309,
518,
30,
365,
18,
4479,
12,
305,
13,
469,
30,
1198,
67,
5129,
293... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
4688,
12,
2890,
16,
733,
67,
350,
4672,
518,
273,
365,
16186,
588,
67,
2165,
12,
1612,
67,
350,
13,
309,
518,
30,
365,
18,
4479,
12,
305,
13,
469,
30,
1198,
67,
5129,
293... |
pl = wikipedia.Page(welcomesite, logg + '/' + year + '/' + month + '/' + day) | target = logg + '/' + year + '/' + month + '/' + day pl = wikipedia.Page(welcomesite, target) | def report(lang, rep_page, username, com): another_page = wikipedia.Page(lang, rep_page) if another_page.exists(): text_get = another_page.get() else: text_get = '' pos = 0 # The talk page includes "_" between the two names, in this way i replace them to " " regex = talk.replace('_', ' ') + username n = re.compile(regex, re.UNICODE) y = n.search(text_get, pos) if y == None: # Adding the log :) rep_text = rep_text % username another_page.put(text_get + rep_text, comment = com, minorEdit = True) wikipedia.output(u"...Reported...") else: pos = y.end() wikipedia.output(u"The user is already in the report page.") | e84f02593b3eb100ad10b8fa43c2d6d5085e2faa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/e84f02593b3eb100ad10b8fa43c2d6d5085e2faa/welcome.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2605,
12,
4936,
16,
2071,
67,
2433,
16,
2718,
16,
532,
4672,
4042,
67,
2433,
273,
21137,
18,
1964,
12,
4936,
16,
2071,
67,
2433,
13,
309,
4042,
67,
2433,
18,
1808,
13332,
977,
67,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2605,
12,
4936,
16,
2071,
67,
2433,
16,
2718,
16,
532,
4672,
4042,
67,
2433,
273,
21137,
18,
1964,
12,
4936,
16,
2071,
67,
2433,
13,
309,
4042,
67,
2433,
18,
1808,
13332,
977,
67,
58... |
axis =self.app.mainCamera.up | axis = self.CalphaViewer.worldToObjectCoordinates(self.app.mainCamera.up) | def posRotateCM_yaw(self, angle): print 'yaw:', angle axis =self.app.mainCamera.up axis = (-1*axis[0], -1*axis[1], -1*axis[2]) oldAngle = self.yaw axis = Vector3DFloat(axis[0], axis[1], axis[2]) cAlphaViewer = self.app.viewers['calpha'] cm = cAlphaViewer.renderer.selectionCenterOfMass() newAngle = math.pi*angle/180 cAlphaViewer.renderer.selectionRotate(cm, axis, newAngle-oldAngle) cAlphaViewer.emitModelChanged() self.yaw = newAngle | 9fefa88d897047cb33ba1b9c7ca873fe31bb572c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4399/9fefa88d897047cb33ba1b9c7ca873fe31bb572c/structure_editor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
949,
16357,
9611,
67,
93,
2219,
12,
2890,
16,
5291,
4672,
1172,
296,
93,
2219,
30,
2187,
225,
5291,
2654,
273,
365,
18,
3005,
2762,
18415,
18,
18179,
19121,
13431,
12,
2890,
18,
2910,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
949,
16357,
9611,
67,
93,
2219,
12,
2890,
16,
5291,
4672,
1172,
296,
93,
2219,
30,
2187,
225,
5291,
2654,
273,
365,
18,
3005,
2762,
18415,
18,
18179,
19121,
13431,
12,
2890,
18,
2910,
... |
if (t-t0)>3600: | if (t-t0)>120: | def proc_kill(self,fd): if fd in self.proc: self.proc[fd]['time']=0 t=time.time() for i in self.proc.keys(): t0=self.proc[i]['time'] if (t-t0)>3600: try: os.close(i) os.kill(self.proc[i]['pid'],signal.SIGTERM) except (IOError,OSError): pass del self.proc[i] | ee47be0f2054695e7e6d7e82ca8f47195820430f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/ee47be0f2054695e7e6d7e82ca8f47195820430f/ajaxterm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5418,
67,
16418,
12,
2890,
16,
8313,
4672,
309,
5194,
316,
365,
18,
9381,
30,
365,
18,
9381,
63,
8313,
23962,
957,
3546,
33,
20,
268,
33,
957,
18,
957,
1435,
364,
277,
316,
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,
5418,
67,
16418,
12,
2890,
16,
8313,
4672,
309,
5194,
316,
365,
18,
9381,
30,
365,
18,
9381,
63,
8313,
23962,
957,
3546,
33,
20,
268,
33,
957,
18,
957,
1435,
364,
277,
316,
365,
18,
... |
filelist.append(i) | filelist.append(i) | def get_file_listing_recursive(dir, mode, pattern=None): """ Returns the file listing of a given directory recursively. It returns only files. Returns a list of [file,/path/to/file] """ filelist = [] # Get root directory files filelist = get_file_listing(dir, mode, pattern) # Get files from subdirs for root, dirs, files in os.walk(dir): if STOP: return filelist for directory in dirs: if STOP: return filelist elem = get_file_listing(os.path.join(root, directory), mode, pattern) for i in elem: if STOP: return filelist filelist.append(i) print "stop", dir return filelist | 48fc1c8d86f8cfbba31b22fbb4fd6c28972893ca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/735/48fc1c8d86f8cfbba31b22fbb4fd6c28972893ca/pyrenamer_filefuncs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
768,
67,
21228,
67,
10543,
12,
1214,
16,
1965,
16,
1936,
33,
7036,
4672,
3536,
2860,
326,
585,
11591,
434,
279,
864,
1867,
8536,
18,
2597,
1135,
1338,
1390,
18,
2860,
279,
666... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
768,
67,
21228,
67,
10543,
12,
1214,
16,
1965,
16,
1936,
33,
7036,
4672,
3536,
2860,
326,
585,
11591,
434,
279,
864,
1867,
8536,
18,
2597,
1135,
1338,
1390,
18,
2860,
279,
666... |
parser = RecordParser() rec = parser.convert_lax(result) return str(rec) + "\n" else: return self._parser.convert_lax(result) class _MartelBaseFastaParser: """Base class to provide a old-Biopython style to Martel parsing. """ def __init__(self, debug): self._it_builder = fasta.format.make_iterator("record", debug_level = debug) | return "\n".join(lines) else : return self._parser.parse_string("\n".join(lines)) class RecordParser: """Parses FASTA sequence data into a Fasta.Record object. """ def __init__(self, debug = 0): pass def parse_string(self, text) : text = text.replace("\r\n","\n") assert text[0] == ">", text text = text.split("\n>",1)[0] title, sequence = text.split("\n", 1) title = title[1:] rec = Record() rec.title = title rec.sequence = sequence.replace("\n","") return rec | def next(self): try: result = self._iterator.next() except StopIteration: return None | dacc73309acc0163f48b31942de3382cc8703457 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7167/dacc73309acc0163f48b31942de3382cc8703457/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
12,
2890,
4672,
775,
30,
563,
273,
365,
6315,
9838,
18,
4285,
1435,
1335,
16179,
30,
327,
599,
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,
1024,
12,
2890,
4672,
775,
30,
563,
273,
365,
6315,
9838,
18,
4285,
1435,
1335,
16179,
30,
327,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
def start(self, delay=0): self._q.put((self._start, delay)) | def start(self, delay=0): self._enqueue((self._start, delay)) | def start(self, delay=0): self._q.put((self._start, delay)) | c2ce4bf43f46ab89a72f8811caa10989e57ce967 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6995/c2ce4bf43f46ab89a72f8811caa10989e57ce967/accounts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
16,
4624,
33,
20,
4672,
365,
6315,
85,
18,
458,
12443,
2890,
6315,
1937,
16,
4624,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
16,
4624,
33,
20,
4672,
365,
6315,
85,
18,
458,
12443,
2890,
6315,
1937,
16,
4624,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
session.queue_declare(queue="q2", durable=True) except qpid.session.SessionException, e: if (530 == e.args[0].error_code): self.fail("ACL should allow queue create request for q2 with any parameter other than exclusive=true"); | queue_options = {} queue_options["qpid.policy_type"] = "ring_strict" session.queue_declare(queue="q2", exclusive=True, arguments=queue_options) except qpid.session.SessionException, e: if (530 == e.args[0].error_code): self.fail("ACL should allow queue create request with name=q2 exclusive=true qpid.policy_type=ring_strict"); try: queue_options = {} queue_options["qpid.max_count"] = "200" queue_options["qpid.max_size"] = "500" session.queue_declare(queue="q5", exclusive=True, arguments=queue_options) self.fail("ACL should deny queue create request with name=q2, qpid.max_size=500 and qpid.max_count=200"); except qpid.session.SessionException, e: self.assertEqual(530,e.args[0].error_code) session = self.get_session('bob','bob') try: queue_options = {} queue_options["qpid.max_count"] = "200" queue_options["qpid.max_size"] = "100" session.queue_declare(queue="q2", exclusive=True, arguments=queue_options) except qpid.session.SessionException, e: if (530 == e.args[0].error_code): self.fail("ACL should allow queue create request with name=q2, qpid.max_size=100 and qpid.max_count=200 "); | def test_queue_allow_mode(self): """ Test cases for queue acl in allow mode """ aclf = ACLFile() aclf.write('acl deny bob@QPID create queue name=q1 durable=true passive=true\n') aclf.write('acl deny bob@QPID create queue name=q2 exclusive=true\n') aclf.write('acl deny bob@QPID access queue name=q3\n') aclf.write('acl deny bob@QPID purge queue name=q3\n') aclf.write('acl deny bob@QPID delete queue name=q4\n') aclf.write('acl allow all all') aclf.close() result = self.reload_acl() if (result.text.find("format error",0,len(result.text)) != -1): self.fail(result) session = self.get_session('bob','bob') try: session.queue_declare(queue="q1", durable=True, passive=True) self.fail("ACL should deny queue create request with name=q1 durable=true passive=true"); except qpid.session.SessionException, e: self.assertEqual(530,e.args[0].error_code) session = self.get_session('bob','bob') try: session.queue_declare(queue="q2", exclusive=True) self.fail("ACL should deny queue create request with name=q2 exclusive=true"); except qpid.session.SessionException, e: self.assertEqual(530,e.args[0].error_code) session = self.get_session('bob','bob') try: session.queue_declare(queue="q2", durable=True) except qpid.session.SessionException, e: if (530 == e.args[0].error_code): self.fail("ACL should allow queue create request for q2 with any parameter other than exclusive=true"); | 8daea4172058afb85e3defd9d65387f669029879 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/198/8daea4172058afb85e3defd9d65387f669029879/acl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4000,
67,
5965,
67,
3188,
12,
2890,
4672,
3536,
7766,
6088,
364,
2389,
7895,
316,
1699,
1965,
3536,
7895,
74,
273,
10098,
812,
1435,
7895,
74,
18,
2626,
2668,
10150,
17096,
800... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4000,
67,
5965,
67,
3188,
12,
2890,
4672,
3536,
7766,
6088,
364,
2389,
7895,
316,
1699,
1965,
3536,
7895,
74,
273,
10098,
812,
1435,
7895,
74,
18,
2626,
2668,
10150,
17096,
800... |
def removeFromContainer(self, childToRemove): | def removeFromContainer(self, parent, child): | def removeFromContainer(self, childToRemove): # @@@ Must be implemented pass | 4a7c83ee4f153096c5bad124f9973a3effb81c75 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/4a7c83ee4f153096c5bad124f9973a3effb81c75/ContainerBlocks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22386,
2170,
12,
2890,
16,
982,
16,
1151,
4672,
468,
22175,
36,
6753,
506,
8249,
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,
... | [
1,
1,
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,
22386,
2170,
12,
2890,
16,
982,
16,
1151,
4672,
468,
22175,
36,
6753,
506,
8249,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if not result: return S_ERROR('Null result from JobState service') | if not result['OK']: return result | def sendStoredJobParameters(self): """ Send the job parameters stored in the internal cache """ # FIXME: What if the same paramenter is set twice? parameters = [] for pname,pvalue,timeStamp in self.jobParameters: parameters.append((pname,pvalue)) | 214881d8826c726afcba88518eb7a72a22e1fd0c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/214881d8826c726afcba88518eb7a72a22e1fd0c/JobReport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
18005,
2278,
2402,
12,
2890,
4672,
3536,
2479,
326,
1719,
1472,
4041,
316,
326,
2713,
1247,
3536,
468,
9852,
30,
18734,
309,
326,
1967,
579,
2328,
353,
444,
13605,
35,
1472,
273,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
18005,
2278,
2402,
12,
2890,
4672,
3536,
2479,
326,
1719,
1472,
4041,
316,
326,
2713,
1247,
3536,
468,
9852,
30,
18734,
309,
326,
1967,
579,
2328,
353,
444,
13605,
35,
1472,
273,
5... |
if category == "": category = "NewsArticles" html = get_index_page_from_cache(journal_name, category, issue_number, language) | def index(self, req, form): """Index page.""" argd = wash_urlargd(form, {'name': (str, ""), 'issue': (str, ""), 'category': (str, ""), 'ln': (str, "")} ) # get / set url parameter journal_name = "" issue_number = "" category = "" req.journal_defaults = {} try: journal_name = argd['name'] if journal_name == "": raise KeyError except KeyError: register_exception(stream='warning', req=req, suffix="No Journal Name was provided.") return webjournal_missing_info_box(req, title="Template not found", msg_title="We don't know which journal you are looking for", msg='''You were looking for a journal without providing a name. Unfortunately we cannot know which journal you are looking for. Below you have a selection of journals that are available on this server. If you should find your journal there, just click the link, otherwise please contact the server admin and ask for existence of the journal you are looking for.''') try: issue_number = argd['issue'] if issue_number == "": raise KeyError except KeyError: issue_number = get_current_issue(journal_name) req.journal_defaults["issue"] = issue_number try : category = argd['category'] except KeyError: category = "" # optional parameter try: language = argd['ln'] except KeyError: language = "en" req.journal_defaults["ln"] = "en" # english is default # try to get the page from the cache if category == "": # todo: make this nicer category = "NewsArticles" html = get_index_page_from_cache(journal_name, category, issue_number, language) #if html: ## raise "got page from cache %s" % html # return html # get all strings you want from the config files config_strings = get_xml_from_config(["index", "rule", "issue_number"], journal_name) try: try: index_page_template = config_strings["index"][0] except: raise InvenioWebJournalNoIndexTemplateError(journal_name) except InvenioWebJournalNoIndexTemplateError, e: register_exception(req=req) return webjournal_error_box(req, "Main Page Template not found", "Problem with the configuration for this journal", "The system couldn't find the template for the main page of this journal. This is a mandatory file and thus indicates that the journal was setup wrong or produced an internal error. If you are neither admin nor developer there is nothing you can do at this point, but send an email request. We apologize for the inconvenience.") index_page_template_path = 'webjournal/%s' % (index_page_template) # find current selected category from the list of rules in the config rule_list = config_strings["rule"] try: if len(rule_list) == 0: raise InvenioWebJournalNoArticleRuleError() except InvenioWebJournalNoArticleRuleError, e: register_exception(req=req) return webjournal_error_box(req, "No Articles", "Problem with the configuration of this journal", "The system couldn't find the definitions for different article kinds (e.g. News, Sports, etc.). If there is nothing defined, nothing can be shown and it thus indicates that there is either a problem with the setup of this journal or in the Software itself. There is nothing you can do at this moment. If you wish you can send an inquiry to the responsible developers. We apologize for the inconvenience.") try: try: issue_number_tag = config_strings["issue_number"][0] except KeyError: raise InvenioWebJournalNoIssueNumberTagError(journal_name) except InvenioWebJournalNoIssueNumberTagError: register_exception(req=req) return webjournal_error_box(req, title="No Issues", title_msg="Problem with the configuration of this journal", msg="The system couldn't find a definition for an issue numbering system. Issue numbers conrol the date of the publication you are seing. This indicates that there is an error in the setup of this journal or the Software itself. There is nothing you can do at the moment. If you wish you can send an inquiry to the responsible developers. We apologize for the inconvenience.") current_category_in_list = 0 i = 0 if category != "": for rule_string in rule_list: category_from_config = rule_string.split(",")[0] if category_from_config.lower() == category.lower(): current_category_in_list = i i+=1 else: # add the first category to the url string req.journal_defaults["category"] = rule_list[0].split(",")[0] # get the important values for the category from the config file rule_string = rule_list[current_category_in_list].replace(" ", "") category = rule_string.split(",")[0] rule = rule_string.split(",")[1] marc_datafield = rule.split(":")[0] rule_match = rule.split(":")[1] marc_tag = marc_datafield[:3] marc_ind1 = (str(marc_datafield[3]) == "_") and " " or marc_datafield[3] marc_ind2 = (str(marc_datafield[4]) == "_") and " " or marc_datafield[4] marc_subfield = marc_datafield[5] # create a marc record, containing category and issue number temp_marc = '''<record> <controlfield tag="001">0</controlfield> <datafield tag="%s" ind1="%s" ind2="%s"> <subfield code="%s">%s</subfield> </datafield> <datafield tag="%s" ind1="%s" ind2="%s"> <subfield code="%s">%s</subfield> </datafield> </record>''' % (issue_number_tag[:3], (issue_number_tag[3] == "_") and " " or issue_number_tag[3], (issue_number_tag[4] == "_") and " " or issue_number_tag[4], issue_number_tag[5], issue_number, marc_tag, marc_ind1, marc_ind2, marc_subfield, rule_match) #temp_marc = temp_marc.decode('utf-8').encode('utf-8') # create a record and get HTML back from bibformat bfo = BibFormatObject(0, ln=language, xml_record=temp_marc, req=req) # pass 0 for rn, we don't need it html_out = format_with_format_template(index_page_template_path, bfo)[0] # done ;) # cache_index_page(journal_name, category, issue_number, html_out, language) return html_out | 4025c04c4cf5479311a45db56ff7d12da5995693 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/4025c04c4cf5479311a45db56ff7d12da5995693/webjournal_webinterface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
12,
2890,
16,
1111,
16,
646,
4672,
3536,
1016,
1363,
12123,
1501,
72,
273,
341,
961,
67,
718,
3175,
72,
12,
687,
16,
13666,
529,
4278,
261,
701,
16,
1408,
3631,
296,
13882,
4278,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
12,
2890,
16,
1111,
16,
646,
4672,
3536,
1016,
1363,
12123,
1501,
72,
273,
341,
961,
67,
718,
3175,
72,
12,
687,
16,
13666,
529,
4278,
261,
701,
16,
1408,
3631,
296,
13882,
4278,
... | |
window.nicklist.remove(p) | window.nicklist.remove(_prefix(network, channel, nick)) | def nicklist_del(network, channel, nick): p = prefix(network, channel, nick) window = windows.get(windows.ChannelWindow, network, channel.name) if window: window.nicklist.remove(p) | 507a4f6d59b0605bdcef8ff21242050428040a4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10693/507a4f6d59b0605bdcef8ff21242050428040a4a/chaninfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10909,
1098,
67,
3771,
12,
5185,
16,
1904,
16,
10909,
4672,
293,
273,
1633,
12,
5185,
16,
1904,
16,
10909,
13,
225,
2742,
273,
9965,
18,
588,
12,
13226,
18,
2909,
3829,
16,
2483,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10909,
1098,
67,
3771,
12,
5185,
16,
1904,
16,
10909,
4672,
293,
273,
1633,
12,
5185,
16,
1904,
16,
10909,
13,
225,
2742,
273,
9965,
18,
588,
12,
13226,
18,
2909,
3829,
16,
2483,
16,
... |
atts['width'] = int(im.size[0] * (float(atts['scale']) / 100)) | atts['width'] = im.size[0] | def visit_image(self, node): atts = node.attributes.copy() if atts.has_key('class'): del atts['class'] # prevent duplication with node attrs atts['src'] = atts['uri'] del atts['uri'] if atts.has_key('scale'): if Image and not (atts.has_key('width') and atts.has_key('height')): try: im = Image.open(str(atts['src'])) except (IOError, # Source image can't be found or opened UnicodeError): # PIL doesn't like Unicode paths. pass else: if not atts.has_key('width'): atts['width'] = int(im.size[0] * (float(atts['scale']) / 100)) if not atts.has_key('height'): atts['height'] = int(im.size[1] * (float(atts['scale']) / 100)) del im del atts['scale'] if not atts.has_key('alt'): atts['alt'] = atts['src'] if isinstance(node.parent, nodes.TextElement): self.context.append('') else: if atts.has_key('align'): self.body.append('<p align="%s">' % (self.attval(atts['align'],))) else: self.body.append('<p>') self.context.append('</p>\n') self.body.append(self.emptytag(node, 'img', '', **atts)) | 3e44153b18ec1bf918f7ea370acca10b4f3678ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/3e44153b18ec1bf918f7ea370acca10b4f3678ad/html4css1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2730,
12,
2890,
16,
756,
4672,
15687,
273,
756,
18,
4350,
18,
3530,
1435,
309,
15687,
18,
5332,
67,
856,
2668,
1106,
11,
4672,
1464,
15687,
3292,
1106,
3546,
6647,
468,
5309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2730,
12,
2890,
16,
756,
4672,
15687,
273,
756,
18,
4350,
18,
3530,
1435,
309,
15687,
18,
5332,
67,
856,
2668,
1106,
11,
4672,
1464,
15687,
3292,
1106,
3546,
6647,
468,
5309,
... |
assert_array_almost_equal(numpy.matrixmultiply(a,x),b) | assert_array_almost_equal(numpy.dot(a,x),b) | def check_random_exact(self): | 9bd2ebf847b7c0e4bdf3e5d49ab67f415145df68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/9bd2ebf847b7c0e4bdf3e5d49ab67f415145df68/test_basic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
9188,
67,
17165,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
9188,
67,
17165,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
print "%s %8s %s" % (getClock(m), var, out,) | print "%s %8s %s%s" % (getClock(m), var, out, pc) | def memDecode(m, reginfo): regname, bitdefs = reginfo var = m.group('var') val = int(m.group('val'), 16) changed = int(m.group('changed'), 16) notfirst = 1 if not changed: # Start of trace - show all bit defs, but don't show the # list of bits to ignore. changed = val notfirst = 0 if not bitdefs: # Only a register name exists (no bit definitions) out = bitDecode(m, ~0, "%08s" % regname, val, changed, notfirst) print "%s %8s %s" % (getClock(m), var, out,) return out = "" unnamedbits = changed for bits, desc in bitdefs: if bits & changed: out += bitDecode(m, bits, desc, val, changed, notfirst) unnamedbits &= ~bits if unnamedbits: # Not all changed bits are named - come up with a "dummy" name # for the remaining bits. out += bitDecode(m, ~0, "?", val&unnamedbits, unnamedbits, notfirst) if notfirst: print "%s %8s %8s:%s" % (getClock(m), var, regname, out) else: # Show register value along with any additional info print "%s %8s %8s=%08x:%s" % (getClock(m), var, regname, val, out) | 9de89e61a897936f4b49121046fb78ee3e5a8811 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12923/9de89e61a897936f4b49121046fb78ee3e5a8811/memalias.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1663,
6615,
12,
81,
16,
960,
1376,
4672,
960,
529,
16,
2831,
12537,
273,
960,
1376,
569,
273,
312,
18,
1655,
2668,
1401,
6134,
1244,
273,
509,
12,
81,
18,
1655,
2668,
1125,
19899,
2872... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1663,
6615,
12,
81,
16,
960,
1376,
4672,
960,
529,
16,
2831,
12537,
273,
960,
1376,
569,
273,
312,
18,
1655,
2668,
1401,
6134,
1244,
273,
509,
12,
81,
18,
1655,
2668,
1125,
19899,
2872... |
if _debug: sys.stderr.write('using an xml library that does not support EntityResolver (not a big deal)\n') encoding_set = (result['encoding'] == xml_encoding) if not encoding_set: bozo_exception = None proposed_encodings = [result['encoding'], xml_encoding, 'utf-8', 'iso-8859-1', 'windows-1252'] tried_encodings = [] for proposed_encoding in proposed_encodings: if proposed_encodings in tried_encodings: continue tried_encodings.append(proposed_encoding) try: data = _changeEncodingDeclaration(data, proposed_encoding) except Exception, bozo_exception: if _debug: sys.stderr.write('character encoding is wrong\n') else: if proposed_encoding != result['encoding']: try: raise CharacterEncodingOverride, "document declared as %s, but parsed as %s" % (result['encoding'], proposed_encoding) except CharacterEncodingOverride, bozo_exception: result['bozo'] = 1 result['bozo_exception'] = bozo_exception result['encoding'] = proposed_encoding encoding_set = 1 break if not encoding_set: result['bozo'] = 1 result['bozo_exception'] = bozo_exception use_strict_parser = 0 if use_strict_parser: | pass | def parse(url_file_stream_or_string, etag=None, modified=None, agent=None, referrer=None): """Parse a feed from a URL, file, stream, or string""" result = FeedParserDict() f = _open_resource(url_file_stream_or_string, etag=etag, modified=modified, agent=agent, referrer=referrer) data = f.read() if hasattr(f, "headers"): if gzip and f.headers.get('content-encoding', '') == 'gzip': try: data = gzip.GzipFile(fileobj=_StringIO(data)).read() except: # some feeds claim to be gzipped but they're not, so we get garbage data = '' if hasattr(f, "info"): info = f.info() result["etag"] = info.getheader("ETag") last_modified = info.getheader("Last-Modified") if last_modified: result["modified"] = _parse_date(last_modified) if hasattr(f, "url"): result["url"] = f.url result["status"] = 200 # default, may be overridden later if hasattr(f, "status"): result["status"] = f.status if hasattr(f, "headers"): result["headers"] = f.headers.dict f.close() if result.get("status", 0) == 304: result['feed'] = FeedParserDict() result['entries'] = [] result['debug_message'] = "The feed has not changed since you last checked, so the server sent no data. This is a feature, not a bug!" return result result['encoding'], http_encoding, xml_encoding = _getCharacterEncoding(result.get("headers", {}), data) result['version'], data = _stripDoctype(data) baseuri = result.get('headers', {}).get('content-location', result.get('url')) # try true XML parser first if not _XML_AVAILABLE: if _debug: sys.stderr.write('no xml libraries available\n') use_strict_parser = _XML_AVAILABLE if use_strict_parser: if _debug: sys.stderr.write('using xml library\n') result['bozo'] = 0 feedparser = _StrictFeedParser(baseuri, result['encoding']) if _debug and _debug_never_use_libxml2: sys.stderr.write('not using libxml2 (even if available)\n') additional_parsers = [] else: additional_parsers = ["drv_libxml2"] saxparser = xml.sax.make_parser(additional_parsers) saxparser.setFeature(xml.sax.handler.feature_namespaces, 1) saxparser.setContentHandler(feedparser) saxparser.setErrorHandler(feedparser) try: saxparser.setDTDHandler(feedparser) except xml.sax.SAXNotSupportedException: # libxml2 driver does not support DTDHandler if _debug: sys.stderr.write('using an xml library that does not support DTDHandler (not a big deal)\n') try: saxparser.setEntityResolver(feedparser) except xml.sax.SAXNotSupportedException: # libxml2 driver does not support EntityResolver if _debug: sys.stderr.write('using an xml library that does not support EntityResolver (not a big deal)\n') encoding_set = (result['encoding'] == xml_encoding) if not encoding_set: bozo_exception = None proposed_encodings = [result['encoding'], xml_encoding, 'utf-8', 'iso-8859-1', 'windows-1252'] tried_encodings = [] for proposed_encoding in proposed_encodings: if proposed_encodings in tried_encodings: continue tried_encodings.append(proposed_encoding) try: data = _changeEncodingDeclaration(data, proposed_encoding) except Exception, bozo_exception: if _debug: sys.stderr.write('character encoding is wrong\n') else: if proposed_encoding != result['encoding']: try: raise CharacterEncodingOverride, "document declared as %s, but parsed as %s" % (result['encoding'], proposed_encoding) except CharacterEncodingOverride, bozo_exception: result['bozo'] = 1 result['bozo_exception'] = bozo_exception result['encoding'] = proposed_encoding encoding_set = 1 break if not encoding_set: result['bozo'] = 1 result['bozo_exception'] = bozo_exception use_strict_parser = 0 if use_strict_parser: source = xml.sax.xmlreader.InputSource() source.setByteStream(_StringIO(data)) if hasattr(saxparser, '_ns_stack'): # work around bug in built-in SAX parser (doesn't recognize xml: namespace) # PyXML doesn't have this problem, and it doesn't have _ns_stack either saxparser._ns_stack.append({'http://www.w3.org/XML/1998/namespace':'xml'}) try: saxparser.parse(source) except Exception, e: if _debug: sys.stderr.write('xml parsing failed\n') feedparser.bozo = 1 feedparser.bozo_exception = feedparser.exc or e if feedparser.bozo: # feed is not well-formed XML, fall back on regex-based parser result['bozo'] = 1 result['bozo_exception'] = feedparser.bozo_exception use_strict_parser = 0 if not use_strict_parser: if _debug: sys.stderr.write('using regexes, now you have two problems\n') feedparser = _LooseFeedParser(baseuri, result['encoding']) feedparser.feed(data) result['feed'] = feedparser.feeddata result['entries'] = feedparser.entries result['version'] = result['version'] or feedparser.version return result | 972cadc09ab0b2fdf411f1a0962eada0cba30b10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/972cadc09ab0b2fdf411f1a0962eada0cba30b10/feedparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
718,
67,
768,
67,
3256,
67,
280,
67,
1080,
16,
13655,
33,
7036,
16,
4358,
33,
7036,
16,
4040,
33,
7036,
16,
14502,
33,
7036,
4672,
3536,
3201,
279,
4746,
628,
279,
1976,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
718,
67,
768,
67,
3256,
67,
280,
67,
1080,
16,
13655,
33,
7036,
16,
4358,
33,
7036,
16,
4040,
33,
7036,
16,
14502,
33,
7036,
4672,
3536,
3201,
279,
4746,
628,
279,
1976,
16... |
correlation; ncc is normalized cross correlation. | correlation; ncc is normalized cross correlation. mse is mean square error. with mse there is no joint histogram. | def optimize_function(x, optfunc_args): """ cost = optimize_function(x, optfunc_args) --- OR --- cost, joint_histogram = optimize_function(x, optfunc_args) computes the alignment between 2 volumes using cross correlation or mutual information metrics. In both the 8 bit joint histogram of the 2 images is computed. The 8 bit scaling is done using an integrated histogram method and is called prior to this. Parameters ....... x : {nd_array} this is the current (6-dim) array with 3 angles and 3 translations. optfunc_args : {tuple} this is a tuple of 8 elements that is formed in the scipy.optimize powell and cg (conjugate gradient) functions. this is why the elements need to be a tuple. The elements of optfunc_args are: image_F : {dictionary} image_F is the source image to be remapped during the registration. it is a dictionary with the data as an ndarray in the ['data'] component. image_G : {dictionary} image_G is the reference image that image_F gets mapped to. sample_vector : {nd_array} sample in x,y,x. should be (1,1,1) fwhm : {nd_array} Gaussian sigma do_lite : {0, 1} lite of 1 is to jitter both images during resampling. 0 is to not jitter. jittering is for non-aliased volumes. smooth : {0, 1} flag for joint histogram low pass filtering. 0 for no filter, 1 for do filter. method : {'nmi', 'mi', 'ncc', 'ecc'} flag for type of registration metric. nmi is normalized mutual information; mi is mutual information; ecc is entropy cross correlation; ncc is normalized cross correlation. ret_histo : {0, 1} if 0 return is: cost if 0 return is: cost, joint_histogram Returns ....... cost : {float} the negative of one of the mutual information metrics or negative cross correlation. use negative as the optimization is minimization. --- OR --- (if ret_histo = 1) cost : {float} the negative of one of the mutual information metrics or negative cross correlation. use negative as the optimization is minimization. joint_histogram : {nd_array} the 2D (256x256) joint histogram of the two volumes Examples ........ >>> import numpy as N >>> import _registration as reg >>> anat_desc = reg.load_anatMRI_desc() >>> image1 = reg.load_volume(anat_desc, imagename='ANAT1_V0001.img') >>> image2 = reg.load_volume(anat_desc, imagename='ANAT1_V0001.img') >>> imdata = reg.build_structs() >>> image1['fwhm'] = reg.build_fwhm(image1['mat'], imdata['step']) >>> image2['fwhm'] = reg.build_fwhm(image2['mat'], imdata['step']) >>> method = 'ncc' >>> lite = 1 >>> smhist = 0 >>> ret_histo = 1 >>> optfunc_args = (image1, image2, imdata['step'], imdata['fwhm'], lite, smhist, method, ret_histo) >>> x = N.zeros(6, dtype=N.float64) >>> return cost, joint_histogram = reg.optimize_function(x, optfunc_args) """ image_F = optfunc_args[0] image_G = optfunc_args[1] sample_vector = optfunc_args[2] fwhm = optfunc_args[3] do_lite = optfunc_args[4] smooth = optfunc_args[5] method = optfunc_args[6] ret_histo = optfunc_args[7] rot_matrix = build_rotate_matrix(x) cost = 0.0 epsilon = 2.2e-16 # image_G is base image # image_F is the to-be-rotated image # rot_matrix is the 4x4 constructed (current angles and translates) transform matrix # sample_vector is the subsample vector for x-y-z F_inv = N.linalg.inv(image_F['mat']) composite = N.dot(F_inv, image_G['mat']) composite = N.dot(composite, rot_matrix) # allocate memory for 2D histogram joint_histogram = N.zeros([256, 256], dtype=N.float64); if do_lite: R.register_histogram_lite(image_F['data'], image_G['data'], composite, sample_vector, joint_histogram) else: R.register_histogram(image_F['data'], image_G['data'], composite, sample_vector, joint_histogram) # smooth the histogram if smooth: p = N.ceil(2*fwhm[0]).astype(int) x = N.array(range(-p, p+1)) kernel1 = smooth_kernel(fwhm[0], x) p = N.ceil(2*fwhm[1]).astype(int) x = N.array(range(-p, p+1)) kernel2 = smooth_kernel(fwhm[1], x) output=None # 2D filter in 1D separable stages axis = 0 result = NDI.correlate1d(joint_histogram, kernel1, axis, output) axis = 1 joint_histogram = NDI.correlate1d(result, kernel1, axis, output) joint_histogram += epsilon # prevent log(0) # normalize the joint histogram joint_histogram /= joint_histogram.sum() # get the marginals marginal_col = joint_histogram.sum(axis=0) marginal_row = joint_histogram.sum(axis=1) if method == 'mi': # mutual information marginal_outer = N.outer(marginal_col, marginal_row) H = joint_histogram * N.log(joint_histogram / marginal_outer) mutual_information = H.sum() cost = -mutual_information elif method == 'ecc': # entropy correlation coefficient marginal_outer = N.outer(marginal_col, marginal_row) H = joint_histogram * N.log(joint_histogram / marginal_outer) mutual_information = H.sum() row_entropy = marginal_row * N.log(marginal_row) col_entropy = marginal_col * N.log(marginal_col) ecc = -2.0*mutual_information/(row_entropy.sum() + col_entropy.sum()) cost = -ecc elif method == 'nmi': # normalized mutual information row_entropy = marginal_row * N.log(marginal_row) col_entropy = marginal_col * N.log(marginal_col) H = joint_histogram * N.log(joint_histogram) nmi = (row_entropy.sum() + col_entropy.sum()) / (H.sum()) cost = -nmi elif method == 'ncc': # cross correlation from the joint histogram r, c = joint_histogram.shape i = N.array(range(1,c+1)) j = N.array(range(1,r+1)) m1 = (marginal_row * i).sum() m2 = (marginal_col * j).sum() sig1 = N.sqrt((marginal_row*(N.square(i-m1))).sum()) sig2 = N.sqrt((marginal_col*(N.square(j-m2))).sum()) [a, b] = N.mgrid[1:c+1, 1:r+1] a = a - m1 b = b - m2 # element multiplies in the joint histogram and grids H = ((joint_histogram * a) * b).sum() ncc = H / (N.dot(sig1, sig2)) cost = -ncc if ret_histo: return cost, joint_histogram else: return cost | de681f926e982b0212f2f58bf637917926737f89 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12971/de681f926e982b0212f2f58bf637917926737f89/_registration.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10979,
67,
915,
12,
92,
16,
2153,
644,
67,
1968,
4672,
3536,
6991,
273,
10979,
67,
915,
12,
92,
16,
2153,
644,
67,
1968,
13,
565,
9948,
4869,
9948,
6991,
16,
15916,
67,
22702,
273,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10979,
67,
915,
12,
92,
16,
2153,
644,
67,
1968,
4672,
3536,
6991,
273,
10979,
67,
915,
12,
92,
16,
2153,
644,
67,
1968,
13,
565,
9948,
4869,
9948,
6991,
16,
15916,
67,
22702,
273,
1... |
if not self._browser._forms: | if not self._browser.forms(): | def submit(self, fieldname): if not self._browser._forms: raise Exception("no forms on this page!") ctl = None form = self._browser.form if form is None: if len(self._browser._forms) == 1: form = self._browser._forms[0] else: raise Exception("more than one form; you must select one (use 'fv') before submitting") | 13736726208ec80019457205a1c4fa1f8596d813 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8598/13736726208ec80019457205a1c4fa1f8596d813/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4879,
12,
2890,
16,
14680,
4672,
309,
486,
365,
6315,
11213,
18,
9741,
13332,
1002,
1185,
2932,
2135,
10138,
603,
333,
1363,
4442,
13,
225,
21903,
273,
599,
225,
646,
273,
365,
6315,
112... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4879,
12,
2890,
16,
14680,
4672,
309,
486,
365,
6315,
11213,
18,
9741,
13332,
1002,
1185,
2932,
2135,
10138,
603,
333,
1363,
4442,
13,
225,
21903,
273,
599,
225,
646,
273,
365,
6315,
112... |
'contracted_katakana':opt_conv["boolean"][option6.get_active()], | 'contracted_katakana': opt_conv["boolean"][option6.get_active()], | def callback(widget,special=None): if special=="save": #Update the configuration. self.param.write({ 'basic_hiragana':opt_conv["boolean"][option1.get_active()], 'basic_hiragana_portions':kanaPortions[0], 'modified_hiragana':opt_conv["boolean"][option2.get_active()], 'modified_hiragana_portions':kanaPortions[1], 'contracted_hiragana':opt_conv["boolean"][option3.get_active()], 'contracted_hiragana_portions':kanaPortions[2], 'basic_katakana':opt_conv["boolean"][option4.get_active()], 'basic_katakana_portions':kanaPortions[3], 'modified_katakana':opt_conv["boolean"][option5.get_active()], 'modified_katakana_portions':kanaPortions[4], 'contracted_katakana':opt_conv["boolean"][option6.get_active()], 'contracted_katakana_portions':kanaPortions[5], 'additional_katakana':opt_conv["boolean"][option7.get_active()], 'additional_katakana_portions':kanaPortions[6], 'transcription_system':opt_conv["transcription_system"][ option8.get_active()], 'answer_mode':opt_conv["answer_mode"][option9.get_active()], 'list_size':option10.get_active()+2, 'rand_answer_sel_range':opt_conv["rand_answer_sel_range"][ option11.get_active()], 'length':int(option12.get_value()), 'kana_no_repeat':opt_conv["boolean"][option13.get_active()], 'lang':opt_conv["lang"][option14.get_active()] }) self.main(box) #Go back to the ``main". | 64cfb9e0b60a3a976c72fa9d5d722987641133b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3073/64cfb9e0b60a3a976c72fa9d5d722987641133b9/gtk_gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1348,
12,
6587,
16,
9371,
33,
7036,
4672,
309,
4582,
31713,
5688,
6877,
468,
1891,
326,
1664,
18,
365,
18,
891,
18,
2626,
12590,
296,
13240,
67,
76,
481,
346,
13848,
4278,
3838,
67,
48... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1348,
12,
6587,
16,
9371,
33,
7036,
4672,
309,
4582,
31713,
5688,
6877,
468,
1891,
326,
1664,
18,
365,
18,
891,
18,
2626,
12590,
296,
13240,
67,
76,
481,
346,
13848,
4278,
3838,
67,
48... |
$pyjs.in_try_except -= 1; sys.save_exception_stack(); var $pyjs_msg = ''; try { $pyjs_msg = "\\n" + sys.trackstackstr(); } catch (s) {}; pyjslib['debugReport'](err + '\\nTraceback:' + $pyjs_msg); | pyjslib['_handle_exception'](err); | def PYVA(content): return compile(dedent(content)) | 5e8341bde915eb90dad9cc490bd887e44367020a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11828/5e8341bde915eb90dad9cc490bd887e44367020a/pyjs_filter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12191,
27722,
12,
1745,
4672,
327,
4074,
12,
785,
319,
12,
1745,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12191,
27722,
12,
1745,
4672,
327,
4074,
12,
785,
319,
12,
1745,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
sytem(self.runAfter) | system(self.runAfter) | def runAfterCommands(self): if self.runAfter is not '': sytem(self.runAfter) if self.runAfterOut is not '': self.session.open(Execute, self.name, None, self.runAfterOut) | 600ecdcfa75fc8000d9c45b12764469df37d428c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10199/600ecdcfa75fc8000d9c45b12764469df37d428c/ppanel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
4436,
9127,
12,
2890,
4672,
309,
365,
18,
2681,
4436,
353,
486,
875,
30,
2619,
12,
2890,
18,
2681,
4436,
13,
309,
365,
18,
2681,
4436,
1182,
353,
486,
875,
30,
365,
18,
3184,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1086,
4436,
9127,
12,
2890,
4672,
309,
365,
18,
2681,
4436,
353,
486,
875,
30,
2619,
12,
2890,
18,
2681,
4436,
13,
309,
365,
18,
2681,
4436,
1182,
353,
486,
875,
30,
365,
18,
3184,
1... |
names = os.listdir(dirpath) names.sort(lambda x,y: cmp(x.lower(), y.lower())) | names = self._list_dir(dirpath) | def _get_suite_items(self, dirpath, suitenames): names = os.listdir(dirpath) names.sort(lambda x,y: cmp(x.lower(), y.lower())) files = [] initfile = None for name in names: path = os.path.join(dirpath, name) if self._is_suite_init_file(name, path): if initfile is None: initfile = path else: LOGGER.error("Ignoring second test suite init file '%s'" % path) elif self._is_ignored(name, path, suitenames): LOGGER.info("Ignoring file or directory '%s'" % name) else: files.append(path) return files, initfile | 7617f14b99e6076e1c142caabc9e19633c0c98a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7408/7617f14b99e6076e1c142caabc9e19633c0c98a0/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
30676,
67,
3319,
12,
2890,
16,
17803,
16,
1597,
305,
6809,
4672,
1257,
273,
365,
6315,
1098,
67,
1214,
12,
1214,
803,
13,
1390,
273,
5378,
1208,
768,
273,
599,
364,
508,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
30676,
67,
3319,
12,
2890,
16,
17803,
16,
1597,
305,
6809,
4672,
1257,
273,
365,
6315,
1098,
67,
1214,
12,
1214,
803,
13,
1390,
273,
5378,
1208,
768,
273,
599,
364,
508,
... |
kernel = '/usr/lib/xen/boot/hvmloader' | kernel = '/usr/lib/xen-default/boot/hvmloader' | def createXenConfig(self, vmName, image, macAddr, bridge, memory, cores, hints, id): fn = os.path.join("/tmp", vmName) vmType = hints.get('vmtype', self.defaultVmType) print 'starting vm with type: ', vmType bootstr = '' if vmType == 'pvgrub': # FIXME: untested, requires Xen 3.3 bootstr = ''' | 787afd97a19dbc056f066117a0e80a968ac780eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5161/787afd97a19dbc056f066117a0e80a968ac780eb/xenpv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
60,
275,
809,
12,
2890,
16,
4268,
461,
16,
1316,
16,
5318,
3178,
16,
10105,
16,
3778,
16,
15355,
16,
13442,
16,
612,
4672,
2295,
273,
1140,
18,
803,
18,
5701,
2932,
19,
5645,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
60,
275,
809,
12,
2890,
16,
4268,
461,
16,
1316,
16,
5318,
3178,
16,
10105,
16,
3778,
16,
15355,
16,
13442,
16,
612,
4672,
2295,
273,
1140,
18,
803,
18,
5701,
2932,
19,
5645,
31... |
self.searcher.localPSIBlast( self.f_target, self.db, npasses=2 ) | self.searcher.localPSIBlast( self.f_target, self.db, npasses=2 ) | def searchLocalPsiBlast(self): | 192f7ffa922aed1ead1fed83d7e0b2a4faaea9b9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/482/192f7ffa922aed1ead1fed83d7e0b2a4faaea9b9/SequenceSearcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
2042,
52,
7722,
38,
2722,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
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,
1623,
2042,
52,
7722,
38,
2722,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
class _Renderer(Ean13._Renderer): | default_options = dict(textyoffset=-4) class _Renderer(LinearCodeRenderer): code_bbox = [0, 0, 13*7+4, DPI] @property def text_bbox(self): textyoffset = self.lookup_option('textyoffset', 0) textsize = self.lookup_option('textsize', 12) textmaxh = textyoffset + textsize if self.lookup_option('includetext', False) is None: return [-10, textyoffset-textsize/2.0, (12-1)*7+8+textsize*0.6, textmaxh] else: return self.code_bbox | def text_bbox(self): textyoffset = self.lookup_option('textyoffset', 0) textsize = self.lookup_option('textsize', 12) textmaxh = textyoffset + textsize if self.lookup_option('includetext', False) is None: return [-10, textyoffset-textsize/2.0, (12-1)*7+8+textsize*0.6, textmaxh] else: return self.code_bbox | c0d20174c7fcc3c635858cb23decc23ee2a09049 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5996/c0d20174c7fcc3c635858cb23decc23ee2a09049/ean.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
977,
67,
20737,
12,
2890,
4672,
977,
93,
3348,
273,
365,
18,
8664,
67,
3482,
2668,
955,
93,
3348,
2187,
374,
13,
977,
1467,
273,
365,
18,
8664,
67,
3482,
2668,
955,
1467,
2187,
2593,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
977,
67,
20737,
12,
2890,
4672,
977,
93,
3348,
273,
365,
18,
8664,
67,
3482,
2668,
955,
93,
3348,
2187,
374,
13,
977,
1467,
273,
365,
18,
8664,
67,
3482,
2668,
955,
1467,
2187,
2593,
... |
b.pack(side = TOP) | b.pack(side=TOP) | def build_tools(self): tframe = self.tframe canvas = self.canvas fr=TFrame(tframe, style='FlatFrame', borderwidth=12) fr.pack(side = TOP, fill = X) label = TLabel(fr, style='FlatLabel') label.pack(side = TOP, fill = X) label = TLabel(tframe, style='HLine') label.pack(side = TOP, fill = X) | 5bd05aab08ecc99debb8be46af1003105e4183ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3123/5bd05aab08ecc99debb8be46af1003105e4183ab/mainwindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
6642,
12,
2890,
4672,
3253,
1474,
273,
365,
18,
88,
3789,
5953,
273,
365,
18,
15424,
225,
3812,
33,
56,
3219,
12,
88,
3789,
16,
2154,
2218,
16384,
3219,
2187,
5795,
2819,
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,
1361,
67,
6642,
12,
2890,
4672,
3253,
1474,
273,
365,
18,
88,
3789,
5953,
273,
365,
18,
15424,
225,
3812,
33,
56,
3219,
12,
88,
3789,
16,
2154,
2218,
16384,
3219,
2187,
5795,
2819,
33,... |
AVISITOR = alist(bot, 'avisitor', a_visitor) | ALISTS = [AKICK, AVISITOR, AMODERATOR] | def a_moderator(item, reason): item.room.moderate('nick', item.nick, 'role', 'moderator', '') | bab40efca50c4e0d03eaefce7b8f5193f06e5b64 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2729/bab40efca50c4e0d03eaefce7b8f5193f06e5b64/alists.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
279,
67,
1711,
7385,
12,
1726,
16,
3971,
4672,
761,
18,
13924,
18,
1711,
12600,
2668,
17091,
2187,
761,
18,
17091,
16,
296,
4615,
2187,
296,
1711,
7385,
2187,
28707,
225,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
279,
67,
1711,
7385,
12,
1726,
16,
3971,
4672,
761,
18,
13924,
18,
1711,
12600,
2668,
17091,
2187,
761,
18,
17091,
16,
296,
4615,
2187,
296,
1711,
7385,
2187,
28707,
225,
2,
-100,
-100,
... |
classMap = self._getClassMap() | def checkPrivate(allVars): privateElement = re.compile(r'\b__') def findPrivate(allVars): variables = [] for node in allVars: fullName, isComplete = treeutil.assembleVariable(node) if privateElement.search(fullName): variables.append(node) return variables def isLocalPrivate(var, fullName): allIdentifier = fullName.split('.') first = second = None if len(allIdentifier) > 0: first = allIdentifier[0] if len(allIdentifier) > 1: second = allIdentifier[1] allPrivatesInThisVar = privateElement.findall(fullName) return (first and (first == "this" or first == "that") and second and privateElement.match(second) and len(allPrivatesInThisVar)==1) variables = findPrivate(allVars) for var in variables: fullName = treeutil.assembleVariable(var)[0] if not isLocalPrivate(var, fullName): self.log(var, "Non-local private data field in '%s'! You should never do this." % treeutil.assembleVariable(var)[0]) return def checkProtected(allVars): def findProtected(allVars): protectedElement = re.compile(r'\b_[^_]') variables = [] for node in allVars: fullName, isComplete = treeutil.assembleVariable(node) if protectedElement.search(fullName): variables.append(node) return variables variables = findProtected(allVars) for var in variables: self.log(var, "Protected data field in '%s'. Protected fields are deprecated. Better use private fields in combination with getter and setter methods." % treeutil.assembleVariable(var)[0]) return def checkImplicit(allVars): def hasUndeclaredMember(fullName): allIdentifier = fullName.split('.') first = second = None if len(allIdentifier) > 0: first = allIdentifier[0] if len(allIdentifier) > 1: second = allIdentifier[1] return (first and (first == "this" or first == "that") and second and second not in restricted) for var in allVars: fullName = treeutil.assembleVariable(var)[0] if hasUndeclaredMember(fullName): self.log(var, "Undeclared local data field in '%s'! You should list this field in the member section." % fullName) return def checkAll(): def findVariables(rootNode): variables = [] for node in treeutil.nodeIterator(rootNode, ["assignment", "call"]): if node.type == "assignment": variables.append(node.getChild("left")) elif node.type == "call": variables.append(node.getChild("operand")) return variables variables = findVariables(classMap["members"]) if "construct" in classMap: variables.extend(findVariables(classMap["construct"])) for node in variables: this = treeutil.selectNode(node, "variable/identifier[1]/@name") if this != "this": continue field = treeutil.selectNode(node, "variable/identifier[2]/@name") if field is None: continue if field[0] != "_": continue elif field[1] == "_": prot = "private" else: prot = "protected" if prot == "protected": self.log(node, "Protected data field '%s'. Protected fields are deprecated. Better use private fields in combination with getter and setter methods." % field) elif not field in restricted: self.log(node, "Implicit declaration of %s field '%s'. You should list this field in the members section." % (prot, field)) classMap = self._getClassMap() | def findVariables(rootNode): variables = [] for node in treeutil.nodeIterator(rootNode, ["assignment", "call"]): if node.type == "assignment": variables.append(node.getChild("left")) elif node.type == "call": variables.append(node.getChild("operand")) return variables | ec00e2844f80c3e0277ecba0e7493d7e837efb49 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/ec00e2844f80c3e0277ecba0e7493d7e837efb49/ecmalint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
6158,
12,
3085,
907,
4672,
3152,
273,
5378,
364,
756,
316,
2151,
1367,
18,
2159,
3198,
12,
3085,
907,
16,
8247,
12960,
3113,
315,
1991,
11929,
4672,
309,
756,
18,
723,
422,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
6158,
12,
3085,
907,
4672,
3152,
273,
5378,
364,
756,
316,
2151,
1367,
18,
2159,
3198,
12,
3085,
907,
16,
8247,
12960,
3113,
315,
1991,
11929,
4672,
309,
756,
18,
723,
422,
315,
... |
<p>Migrate PTK content to CMF site</p> <p>Path (not including "http://") to PTK instance (source): | <h2>Migrate PTK content to CMF site</h2> <p>Path (not including server URL) to PTK instance (source): | def migrate(self, src_path='', dest_path=''): if not src_path or not dest_path: return ''' <html><body><form action="%s" method="POST"> <p>Migrate PTK content to CMF site</p> <p>Path (not including "http://") to PTK instance (source): <input type="text" name="src_path"></p> <p>Path (not including "http://") to CMF site (destination): <input type="text" name="dest_path"></p> <input type="submit" name="submit" value="Migrate"> </form></body></html> ''' % self.REQUEST['URL'] root = self.getPhysicalRoot() src_folder = root.restrictedTraverse(src_path) dst_folder = root.restrictedTraverse(dest_path) res = MigrationResults() _migrateObjectManager(src_folder, dst_folder, ptk2cmf_conversions, ptk2cmf_skip, res) ownership_res = [] _cleanupOwnership(dst_folder, ownership_res, 1) return ''' <html><body><p>Finished migration.</p> <p>Warnings (if any):<ul><li>%s</li></ul></p> <p>Visited folders:<ul><li>%s</li></ul></p> <p>Skipped:<ul><li>%s</li></ul></p> <p>Converted content:</p><pre>%s</pre> <p>Fixed up ownership:</p><pre>%s</pre> </body></html> ''' % (join(res.warnings, '</li>\n<li>'), join(res.visited_folders, '</li>\n<li>'), join(res.skipped, '</li>\n<li>'), join(res.copied, '\n'), join(ownership_res, '\n'), ) | 2b8f52be9ede3f56a5fb14e9fed0e592d52ccb16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/2b8f52be9ede3f56a5fb14e9fed0e592d52ccb16/migrate_ptk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13187,
12,
2890,
16,
1705,
67,
803,
2218,
2187,
1570,
67,
803,
2218,
11,
4672,
309,
486,
1705,
67,
803,
578,
486,
1570,
67,
803,
30,
327,
9163,
411,
2620,
4438,
3432,
4438,
687,
1301,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13187,
12,
2890,
16,
1705,
67,
803,
2218,
2187,
1570,
67,
803,
2218,
11,
4672,
309,
486,
1705,
67,
803,
578,
486,
1570,
67,
803,
30,
327,
9163,
411,
2620,
4438,
3432,
4438,
687,
1301,
... |
for property in ['cluster', 'hostname', 'disks', 'vcpus', 'pnode', 'os', 'disk_template']: | for property in ['cluster', 'hostname', 'disk_size','nictype', 'nic', 'vcpus', 'pnode', 'os', 'disk_template', 'kernelpath', 'rootpath', 'bootorder']: | def test_view_create(self): """ Test creating a virtual machine """ url = '/vm/add/%s' group1 = UserGroup(id=2, name='testing_group2') group1.save() cluster1 = Cluster(hostname='test2.osuosl.bak', slug='OSL_TEST2') cluster1.save() # anonymous user response = c.get(url % '', follow=True) self.assertEqual(200, response.status_code) self.assertTemplateUsed(response, 'registration/login.html') # unauthorized user self.assert_(c.login(username=user.username, password='secret')) response = c.post(url % '') self.assertEqual(403, response.status_code) # authorized GET (create_vm permissions) user.grant('create_vm', cluster) response = c.get(url % '') self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/create.html') user.revoke_all(cluster) # authorized GET (cluster admin permissions) user.grant('admin', cluster) response = c.get(url % '') self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/create.html') user.revoke_all(cluster) # authorized GET (superuser) user.is_superuser = True user.save() response = c.get(url % '') self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/create.html') # GET unknown cluster response = c.get(url % 'DOES_NOT_EXIST') self.assertEqual(404, response.status_code) # GET valid cluster response = c.get(url % cluster.slug) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/create.html') data = dict(cluster=cluster.id, owner=user.get_profile().id, #XXX remove this hostname='new.vm.hostname', disk_template='plain', disks= [ [], [{ "size": 128, }, { "size": 321, }], [{ "size": 512, }], ], nics = [ {}, {"bridge": "br1", } ], ram=256, vcpus=2, os='image+ubuntu-lucid', pnode=cluster.nodes()[0], snode=cluster.nodes()[0]) # POST - invalid cluster data_ = data.copy() data_['cluster'] = -1 response = c.post(url % '', data_) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/create.html') self.assertFalse(VirtualMachine.objects.filter(hostname='new.vm.hostname').exists()) # POST - unauthorized for cluster selected (authorized for another) user.grant('create_vm', cluster1) user.is_superuser = False user.save() response = c.post(url % '', data_) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/create.html') self.assertFalse(VirtualMachine.objects.filter(hostname='new.vm.hostname').exists()) # POST - required values for property in ['cluster', 'hostname', 'disks', 'vcpus', 'pnode', 'os', 'disk_template']: data_ = data.copy() del data_[property] response = c.post(url % '', data_) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/create.html') self.assertFalse(VirtualMachine.objects.filter(hostname='new.vm.hostname').exists()) # POST - over ram quota profile = user.get_profile() cluster.set_quota(profile, dict(ram=1000, disk=2000, virtual_cpus=10)) vm = VirtualMachine(cluster=cluster, ram=100, disk=[[{'size':100}]], virtual_cpus=2, owner=profile).save() data_ = data.copy() data_['ram'] = 2000 response = c.post(url % '', data_) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/create.html') self.assertFalse(VirtualMachine.objects.filter(hostname='new.vm.hostname').exists()) # POST - over disk quota data_ = data.copy() data_['disk'] = [[{'size':2000}]] response = c.post(url % '', data_) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/create.html') self.assertFalse(VirtualMachine.objects.filter(hostname='new.vm.hostname').exists()) # POST - over cpu quota data_ = data.copy() data_['vcpus'] = 2000 response = c.post(url % '', data_) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/create.html') self.assertFalse(VirtualMachine.objects.filter(hostname='new.vm.hostname').exists()) # POST invalid owner data_ = data.copy() data_['owner'] = -1 response = c.post(url % '', data_) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/create.html') self.assertFalse(VirtualMachine.objects.filter(hostname='new.vm.hostname').exists()) # POST - user authorized for cluster (create_vm) user.grant('admin', cluster) response = c.post(url % '', data, follow=True) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/detail.html') new_vm = VirtualMachine.objects.get(hostname='new.vm.hostname') self.assertEqual(new_vm, response.context['instance']) self.assert_(user.has_perm('admin', new_vm), user.__dict__) user.revoke_all(cluster) user.revoke_all(new_vm) VirtualMachine.objects.all().delete() # POST - user authorized for cluster (admin) user.grant('admin', cluster) response = c.post(url % '', data, follow=True) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/detail.html') new_vm = VirtualMachine.objects.get(hostname='new.vm.hostname') self.assertEqual(new_vm, response.context['instance']) self.assert_(user.has_perm('admin', new_vm)) VirtualMachine.objects.all().delete() user.revoke_all(cluster) user.revoke_all(new_vm) # POST - User attempting to be other user data_ = data.copy() data_['owner'] = user1.get_profile().id response = c.post(url % '', data_) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/create.html') self.assertFalse(VirtualMachine.objects.filter(hostname='new.vm.hostname').exists()) # POST - user authorized for cluster (superuser) user.is_superuser = True user.save() response = c.post(url % '', data, follow=True) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/detail.html') new_vm = VirtualMachine.objects.get(hostname='new.vm.hostname') self.assertEqual(new_vm, response.context['instance']) self.assert_(user.has_perm('admin', new_vm)) user.revoke_all(new_vm) VirtualMachine.objects.all().delete() # POST - ganeti error cluster.rapi.CreateInstance.error = client.GanetiApiError('Testing Error') response = c.post(url % '', data) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/create.html') self.assertFalse(VirtualMachine.objects.filter(hostname='new.vm.hostname').exists()) cluster.rapi.CreateInstance.error = None # POST - User attempting to be other user (superuser) data_ = data.copy() data_['owner'] = user1.get_profile().id response = c.post(url % '', data_, follow=True) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/detail.html') new_vm = VirtualMachine.objects.get(hostname='new.vm.hostname') self.assertEqual(new_vm, response.context['instance']) self.assert_(user1.has_perm('admin', new_vm)) self.assertEqual([], user.get_perms(new_vm)) user.revoke_all(new_vm) user1.revoke_all(new_vm) VirtualMachine.objects.all().delete() # reset for group owner user.is_superuser = False user.save() data['owner'] = group.organization.id # POST - user is not member of group group.grant('create_vm', cluster) response = c.post(url % '', data) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/create.html') self.assertFalse(VirtualMachine.objects.filter(hostname='new.vm.hostname').exists()) group.revoke_all(new_vm) VirtualMachine.objects.all().delete() # add user to group group.users.add(user) # POST - group authorized for cluster (create_vm) group.grant('create_vm', cluster) response = c.post(url % '', data, follow=True) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/detail.html') new_vm = VirtualMachine.objects.get(hostname='new.vm.hostname') self.assertEqual(new_vm, response.context['instance']) self.assert_(group.has_perm('admin', new_vm)) group.revoke_all(cluster) group.revoke_all(new_vm) VirtualMachine.objects.all().delete() # POST - group authorized for cluster (admin) group.grant('admin', cluster) response = c.post(url % '', data, follow=True) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/detail.html') new_vm = VirtualMachine.objects.get(hostname='new.vm.hostname') self.assertEqual(new_vm, response.context['instance']) self.assert_(group.has_perm('admin', new_vm)) group.revoke_all(cluster) group.revoke_all(new_vm) VirtualMachine.objects.all().delete() # POST - group authorized for cluster (superuser) user.is_superuser = True user.save() response = c.post(url % '', data, follow=True) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/detail.html') new_vm = VirtualMachine.objects.get(hostname='new.vm.hostname') self.assertEqual(new_vm, response.context['instance']) self.assert_(group.has_perm('admin', new_vm)) group.revoke_all(new_vm) VirtualMachine.objects.all().delete() # POST - not a group member (superuser) data_ = data.copy() data_['owner'] = group1.organization.id response = c.post(url % '', data_, follow=True) self.assertEqual(200, response.status_code) self.assertEqual('text/html; charset=utf-8', response['content-type']) self.assertTemplateUsed(response, 'virtual_machine/detail.html') new_vm = VirtualMachine.objects.get(hostname='new.vm.hostname') self.assertEqual(new_vm, response.context['instance']) self.assert_(group1.has_perm('admin', new_vm)) self.assertFalse(group.has_perm('admin', new_vm)) | 2162f2fc3bbfc1a335a7d4bcf29dfb58afe849ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10509/2162f2fc3bbfc1a335a7d4bcf29dfb58afe849ba/virtual_machine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1945,
67,
2640,
12,
2890,
4672,
3536,
7766,
4979,
279,
5024,
5228,
3536,
880,
273,
1173,
3489,
19,
1289,
5258,
87,
11,
1041,
21,
273,
30928,
12,
350,
33,
22,
16,
508,
2218,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1945,
67,
2640,
12,
2890,
4672,
3536,
7766,
4979,
279,
5024,
5228,
3536,
880,
273,
1173,
3489,
19,
1289,
5258,
87,
11,
1041,
21,
273,
30928,
12,
350,
33,
22,
16,
508,
2218,
... |
self.start = 0 if self.player.item_info and hasattr(self.player.item_info, 'ts_start'): self.start = self.player.item_info.ts_start | self.start = 0 try: self.length = int(self.item.info['length']) except: self.lebgth = 0 if self.player.item_info: length = int(self.player.item_info.length) if hasattr(self.player.item_info, 'ts_start'): self.start = self.player.item_info.ts_start | def play(self, command, player): """ called before playing is started to add some stuff to the command line """ self.item = player.item self.player = player self.osd_visible = False self.bmovl = None | 3489fc1ad1f871f05615c51ddeca3e4a586b5982 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/3489fc1ad1f871f05615c51ddeca3e4a586b5982/bmovl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6599,
12,
2890,
16,
1296,
16,
7291,
4672,
3536,
2566,
1865,
23982,
353,
5746,
358,
527,
2690,
10769,
358,
326,
1296,
980,
3536,
365,
18,
1726,
3639,
273,
7291,
18,
1726,
365,
18,
14872,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6599,
12,
2890,
16,
1296,
16,
7291,
4672,
3536,
2566,
1865,
23982,
353,
5746,
358,
527,
2690,
10769,
358,
326,
1296,
980,
3536,
365,
18,
1726,
3639,
273,
7291,
18,
1726,
365,
18,
14872,
... |
env=os.environ.copy(), | env=(os.environ.copy() if sys.platform != "win32" else None), | def start_process(command, **kwargs): """Start `command` as a new background subprocess. `command` and `kwargs` are passed to :meth:`subprocess.Popen.__init__`. Raise :exc:`aeidon.ProcessError` if something goes wrong. Return :class:`subprocess.Popen` instance. """ try: return subprocess.Popen(command, shell=(sys.platform != "win32"), cwd=os.getcwd(), env=os.environ.copy(), universal_newlines=True, **kwargs) except OSError as (no, message): raise aeidon.ProcessError(message) | 2c402a866e5a3aaa5eddcd73cb74e689de8741a1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12852/2c402a866e5a3aaa5eddcd73cb74e689de8741a1/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
2567,
12,
3076,
16,
2826,
4333,
4672,
3536,
1685,
1375,
3076,
68,
487,
279,
394,
5412,
6652,
18,
225,
1375,
3076,
68,
471,
1375,
4333,
68,
854,
2275,
358,
294,
27305,
28288,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
2567,
12,
3076,
16,
2826,
4333,
4672,
3536,
1685,
1375,
3076,
68,
487,
279,
394,
5412,
6652,
18,
225,
1375,
3076,
68,
471,
1375,
4333,
68,
854,
2275,
358,
294,
27305,
28288,
1... |
self.library_path = get_library_path() if self.library_path is None: | self.library_path = get_library_path(parent=self.splash_screen) if not self.library_path: | def initialize(self, *args): if gprefs.get('show_splash_screen', True): self.show_splash_screen() | 4e136e7d4b31d76de5669b03ac8cb99c635196e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/4e136e7d4b31d76de5669b03ac8cb99c635196e2/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
16,
380,
1968,
4672,
309,
314,
1484,
2556,
18,
588,
2668,
4500,
67,
13106,
961,
67,
9252,
2187,
1053,
4672,
365,
18,
4500,
67,
13106,
961,
67,
9252,
1435,
2,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
16,
380,
1968,
4672,
309,
314,
1484,
2556,
18,
588,
2668,
4500,
67,
13106,
961,
67,
9252,
2187,
1053,
4672,
365,
18,
4500,
67,
13106,
961,
67,
9252,
1435,
2,
-100,
-100... |
interCharTimeout + 1 | interCharTimeout + 1 | def setInterCharTimeout(self, interCharTimeout): """Change inter-character timeout setting.""" if interCharTimeout is not None: if interCharTimeout < 0: raise ValueError("Not a valid timeout: %r" % interCharTimeout) try: interCharTimeout + 1 #test if it's a number, will throw a TypeError if not... except TypeError: raise ValueError("Not a valid timeout: %r" % interCharTimeout) self._interCharTimeout = interCharTimeout if self._isOpen: self._reconfigurePort() | 08389a910a6098708fb05bf3b12c10c8dafc4eb6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10955/08389a910a6098708fb05bf3b12c10c8dafc4eb6/serialutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2465,
2156,
2694,
12,
2890,
16,
1554,
2156,
2694,
4672,
3536,
3043,
1554,
17,
11560,
2021,
3637,
12123,
309,
1554,
2156,
2694,
353,
486,
599,
30,
309,
1554,
2156,
2694,
411,
374,
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,
444,
2465,
2156,
2694,
12,
2890,
16,
1554,
2156,
2694,
4672,
3536,
3043,
1554,
17,
11560,
2021,
3637,
12123,
309,
1554,
2156,
2694,
353,
486,
599,
30,
309,
1554,
2156,
2694,
411,
374,
30... |
('Fallout - Meshes.bsa',1138575220), ('Fallout - Misc.bsa',1139433736), ('Fallout - Sounds.bsa',1138660560), ('Fallout - Textures - Compressed.bsa',1138162634), ('Fallout - Voices1.bsa',1138162934), ('Fallout - Voices2.bsa',1138166742), | ('Fallout - MenuVoices.bsa',1138575220), ('Fallout - Meshes.bsa',1139433736), ('Fallout - Misc.bsa',1138660560), ('Fallout - Sounds.bsa',1138162634), ('Fallout - Textures.bsa',1138162934), ('Fallout - Voices.bsa',1138166742), | def resetMTimes(self): """Reset dates of bsa files to 'correct' values.""" #--Fix the data of a few archive files bsaTimes = ( ('Fallout - Meshes.bsa',1138575220), ('Fallout - Misc.bsa',1139433736), ('Fallout - Sounds.bsa',1138660560), ('Fallout - Textures - Compressed.bsa',1138162634), ('Fallout - Voices1.bsa',1138162934), ('Fallout - Voices2.bsa',1138166742), ) for bsaFile,mtime in bsaTimes: dirs['mods'].join(bsaFile).mtime = mtime | 2e6db0ec4099b9682b5a69f3ca23782f6cc992b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/2e6db0ec4099b9682b5a69f3ca23782f6cc992b2/bosh.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
6152,
4485,
12,
2890,
4672,
3536,
7013,
7811,
434,
7081,
69,
1390,
358,
296,
6746,
11,
924,
12123,
468,
413,
8585,
326,
501,
434,
279,
11315,
5052,
1390,
7081,
69,
10694,
273,
261,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
6152,
4485,
12,
2890,
4672,
3536,
7013,
7811,
434,
7081,
69,
1390,
358,
296,
6746,
11,
924,
12123,
468,
413,
8585,
326,
501,
434,
279,
11315,
5052,
1390,
7081,
69,
10694,
273,
261,... |
if type(name) is type(()): uri, localname, prefix = name name = "%s:%s"%(prefix,localname) | def startElement(self, name, attrs): if type(name) is type(()): uri, localname, prefix = name name = "%s:%s"%(prefix,localname) self._out.write('<' + name) for (name, value) in attrs.items(): self._out.write(' %s="%s"' % (name, escape(value))) self._out.write('>') | d2e8ed58c83ecc5390d6cf99651b791350b04e61 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/d2e8ed58c83ecc5390d6cf99651b791350b04e61/saxutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13591,
12,
2890,
16,
508,
16,
3422,
4672,
365,
6315,
659,
18,
2626,
2668,
32,
11,
397,
508,
13,
364,
261,
529,
16,
460,
13,
316,
3422,
18,
3319,
13332,
365,
6315,
659,
18,
2626,
2668... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13591,
12,
2890,
16,
508,
16,
3422,
4672,
365,
6315,
659,
18,
2626,
2668,
32,
11,
397,
508,
13,
364,
261,
529,
16,
460,
13,
316,
3422,
18,
3319,
13332,
365,
6315,
659,
18,
2626,
2668... | |
assert self.typedesc is not None | def freeze(self, memo): contmemo = memo.containers assert self not in contmemo # contmemo no longer used assert self.typedesc is not None result = contmemo[self] = FrozenVirtualStruct(self.typedesc) frozens = [box.freeze(memo) for box in self.content_boxes] result.fz_content_boxes = frozens return result | c4f4e0fc504144433de8e467cdb427939d238666 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/c4f4e0fc504144433de8e467cdb427939d238666/rcontainer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16684,
12,
2890,
16,
11063,
4672,
466,
19521,
273,
11063,
18,
20596,
1815,
365,
486,
316,
466,
19521,
377,
468,
466,
19521,
1158,
7144,
1399,
563,
273,
466,
19521,
63,
2890,
65,
273,
478... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16684,
12,
2890,
16,
11063,
4672,
466,
19521,
273,
11063,
18,
20596,
1815,
365,
486,
316,
466,
19521,
377,
468,
466,
19521,
1158,
7144,
1399,
563,
273,
466,
19521,
63,
2890,
65,
273,
478... | |
self.parseAction += map(self._normalizeParseActionArgs, list(fns)) | self.parseAction += list(map(self._normalizeParseActionArgs, list(fns))) | def addParseAction( self, *fns, **kwargs ): """Add parse action to expression's list of parse actions. See L{I{setParseAction}<setParseAction>}.""" self.parseAction += map(self._normalizeParseActionArgs, list(fns)) self.callDuringTry = self.callDuringTry or ("callDuringTry" in kwargs and kwargs["callDuringTry"]) return self | c6e5c5fcf7fe09d7390a6d3525397e48c03606ea /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3693/c6e5c5fcf7fe09d7390a6d3525397e48c03606ea/pyparsing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
3201,
1803,
12,
365,
16,
380,
74,
2387,
16,
2826,
4333,
262,
30,
3536,
986,
1109,
1301,
358,
2652,
1807,
666,
434,
1109,
4209,
18,
2164,
511,
95,
45,
95,
542,
3201,
1803,
97,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
3201,
1803,
12,
365,
16,
380,
74,
2387,
16,
2826,
4333,
262,
30,
3536,
986,
1109,
1301,
358,
2652,
1807,
666,
434,
1109,
4209,
18,
2164,
511,
95,
45,
95,
542,
3201,
1803,
97,
32... |
inProcessOpts .append( '-o GridCEQueue=%s' % CE ) | if pilotRef != 'Unknown': inProcessOpts .append( '-o GridCEQueue=%s' % CE ) | def executeAndGetOutput( cmd ): try: import subprocess p = subprocess.Popen( "%s" % cmd, shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE, close_fds = True ) outData = p.stdout.read().strip() returnCode = p.wait() except ImportError: import popen2 p3 = popen2.Popen3( "%s" % cmd ) outData = p3.fromchild.read().strip() returnCode = p3.wait() return ( returnCode, outData ) | 8922130e24bc4dbc0c83fb4f30f8c4eb2eaf22e0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/8922130e24bc4dbc0c83fb4f30f8c4eb2eaf22e0/dirac-pilot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
14042,
1447,
12,
1797,
262,
30,
775,
30,
1930,
6652,
293,
273,
6652,
18,
52,
3190,
12,
2213,
87,
6,
738,
1797,
16,
5972,
273,
1053,
16,
3909,
273,
6652,
18,
27602,
16,
4514,
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,
1836,
14042,
1447,
12,
1797,
262,
30,
775,
30,
1930,
6652,
293,
273,
6652,
18,
52,
3190,
12,
2213,
87,
6,
738,
1797,
16,
5972,
273,
1053,
16,
3909,
273,
6652,
18,
27602,
16,
4514,
27... |
'_default': u'Annex talk', | '_default': u'Appendix talk', | def __init__(self): family.Family.__init__(self) self.name = 'wiktionary' self.langs = { 'minnan':'zh-min-nan.wiktionary.org', 'nb':'no.wiktionary.org', 'zh-cn':'zh.wiktionary.org', 'zh-tw':'zh.wiktionary.org' } for lang in self.knownlanguages: if not lang in ['ee','ht','ny', 'se', 'tum']: self.langs[lang] = lang+'.wiktionary.org' # Most namespaces are inherited from family.Family. | dc0bee136edc4aa5926e427bf334e8075f22a777 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/dc0bee136edc4aa5926e427bf334e8075f22a777/wiktionary_family.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
6755,
18,
9203,
16186,
2738,
972,
12,
2890,
13,
365,
18,
529,
273,
296,
11999,
24252,
814,
11,
365,
18,
4936,
87,
273,
288,
296,
1154,
13569,
11,
2497,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
6755,
18,
9203,
16186,
2738,
972,
12,
2890,
13,
365,
18,
529,
273,
296,
11999,
24252,
814,
11,
365,
18,
4936,
87,
273,
288,
296,
1154,
13569,
11,
2497,... |
if v['GCC_CONFIGURED_PLATFORM'] == 'linux': conf.env.append_unique('CCFLAGS', ['-fPIC']) conf.env.append_unique('CXXFLAGS', ['-fPIC']) conf.env.append_unique('LINKFLAGS', ['-rdynamic']) | def find_cross_gcc(conf): try: target = Options.options.target except: target = None if not target: target = conf.env['GCC_TARGET'] version = conf.env['GCC_VERSION'] versionsmall = '.'.join(version.split('.')[0:2]) if target: v = conf.env v['GCC_CONFIGURED_ARCH'] = parse_gcc_target(target) if not v['CC']: v['CC'] = conf.find_program(target+'-gcc-'+version, var='CC', path_list=v['GCC_PATH']) if not v['CC']: v['CC'] = conf.find_program(target+'-gcc-'+versionsmall, var='CC', path_list=v['GCC_PATH']) if not v['CC']: conf.fatal('unable to find gcc for target %s' % target) if not v['CXX']: v['CXX'] = conf.find_program(target+'-g++-'+version, var='CXX', path_list=v['GCC_PATH']) if not v['CXX']: v['CXX'] = conf.find_program(target+'-g++-'+versionsmall, var='CXX', path_list=v['GCC_PATH']) if not v['CXX']: v['CXX'] = conf.find_program(target+'-c++-'+version, var='CXX', path_list=v['GCC_PATH']) if not v['CXX']: v['CXX'] = conf.find_program(target+'-c++-'+versionsmall, var='CXX', path_list=v['GCC_PATH']) if not v['CXX']: v['CXX'] = conf.find_program(target+'-g++', var='CXX', path_list=v['GCC_PATH']) if not v['CXX']: v['CXX'] = conf.find_program(target+'-c++', var='CXX', path_list=v['GCC_PATH']) if not v['CXX']: conf.fatal('unable to find g++ for target %s' % target) if not v['CPP']: v['CPP'] = conf.find_program(target+'-cpp-'+version, var='CPP', path_list=v['GCC_PATH']) if not v['CPP']: v['CPP'] = conf.find_program(target+'-cpp', var='CPP', path_list=v['GCC_PATH']) if not v['CPP']: v['CPP'] = conf.find_program('cpp-'+version, var='CPP', path_list=v['GCC_PATH']) if not v['CPP']: v['CPP'] = conf.find_program('cpp-'+version[0:3], var='CPP', path_list=v['GCC_PATH']) if not v['CPP']: conf.fatal('unable to find cpp for target %s' % target) if not v['AS']: v['AS'] = v['CC'] if not v['AR']: v['AR'] = conf.find_program(target+'-ar', var='AR', path_list=v['GCC_PATH']) if not v['AR']: v['AR'] = conf.find_program('ar', var='AR', path_list=v['GCC_PATH']) if not v['AR']: conf.fatal('unable to find ar for target %s' % target) if not v['RANLIB']: v['RANLIB'] = conf.find_program(target+'-ranlib', var='RANLIB', path_list=v['GCC_PATH']) if not v['RANLIB']: v['RANLIB'] = conf.find_program('ar', var='RANLIB', path_list=v['GCC_PATH']) if not v['RANLIB']: conf.fatal('unable to find ranlib for target %s' % target) conf.check_tool('gcc gxx gas') conf.env.append_unique('ASFLAGS', '-c') conf.env['CCFLAGS_warnall'] = ['-std=c99', '-Wall', '-Wextra', '-pedantic', '-Winline', '-Wno-unknown-pragmas', '-Wno-unused-parameter', '-Werror'] conf.env['CXXFLAGS_warnall'] = ['-Wall', '-Wextra', '-Wno-unknown-pragmas', '-Wno-unused-parameter', '-Werror'] conf.env['CCFLAGS_debug'] = ['-pipe', '-g', '-D_DEBUG'] conf.env['CXXFLAGS_debug'] = ['-pipe', '-g', '-D_DEBUG', '-Wno-invalid-offsetof'] conf.env['LINKFLAGS_debug'] = ['-pipe', '-g', '-Wl,-x', '-Wl,-O2'] conf.env['ASFLAGS_debug'] = ['-pipe', '-g', '-D_DEBUG'] conf.env['CCFLAGS_release'] = ['-pipe', '-g', '-O1'] conf.env['CXXFLAGS_release'] = ['-pipe', '-g', '-O1', '-Wno-invalid-offsetof'] conf.env['ASFLAGS_release'] = ['-pipe', '-g', '-O1'] conf.env['LINKFLAGS_release'] = ['-pipe', '-g', '-Wl,-x', '-Wl,-O2'] conf.env['CCFLAGS_profile'] = ['-pipe', '-g', '-DNDEBUG', '-O3'] conf.env['CXXFLAGS_profile'] = ['-pipe', '-g', '-DNDEBUG', '-O3', '-fno-rtti', '-fno-exceptions', '-Wno-invalid-offsetof'] conf.env['ASFLAGS_profile'] = ['-pipe', '-g', '-DNDEBUG', '-O3'] conf.env['LINKFLAGS_profile'] = ['-pipe', '-g', '-s', '-Wl,-x', '-Wl,-O2'] conf.env['CCFLAGS_final'] = ['-pipe', '-g', '-DNDEBUG', '-O3'] conf.env['CXXFLAGS_final'] = ['-pipe', '-g', '-DNDEBUG', '-O3', '-fno-rtti', '-fno-exceptions', '-Wno-invalid-offsetof'] conf.env['ASFLAGS_final'] = ['-pipe', '-g', '-DNDEBUG', '-O3'] conf.env['LINKFLAGS_final'] = ['-pipe', '-g', '-s', '-Wl,-x', '-Wl,-O2'] if v['GCC_CONFIGURED_ARCH'] in ['amd64', 'x86']: conf.env.append_unique('CCFLAGS', ['-mfpmath=sse', '-msse2']) conf.env.append_unique('CXXFLAGS', ['-mfpmath=sse', '-msse2']) if v['GCC_CONFIGURED_PLATFORM'] == 'linux': conf.env.append_unique('CCFLAGS', ['-fPIC']) conf.env.append_unique('CXXFLAGS', ['-fPIC']) conf.env.append_unique('LINKFLAGS', ['-rdynamic']) if v['GCC_CONFIGURED_PLATFORM'] != 'win32': conf.env.append_unique('CCFLAGS', ['-fvisibility=hidden']) conf.env.append_unique('CXXFLAGS', ['-fvisibility=hidden']) if v['GCC_CONFIGURED_PLATFORM'] == 'wii': flags = ['-mcpu=750', '-mrvl', '-meabi', '-msdata=eabi', '-mhard-float', '-fmodulo-sched', '-ffunction-sections', '-fdata-sections', '-mregnames', '-Wa,-mgekko'] conf.env.append_unique('CCFLAGS', flags) conf.env.append_unique('CXXFLAGS', flags) conf.env.append_unique('ASFLAGS', flags+['-mregnames', '-D_LANGUAGE_ASSEMBLY']) conf.env.append_unique('LINKFLAGS', flags) | 6eee9723d26418465d370b9e61c09df4545a2130 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7302/6eee9723d26418465d370b9e61c09df4545a2130/cross_gcc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
14653,
67,
75,
952,
12,
3923,
4672,
775,
30,
1018,
273,
5087,
18,
2116,
18,
3299,
1335,
30,
1018,
273,
599,
309,
486,
1018,
30,
1018,
273,
2195,
18,
3074,
3292,
43,
6743,
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,
1104,
67,
14653,
67,
75,
952,
12,
3923,
4672,
775,
30,
1018,
273,
5087,
18,
2116,
18,
3299,
1335,
30,
1018,
273,
599,
309,
486,
1018,
30,
1018,
273,
2195,
18,
3074,
3292,
43,
6743,
6... | |
pid, status = os.waitpid(child_pid, 0) return status | os.waitpid(child_pid, 0) return | def wait(self, child_pid): """Wait for child_pid to finish, ignoring EINTR.""" while True: try: pid, status = os.waitpid(child_pid, 0) return status except OSError as e: if e.errno != errno.EINTR: raise | ea9f83bf36178336dfcb304723d862ecd988e1b8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/ea9f83bf36178336dfcb304723d862ecd988e1b8/test_signal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2529,
12,
2890,
16,
1151,
67,
6610,
4672,
3536,
5480,
364,
1151,
67,
6610,
358,
4076,
16,
14398,
512,
3217,
54,
12123,
1323,
1053,
30,
775,
30,
1140,
18,
7048,
6610,
12,
3624,
67,
6610... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2529,
12,
2890,
16,
1151,
67,
6610,
4672,
3536,
5480,
364,
1151,
67,
6610,
358,
4076,
16,
14398,
512,
3217,
54,
12123,
1323,
1053,
30,
775,
30,
1140,
18,
7048,
6610,
12,
3624,
67,
6610... |
j = match.start() self.handle_comment(rawdata[i+4: j]) | if report: j = match.start() self.handle_comment(rawdata[i+4: j]) | def parse_comment(self, i): rawdata = self.rawdata assert rawdata[i:i+4] == '<!--', 'unexpected call to parse_comment()' match = commentclose.search(rawdata, i+4) if not match: return -1 j = match.start() self.handle_comment(rawdata[i+4: j]) j = match.end() return j | 68eac2b574ed837099998d68ea592d02bd8ca129 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/68eac2b574ed837099998d68ea592d02bd8ca129/HTMLParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
3469,
12,
2890,
16,
277,
4672,
1831,
892,
273,
365,
18,
1899,
892,
1815,
1831,
892,
63,
77,
30,
77,
15,
24,
65,
422,
2368,
22772,
2187,
296,
21248,
745,
358,
1109,
67,
3469... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
3469,
12,
2890,
16,
277,
4672,
1831,
892,
273,
365,
18,
1899,
892,
1815,
1831,
892,
63,
77,
30,
77,
15,
24,
65,
422,
2368,
22772,
2187,
296,
21248,
745,
358,
1109,
67,
3469... |
"PPC32_OPENBSD" : "-lm -lpthread", "SPARC64_OPENBSD" : "-lm -lpthread" | "MIPS64_OPENBSD" : " -lm -lpthread ", "PPC32_OPENBSD" : " -lm -lpthread ", "SPARC64_OPENBSD" : " -lm -lpthread ", | def Boot(): global BuildLocal BuildLocal += " -boot -keep" Version = "1" Compile = ("gcc -gstabs+ " + ({ "SPARC32_LINUX" : "-m32 -munaligned-doubles", "SPARC64_LINUX" : "-m64 -munaligned-doubles", "LINUXLIBC6" : "-m32 -fPIC -mno-align-double", "AMD64_LINUX" : "-m64 -fPIC -mno-align-double" }.get(Target) or "")) Link = (Compile + " " + ({ "PPC32_OPENBSD" : "-lm -lpthread", "SPARC64_OPENBSD" : "-lm -lpthread" }.get(Target) or "")) Assemble = ("as " + ({ "SPARC32_LINUX" : "-32", "SPARC64_LINUX" : "-64", "LINUXLIBC6" : "--32", "AMD64_LINUX" : "--64" }.get(Target) or "")) BootDir = "/cm3-boot-POSIX-" + Target + "-" + Version P = [ "import-libs", "m3core", "libm3", "sysutils", "m3middle", "m3quake", "m3objfile", "m3linker", "m3back", "m3front", "cm3" ] if Target == "NT386": P += ["mklib"] #DoPackage(["", "realclean"] + P) or sys.exit(1) DoPackage(["", "buildlocal"] + P) or sys.exit(1) if os.path.isdir(BootDir): shutil.rmtree(BootDir) os.mkdir(BootDir) # # This would probably be a good use of XSL (xml style sheets) # Make = open(os.path.join(BootDir, "make.sh"), "wb") MakeVerbose = open(os.path.join(BootDir, "makeverbose.sh"), "wb") Makefile = open(os.path.join(BootDir, "Makefile"), "wb") Makefile.write("all: cm3\nAssemble=" + Assemble + "\nCompile=" + Compile + "\nLink=" + Link + "\n") for q in P: dir = GetPackagePath(q) for a in os.listdir(os.path.join(Root, dir, Config)): if (a.endswith(".ms") or a.endswith(".is") or a.endswith(".c")): CopyFile(os.path.join(Root, dir, Config, a), BootDir) Makefile.write("Objects += " + a + ".o\n" + a + ".o: " + a + "\n\t") if a.endswith(".c"): Make.write(Compile + " -c " + a + "\n") MakeVerbose.write("echo " + Compile + " -c " + a + "\n") MakeVerbose.write(Compile + " -C " + a + "\n") Makefile.write("$(Compile) -c " + a + "\n") else: Make.write(Assemble + " " + a + " -o " + a + ".o\n") MakeVerbose.write("echo " + Assemble + " " + a + " -o " + a + ".o\n") MakeVerbose.write(Assemble + " " + a + " -o " + a + ".o\n") Makefile.write("$(Assemble) " + a + " -o " + a + ".o\n") if a.endswith(".h"): CopyFile(os.path.join(Root, dir, Config, a), BootDir) Makefile.write("cm3: $(Objects)\n\t$(Link) -o cm3 *.o\n") Make.write(Link + " -o cm3 *.o\n") MakeVerbose.write("echo " + Link + " -o cm3 *.o\n") MakeVerbose.write(Link + " -o cm3 *.o\n") Make.close() Makefile.close() MakeVerbose.close() os.chdir("/") _MakeArchive(BootDir[1:]) | 5ede0f80a9877b27e6fe73475bd5c595c157b542 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9328/5ede0f80a9877b27e6fe73475bd5c595c157b542/pylib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26254,
13332,
225,
2552,
3998,
2042,
3998,
2042,
1011,
315,
300,
7137,
300,
10102,
6,
225,
4049,
273,
315,
21,
6,
225,
16143,
273,
7566,
75,
952,
300,
75,
334,
5113,
15,
315,
397,
1079... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26254,
13332,
225,
2552,
3998,
2042,
3998,
2042,
1011,
315,
300,
7137,
300,
10102,
6,
225,
4049,
273,
315,
21,
6,
225,
16143,
273,
7566,
75,
952,
300,
75,
334,
5113,
15,
315,
397,
1079... |
return "%s (%s)" % (_strclass(self.__class__), self.__testFunc.__name__) | return "%s (%s)" % (_strclass(self.__class__), self._testFunc.__name__) | def __str__(self): return "%s (%s)" % (_strclass(self.__class__), self.__testFunc.__name__) | beef07330851eb7c0712f5c97725a39cad43dad9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/beef07330851eb7c0712f5c97725a39cad43dad9/unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
2213,
87,
6142,
87,
2225,
738,
261,
67,
701,
1106,
12,
2890,
16186,
1106,
972,
3631,
365,
16186,
3813,
2622,
16186,
529,
972,
13,
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,
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,
701,
972,
12,
2890,
4672,
327,
2213,
87,
6142,
87,
2225,
738,
261,
67,
701,
1106,
12,
2890,
16186,
1106,
972,
3631,
365,
16186,
3813,
2622,
16186,
529,
972,
13,
2,
-100,
-100,
-1... |
def debugancestor(ui, *opts): | def debugancestor(ui, *args): | def debugancestor(ui, *opts): """find the ancestor revision of two revisions in a given index""" if len(opts) == 3: index, rev1, rev2 = opts r = revlog.revlog(util.opener(os.getcwd(), audit=False), index) elif len(opts) == 2: rev1, rev2 = opts repo = hg.repository(ui) r = repo.changelog else: raise util.Abort(_('either two or three arguments required')) a = r.ancestor(r.lookup(rev1), r.lookup(rev2)) ui.write("%d:%s\n" % (r.rev(a), hex(a))) | c096d95db96b76ee25bc0c42bad2e7507eab9200 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/c096d95db96b76ee25bc0c42bad2e7507eab9200/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
28798,
12,
4881,
16,
380,
1968,
4672,
3536,
4720,
326,
9731,
6350,
434,
2795,
18325,
316,
279,
864,
770,
8395,
309,
562,
12,
4952,
13,
422,
890,
30,
770,
16,
5588,
21,
16,
5588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
28798,
12,
4881,
16,
380,
1968,
4672,
3536,
4720,
326,
9731,
6350,
434,
2795,
18325,
316,
279,
864,
770,
8395,
309,
562,
12,
4952,
13,
422,
890,
30,
770,
16,
5588,
21,
16,
5588,
... |
HEADER_PATH=path)) | HEADER_PATH=path, NEW_HEADER_PATH=path_to_new)) | def main(outdir, compiler, template_file, header_list_file): if not os.path.isdir(outdir): os.mkdir(outdir) template = open(template_file, 'r').read() for header in open(header_list_file, 'r'): header = header.rstrip() if 0 == len(header) or is_comment(header): continue path = header_path(header, compiler) try: f = open(os.path.join(outdir, header), 'w') f.write(string.Template(template).substitute(HEADER=header, HEADER_PATH=path)) finally: f.close() | c5d15d701b680cc73f7db8a8fa42f51cacdf8871 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11102/c5d15d701b680cc73f7db8a8fa42f51cacdf8871/make-stl-wrappers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
659,
1214,
16,
5274,
16,
1542,
67,
768,
16,
1446,
67,
1098,
67,
768,
4672,
309,
486,
1140,
18,
803,
18,
291,
1214,
12,
659,
1214,
4672,
1140,
18,
26686,
12,
659,
1214,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
659,
1214,
16,
5274,
16,
1542,
67,
768,
16,
1446,
67,
1098,
67,
768,
4672,
309,
486,
1140,
18,
803,
18,
291,
1214,
12,
659,
1214,
4672,
1140,
18,
26686,
12,
659,
1214,
13,
... |
if xdpyinfo.count('FGLRX'): for location in fglrx_locations: if os.path.exists(location): print '* fglrx found, exporting: LD_PRELOAD=' + location os.environ['LD_PRELOAD'] = location break | if 'client glx vendor string: ATI' in glxinfo and is_xgl(): for location in [l for l in mesa_libgl_locations if os.path.exists(l)]: print '* fglrx found, exporting: LD_PRELOAD=%s' %(location) os.environ['LD_PRELOAD'] = location break | def env_fglrx(): 'Determines if we are using fglrx' if xdpyinfo.count('FGLRX'): for location in fglrx_locations: if os.path.exists(location): print '* fglrx found, exporting: LD_PRELOAD=' + location os.environ['LD_PRELOAD'] = location break | 464212ccf5920e62ad08486fb833d3cd7644d530 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/909/464212ccf5920e62ad08486fb833d3cd7644d530/libfusionicon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1550,
67,
2137,
10826,
92,
13332,
296,
10114,
309,
732,
854,
1450,
284,
7043,
20122,
11,
225,
309,
296,
2625,
5118,
92,
8556,
533,
30,
14464,
45,
11,
316,
5118,
92,
1376,
471,
353,
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,
1550,
67,
2137,
10826,
92,
13332,
296,
10114,
309,
732,
854,
1450,
284,
7043,
20122,
11,
225,
309,
296,
2625,
5118,
92,
8556,
533,
30,
14464,
45,
11,
316,
5118,
92,
1376,
471,
353,
67,... |
if pb: | if pb: | def run_tests(tests, test_dir, lib_dir): pb = None if not OPTIONS.hide_progress and not OPTIONS.show_cmd: try: from progressbar import ProgressBar pb = ProgressBar('', len(tests), 13) except ImportError: pass failures = [] complete = False doing = 'before starting' try: for i, test in enumerate(tests): doing = 'on %s'%test.path ok, out, err = run_test(test, lib_dir) doing = 'after %s'%test.path if not ok: failures.append(test.path) if OPTIONS.tinderbox: if ok: print('TEST-PASS | trace-test.py | %s'%test.path) else: lines = [ _ for _ in out.split('\n') + err.split('\n') if _ != '' ] if len(lines) >= 1: msg = lines[-1] else: msg = '' print('TEST-UNEXPECTED-FAIL | trace-test.py | %s: %s'% (test.path, msg)) n = i + 1 if pb: pb.label = '[%3d|%3d|%3d]'%(n - len(failures), len(failures), n) pb.update(n) complete = True except KeyboardInterrupt: pass if pb: pb.finish() if failures: if OPTIONS.write_failures: try: out = open(OPTIONS.write_failures, 'w') for test in failures: out.write(os.path.relpath(test, test_dir) + '\n') out.close() except IOError: sys.stderr.write("Exception thrown trying to write failure file '%s'\n"% OPTIONS.write_failures) traceback.print_exc() sys.stderr.write('---\n') print('FAILURES:') for test in failures: if OPTIONS.show_failed: print(' ' + subprocess.list2cmdline(get_test_cmd(test, lib_dir))) else: print(' ' + test) else: print('PASSED ALL' + ('' if complete else ' (partial run -- interrupted by user %s)'%doing)) | ea23dc85970663d5f24e981c348fb0d236c55290 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/ea23dc85970663d5f24e981c348fb0d236c55290/trace-test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
12,
16341,
16,
1842,
67,
1214,
16,
2561,
67,
1214,
4672,
6386,
273,
599,
309,
486,
16726,
18,
11248,
67,
8298,
471,
486,
16726,
18,
4500,
67,
4172,
30,
775,
30,
628,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
12,
16341,
16,
1842,
67,
1214,
16,
2561,
67,
1214,
4672,
6386,
273,
599,
309,
486,
16726,
18,
11248,
67,
8298,
471,
486,
16726,
18,
4500,
67,
4172,
30,
775,
30,
628,
... |
pop3proxy.stop(pop3proxy.state) | self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) self.event_stopping.set() pop3proxy.stop(pop3proxy.state) | def SvcStop(self): pop3proxy.stop(pop3proxy.state) | 7786de3380fd6a988af1b2de02c4d3ce6c8f783d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/7786de3380fd6a988af1b2de02c4d3ce6c8f783d/pop3proxy_service.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
348,
4227,
4947,
12,
2890,
4672,
1843,
23,
5656,
18,
5681,
12,
5120,
23,
5656,
18,
2019,
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,
... | [
1,
1,
1,
1,
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,
348,
4227,
4947,
12,
2890,
4672,
1843,
23,
5656,
18,
5681,
12,
5120,
23,
5656,
18,
2019,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
class MsrpSession(SipSession): __swig_setmethods__ = {} for _s in [SipSession]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) | class MsrpSession(InviteSession): __swig_setmethods__ = {} for _s in [InviteSession]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) | def reject(self, *args): return _tinyWRAP.CallSession_reject(self, *args) | 5a446dc5431ef2708d3b137a144d856c9994dd9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5606/5a446dc5431ef2708d3b137a144d856c9994dd9d/tinyWRAP.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4925,
12,
2890,
16,
380,
1968,
4672,
327,
389,
88,
11652,
27664,
18,
1477,
2157,
67,
24163,
12,
2890,
16,
380,
1968,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4925,
12,
2890,
16,
380,
1968,
4672,
327,
389,
88,
11652,
27664,
18,
1477,
2157,
67,
24163,
12,
2890,
16,
380,
1968,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
res = self._findFiles(lfns,['FileID','UID'],connection=connection) | res = self._findFiles( lfns, ['FileID', 'UID'], connection = connection ) | def setFileOwner(self,lfns,connection=False): connection = self._getConnection(connection) """ Get set the group for the supplied files """ res = self._findFiles(lfns,['FileID','UID'],connection=connection) if not res['OK']: return res failed = res['Value']['Failed'] successful = {} for lfn in res['Value']['Successful'].keys(): owner = lfns[lfn]['Owner'] if type(owner) in StringTypes: userRes = self.db.ugManager.findUser(owner) if not userRes['OK']: return userRes owner = userRes['Value'] currentOwner = res['Value']['Successful'][lfn]['UID'] if int(owner) == int(currentOwner): successful[lfn] = True else: fileID = res['Value']['Successful'][lfn]['FileID'] res = self._setFileOwner(fileID,owner,connection=connection) if not res['OK']: failed[lfn] = res['Message'] else: successful[lfn] = True return S_OK({'Successful':successful,'Failed':failed}) | 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,
19658,
5541,
12,
2890,
16,
20850,
2387,
16,
4071,
33,
8381,
4672,
1459,
273,
365,
6315,
588,
1952,
12,
4071,
13,
3536,
968,
444,
326,
1041,
364,
326,
4580,
1390,
3536,
400,
273,
365,
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,
19658,
5541,
12,
2890,
16,
20850,
2387,
16,
4071,
33,
8381,
4672,
1459,
273,
365,
6315,
588,
1952,
12,
4071,
13,
3536,
968,
444,
326,
1041,
364,
326,
4580,
1390,
3536,
400,
273,
365,
6... |
def wm_state(self): """Return the state of this widget as one of normal, icon, iconic (see wm_iconwindow) and withdrawn.""" return self.tk.call('wm', 'state', self._w) | def wm_state(self, newstate=None): """Query or set the state of this widget as one of normal, icon, iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).""" return self.tk.call('wm', 'state', self._w, newstate) | def wm_state(self): """Return the state of this widget as one of normal, icon, iconic (see wm_iconwindow) and withdrawn.""" return self.tk.call('wm', 'state', self._w) | 8376751181bc4904c25af81c6e0705bced652b34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/8376751181bc4904c25af81c6e0705bced652b34/Tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18200,
67,
2019,
12,
2890,
4672,
3536,
990,
326,
919,
434,
333,
3604,
487,
1245,
434,
2212,
16,
4126,
16,
4126,
335,
261,
5946,
18200,
67,
3950,
5668,
13,
471,
598,
9446,
82,
12123,
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18200,
67,
2019,
12,
2890,
4672,
3536,
990,
326,
919,
434,
333,
3604,
487,
1245,
434,
2212,
16,
4126,
16,
4126,
335,
261,
5946,
18200,
67,
3950,
5668,
13,
471,
598,
9446,
82,
12123,
32... |
redirURL = urljoin(redirURL,info['location']) | if info.has_key('location'): redirURL = urljoin(redirURL,info['location']) | def grabURL(url, type="GET",start = 0, etag=None,modified=None): maxDepth = 10 maxAuthAttempts = 5 redirURL = url myHeaders = {"User-Agent":"DTV/pre-release (http://participatoryculture.org/)"} (scheme, host, path, params, query, fragment) = urlparse(url) #print "grab URL called for "+host auth = findHTTPAuth(host,path) if not auth is None: #print " adding auth header" myHeaders["Authorization"] = auth.getAuthScheme()+' '+auth.getAuthToken() if len(params): path += ';'+params if len(query): path += '?'+query if start > 0: myHeaders["Range"] = "bytes="+str(start)+"-" if not etag is None: myHeaders["If-None-Match"] = etag if not modified is None: myHeaders["If-Modified-Since"] = modified download = connectionPool.getRequest(scheme,host,type,path, headers = myHeaders) if download is None: return None #print "Got it!" depth = 0 authAttempts = 0 while ((download.status != 304) and ((start == 0 and download.status != 200) or (start > 0 and download.status != 206)) and (depth < maxDepth and authAttempts < maxAuthAttempts)): if download.status == 302 or download.status == 307 or download.status == 301: #print " redirect" depth += 1 info = download.msg download.close() redirURL = urljoin(redirURL,info['location']) if download.status == 301: url = redirURL (scheme, host, path, params, query, fragment) = urlparse(redirURL) try: del myHeaders["Authorization"] except KeyError: pass auth = findHTTPAuth(host,path) if not auth is None: #print " adding auth header" myHeaders["Authorization"] = auth.getAuthScheme()+' '+auth.getAuthToken() if len(params): path += ';'+params if len(query): path += '?'+query #print "getURLInfo Redirected to "+host download = connectionPool.getRequest(scheme,host,type,path, headers=myHeaders) if download is None: return None elif download.status == 401: if download.msg.has_key('WWW-Authenticate'): authAttempts += 1 info = download.msg download.close() regExp = re.compile("^(.*?)\s+realm\s*=\s*\"(.*?)\"$").search(info['WWW-Authenticate']) authScheme = regExp.expand("\\1") realm = regExp.expand("\\2") #print "Trying to authenticate "+host+" realm:"+realm result = delegate.getHTTPAuth(host,realm) if not result is None: auth = HTTPAuthPassword(result[0],result[1],host, realm, path, authScheme) myHeaders["Authorization"] = auth.getAuthScheme()+' '+auth.getAuthToken() download = connectionPool.getRequest(scheme,host,type,path, headers=myHeaders) else: return None #The user hit Cancel #This is where we would do our magic to prompt for a password #If we get a good password, we save it else: break else: #Some state we don't handle break # Valid or cached pages if not download.status in [200,206,304]: return None #print "processing request" info = download.msg myInfo = {} for key in info.keys(): myInfo[key] = info[key] info = myInfo if type == 'GET': info['file-handle'] = download else: download.close() #print "closed request" try: disposition = info['content-disposition'] info['filename'] = re.compile("^.*filename\s*=\s*\"(.*?)\"$").search(disposition).expand("\\1") info['filename'].replace ("/","") info['filename'].replace ("\\","") except KeyError: try: info['filename'] = re.compile("^.*?([^/]+)/?$").search(path).expand("\\1") except AttributeError: info['filename'] = 'unknown' info['redirected-url'] = redirURL info['updated-url'] = url info['status'] = download.status try: info['charset'] = re.compile("^.*charset\s*=\s*(\S+)/?$").search(info['content-type']).expand("\\1") except (AttributeError, KeyError): pass return info | 19216ba63b19e8aa890ebb3e3fd934ac8afa4bf3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12354/19216ba63b19e8aa890ebb3e3fd934ac8afa4bf3/downloader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11086,
1785,
12,
718,
16,
618,
1546,
3264,
3113,
1937,
273,
374,
16,
13655,
33,
7036,
16,
7342,
33,
7036,
4672,
22074,
273,
1728,
943,
1730,
10113,
273,
1381,
283,
1214,
1785,
273,
880,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11086,
1785,
12,
718,
16,
618,
1546,
3264,
3113,
1937,
273,
374,
16,
13655,
33,
7036,
16,
7342,
33,
7036,
4672,
22074,
273,
1728,
943,
1730,
10113,
273,
1381,
283,
1214,
1785,
273,
880,
... |
if utils.matchAnyRegexp(name[1], ['season (?P<season>[0-9]+)']): | if utils.matchAnyRegexp(name[1], [ 'season (?P<season>[0-9]+)', 'saison (?P<season>[0-9]+)' ]): | def start(self, query): self.checkValid(query) | ecf9b6b3b69d84824aeb9b9f19d0c0f4e7f2b36b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11141/ecf9b6b3b69d84824aeb9b9f19d0c0f4e7f2b36b/episodefilename.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
16,
843,
4672,
365,
18,
1893,
1556,
12,
2271,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
16,
843,
4672,
365,
18,
1893,
1556,
12,
2271,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if self.name()[0] == ' | if self._isAutoblock: | def block(self, expiry = None, reason = None, anon= True, noCreate = False, onAutoblock = False, banMail = False, watchUser = False, allowUsertalk = True, reBlock = False): """ Block the user by API. | 0553617ec4a3c10f8ce44d225a0ca714f640d691 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/0553617ec4a3c10f8ce44d225a0ca714f640d691/userlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1203,
12,
2890,
16,
10839,
273,
599,
16,
3971,
273,
599,
16,
30637,
33,
1053,
16,
1158,
1684,
273,
1083,
16,
603,
7150,
947,
739,
273,
1083,
16,
25732,
6759,
273,
1083,
16,
4267,
1299,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1203,
12,
2890,
16,
10839,
273,
599,
16,
3971,
273,
599,
16,
30637,
33,
1053,
16,
1158,
1684,
273,
1083,
16,
603,
7150,
947,
739,
273,
1083,
16,
25732,
6759,
273,
1083,
16,
4267,
1299,... |
return self.app_zsnes(c) | return self.either(c, 'zsnes') | def app_default(self, c): """How to determine the default application?""" f = c.file | d012468d69a53fe582b3a45f18a6aedb304defb3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5729/d012468d69a53fe582b3a45f18a6aedb304defb3/apps.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
595,
67,
1886,
12,
2890,
16,
276,
4672,
3536,
44,
543,
358,
4199,
326,
805,
2521,
35,
8395,
284,
273,
276,
18,
768,
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,
595,
67,
1886,
12,
2890,
16,
276,
4672,
3536,
44,
543,
358,
4199,
326,
805,
2521,
35,
8395,
284,
273,
276,
18,
768,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
(None, " "), | (None, " "), | def interaction(self, exc_tuple): self.current_exc_tuple = exc_tuple | e032f4d4e7d00a05fe0f27b0ce4695345bb987e0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12738/e032f4d4e7d00a05fe0f27b0ce4695345bb987e0/debugger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13581,
12,
2890,
16,
3533,
67,
8052,
4672,
365,
18,
2972,
67,
10075,
67,
8052,
273,
3533,
67,
8052,
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,
13581,
12,
2890,
16,
3533,
67,
8052,
4672,
365,
18,
2972,
67,
10075,
67,
8052,
273,
3533,
67,
8052,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
profilers = self.job.profilers if not profilers.only(): for i in range(iterations): utils.system(self.srcdir + '/src/stress ' + args) if profilers.present(): profilers.start(self) utils.system(self.srcdir + '/src/stress ' + args) profilers.stop(self) profilers.report(self) | utils.system(self.srcdir + '/src/stress ' + args) | def execute(self, iterations = 1, args = ''): if not args: threads = 2*autotest_utils.count_cpus() args = '-c %d -i %d -m %d -d %d -t 60 -v' % \ (threads, threads, threads, threads) | 495bd26593d9d190de5e82631dc22eb40ca85f4a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/495bd26593d9d190de5e82631dc22eb40ca85f4a/stress.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
11316,
273,
404,
16,
833,
273,
875,
4672,
309,
486,
833,
30,
7403,
273,
576,
14,
5854,
352,
395,
67,
5471,
18,
1883,
67,
20696,
1435,
833,
273,
2400,
71,
738,
72,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2890,
16,
11316,
273,
404,
16,
833,
273,
875,
4672,
309,
486,
833,
30,
7403,
273,
576,
14,
5854,
352,
395,
67,
5471,
18,
1883,
67,
20696,
1435,
833,
273,
2400,
71,
738,
72,... |
if self.path.has_key(dirname) and self.path[dirname].has_key(filename): return len(self.path[dirname][filename]) > 0 | if self.path.has_key(dirname) and self.path[dirname].has_key(basename): return len(self.path[dirname][basename]) > 0 | def isDuplicate(self, filename): (dirname, basename) = os.path.split(filename) if len(dirname) > 0 and dirname[-1] != "/": dirname += "/" | e0106769fd056a3d2a869a4070f727b30e66fa80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/e0106769fd056a3d2a869a4070f727b30e66fa80/lists.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
11826,
12,
2890,
16,
1544,
4672,
261,
12287,
16,
4882,
13,
273,
1140,
18,
803,
18,
4939,
12,
3459,
13,
309,
562,
12,
12287,
13,
405,
374,
471,
4283,
18919,
21,
65,
480,
4016,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
11826,
12,
2890,
16,
1544,
4672,
261,
12287,
16,
4882,
13,
273,
1140,
18,
803,
18,
4939,
12,
3459,
13,
309,
562,
12,
12287,
13,
405,
374,
471,
4283,
18919,
21,
65,
480,
4016,
30... |
section = regex.match("^Fix", text_lines[0]) < 0 sorter.append(group_order, section, date, group, text_lines, author, file, revision, tags) | section = re.match("^Fix", text_lines[0]) < 0 sorter.append((group_order, section, date, group, text_lines, author, file, revision, tags)) | def main(): import sys, getopt, time, string, regex, regsub try: opts, args = getopt.getopt(sys.argv[1:], "C:d:Hi:l:Mptr:v:", ["CVS_command", "date", "indent", "length", "Merge", "patches", #### not yet supported "text", "rlog_options", #### not yet supported "version" ]) except getopt.error, msg: sys.stdout = sys.stderr print msg print "Usage: cvs2hist ...options..." print "Options: [-C CVS_command] [-d rcs_date] [-i indent] [-l length]" print " [-M] [-p] [-t] [-r rlog_options] [-v version]" sys.exit(2) # Set up defaults for all of the command line options. cvs_repository = GetCVSRepository() if not cvs_repository: print "cvs2hist must be executed in a working CVS directory" sys.exit(2) cvs_command = "cvs" date_option = "" indent = 0 length = 76 merge = 0 patches = 0 rlog_options = "" text_option = 0; version = "CVS" # override defaults if specified on the command line for o, a in opts: if o == '-C' : cvs_command = a elif o == '-d' : date_option = "'-d>" + a + "'" elif o == '-i' : indent = string.atoi(a) elif o == '-l' : length = string.atoi(a) elif o == '-M' : merge = 1 elif o == '-p' : patches = 1 elif o == '-t' : text_option = 1 elif o == '-r' : rlog_options = a elif o == '-v' : version = a else: print "getopt should have failed already" # return only messages on the default branch, unless told otherwise if rlog_options == "": rlog_options = '-b' # set up the cvs log command arguments. log_date_command = cvs_command + ' -d ' + cvs_repository +' -Q log ' + date_option + ' ' + rlog_options # Acquire the log data. log = BuildLog(log_date_command) # By default, if no date option is specified, produce output for # changes since the most recent tagged version. To avoid a second # pass over the CVS repository, we do the filtering locally. min_date = '0000/00/00 00:00:00' if date_option == "": for date, author, text_lines, file, revision, tags in log: if len(tags) != 0 and date > min_date: min_date = date # Scan the makefiles to find source file names. sources = {} sources = ScanMakefileForSources('src/lib.mak', sources, "Library") for key in sources.keys(): if key[:5] == 'src/s': sources[key] = "Streams" sources = ScanMakefileForSources('src/devs.mak', sources, "Drivers") for key in sources.keys(): if key[:10] == 'src/gdevpd': sources[key] = "PDF writer" sources = ScanMakefileForSources('src/int.mak', sources, "Interpreter") sources = ScanMakefileForSources('src/contrib.mak', sources, "Drivers") # Sort the log by group, then by fix/non-fix, then by date, then by # description (to group logically connected files together). sorter = [] group_pattern = regex.compile("^(\([^)]+\))[ ]+") for date, author, text_lines, file, revision, tags in log: if date <= min_date: continue line = '' while len(text_lines) > 0: line = string.strip(text_lines[0]) if line != '': break text_lines[:1] = [] if merge: group = "(all)" elif group_pattern.match(text_lines[0]) > 0: group = group_pattern.group(1) text_lines[0] = text_lines[0][len(group_pattern.group(0)):] else: group = SourceFileGroup(file, sources) try: group_order = GroupOrder[group] except KeyError: group_order = 99 if line[:4] == "Fix:": text_lines[0] = line[4:] + '\n' section = 0 else: section = regex.match("^Fix", text_lines[0]) < 0 sorter.append(group_order, section, date, group, text_lines, author, file, revision, tags) sorter.sort() log = sorter # Print the HTML header. time_now = time.localtime(time.time()) version_date = time.strftime('%Y-%m-%d', time_now) version_time = time.strftime('%Y-%m-%d %H:%M:%S', time_now) if text_option == 0: print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" print "<html><head>" print "<title>Ghostscript " + version + " change history as of " + version_time + "</title>" print "<link rel=stylesheet type=\"text/css\" href=\"gs.css\">" print "</head><body>\n" print '<!-- cvs command: ' + log_date_command + ' -->\n' last_group = None groups = [] for omit_group_order, section, date, group, description, author, rcs_file, revision, tags in log: if group != last_group: groups.append(group) last_group = group print VersionTOC(version, version_date, groups) else: print "Ghostscript change history as of " + version_time # Pass through the logs creating new entries based on changing # authors, groups, dates and descriptions. last_group = None last_section = None last_description = None last_author = None last_date = None rev_files = [] for omit_group_order, section, date, group, description, author, rcs_file, revision, tags in log: if group != last_group: if rev_files != []: print ChangeLogEntry(cvs_command, last_author, last_date, rev_files, last_description, prefix, indent, length, patches, text_option)[:-1] rev_files = [] if text_option == 0: print ChangeLogGroupHeader(group, last_group, version) else: print '\n****** ' + group + ' ******' last_group = group last_section = None last_description = None if section != last_section: if rev_files != []: print ChangeLogEntry(cvs_command, last_author, last_date, rev_files, last_description, prefix, indent, length, patches, text_option)[:-1] rev_files = [] (header, prefix) = ChangeLogSectionHeader(section, last_section, version) if header != None: print header last_section = section last_description = None if author != last_author or description != last_description or abs(RCSDateToSeconds(date) - RCSDateToSeconds(last_date)) >= 3: if rev_files != []: print ChangeLogEntry(cvs_command, last_author, last_date, rev_files, last_description, prefix, indent, length, patches, text_option)[:-1] rev_files = [] last_author = author last_date = date last_description = description # Accumulate the revisions and RCS files. rev_files.append(revision, rcs_file) # print the last entry if there is one (i.e. the last two entries # have the same author and date) if rev_files != []: print ChangeLogEntry(cvs_command, last_author, last_date, rev_files, last_description, prefix, indent, length, patches, text_option)[:-1] # Print the HTML trailer. if text_option == 0: print "\n</pre></body></html>" | 92f58f6b8b028bc901c1c5f2bd420c92e105f2c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1296/92f58f6b8b028bc901c1c5f2bd420c92e105f2c9/cvs2hist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1930,
2589,
16,
336,
3838,
16,
813,
16,
533,
16,
3936,
16,
17518,
373,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
315,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1930,
2589,
16,
336,
3838,
16,
813,
16,
533,
16,
3936,
16,
17518,
373,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
315,... |
def save_bytes(self, obj): if self.bin: n = len(obj) if n < 256: self.write(SHORT_BINSTRING + bytes([n]) + bytes(obj)) else: self.write(BINSTRING + pack("<i", n) + bytes(obj)) else: self.write(STRING + bytes(repr(obj).lstrip("b")) + b'\n') self.memoize(obj) dispatch[bytes] = save_bytes | def save_bytes(self, obj): # Like save_string if self.bin: n = len(obj) if n < 256: self.write(SHORT_BINSTRING + bytes([n]) + bytes(obj)) else: self.write(BINSTRING + pack("<i", n) + bytes(obj)) else: # Strip leading 'b' self.write(STRING + bytes(repr(obj).lstrip("b")) + b'\n') self.memoize(obj) | 32c5b86893d8cb9f5c422a7a2945f4f24f131503 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/32c5b86893d8cb9f5c422a7a2945f4f24f131503/pickle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
3890,
12,
2890,
16,
1081,
4672,
468,
23078,
1923,
67,
1080,
309,
365,
18,
4757,
30,
290,
273,
562,
12,
2603,
13,
309,
290,
411,
8303,
30,
365,
18,
2626,
12,
15993,
67,
1261... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
3890,
12,
2890,
16,
1081,
4672,
468,
23078,
1923,
67,
1080,
309,
365,
18,
4757,
30,
290,
273,
562,
12,
2603,
13,
309,
290,
411,
8303,
30,
365,
18,
2626,
12,
15993,
67,
1261... | |
milestone = Milestone(self.__env, name) | milestone = Milestone(self.env_open(), name) | def _do_milestone_rename(self, name, newname): milestone = Milestone(self.__env, name) milestone.name = newname milestone.update() | 132f03448459e7c8907500129479bb5f6c5bc47a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/132f03448459e7c8907500129479bb5f6c5bc47a/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
81,
18270,
67,
18539,
12,
2890,
16,
508,
16,
26722,
4672,
28664,
273,
490,
18270,
12,
2890,
18,
3074,
67,
3190,
9334,
508,
13,
28664,
18,
529,
273,
26722,
28664,
18,
272... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
81,
18270,
67,
18539,
12,
2890,
16,
508,
16,
26722,
4672,
28664,
273,
490,
18270,
12,
2890,
18,
3074,
67,
3190,
9334,
508,
13,
28664,
18,
529,
273,
26722,
28664,
18,
272... |
__slots__ = ["options", "dynamic_parameters"] | __slots__ = ["options", "dynamic_parameters", "n_calls"] | def write_only_if_safe(file_name, text): from libtbx.str_utils import show_string import os op = os.path if (op.exists(file_name)): if (not op.isfile(file_name)): raise RuntimeError( "Not a regular file: %s" % show_string(file_name)) stat = check_fingerprint(file_name=file_name) if (stat is None or not stat): raise RuntimeError( "File appears to be manually modified: %s" % show_string(file_name)) hexdigest = compute_hexdigest(text=text) f = open(file_name, "w") f.write("// fingerprint %s\n" % hexdigest) f.write(text) | a6eff680069c8f5a397712608c86c3acc22ab979 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/a6eff680069c8f5a397712608c86c3acc22ab979/cout.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
3700,
67,
430,
67,
4626,
12,
768,
67,
529,
16,
977,
4672,
628,
2561,
18587,
92,
18,
701,
67,
5471,
1930,
2405,
67,
1080,
1930,
1140,
1061,
273,
1140,
18,
803,
309,
261,
556... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
3700,
67,
430,
67,
4626,
12,
768,
67,
529,
16,
977,
4672,
628,
2561,
18587,
92,
18,
701,
67,
5471,
1930,
2405,
67,
1080,
1930,
1140,
1061,
273,
1140,
18,
803,
309,
261,
556... |
def create_nearest_terms_box(urlargs, p, f, n=5, prologue="<blockquote>", epilogue="</blockquote>"): | def create_nearest_terms_box(urlargs, p, f, t='w', n=5, prologue="<blockquote>", epilogue="</blockquote>"): | def create_nearest_terms_box(urlargs, p, f, n=5, prologue="<blockquote>", epilogue="</blockquote>"): """Return text box containing list of 'n' nearest terms above/below 'p' in the words index list for the field 'f'. Propose new searches according to `urlargs' with the new words. """ out = "" # deduce into which bibwordsX table we will search: bibwordsX = "bibwords%d" % get_wordsindex_id("anyfield") if f: wordsindex_id = get_wordsindex_id(f) if wordsindex_id: bibwordsX = "bibwords%d" % wordsindex_id else: return "%sNo words index available for %s.%s" % (prologue, f, epilogue) nearest_words = [] # will hold the (sorted) list of nearest words # try to get `n' words above `p': query = "SELECT word FROM %s WHERE word<'%s' ORDER BY word DESC LIMIT %d" % (bibwordsX, escape_string(p), n) res = run_sql(query) if res: for row in res: nearest_words.append(row[0]) nearest_words.reverse() # insert given word `p': nearest_words.append(p) # try to get `n' words below `p': query = "SELECT word FROM %s WHERE word>'%s' ORDER BY word ASC LIMIT %d" % (bibwordsX, escape_string(p), n) res = run_sql(query) if res: for row in res: nearest_words.append(row[0]) # output the words: if nearest_words: out += """<table class="nearesttermsbox" cellpadding="0" cellspacing="0" border="0">""" for word in nearest_words: if word == p: # print search word for orientation: if get_word_nbhits(word, f) > 0: out += """<tr> <td class="nearesttermsboxbodyselected" align="right">%d</td> <td class="nearesttermsboxbodyselected" width="15"> </td> <td class="nearesttermsboxbodyselected" align="left"> <a class="nearesttermsselected" href="%s/search.py?%s">%s</a> </td> </tr>""" % \ (get_word_nbhits(word, f), weburl, urlargs_replace_text_in_arg(urlargs, 'p', p, word), word) else: out += """<tr> <td class="nearesttermsboxbodyselected" align="right">-</td> <td class="nearesttermsboxbodyselected" width="15"> </td> <td class="nearesttermsboxbodyselected" align="left">%s</td> </tr>""" % word else: out += """<tr> <td class="nearesttermsboxbody" align="right">%s</td> <td class="nearesttermsboxbody" width="15"> </td> <td class="nearesttermsboxbody" align="left"> <a class="nearestterms" href="%s/search.py?%s">%s</a> </td> </tr>""" % \ (get_word_nbhits(word, f), weburl, urlargs_replace_text_in_arg(urlargs, 'p', p, word), word) out += "</table>" else: out += "No words index available for this query." # return the text return "%s%s%s" % (prologue, out, epilogue) | 535ed6a8d836745c0ddd7f1016fbe145d7c7bebd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/535ed6a8d836745c0ddd7f1016fbe145d7c7bebd/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
25785,
67,
10112,
67,
2147,
12,
718,
1968,
16,
293,
16,
284,
16,
268,
2218,
91,
2187,
290,
33,
25,
16,
450,
1330,
344,
1546,
32,
2629,
6889,
2984,
16,
5529,
21947,
344,
1546... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
25785,
67,
10112,
67,
2147,
12,
718,
1968,
16,
293,
16,
284,
16,
268,
2218,
91,
2187,
290,
33,
25,
16,
450,
1330,
344,
1546,
32,
2629,
6889,
2984,
16,
5529,
21947,
344,
1546... |
print "Could not open serial port %s: %s" % (ser.portstr, e) | sys.stderr.write("Could not open serial port %s: %s\n" % (ser.portstr, e)) | def stop(self): """Stop copying""" if self.alive: self.alive = False self.thread_read.join() | eb345d44f6beabbef6486a85e9864003536e9fc3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10955/eb345d44f6beabbef6486a85e9864003536e9fc3/tcp_serial_redirect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2132,
12,
2890,
4672,
3536,
4947,
8933,
8395,
309,
365,
18,
11462,
30,
365,
18,
11462,
273,
1083,
365,
18,
5930,
67,
896,
18,
5701,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2132,
12,
2890,
4672,
3536,
4947,
8933,
8395,
309,
365,
18,
11462,
30,
365,
18,
11462,
273,
1083,
365,
18,
5930,
67,
896,
18,
5701,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
print "__oct__:", args | def __oct__(self, *args): print "__oct__:", args return '01' | 6addbd51e99eed73f715fd88f76faa1499ffcafa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/6addbd51e99eed73f715fd88f76faa1499ffcafa/test_class.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
13410,
972,
12,
2890,
16,
380,
1968,
4672,
327,
296,
1611,
11,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
13410,
972,
12,
2890,
16,
380,
1968,
4672,
327,
296,
1611,
11,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
if not raw_report[0] or \ | if not raw_report[0] and \ | def _process_raw_report(self, raw_report): "Default raw input report data handler" my_debug = False if not self.__evt_handlers or not self.is_opened(): return | 899b5c42fe07befc6ccf3c977b66bc2d76359029 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11669/899b5c42fe07befc6ccf3c977b66bc2d76359029/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
67,
1899,
67,
6006,
12,
2890,
16,
1831,
67,
6006,
4672,
315,
1868,
1831,
810,
2605,
501,
1838,
6,
3399,
67,
4148,
273,
1083,
309,
486,
365,
16186,
73,
11734,
67,
11046,
578,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
67,
1899,
67,
6006,
12,
2890,
16,
1831,
67,
6006,
4672,
315,
1868,
1831,
810,
2605,
501,
1838,
6,
3399,
67,
4148,
273,
1083,
309,
486,
365,
16186,
73,
11734,
67,
11046,
578,... |
def send_UTM(self): for key in ('PN', 'SL', 'Pings', 'PIDS'): val = getattr(self.channel.gamelobby, key) if val: self.sendMessage('UTM', self.channel.name, ':{0}/ {1}'.format(key, val), prefix=self.channel.users.all()[0]) | def send_UTM(self): for key in ('PN', 'SL', 'Pings', 'PIDS'): val = getattr(self.channel.gamelobby, key) if val: self.sendMessage('UTM', self.channel.name, ':{0}/ {1}'.format(key, val), prefix=self.channel.users.all()[0]) ## HACK: assumes first in list is host | e76579e1f18afd0be29eb935bd6469d5f720054c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10390/e76579e1f18afd0be29eb935bd6469d5f720054c/peerchat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
1693,
49,
12,
2890,
4672,
364,
498,
316,
7707,
15124,
2187,
296,
4559,
2187,
296,
52,
899,
2187,
296,
16522,
55,
11,
4672,
1244,
273,
3869,
12,
2890,
18,
4327,
18,
75,
9925,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
1693,
49,
12,
2890,
4672,
364,
498,
316,
7707,
15124,
2187,
296,
4559,
2187,
296,
52,
899,
2187,
296,
16522,
55,
11,
4672,
1244,
273,
3869,
12,
2890,
18,
4327,
18,
75,
9925,
... | |
return "Directory listing for %s" % request.uri | return "Directory listing for %s" % urllib.unquote(request.uri) | def wmfactory_header(self, request): return "Directory listing for %s" % request.uri | 5f486b2f580aea57686744c882b43b0f4585646a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5f486b2f580aea57686744c882b43b0f4585646a/dirlist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18200,
6848,
67,
3374,
12,
2890,
16,
590,
4672,
327,
315,
2853,
11591,
364,
738,
87,
6,
738,
590,
18,
1650,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
18200,
6848,
67,
3374,
12,
2890,
16,
590,
4672,
327,
315,
2853,
11591,
364,
738,
87,
6,
738,
590,
18,
1650,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
tha generator names then it appears first. | the generator names then it appears first. | def put_natural_embedding_first(v): """ Helper function for embeddings() functions for number fields. INPUT: a list of embeddings of a number field OUTPUT: None. The list is altered in-place, so that, if possible, the first embedding has been switched with one of the others, so that if there is an embedding which preserves tha generator names then it appears first. EXAMPLES: sage: K.<a> = CyclotomicField(7) sage: embs = K.embeddings(K) sage: [e(a) for e in embs] # already sorted [a, a^2, a^3, a^4, a^5, -a^5 - a^4 - a^3 - a^2 - a - 1] sage: permuted_embs = [embs[i] for i in [1,2,3,4,5,0]] sage: [e(a) for e in permuted_embs] # natural map is not first [a^2, a^3, a^4, a^5, -a^5 - a^4 - a^3 - a^2 - a - 1, a] sage: from sage.rings.number_field.number_field import put_natural_embedding_first sage: put_natural_embedding_first(permuted_embs) sage: [e(a) for e in permuted_embs] # now natural map is first [a, a^3, a^4, a^5, -a^5 - a^4 - a^3 - a^2 - a - 1, a^2] """ for i in range(len(v)): phi = v[i] a = str(list(phi.domain().gens())) b = str(list(phi.im_gens())) if a == b: v[i] = v[0] v[0] = phi return | 76de006bef69d661823cf2046676bfdba0631cab /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/76de006bef69d661823cf2046676bfdba0631cab/number_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
67,
18757,
3766,
67,
23744,
67,
3645,
12,
90,
4672,
3536,
9705,
445,
364,
4724,
24715,
1435,
4186,
364,
1300,
1466,
18,
225,
12943,
30,
279,
666,
434,
4724,
24715,
434,
279,
1300,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
67,
18757,
3766,
67,
23744,
67,
3645,
12,
90,
4672,
3536,
9705,
445,
364,
4724,
24715,
1435,
4186,
364,
1300,
1466,
18,
225,
12943,
30,
279,
666,
434,
4724,
24715,
434,
279,
1300,
... |
class _sc_matrix(spmatrix): | class _cs_matrix(spmatrix): | def save(self, file_name, format = '%d %d %f\n'): try: fd = open(file_name, 'w') except Exception, e: raise e, file_name | faa3aff2efd30018dbc353dbab92d7337521e7d2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/faa3aff2efd30018dbc353dbab92d7337521e7d2/sparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
585,
67,
529,
16,
740,
273,
1995,
72,
738,
72,
738,
74,
64,
82,
11,
4672,
775,
30,
5194,
273,
1696,
12,
768,
67,
529,
16,
296,
91,
6134,
1335,
1185,
16,
425,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
585,
67,
529,
16,
740,
273,
1995,
72,
738,
72,
738,
74,
64,
82,
11,
4672,
775,
30,
5194,
273,
1696,
12,
768,
67,
529,
16,
296,
91,
6134,
1335,
1185,
16,
425,
... |
appscript.app(terminal_program).activate() | limit = 100 app = appscript.app(terminal_program) while limit > 0: limit -= 1 app.activate() if app.frontmost(): return | def activate_terminal(): terminal_program = os.environ.get("VIMPDBHOOK_TERMINAL_APP", "iTerm") appscript.app(terminal_program).activate() | 6b2e65a461c4aae7a2049f666739afb10f3fbab6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4197/6b2e65a461c4aae7a2049f666739afb10f3fbab6/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10235,
67,
15979,
13332,
8651,
67,
12890,
273,
1140,
18,
28684,
18,
588,
2932,
58,
9883,
2290,
7995,
3141,
67,
29516,
1013,
67,
7215,
3113,
315,
77,
4065,
7923,
1800,
273,
2130,
595,
273... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10235,
67,
15979,
13332,
8651,
67,
12890,
273,
1140,
18,
28684,
18,
588,
2932,
58,
9883,
2290,
7995,
3141,
67,
29516,
1013,
67,
7215,
3113,
315,
77,
4065,
7923,
1800,
273,
2130,
595,
273... |
if len(self._ms.getSchemataNames(True)) == 1: raise RuntimeError(self.translate('atse_can_not_remove_last_schema', | if len(self.atse_getSchemataNames(True)) == 1: raise SchemaEditorError(self.translate('atse_can_not_remove_last_schema', | def atse_delSchemata(self, name, RESPONSE=None): """ delete a schemata """ | 6ba517ab6fceaae7426ea4613c331aa7515f7856 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/6ba517ab6fceaae7426ea4613c331aa7515f7856/SchemaEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
622,
307,
67,
3771,
55,
1036,
396,
12,
2890,
16,
508,
16,
20645,
33,
7036,
4672,
3536,
1430,
279,
30140,
396,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
622,
307,
67,
3771,
55,
1036,
396,
12,
2890,
16,
508,
16,
20645,
33,
7036,
4672,
3536,
1430,
279,
30140,
396,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self._sampwidth = (_read_short(chunk) + 7) / 8 | self._sampwidth = (_read_short(chunk) + 7) // 8 | def _read_comm_chunk(self, chunk): self._nchannels = _read_short(chunk) self._nframes = _read_long(chunk) self._sampwidth = (_read_short(chunk) + 7) / 8 self._framerate = int(_read_float(chunk)) self._framesize = self._nchannels * self._sampwidth if self._aifc: #DEBUG: SGI's soundeditor produces a bad size :-( kludge = 0 if chunk.chunksize == 18: kludge = 1 print 'Warning: bad COMM chunk size' chunk.chunksize = 23 #DEBUG end self._comptype = chunk.read(4) #DEBUG start if kludge: length = ord(chunk.file.read(1)) if length & 1 == 0: length = length + 1 chunk.chunksize = chunk.chunksize + length chunk.file.seek(-1, 1) #DEBUG end self._compname = _read_string(chunk) if self._comptype != 'NONE': if self._comptype == 'G722': try: import audioop except ImportError: pass else: self._convert = self._adpcm2lin self._framesize = self._framesize / 4 return # for ULAW and ALAW try Compression Library try: import cl except ImportError: if self._comptype == 'ULAW': try: import audioop self._convert = self._ulaw2lin self._framesize = self._framesize / 2 return except ImportError: pass raise Error, 'cannot read compressed AIFF-C files' if self._comptype == 'ULAW': scheme = cl.G711_ULAW self._framesize = self._framesize / 2 elif self._comptype == 'ALAW': scheme = cl.G711_ALAW self._framesize = self._framesize / 2 else: raise Error, 'unsupported compression type' self._decomp = cl.OpenDecompressor(scheme) self._convert = self._decomp_data else: self._comptype = 'NONE' self._compname = 'not compressed' | 994538112c1091eacdb5eecc6f7c52b5b004007c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/994538112c1091eacdb5eecc6f7c52b5b004007c/aifc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
67,
5702,
67,
6551,
12,
2890,
16,
2441,
4672,
365,
6315,
82,
9114,
273,
389,
896,
67,
6620,
12,
6551,
13,
365,
6315,
82,
10278,
273,
389,
896,
67,
5748,
12,
6551,
13,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
67,
5702,
67,
6551,
12,
2890,
16,
2441,
4672,
365,
6315,
82,
9114,
273,
389,
896,
67,
6620,
12,
6551,
13,
365,
6315,
82,
10278,
273,
389,
896,
67,
5748,
12,
6551,
13,
365,
... |
self.failUnless( now <= ct <= now + ok_delta, (now, ct)) | self.failUnless( now <= ct <= nowish, (now, ct)) | def testFileTimes(self): if issubclass(pywintypes.TimeType, datetime.datetime): from win32timezone import GetLocalTimeZone now = datetime.datetime.now(tz=GetLocalTimeZone()) ok_delta = datetime.timedelta(seconds=1) later = now + datetime.timedelta(seconds=120) else: tick = int(time.time()) now = pywintypes.Time(tick) ok_delta = 1 later = pywintypes.Time(tick+120) | cc4c24e2f7937be9431972ddb327c9bbbc07b4f5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/992/cc4c24e2f7937be9431972ddb327c9bbbc07b4f5/test_win32file.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
812,
10694,
12,
2890,
4672,
309,
14664,
12,
2074,
91,
474,
989,
18,
950,
559,
16,
3314,
18,
6585,
4672,
628,
5657,
1578,
12690,
1930,
968,
2042,
16760,
2037,
273,
3314,
18,
6585,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
812,
10694,
12,
2890,
4672,
309,
14664,
12,
2074,
91,
474,
989,
18,
950,
559,
16,
3314,
18,
6585,
4672,
628,
5657,
1578,
12690,
1930,
968,
2042,
16760,
2037,
273,
3314,
18,
6585,
... |
filtered_obj = obj_content.obj | filtered_obj_content = obj_content | def find_entity_view(self, view_type, begin_entity=None, filter=None): """Return a new instance based on the search filter. | 643dd387891f2f389168833e172871a1fc3ac75f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11290/643dd387891f2f389168833e172871a1fc3ac75f/vim25.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
1096,
67,
1945,
12,
2890,
16,
1476,
67,
723,
16,
2376,
67,
1096,
33,
7036,
16,
1034,
33,
7036,
4672,
3536,
990,
279,
394,
791,
2511,
603,
326,
1623,
1034,
18,
2,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
1096,
67,
1945,
12,
2890,
16,
1476,
67,
723,
16,
2376,
67,
1096,
33,
7036,
16,
1034,
33,
7036,
4672,
3536,
990,
279,
394,
791,
2511,
603,
326,
1623,
1034,
18,
2,
-100,
-100... |
vers_minor = string.split (self.target_version, '.')[1] inifile.write ("vers_minor=%s\n" % vers_minor) | inifile.write ("target_version=%s\n" % self.target_version) | def create_inifile (self): # Create an inifile containing data describing the installation. # This could be done without creating a real file, but # a file is (at least) useful for debugging bdist_wininst. | 9a4738fdcc09d216f84309e10e81edd081110eab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/9a4738fdcc09d216f84309e10e81edd081110eab/bdist_wininst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
267,
430,
398,
261,
2890,
4672,
468,
1788,
392,
316,
430,
398,
4191,
501,
16868,
326,
13193,
18,
468,
1220,
3377,
506,
2731,
2887,
4979,
279,
2863,
585,
16,
1496,
468,
279,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
267,
430,
398,
261,
2890,
4672,
468,
1788,
392,
316,
430,
398,
4191,
501,
16868,
326,
13193,
18,
468,
1220,
3377,
506,
2731,
2887,
4979,
279,
2863,
585,
16,
1496,
468,
279,
58... |
print "Unmatched open delimiter '%s' on line %d", (symbol, lineno) | print "Unmatched open delimiter '%s' on line %d" % (symbol, lineno) | def checkit(source, opts, morecmds=[]): """Check the LaTex formatting in a sequence of lines. Opts is a mapping of options to option values if any: -m munge parenthesis and brackets -f forward slash warnings to be skipped -d delimiters only checking -v verbose listing on delimiters -s lineno: linenumber to start scan (default is 1). Morecmds is a sequence of LaTex commands (without backslashes) that are to be considered valid in the scan. """ texcmd = re.compile(r'\\[A-Za-z]+') validcmds = sets.Set(cmdstr.split()) for cmd in morecmds: validcmds.add('\\' + cmd) openers = [] # Stack of pending open delimiters if '-m' in opts: pairmap = {']':'[(', ')':'(['} # Munged openers else: pairmap = {']':'[', ')':'('} # Normal opener for a given closer openpunct = sets.Set('([') # Set of valid openers delimiters = re.compile(r'\\(begin|end){([_a-zA-Z]+)}|([()\[\]])') startline = int(opts.get('-s', '1')) lineno = 0 for lineno, line in izip(count(startline), islice(source, startline-1, None)): line = line.rstrip() if '-f' not in opts and '/' in line: # Warn whenever forward slashes encountered line = line.rstrip() print 'Warning, forward slash on line %d: %s' % (lineno, line) if '-d' not in opts: # Validate commands nc = line.find(r'\newcommand') if nc != -1: start = line.find('{', nc) end = line.find('}', start) validcmds.add(line[start+1:end]) for cmd in texcmd.findall(line): if cmd not in validcmds: print r'Warning, unknown tex cmd on line %d: \%s' % (lineno, cmd) # Check balancing of open/close markers (parens, brackets, etc) for begend, name, punct in delimiters.findall(line): if '-v' in opts: print lineno, '|', begend, name, punct, if begend == 'begin' and '-d' not in opts: openers.append((lineno, name)) elif punct in openpunct: openers.append((lineno, punct)) elif begend == 'end' and '-d' not in opts: matchclose(lineno, name, openers, pairmap) elif punct in pairmap: matchclose(lineno, punct, openers, pairmap) if '-v' in opts: print ' --> ', openers for lineno, symbol in openers: print "Unmatched open delimiter '%s' on line %d", (symbol, lineno) print 'Done checking %d lines.' % (lineno,) return 0 | 55b90d0e44a443ac52b870ca5d4405d432ce54ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/55b90d0e44a443ac52b870ca5d4405d432ce54ee/texcheck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
305,
12,
3168,
16,
1500,
16,
1898,
24680,
33,
8526,
4672,
3536,
1564,
326,
21072,
16733,
10407,
316,
279,
3102,
434,
2362,
18,
225,
25769,
353,
279,
2874,
434,
702,
358,
1456,
924,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
305,
12,
3168,
16,
1500,
16,
1898,
24680,
33,
8526,
4672,
3536,
1564,
326,
21072,
16733,
10407,
316,
279,
3102,
434,
2362,
18,
225,
25769,
353,
279,
2874,
434,
702,
358,
1456,
924,
... |
sage: p = SQLQuery(DB, {'table_name':'simon', 'display_cols':'b2', 'dillhole':['b2','=', 0]}) | sage: p = SQLQuery(DB, {'table_name':'simon', 'display_cols':'b2', 'expression':['b2','=', 0]}) | def delete_rows(self, query): """ DOCSTRING COMMENTS: - Query must have no join statements (you can only delete from one table at a time) (This might be an interesting TODO later, ie: another function that creates multiple delete statements from a query with joins... I don't think it's really necessary at this time though. - Use a query instance to modify your database. - Note that you cannot use a GenericSQLQuery. (NO RESPONSIBILITY) - If you would like to remove all data that satisfies a query, enter that query as a parameter in the delete_rows function. - Recommended use: have some kind of primary key column that you use as a parameter in the query - Be careful, test your query first. - (Examples of this) - Also note that this database must be the database that the query is associated with (test that?) ROBERT : I haven't tested this... if if doesn't work, then it is probably the param_tuple thing... send me an email if it's not working | 85d02cb25b26fc015382d67ed0b0b5b5529e5568 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/85d02cb25b26fc015382d67ed0b0b5b5529e5568/database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
3870,
12,
2890,
16,
843,
4672,
3536,
5467,
39,
5804,
19400,
55,
30,
300,
2770,
1297,
1240,
1158,
1233,
6317,
261,
19940,
848,
1338,
1430,
628,
1245,
1014,
622,
279,
813,
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,
1430,
67,
3870,
12,
2890,
16,
843,
4672,
3536,
5467,
39,
5804,
19400,
55,
30,
300,
2770,
1297,
1240,
1158,
1233,
6317,
261,
19940,
848,
1338,
1430,
628,
1245,
1014,
622,
279,
813,
13,
... |
elif isinstance(contours, (int, Integer)): subplot.contourf(self.xy_data_array, int(contours), cmap=cmap, extent=(x0,x1,y0,y1)) | def _render_on_subplot(self, subplot): """ TESTS: | 193e4ecc8643b94b550be6610365db125959929a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/193e4ecc8643b94b550be6610365db125959929a/contour_plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
265,
67,
24523,
12,
2890,
16,
19826,
4672,
3536,
22130,
55,
30,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
265,
67,
24523,
12,
2890,
16,
19826,
4672,
3536,
22130,
55,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
@raises C{ProductDefinitionTroveNotFound}: @raises C{ProductDefinitionFileNotFound}: | @raises C{ProductDefinitionTroveNotFoundError}: @raises C{ProductDefinitionFileNotFoundError}: | def loadFromRepository(self, client): """ Load a C{ProductDefinition} object from a Conary repository. Prior to calling this method, the C{ProductDefinition} object should be initialized by calling C{setProductShortname}, C{setProductVersion}, C{setConaryRepositoryHostname} and C{setConaryNamespace}. @param client: A Conary client object @type client: C{conaryclient.ConaryClient} @raises C{RepositoryError}: @raises C{ProductDefinitionTroveNotFound}: @raises C{ProductDefinitionFileNotFound}: """ label = self.getProductDefinitionLabel() stream, nvf = self._getStreamFromRepository(client, label) stream.seek(0) self.parseStream(stream) | ab0b75d0a64a0aee3d33fdaeaea0d7103596ea1e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7634/ab0b75d0a64a0aee3d33fdaeaea0d7103596ea1e/api1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24935,
3305,
12,
2890,
16,
1004,
4672,
3536,
4444,
279,
385,
95,
4133,
1852,
97,
733,
628,
279,
735,
814,
3352,
18,
30326,
358,
4440,
333,
707,
16,
326,
385,
95,
4133,
1852,
97,
733,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24935,
3305,
12,
2890,
16,
1004,
4672,
3536,
4444,
279,
385,
95,
4133,
1852,
97,
733,
628,
279,
735,
814,
3352,
18,
30326,
358,
4440,
333,
707,
16,
326,
385,
95,
4133,
1852,
97,
733,
... |
"""Pings the index server with sitemap files that are new since last ping""" _INDEXER_MAP = {'google': 'http://www.google.com/webmasters/tools/ping?', 'not-specified': ''} | """Pings the index server with sitemap files that are new since last ping""" _INDEXER_MAP = {'google': 'http://www.google.com/webmasters/tools/ping?', 'not-specified': ''} | def get(self): requested_shard_index = self.request.get('shard_index') sitemap_info = _get_static_sitemap_info() shard_size_seconds = sitemap_info.shard_size_seconds then = sitemap_info.static_sitemaps_generation_time | 64c260bbfba7eb92917fa51399bfcab18972dc86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6014/64c260bbfba7eb92917fa51399bfcab18972dc86/sitemap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
3764,
67,
22630,
67,
1615,
273,
365,
18,
2293,
18,
588,
2668,
22630,
67,
1615,
6134,
14628,
67,
1376,
273,
389,
588,
67,
3845,
67,
21517,
67,
1376,
1435,
5820,
67,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
3764,
67,
22630,
67,
1615,
273,
365,
18,
2293,
18,
588,
2668,
22630,
67,
1615,
6134,
14628,
67,
1376,
273,
389,
588,
67,
3845,
67,
21517,
67,
1376,
1435,
5820,
67,... |
if form.is_valid(): saved_persongroup = form.save() persongroup = PersonGroups.objects.get(pk=saved_persongroup.id) formset = PersonFormSet(request.POST, request.FILES, instance=persongroup) if formset.is_valid(): personformset = formset.save(commit=False) return HttpResponseRedirect('/admin/dashboard/persongroups/') else: return render_to_response('add_person_group.html', {'form':form, 'formset':formset}) else: return render_to_response('add_person_group.html', {'form':form, 'formset':formset}) else: form = PersonGroupsForm() formset = PersonFormSet() return render_to_response('add_person_group.html', {'form':form,'formset':formset}) def add_person_group_1(request): PersonFormSet = modelformset_factory(Person, extra=3, exclude=('equipmentholder','relations','adopted_agricultural_practices',)) if request.method == 'POST': form = PersonGroupsForm(request.POST) formset = PersonFormSet(request.POST, request.FILES) if form.is_valid(): for k,v in request.POST.items(): if k[:5] == 'form-': s = k.split('-') if s[1] != u'TOTAL_FORMS' and s[1] != u'INITIAL_FORMS' and s[2] == 'village': request.POST[k] = request.POST['village'] '''i = s[1] if i not in a and s[1] != u'TOTAL_FORMS' and s[1] != u'INITIAL_FORMS': print s[1] a[i] = {s[2]: v} elif s[1] != u'TOTAL_FORMS' and s[1] != u'INITIAL_FORMS': print s[1] a[i].update({s[2]: v}) for k,v in a.items(): print v print cd['group_name'] p = PersonForm({'group':cd['group_name'] ,'village': v['village'], 'phone_no': v['phone_no'], 'father_name': v['father_name'], 'person_name': v['person_name'], 'address': v['address'], 'gender': v['gender'], 'age': v['age'], 'land_holdings': v['land_holdings'], 'id': v['id']}) if p.is_valid(): p.save() return HttpResponseRedirect('/admin/dashboard/persongroups/') else: print 'false' return render_to_response('add_person_group.html', {'form':form, 'formset':formset})''' formset = PersonFormSet(request.POST, request.FILES) if formset.is_valid(): save_tuple = form.save() for k,v in request.POST.items(): if k[:5] == 'form-': s = k.split('-') if s[1] != u'TOTAL_FORMS' and s[1] != u'INITIAL_FORMS' and s[2] == 'group': request.POST[k] = save_tuple.id formset = PersonFormSet(request.POST, request.FILES) if formset.is_valid(): formset.save() return HttpResponseRedirect('/admin/dashboard/persongroups/') else: return render_to_response('add_person_group.html', {'form':form, 'formset':formset}) else: return render_to_response('add_person_group.html', {'form':form, 'formset':formset}) else: form = PersonGroupsForm() formset = PersonFormSet(queryset=PersonGroups.objects.none()) return render_to_response('add_person_group.html', {'form':form,'formset':formset}) | if formset.is_valid(): formset.save() return HttpResponseRedirect('/admin/dashboard/persongroups/') else: return render_to_response('add_person_group.html', {'form':form, 'formset':formset}) else: return render_to_response('add_person_group.html', {'form':form, 'formset':formset}) else: form = PersonGroupsForm() formset = PersonFormSet(queryset=PersonGroups.objects.none()) return render_to_response('add_person_group.html', {'form':form,'formset':formset}) | def add_person_group(request): PersonFormSet = inlineformset_factory(PersonGroups, Person,extra=3, exclude=('equipmentholder','relations','adopted_agricultural_practices',)) if request.method == 'POST': form = PersonGroupsForm(request.POST) formset = PersonFormSet(request.POST, request.FILES) if form.is_valid(): saved_persongroup = form.save() persongroup = PersonGroups.objects.get(pk=saved_persongroup.id) formset = PersonFormSet(request.POST, request.FILES, instance=persongroup) if formset.is_valid(): personformset = formset.save(commit=False) return HttpResponseRedirect('/admin/dashboard/persongroups/') else: return render_to_response('add_person_group.html', {'form':form, 'formset':formset}) else: return render_to_response('add_person_group.html', {'form':form, 'formset':formset}) else: form = PersonGroupsForm() formset = PersonFormSet() return render_to_response('add_person_group.html', {'form':form,'formset':formset}) | 7759d6eb08a7e6568691e648ed314450c8afa48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11995/7759d6eb08a7e6568691e648ed314450c8afa48e/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
12479,
67,
1655,
12,
2293,
4672,
11573,
1204,
694,
273,
6370,
687,
542,
67,
6848,
12,
8346,
3621,
16,
11573,
16,
7763,
33,
23,
16,
4433,
33,
2668,
14298,
11568,
4505,
17023,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12479,
67,
1655,
12,
2293,
4672,
11573,
1204,
694,
273,
6370,
687,
542,
67,
6848,
12,
8346,
3621,
16,
11573,
16,
7763,
33,
23,
16,
4433,
33,
2668,
14298,
11568,
4505,
17023,
1... |
"r'''": single3prog, 'r"""': double3prog} | "r'''": single3prog, 'r"""': double3prog, "R'''": single3prog, 'R"""': double3prog, 'r': None, 'R': None} | def maybe(*choices): return apply(group, choices) + '?' | d11b888f9fc4baa2e0d763a0360c02bc7403a9ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11b888f9fc4baa2e0d763a0360c02bc7403a9ca/tokenize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6944,
30857,
11937,
4672,
327,
2230,
12,
1655,
16,
7246,
13,
397,
6787,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6944,
30857,
11937,
4672,
327,
2230,
12,
1655,
16,
7246,
13,
397,
6787,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def __init__(self, fd, datasize): | def __init__(self, fd, datasize, filename): | def __init__(self, fd, datasize): self.fd = fd self.length = 0 # length of all decompressed data self.length2 = datasize self.enddata = "" # remember last 8 bytes for crc/length check self.pos = 0 self.data = "" if self.fd.read(3) != "\037\213\010": print "Not a gzipped file" sys.exit(0) # flag (1 byte), modification time (4 bytes), extra flags (1), OS (1) data = doRead(self.fd, 7) flag = ord(data[0]) if flag & FEXTRA: # Read & discard the extra field, if present xlen = ord(self.fd.read(1)) xlen += 256 * ord(self.fd.read(1)) doRead(self.fd, xlen) if flag & FNAME: # Read and discard a nul-terminated string containing the filename while self.fd.read(1) != "\000": pass if flag & FCOMMENT: # Read and discard a nul-terminated string containing a comment while self.fd.read(1) != "\000": pass if flag & FHCRC: doRead(self.fd, 2) # Read & discard the 16-bit header CRC self.decompobj = zlib.decompressobj(-zlib.MAX_WBITS) self.crcval = zlib.crc32("") | 84b434fe65169e54b0a8bb6f49614f3ac9d5d0ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/84b434fe65169e54b0a8bb6f49614f3ac9d5d0ea/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5194,
16,
5386,
554,
16,
1544,
4672,
365,
18,
8313,
273,
5194,
365,
18,
2469,
273,
374,
468,
769,
434,
777,
443,
15385,
501,
365,
18,
2469,
22,
273,
53... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5194,
16,
5386,
554,
16,
1544,
4672,
365,
18,
8313,
273,
5194,
365,
18,
2469,
273,
374,
468,
769,
434,
777,
443,
15385,
501,
365,
18,
2469,
22,
273,
53... |
subscribed = False | email = formdata.get('email', None) if Subscription.email_is_subscribed(email): subscribed = True else: subscribed = False | def contact_form_listener(sender, object=None, formdata=None, form=None, **kwargs): if 'newsletter' not in formdata: subscribed = False else: subscribed = formdata['newsletter'] log.debug('Updating newletter subscription for %s to %s', object, subscribed) update_subscription(object, subscribed) | e2f3f5261f5c8ce087bcf7d4aa2acde33e94ad84 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13656/e2f3f5261f5c8ce087bcf7d4aa2acde33e94ad84/listeners.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5388,
67,
687,
67,
12757,
12,
15330,
16,
733,
33,
7036,
16,
30642,
33,
7036,
16,
646,
33,
7036,
16,
2826,
4333,
4672,
309,
296,
18443,
13449,
11,
486,
316,
30642,
30,
2699,
273,
30642,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5388,
67,
687,
67,
12757,
12,
15330,
16,
733,
33,
7036,
16,
30642,
33,
7036,
16,
646,
33,
7036,
16,
2826,
4333,
4672,
309,
296,
18443,
13449,
11,
486,
316,
30642,
30,
2699,
273,
30642,... |
logging.info('--------------------') logging.info(' -- PUT ResultParent & ResultTime') logging.info('--------------------') | logging.info(' ------ AddResult, %s of %s: %s', i + 1, NUM_RECORDS, results_str) | def _GetRandomScore(test): return random.randrange(test.min_value, test.max_value + 1) | 7407f8a2515d9a751b1ff4afa2c50a4d5febdb49 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5745/7407f8a2515d9a751b1ff4afa2c50a4d5febdb49/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
967,
8529,
7295,
12,
3813,
4672,
327,
2744,
18,
7884,
3676,
12,
3813,
18,
1154,
67,
1132,
16,
1842,
18,
1896,
67,
1132,
397,
404,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
967,
8529,
7295,
12,
3813,
4672,
327,
2744,
18,
7884,
3676,
12,
3813,
18,
1154,
67,
1132,
16,
1842,
18,
1896,
67,
1132,
397,
404,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.lines[i + 1].startswith(self.INDEX_SEP)): | self.lines[i + 1] == self.INDEX_SEP): | def parse_change_header(self, linenum): """ Parses part of the diff beginning at the specified line number, trying to find a diff header. """ info = {} file = None start = linenum linenum = self.parse_special_header(linenum, info) linenum = self.parse_diff_header(linenum, info) | 9a863dea68d323b49a9d51ca718df7c291c075c5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1600/9a863dea68d323b49a9d51ca718df7c291c075c5/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
3427,
67,
3374,
12,
2890,
16,
4739,
7924,
4672,
3536,
2280,
2420,
1087,
434,
326,
3122,
8435,
622,
326,
1269,
980,
1300,
16,
8374,
358,
1104,
279,
3122,
1446,
18,
3536,
1123,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
3427,
67,
3374,
12,
2890,
16,
4739,
7924,
4672,
3536,
2280,
2420,
1087,
434,
326,
3122,
8435,
622,
326,
1269,
980,
1300,
16,
8374,
358,
1104,
279,
3122,
1446,
18,
3536,
1123,
... |
sage: R = Zp(3, 10, 'lazy'); R.precision_cap() 10 | def precision_cap(self): r""" Returns the precision cap for self. | 4705f54d3a8cb1ec355cf5a3a8189d9c2b64e1ac /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/4705f54d3a8cb1ec355cf5a3a8189d9c2b64e1ac/local_generic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6039,
67,
5909,
12,
2890,
4672,
436,
8395,
2860,
326,
6039,
3523,
364,
365,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6039,
67,
5909,
12,
2890,
4672,
436,
8395,
2860,
326,
6039,
3523,
364,
365,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
repl, '\n'.join(lines)).split('\n') | repl, lines) | def repl(m): try: lexer = get_lexer_by_name(m.group(1)) except ValueError: lexer = TextLexer() code = highlight(m.group(2), lexer, formatter) code = code.replace('\n\n', '\n \n') return '\n\n<div class="code">%s</div>\n\n' % code | c8c61d6df18f27005d52fa6ae4672c2a7c425a32 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2885/c8c61d6df18f27005d52fa6ae4672c2a7c425a32/markdown-processor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6831,
12,
81,
4672,
775,
30,
8512,
273,
336,
67,
31731,
67,
1637,
67,
529,
12,
81,
18,
1655,
12,
21,
3719,
1335,
2068,
30,
8512,
273,
3867,
13356,
1435,
981,
273,
8839,
12,
81,
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,
6831,
12,
81,
4672,
775,
30,
8512,
273,
336,
67,
31731,
67,
1637,
67,
529,
12,
81,
18,
1655,
12,
21,
3719,
1335,
2068,
30,
8512,
273,
3867,
13356,
1435,
981,
273,
8839,
12,
81,
18,
... |
isofstype = self.__isofstype, | isofstype = self._isofstype, | def __write_yaboot_config(isodir, bit): cfg = self.__get_basic_yaboot_config(name = self.name, timeout = self._timeout * 100) | 4a670c764a1a949c866539b8a6a60e2729747acb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9342/4a670c764a1a949c866539b8a6a60e2729747acb/live.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2626,
67,
93,
378,
1632,
67,
1425,
12,
291,
369,
481,
16,
2831,
4672,
2776,
273,
365,
16186,
588,
67,
13240,
67,
93,
378,
1632,
67,
1425,
12,
529,
273,
365,
18,
529,
16,
2021,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2626,
67,
93,
378,
1632,
67,
1425,
12,
291,
369,
481,
16,
2831,
4672,
2776,
273,
365,
16186,
588,
67,
13240,
67,
93,
378,
1632,
67,
1425,
12,
529,
273,
365,
18,
529,
16,
2021,
... |
atq = atf(atw) | atw = atf(atw) | def add(w, make_current=False, once=False): global current global current_once global add_tag w = renpy.easy.displayable(w) w = w.parameterize('displayable', [ ]) atw = w while at_stack: atf = at_stack.pop() if isinstance(atf, renpy.display.motion.Transform): atw = atf(child=atw) else: atq = atf(atw) if isinstance(current, str): renpy.game.context(-1).scene_lists.add(current, atw, key=add_tag) elif current is None: pass else: current.add(atw) add_tag = None if current_once: current_once = False close() current_once = once if make_current: current_stack.append(current) current = w return w | 9e0932af5a8d317a1a4df5ae579bf60ee71879b5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10962/9e0932af5a8d317a1a4df5ae579bf60ee71879b5/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
12,
91,
16,
1221,
67,
2972,
33,
8381,
16,
3647,
33,
8381,
4672,
225,
2552,
783,
2552,
783,
67,
8243,
2552,
527,
67,
2692,
225,
341,
273,
1654,
2074,
18,
73,
15762,
18,
5417,
429... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
91,
16,
1221,
67,
2972,
33,
8381,
16,
3647,
33,
8381,
4672,
225,
2552,
783,
2552,
783,
67,
8243,
2552,
527,
67,
2692,
225,
341,
273,
1654,
2074,
18,
73,
15762,
18,
5417,
429... |
basicsize = h + l + p + l + p + usize * (len(s) + 1) | basicsize = size(h + 'PPlP') + usize * (len(s) + 1) | def test_specialtypes(self): i = self.i l = self.l p = self.p h = self.headersize # dict self.check_sizeof({}, h + 3*l + 3*p + 8*(l + 2*p)) longdict = {1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8} self.check_sizeof(longdict, h + 3*l + 3*p + 8*(l + 2*p) + 16*(l + 2*p)) # list self.check_sizeof([], h + l + p + l) self.check_sizeof([1, 2, 3], h + l + p + l + 3*l) # unicode usize = len(u'\0'.encode('unicode-internal')) samples = [u'', u'1'*100] # we need to test for both sizes, because we don't know if the string # has been cached for s in samples: basicsize = h + l + p + l + p + usize * (len(s) + 1) self.check_sizeof(s, basicsize,\ size2=basicsize + sys.getsizeof(str(s))) # XXX trigger caching encoded version as Python string s = samples[1] try: getattr(sys, s) except AttributeError: pass finally: self.check_sizeof(s, basicsize + sys.getsizeof(str(s))) | 300a10ceb1febf233333c4843a55c526b4019feb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/300a10ceb1febf233333c4843a55c526b4019feb/test_sys.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9371,
2352,
12,
2890,
4672,
277,
273,
365,
18,
77,
328,
273,
365,
18,
80,
293,
273,
365,
18,
84,
366,
273,
365,
18,
2485,
554,
468,
2065,
365,
18,
1893,
67,
1467,
792,
23... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9371,
2352,
12,
2890,
4672,
277,
273,
365,
18,
77,
328,
273,
365,
18,
80,
293,
273,
365,
18,
84,
366,
273,
365,
18,
2485,
554,
468,
2065,
365,
18,
1893,
67,
1467,
792,
23... |
jack = jack.mate | realjack = jack.mate | def addPins(line): """create pins (and auto-lines) for a given line""" for jacknum, pinnum in zip(line.jacknums, line.pinnums): #find jack and perform some consistency checks try: jack = containers[-1].jacks[containers[-1].jacks.index(jacknum)] except ValueError: raise Failure("unrecognized jack: %s"%jacknum) lineend = 'box' if jack.placeholder: #jack is placeholder in direct-connected pair jack = jack.mate #use the real jack...its mate lineend = 'cable' try: #test pin number if jack.conn.flags['alpha'] == 'N' and ((int(pinnum) > jack.conn.count \ and jack.conn.count > 0) or int(pinnum) <= 0): raise Failure("invalid pin number: %s"%pinnum) except ValueError: raise Failure("unexpected non-numeric pin: %s"%pinnum) if jack.mate is None: #unmated, add a dangling pin (no cline yet) newpin = Pin(pinnum, line.desc, jack, line, None) if newpin not in jack.pins: jack.pins.append(newpin) else: #already mated, need to add extra stuff try: #see if pin has already been generated pin = jack.pins[jack.pins.index(pinnum)] except ValueError: #pin not yet generated newline = Line(line.desc, "(%s,%s)"%(jack.mate.ref,pinnum)) newline.autogen = True if jack.cable is None: #no cable if lineend == 'box': newpin = Pin(pinnum, line.desc, jack, line, newline) newline.owner = jack.mate.location jack.mate.location.lines.append(newline) else: newpin = Pin(pinnum, line.desc, jack, newline, line) newline.owner = jack.location jack.location.lines.append(newline) else: #using a cable, make another new line and pin if lineend == 'cable': raise Failure('inconsistent state') cableline = Line(line.desc, "") cableline.autogen = True cableline.owner = jack.cable newpin = Pin(pinnum, line.desc, jack, line, cableline) newerpin = Pin(pinnum, line.desc, jack.mate, newline, cableline) jack.cable.lines.append(cableline) if newerpin not in jack.mate.pins: jack.mate.pins.append(newerpin) jack.pins.append(newpin) else: #pin exists if not pin.lines[lineend].autogen: raise Failure("line conflicts for pin (%s,%s)"%(jacknum,pinnum)) jack.parent.lines.remove(pin.lines[lineend]) pin.desc = line.desc pin.lines[lineend] = line #other lines exist already (?), so this case is done if line in containers[-1].lines: raise Failure("line overlaps existing one") containers[-1].lines.append(line) | 4d7794e176655980479c9193da7e83bd5d0a676b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2109/4d7794e176655980479c9193da7e83bd5d0a676b/sedparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
52,
2679,
12,
1369,
4672,
3536,
2640,
23391,
261,
464,
3656,
17,
3548,
13,
364,
279,
864,
980,
8395,
364,
525,
484,
2107,
16,
7092,
2107,
316,
3144,
12,
1369,
18,
78,
484,
21180,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
52,
2679,
12,
1369,
4672,
3536,
2640,
23391,
261,
464,
3656,
17,
3548,
13,
364,
279,
864,
980,
8395,
364,
525,
484,
2107,
16,
7092,
2107,
316,
3144,
12,
1369,
18,
78,
484,
21180,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.